1 This is a terse description of the new features added to bash-2.01 since
2 the release of bash-2.0. As always, the manual page (doc/bash.1) is the
3 place to look for complete descriptions.
5 1. New Features in Bash
7 a. There is a new builtin array variable: GROUPS, the set of groups to which
8 the user belongs. This is used by the test suite.
10 2. New Features in Readline
12 a. If a key sequence bound to `universal-argument' is read while reading a
13 numeric argument started with `universal-argument', it terminates the
14 argument but is otherwise ignored. This provides a way to insert multiple
15 instances of a digit string, and is how GNU emacs does it.
17 -------------------------------------------------------------------------------
18 This is a terse description of the new features added to bash-2.0 since
19 the release of bash-1.14.7. As always, the manual page (doc/bash.1) is
20 the place to look for complete descriptions.
22 1. New Features in Bash
24 a. There is a new invocation option, -D, that dumps translatable strings
27 b. The `long' invocation options must now be prefixed with `--'.
29 c. New long invocation options: --dump-strings, --help, --verbose
31 d. The `nolineediting' invocation option was renamed to `noediting'.
33 e. The `nobraceexpansion' and `quiet' long invocation options were removed.
35 f. The `--help' and `--version' long options now work as the GNU coding
38 g. If invoked as `sh', bash now enters posix mode after reading the
39 startup files, and reads and executes commands from the file named
40 by $ENV if interactive (as POSIX.2 specifies). A login shell invoked
41 as `sh' reads $ENV after /etc/profile and ~/.profile.
43 h. There is a new reserved word, `time', for timing pipelines, builtin
44 commands, and shell functions. It uses the value of the TIMEFORMAT
45 variable as a format string describing how to print the timing
48 i. The $'...' quoting syntax expands ANSI-C escapes in ... and leaves the
51 j. The $"..." quoting syntax performs locale-specific translation of ...
52 and leaves the result double-quoted.
54 k. LINENO now works correctly in functions.
56 l. New variables: DIRSTACK, PIPESTATUS, BASH_VERSINFO, HOSTNAME, SHELLOPTS,
57 MACHTYPE. The first three are array variables.
59 m. The BASH_VERSION and BASH_VERSINFO variables now include the shell's
60 `release status' (alpha[N], beta[N], release).
62 n. Some variables have been removed: MAIL_WARNING, notify, history_control,
63 command_oriented_history, glob_dot_filenames, allow_null_glob_expansion,
64 nolinks, hostname_completion_file, noclobber, no_exit_on_failed_exec, and
65 cdable_vars. Most of them are now implemented with the new `shopt'
66 builtin; others were already implemented by `set'.
68 o. Bash now uses some new variables: LC_ALL, LC_MESSAGES, LC_CTYPE,
69 LC_COLLATE, LANG, GLOBIGNORE, HISTIGNORE.
71 p. The shell now supports integer-indexed arrays of unlimited length,
72 with a new compound assignment syntax and changes to the appropriate
73 builtin commands (declare/typeset, read, readonly, etc.). The array
74 index may be an arithmetic expression.
76 q. ${!var}: indirect variable expansion, equivalent to eval \${$var}.
78 r. ${paramter:offset[:length]}: variable substring extraction.
80 s. ${parameter/pattern[/[/]string]}: variable pattern substitution.
82 t. The $[...] arithmetic expansion syntax is no longer supported, in
85 u. Aliases can now be expanded in shell scripts with a shell option
86 (shopt expand_aliases).
88 v. History and history expansion can now be used in scripts with
89 set -o history and set -H.
91 w. All builtins now return an exit status of 2 for incorrect usage.
93 x. Interactive shells resend SIGHUP to all running or stopped children
94 if (and only if) they exit due to a SIGHUP.
96 y. New prompting expansions: \a, \e, \H, \T, \@, \v, \V.
98 z. Variable expansion in prompt strings is now controllable via a shell
99 option (shopt promptvars).
101 aa. Bash now defaults to using command-oriented history.
103 bb. The history file ($HISTFILE) is now truncated to $HISTFILESIZE after
106 cc. The POSIX.2 conditional arithmetic evaluation syntax (expr ? expr : expr)
107 has been implemented.
109 dd. Each builtin now accepts `--' to signify the end of the options, except
110 as documented (echo, etc.).
112 ee. All builtins use -p to display values in a re-readable format where
113 appropriate, except as documented (echo, type, etc.).
115 ff. The `alias' builtin has a new -p option.
117 gg. Changes to the `bind' builtin:
118 o has new options: -psPSVr.
119 o the `-d' option was renamed to `-p'
120 o the `-v' option now dumps variables; the old `-v' is now `-P'
122 hh. The `bye' synonym for `exit' was removed.
124 ii. The -L and -P options to `cd' and `pwd' have been documented.
126 jj. The `cd' builtin now does spelling correction on the directory name
127 by default. This is settable with a shell option (shopt cdspell).
129 kk. The `declare' builtin has new options: -a, -F, -p.
131 ll. The `dirs' builtin has new options: -c, -p, -v.
133 mm. The new `disown' builtin removes jobs from the shell's jobs table
134 or inhibits the resending of SIGHUP when the shell receives a
137 nn. The `echo' builtin has a new escape character: \e.
139 oo. The `enable' builtin can now load new builtins dynamically from shared
140 objects on systems with the dlopen/dlsym interface. There are a number
141 of examples in the examples/loadables directory. There are also
142 new options: -d, -f, -s, -p.
144 pp. The `-all' option to `enable' was removed in favor of `-a'.
146 qq. The `exec' builtin has new options: -l, -c, -a.
148 rr. The `hash' builtin has a new option: -p.
150 ss. The `history' builtin has new options: -c, -p, -s.
152 tt. The `jobs' builtin has new options: -r, -s.
154 uu. The `kill' builtin has new options: -n signum, -l signame.
156 vv. The `pushd' and `popd' builtins have a new option: -n.
158 ww. The `read' builtin has new options: -p prompt, -e, -a.
160 xx. The `readonly' builtin has a new -a option, and the -n option was removed.
162 yy. Changes to the `set' builtin:
163 o new options: -B, -o keyword, -o onecmd, -o history
164 o options removed: -l, -d, -o nohash
165 o options changed: +o, -h, -o hashall
166 o now displays variables in a format that can be re-read as input
168 zz. The new `shopt' builtin controls shell optional behavior previously
169 done by setting and unsetting certain shell variables.
171 aaa. The `test' builtin has new operators: -o option, s1 == s2, s1 < s2,
172 and s1 > s2, where s1 and s2 are strings.
174 bbb. There is a new trap, DEBUG, executed after every simple command.
176 ccc. The `trap' builtin has a new -p option.
178 ddd. The `ulimit' builtin has a new -l option on 4.4BSD-based systems.
180 eee. The PS1, PS2, PATH, and IFS variables may now be unset.
182 fff. The restricted shell mode has been expanded and is now documented.
184 ggg. Security improvements:
185 o functions are not imported from the environment if running setuid
187 o no startup files are sourced if running setuid or with -p
189 hhh. The documentation has been overhauled: the texinfo manual was
190 expanded, and HTML versions of the man page and texinfo manual
193 iii. Changes to Posix mode:
194 o Command lookup now finds special builtins before shell functions.
195 o Failure of a special builtin causes a non-interactive shell to
196 exit. Failures are defined in the POSIX.2 specification.
197 o If the `cd' builtin finds a directory to change to using $CDPATH,
198 the value assigned to PWD when `cd' completes does not contain
200 o A non-interactive shell exits if a variable assignment error
201 occurs when no command name follows the assignment statements.
202 o A non-interactive shell exits if the interation variable in a
203 `for' statement or the selection variable in a `select' statement
204 is read-only or another variable assignment error occurs.
205 o The `<>' redirection operator now opens a file for both stdin and
206 stdout by default, not just when in posix mode.
207 o Assignment statements preceding special builtins now persist in
208 the shell's environment when the builtin completes.
210 Posix mode is now completely POSIX.2-compliant (modulo bugs). When
211 invoked as sh, bash should be completely POSIX.2-compliant.
213 jjj. The default value of PS1 is now "\s-\v\$ ".
215 kkk. The ksh-like ((...)) arithmetic command syntax has been implemented.
216 This is exactly equivalent to `let "..."'.
218 lll. Integer constants have been extended to base 64.
220 mmm. The `ulimit' builtin now sets both hard and soft limits and reports the
221 soft limit by default.
223 2. New Features in Readline
225 a. New variables: enable-keypad, input-meta (new name for meta-flag),
226 mark-directories, visible-stats (now documented), disable-completion,
229 b. New bindable commands: kill-region, copy-region-as-kill,
230 copy-backward-word, copy-forward-word, set-mark, exchange-point-and-mark,
231 character-search, character-search-backward, insert-comment,
232 glob-expand-word, glob-list-expansions, dump-variables, dump-macros.
234 c. New emacs keybindings: delete-horizontal-space (M-\),
235 insert-completions (M-*), possible-completions (M-=).
237 d. The history-search-backward and history-search-forward commands were
238 modified to be the same as previous-line and next-line if point is at
239 the start of the line.
241 e. More file types are available for the visible-stats mode.
243 3. Changes of interest in the Bash implementation
245 a. There is a new autoconf-based configuration mechanism.
247 b. More things have been moved from Posix mode to standard shell behavior.
249 c. The trace output (set -x) now inserts quotes where necessary so it can
252 d. There is a compile-time option for a system-wide interactive shell
253 startup file (disabled by default).
255 e. The YACC grammar is smaller and tighter, and all 66 shift-reduce
256 conflicts are gone. Several parsing bugs have been fixed.
258 f. Builtin option parsing has been regularized (using internal_getopt()),
259 with the exception of `echo', `type', and `set'.
261 g. Builtins now return standard usage messages constructed from the
262 `short doc' used by the help builtin.
264 h. Completion now quotes using backslashes by default, but honors
265 user-supplied quotes.
267 i. The GNU libc malloc is available as a configure-time option.
269 j. There are more internationalization features; bash uses gettext if
270 it is available. The $"..." translation syntax uses the current
273 k. There is better reporting of job termination when the shell is not
276 l. The shell is somewhat more efficient: it uses a little less memory and
277 makes fewer system calls.
279 4. Changes of interest in the Readline implementation
281 a. There is now support for readline `callback' functions.
283 b. There is now support for user-supplied input, redisplay, and terminal
284 preparation functions.
286 c. Most of the shell-specific code in readline has been generalized or
289 d. Most of the annoying redisplay bugs have been fixed, notably the problems
290 with incremental search and excessive redrawing when special characters
291 appear in the prompt string.
293 e. There are new library functions and variables available to application
294 writers, most having to do with completion and quoting.
296 f. The NEWLINE character (^J) is now treated as a search terminator by the
297 incremental search functions.