mirror of
https://https.git.savannah.gnu.org/git/bash.git
synced 2026-07-11 14:10:49 +02:00
bash-5.0 distribution sources and documentation
This commit is contained in:
@@ -2,9 +2,9 @@ Compatibility with previous versions
|
||||
====================================
|
||||
|
||||
This document details the incompatibilities between this version of bash,
|
||||
bash-4.4, and the previous widely-available versions, bash-3.x (which is
|
||||
still the `standard' version for Mac OS X), 4.1/4.2 (which are still
|
||||
standard on a few Linux distributions), and bash-4.3, the current
|
||||
bash-5.0, and the previous widely-available versions, bash-3.x (which is
|
||||
still the `standard' version for Mac OS X), 4.2/4.3 (which are still
|
||||
standard on a few Linux distributions), and bash-4.4, the current
|
||||
widely-available version. These were discovered by users of bash-2.x
|
||||
through 4.x, so this list is not comprehensive. Some of these
|
||||
incompatibilities occur between the current version and versions 2.0 and
|
||||
@@ -391,6 +391,20 @@ above.
|
||||
argument to `declare' or a similar builtin expands to a word that looks
|
||||
like a compound array assignment (e.g. declare w=$x where x='(foo)').
|
||||
|
||||
60. Bash-5.0 only sets up BASH_ARGV and BASH_ARGC at startup if extended
|
||||
debugging mode is active. The old behavior of unconditionally setting
|
||||
BASH_ARGC and BASH_ARGV is available at compatibility levels less than
|
||||
or equal to 44.
|
||||
|
||||
61. Bash-5.0 doesn't allow a `break' or `continue' in a subshell to attempt
|
||||
to break or continue loop execution inherited from the calling context.
|
||||
|
||||
62. Bash-5.0 doesn't allow variable assignments preceding builtins like
|
||||
export and readonly to modify variables with the same name in preceding
|
||||
contexts (including the global context) unless the shell is in posix
|
||||
mode, since export and readonly are special builtins.
|
||||
|
||||
|
||||
Shell Compatibility Level
|
||||
=========================
|
||||
|
||||
@@ -446,10 +460,22 @@ compat43 set
|
||||
(declare -a foo='(1 2)')
|
||||
- word expansion errors are considered non-fatal errors that cause the
|
||||
current command to fail, even in Posix mode
|
||||
- when executing a shell function, the loop state (while/until/etc.) is
|
||||
not reset, so `break' or `continue' in a shell function will break or
|
||||
continue loops in the calling context. Bash-4.4 and later reset the
|
||||
loop state to prevent this.
|
||||
- when executing a shell function, the loop state (while/until/etc.)
|
||||
is not reset, so `break' or `continue' in that function will break
|
||||
or continue loops in the calling context. Bash-4.4 and later reset
|
||||
the loop state to prevent this.
|
||||
|
||||
compat44 set
|
||||
- the shell sets up the values used by BASH_ARGV and BASH_ARGC so
|
||||
they can expand to the shell's positional parameters even if extended
|
||||
debug mode is not enabled
|
||||
- a subshell inherits loops from its parent contenxt, so `break'
|
||||
or `continue' will cause the subshell to exit
|
||||
- variable assignments preceding builtins like export and readonly
|
||||
that set attributes continue to affect variables with the same
|
||||
name in the calling environment even if the shell is not in posix
|
||||
mode
|
||||
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
|
||||
|
||||
Reference in New Issue
Block a user