summaryrefslogtreecommitdiff
path: root/COMPAT
diff options
context:
space:
mode:
Diffstat (limited to 'COMPAT')
-rw-r--r--COMPAT120
1 files changed, 85 insertions, 35 deletions
diff --git a/COMPAT b/COMPAT
index 6d30663..c591ede 100644
--- a/COMPAT
+++ b/COMPAT
@@ -1,10 +1,10 @@
-This document details the incompatibilites between this version of bash,
-bash-3.1, and a previous widely-available version, bash-1.14 (which
-is still the `standard' version for a few Linux distributions). These
-were discovered by users of bash-2.x and 3.x, so this list is not
-comprehensive. Some of these incompatibilities occur between the current
-version and versions 2.0 and above. (The differences between bash-1.14
-and bash-2.0 were significant.)
+This document details the incompatibilities between this version of bash,
+bash-3.2, and the previous widely-available versions, bash-1.14 (which is
+still the `standard' version for a few Linux distributions) and bash-2.x.
+These were discovered by users of bash-2.x and 3.x, so this list is not
+comprehensive. Some of these incompatibilities occur between the current
+version and versions 2.0 and above. (The differences between bash-1.14 and
+bash-2.0 were significant.)
1. Bash uses a new quoting syntax, $"...", to do locale-specific
string translation. Users who have relied on the (undocumented)
@@ -184,42 +184,92 @@ and bash-2.0 were significant.)
with `z' and still allow individual users to change the collation order.
Users may put the above command into their own profiles as well, of course.
-14. Bash versions up to 1.14.7 included an undocumented `-l' operator to
- the `test/[' builtin. It was a unary operator that expanded to the
- length of its string argument. This let you do things like
+14. Bash versions up to 1.14.7 included an undocumented `-l' operator to
+ the `test/[' builtin. It was a unary operator that expanded to the
+ length of its string argument. This let you do things like
test -l $variable -lt 20
- for example.
+ for example.
- This was included for backwards compatibility with old versions of the
- Bourne shell, which did not provide an easy way to obtain the length of
- the value of a shell variable.
+ This was included for backwards compatibility with old versions of the
+ Bourne shell, which did not provide an easy way to obtain the length of
+ the value of a shell variable.
- This operator is not part of the POSIX standard, because one can (and
- should) use ${#variable} to get the length of a variable's value.
- Bash-2.x does not support it.
+ This operator is not part of the POSIX standard, because one can (and
+ should) use ${#variable} to get the length of a variable's value.
+ Bash-2.x does not support it.
-15. Bash no longer auto-exports the HOME, PATH, SHELL, TERM, HOSTNAME,
- HOSTTYPE, MACHTYPE, or OSTYPE variables.
+15. Bash no longer auto-exports the HOME, PATH, SHELL, TERM, HOSTNAME,
+ HOSTTYPE, MACHTYPE, or OSTYPE variables. If they appear in the initial
+ environment, the export attribute will be set, but if bash provides a
+ default value, they will remain local to the current shell.
-16. Bash no longer initializes the FUNCNAME, GROUPS, or DIRSTACK variables
- to have special behavior if they appear in the initial environment.
+16. Bash no longer initializes the FUNCNAME, GROUPS, or DIRSTACK variables
+ to have special behavior if they appear in the initial environment.
-17. Bash no longer removes the export attribute from the SSH_CLIENT or
- SSH2_CLIENT variables, and no longer attempts to discover whether or
- not it has been invoked by sshd in order to run the startup files.
+17. Bash no longer removes the export attribute from the SSH_CLIENT or
+ SSH2_CLIENT variables, and no longer attempts to discover whether or
+ not it has been invoked by sshd in order to run the startup files.
-18. Bash no longer requires that the body of a function be a group command;
- any compound command is accepted.
+18. Bash no longer requires that the body of a function be a group command;
+ any compound command is accepted.
-19. As of bash-3.0, the pattern substitution operators no longer perform
- quote removal on the pattern before attempting the match. This is the
- way the pattern removal functions behave, and is more consistent.
+19. As of bash-3.0, the pattern substitution operators no longer perform
+ quote removal on the pattern before attempting the match. This is the
+ way the pattern removal functions behave, and is more consistent.
-20. After bash-3.0 was released, I reimplemented tilde expansion, incorporating
- it into the mainline word expansion code. This fixes the bug that caused
- the results of tilde expansion to be re-expanded. There is one
- incompatibility: a ${paramOPword} expansion within double quotes will not
- perform tilde expansion on WORD. This is consistent with the other
- expansions, and what POSIX specifies.
+20. After bash-3.0 was released, I reimplemented tilde expansion, incorporating
+ it into the mainline word expansion code. This fixes the bug that caused
+ the results of tilde expansion to be re-expanded. There is one
+ incompatibility: a ${paramOPword} expansion within double quotes will not
+ perform tilde expansion on WORD. This is consistent with the other
+ expansions, and what POSIX specifies.
+
+21. A number of variables have the integer attribute by default, so the +=
+ assignment operator returns expected results: RANDOM, LINENO, MAILCHECK,
+ HISTCMD, OPTIND.
+
+22. Bash-3.x is much stricter about $LINENO correctly reflecting the line
+ number in a script; assignments to LINENO have little effect.
+
+23. By default, readline binds the terminal special characters to their
+ readline equivalents. As of bash-3.1/readline-5.1, this is optional and
+ controlled by the bind-tty-special-chars readline variable.
+
+24. The \W prompt string expansion abbreviates $HOME as `~'. The previous
+ behavior is available with ${PWD##/*/}.
+
+25. The arithmetic exponentiation operator is right-associative as of bash-3.1.
+
+26. The rules concerning valid alias names are stricter, as per POSIX.2.
+
+27. The Readline key binding functions now obey the convert-meta setting active
+ when the binding takes place, as the dispatch code does when characters
+ are read and processed.
+
+28. The historical behavior of `trap' reverting signal disposition to the
+ original handling in the absence of a valid first argument is implemented
+ only if the first argument is a valid signal number.
+
+29. In versions of bash after 3.1, the ${parameter//pattern/replacement}
+ expansion does not interpret `%' or `#' specially. Those anchors don't
+ have any real meaning when replacing every match.
+
+30. Beginning with bash-3.1, the combination of posix mode and enabling the
+ `xpg_echo' option causes echo to ignore all options, not looking for `-n'
+
+31. Beginning with bash-3.2, bash follows the Bourne-shell-style (and POSIX-
+ style) rules for parsing the contents of old-style backquoted command
+ substitutions. Previous versions of bash attempted to recursively parse
+ embedded quoted strings and shell constructs; bash-3.2 uses strict POSIX
+ rules to find the closing backquote and simply passes the contents of the
+ command substitution to a subshell for parsing and execution.
+
+32. Beginning with bash-3.2, bash uses access(2) when executing primaries for
+ the test builtin and the [[ compound command, rather than looking at the
+ file permission bits obtained with stat(2). This obeys restrictions of
+ the file system (e.g., read-only or noexec mounts) not available via stat.
+
+33. Beginning with bash-3.1/readline-5.1, the readline key binding code obeys
+ the current setting of the `convert-meta' variable.