]> git.ipfire.org Git - thirdparty/bash.git/blob - COMPAT
Imported from ../bash-2.01.tar.gz.
[thirdparty/bash.git] / COMPAT
1 This document details the incompatibilites between this version of bash,
2 bash-2.01, and the previous widely-available version, bash-1.14. These
3 were discovered by alpha and beta testers, so they will likely be
4 encountered by a significant number of users.
5
6 1. Bash now uses a new quoting syntax, $"...", to do locale-specific
7 string translation. Users who have relied on the (undocumented)
8 behavior of bash-1.14 will have to change their scripts. For
9 instance, if you are doing something like this to get the value of
10 a variable whose name is the value of a second variable:
11
12 eval var2=$"$var1"
13
14 you will have to change to a different syntax.
15
16 This capability is directly supported by bash-2.0:
17
18 var2=${!var1}
19
20 This alternate syntax will work portably between bash-1.14 and bash-2.0:
21
22 eval var2=\$${var1}
23
24 2. One of the bugs fixed in the YACC grammar tightens up the rules
25 concerning group commands ( {...} ). The `list' that composes the
26 body of the group command must be terminated by a newline or
27 semicolon. That's because the braces are reserved words, and are
28 recognized as such only when a reserved word is legal. This means
29 that while bash-1.14 accepted shell function definitions like this:
30
31 foo() { : }
32
33 bash-2.0 requires this:
34
35 foo() { :; }
36
37 This is also an issue for commands like this:
38
39 mkdir dir || { echo 'could not mkdir' ; exit 1; }
40
41 The syntax required by bash-2.0 is also accepted by bash-1.14.
42
43 3. The options to `bind' have changed to make them more consistent with
44 the rest of the bash builtins. If you are using `bind -d' to list
45 the readline keybindings in a form that can be re-read, use `bind -p'
46 instead. If you were using `bind -v' to list the keybindings, use
47 `bind -P' instead.
48
49 4. The `long' invocation options must now be prefixed by `--' instead
50 of `-'. (The old form is still accepted, for the time being.)
51
52 5. There was a bug in the version of readline distributed with bash-1.14
53 that caused it to write badly-formatted key bindings when using
54 `bind -d'. The only key sequences that were affected are C-\ (which
55 should appear as \C-\\ in a key binding) and C-" (which should appear
56 as \C-\"). If these key sequences appear in your inputrc, as, for
57 example,
58
59 "\C-\": self-insert
60
61 they will need to be changed to something like the following:
62
63 "\C-\\": self-insert
64
65 6. A number of people complained above having to use ESC to terminate an
66 incremental search, and asked for an alternate mechanism. Bash-2.0
67 allows ^J to terminate the search without accepting the line. Use
68 ^M to terminate the search and accept the line, as in bash-1.14.
69
70 7. Some variables have been removed: MAIL_WARNING, notify, history_control,
71 command_oriented_history, glob_dot_filenames, allow_null_glob_expansion,
72 nolinks, hostname_completion_file, noclobber, no_exit_on_failed_exec, and
73 cdable_vars. Most of them are now implemented with the new `shopt'
74 builtin; others were already implemented by `set'. Here is a list of
75 correspondences:
76
77 MAIL_WARNING shopt mailwarn
78 notify set -o notify
79 history_control HISTCONTROL
80 command_oriented_history shopt cmdhist
81 glob_dot_filenames shopt dotglob
82 allow_null_glob_expansion shopt nullglob
83 nolinks set -o physical
84 hostname_completion_file HOSTFILE
85 noclobber set -o noclobber
86 no_exit_on_failed_exec shopt execfail
87 cdable_vars shopt cdable_vars
88
89 8. `ulimit' now sets both hard and soft limits and reports the soft limit
90 by default (when neither -H nor -S is specified). This is compatible
91 with versions of sh and ksh that implement `ulimit'. The bash-1.14
92 behavior of, for example,
93
94 ulimit -c 0
95
96 can be obtained with
97
98 ulimit -S -c 0
99
100 It may be useful to define an alias:
101
102 alias ulimit="ulimit -S"
103