1 This is a terse description of the new features added to bash-2.02 since
2 the release of bash-2.01.1. As always, the manual page (doc/bash.1) is
3 the place to look for complete descriptions.
5 1. New Features in Bash
7 a. A new version of malloc, based on the older GNU malloc, that has many
8 changes, is more page-based, is more conservative with memory usage,
9 and does not `orphan' large blocks when they are freed.
11 b. A new version of gmalloc, based on the old GLIBC malloc, with many
12 changes and range checking included by default.
14 c. A new implementation of fnmatch(3) that includes full POSIX.2 Basic
15 Regular Expression matching, including character classes, collating
16 symbols, equivalence classes, and support for case-insensitive pattern
19 d. ksh-88 egrep-style extended pattern matching ([@+*?!](patlist)) has been
20 implemented, controlled by a new `shopt' option, `extglob'.
22 e. There is a new ksh-like `[[' compound command, which implements
23 extended `test' functionality.
25 f. There is a new `printf' builtin, implemented according to the POSIX.2
28 g. There is a new feature for command substitution: $(< filename) now expands
29 to the contents of `filename', with any trailing newlines removed
30 (equivalent to $(cat filename)).
32 h. There are new tilde prefixes which expand to directories from the
35 i. There is a new `**' arithmetic operator to do exponentiation.
37 j. There are new configuration options to control how bash is linked:
38 `--enable-profiling', to allow bash to be profiled with gprof, and
39 `--enable-static-link', to allow bash to be linked statically.
41 k. There is a new configuration option, `--enable-cond-command', which
42 controls whether or not the `[[' command is included. It is on by
45 l. There is a new configuration option, `--enable-extended-glob', which
46 controls whether or not the ksh extended globbing feature is included.
47 It is enabled by default.
49 m. There is a new configuration #define in config.h.top that, when enabled,
50 will cause all login shells to source /etc/profile and one of the user-
51 specific login shell startup files, whether or not the shell is
54 n. There is a new invocation option, `--dump-po-strings', to dump
55 a shell script's translatable strings ($"...") in GNU `po' format.
57 o. There is a new `shopt' option, `nocaseglob', to enable case-insensitive
58 pattern matching when globbing filenames and using the `case' construct.
60 p. There is a new `shopt' option, `huponexit', which, when enabled, causes
61 the shell to send SIGHUP to all jobs when an interactive login shell
64 q. `bind' has a new `-u' option, which takes a readline function name as an
65 argument and unbinds all key sequences bound to that function in a
68 r. `disown' now has `-a' and `-r' options, to limit operation to all jobs
69 and running jobs, respectively.
71 s. The `shopt' `-p' option now causes output to be displayed in a reusable
74 t. `test' has a new `-N' option, which returns true if the filename argument
75 has been modified since it was last accessed.
77 u. `umask' now has a `-p' option to print output in a reusable format.
79 v. A new escape sequence, `\xNNN', has been added to the `echo -e' and $'...'
80 translation code. It expands to the character whose ascii code is NNN
83 w. The prompt string expansion code has a new `\r' escape sequence.
85 x. The shell may now be cross-compiled for the CYGWIN32 environment on
88 2. New Features in Readline
90 a. There is now an option for `iterative' yank-last-arg handline, so a user
91 can keep entering `M-.', yanking the last argument of successive history
94 b. New variable, `print-completions-horizontally', which causes completion
95 matches to be displayed across the screen (like `ls -x') rather than up
96 and down the screen (like `ls').
98 c. New variable, `completion-ignore-case', which causes filename completion
99 and matching to be performed case-insensitively.
101 d. There is a new bindable command, `magic-space', which causes history
102 expansion to be performed on the current readline buffer and a space to
103 be inserted into the result.
105 e. There is a new bindable command, `menu-complete', which enables tcsh-like
106 menu completion (successive executions of menu-complete insert a single
107 completion match, cycling through the list of possible completions).
109 f. There is a new bindable command, `paste-from-clipboard', for use on Win32
110 systems, to insert the text from the Win32 clipboard into the editing
113 g. The key sequence translation code now understands printf-style backslash
114 escape sequences, including \NNN octal escapes. These escape sequences
115 may be used in key sequence definitions or macro values.
117 h. An `$include' inputrc file parser directive has been added.
119 -------------------------------------------------------------------------------
120 This is a terse description of the new features added to bash-2.01 since
121 the release of bash-2.0. As always, the manual page (doc/bash.1) is the
122 place to look for complete descriptions.
124 1. New Features in Bash
126 a. There is a new builtin array variable: GROUPS, the set of groups to which
127 the user belongs. This is used by the test suite.
129 2. New Features in Readline
131 a. If a key sequence bound to `universal-argument' is read while reading a
132 numeric argument started with `universal-argument', it terminates the
133 argument but is otherwise ignored. This provides a way to insert multiple
134 instances of a digit string, and is how GNU emacs does it.
136 -------------------------------------------------------------------------------
137 This is a terse description of the new features added to bash-2.0 since
138 the release of bash-1.14.7. As always, the manual page (doc/bash.1) is
139 the place to look for complete descriptions.
141 1. New Features in Bash
143 a. There is a new invocation option, -D, that dumps translatable strings
146 b. The `long' invocation options must now be prefixed with `--'.
148 c. New long invocation options: --dump-strings, --help, --verbose
150 d. The `nolineediting' invocation option was renamed to `noediting'.
152 e. The `nobraceexpansion' and `quiet' long invocation options were removed.
154 f. The `--help' and `--version' long options now work as the GNU coding
157 g. If invoked as `sh', bash now enters posix mode after reading the
158 startup files, and reads and executes commands from the file named
159 by $ENV if interactive (as POSIX.2 specifies). A login shell invoked
160 as `sh' reads $ENV after /etc/profile and ~/.profile.
162 h. There is a new reserved word, `time', for timing pipelines, builtin
163 commands, and shell functions. It uses the value of the TIMEFORMAT
164 variable as a format string describing how to print the timing
167 i. The $'...' quoting syntax expands ANSI-C escapes in ... and leaves the
168 result single-quoted.
170 j. The $"..." quoting syntax performs locale-specific translation of ...
171 and leaves the result double-quoted.
173 k. LINENO now works correctly in functions.
175 l. New variables: DIRSTACK, PIPESTATUS, BASH_VERSINFO, HOSTNAME, SHELLOPTS,
176 MACHTYPE. The first three are array variables.
178 m. The BASH_VERSION and BASH_VERSINFO variables now include the shell's
179 `release status' (alpha[N], beta[N], release).
181 n. Some variables have been removed: MAIL_WARNING, notify, history_control,
182 command_oriented_history, glob_dot_filenames, allow_null_glob_expansion,
183 nolinks, hostname_completion_file, noclobber, no_exit_on_failed_exec, and
184 cdable_vars. Most of them are now implemented with the new `shopt'
185 builtin; others were already implemented by `set'.
187 o. Bash now uses some new variables: LC_ALL, LC_MESSAGES, LC_CTYPE,
188 LC_COLLATE, LANG, GLOBIGNORE, HISTIGNORE.
190 p. The shell now supports integer-indexed arrays of unlimited length,
191 with a new compound assignment syntax and changes to the appropriate
192 builtin commands (declare/typeset, read, readonly, etc.). The array
193 index may be an arithmetic expression.
195 q. ${!var}: indirect variable expansion, equivalent to eval \${$var}.
197 r. ${paramter:offset[:length]}: variable substring extraction.
199 s. ${parameter/pattern[/[/]string]}: variable pattern substitution.
201 t. The $[...] arithmetic expansion syntax is no longer supported, in
204 u. Aliases can now be expanded in shell scripts with a shell option
205 (shopt expand_aliases).
207 v. History and history expansion can now be used in scripts with
208 set -o history and set -H.
210 w. All builtins now return an exit status of 2 for incorrect usage.
212 x. Interactive shells resend SIGHUP to all running or stopped children
213 if (and only if) they exit due to a SIGHUP.
215 y. New prompting expansions: \a, \e, \H, \T, \@, \v, \V.
217 z. Variable expansion in prompt strings is now controllable via a shell
218 option (shopt promptvars).
220 aa. Bash now defaults to using command-oriented history.
222 bb. The history file ($HISTFILE) is now truncated to $HISTFILESIZE after
225 cc. The POSIX.2 conditional arithmetic evaluation syntax (expr ? expr : expr)
226 has been implemented.
228 dd. Each builtin now accepts `--' to signify the end of the options, except
229 as documented (echo, etc.).
231 ee. All builtins use -p to display values in a re-readable format where
232 appropriate, except as documented (echo, type, etc.).
234 ff. The `alias' builtin has a new -p option.
236 gg. Changes to the `bind' builtin:
237 o has new options: -psPSVr.
238 o the `-d' option was renamed to `-p'
239 o the `-v' option now dumps variables; the old `-v' is now `-P'
241 hh. The `bye' synonym for `exit' was removed.
243 ii. The -L and -P options to `cd' and `pwd' have been documented.
245 jj. The `cd' builtin now does spelling correction on the directory name
246 by default. This is settable with a shell option (shopt cdspell).
248 kk. The `declare' builtin has new options: -a, -F, -p.
250 ll. The `dirs' builtin has new options: -c, -p, -v.
252 mm. The new `disown' builtin removes jobs from the shell's jobs table
253 or inhibits the resending of SIGHUP when the shell receives a
256 nn. The `echo' builtin has a new escape character: \e.
258 oo. The `enable' builtin can now load new builtins dynamically from shared
259 objects on systems with the dlopen/dlsym interface. There are a number
260 of examples in the examples/loadables directory. There are also
261 new options: -d, -f, -s, -p.
263 pp. The `-all' option to `enable' was removed in favor of `-a'.
265 qq. The `exec' builtin has new options: -l, -c, -a.
267 rr. The `hash' builtin has a new option: -p.
269 ss. The `history' builtin has new options: -c, -p, -s.
271 tt. The `jobs' builtin has new options: -r, -s.
273 uu. The `kill' builtin has new options: -n signum, -l signame.
275 vv. The `pushd' and `popd' builtins have a new option: -n.
277 ww. The `read' builtin has new options: -p prompt, -e, -a.
279 xx. The `readonly' builtin has a new -a option, and the -n option was removed.
281 yy. Changes to the `set' builtin:
282 o new options: -B, -o keyword, -o onecmd, -o history
283 o options removed: -l, -d, -o nohash
284 o options changed: +o, -h, -o hashall
285 o now displays variables in a format that can be re-read as input
287 zz. The new `shopt' builtin controls shell optional behavior previously
288 done by setting and unsetting certain shell variables.
290 aaa. The `test' builtin has new operators: -o option, s1 == s2, s1 < s2,
291 and s1 > s2, where s1 and s2 are strings.
293 bbb. There is a new trap, DEBUG, executed after every simple command.
295 ccc. The `trap' builtin has a new -p option.
297 ddd. The `ulimit' builtin has a new -l option on 4.4BSD-based systems.
299 eee. The PS1, PS2, PATH, and IFS variables may now be unset.
301 fff. The restricted shell mode has been expanded and is now documented.
303 ggg. Security improvements:
304 o functions are not imported from the environment if running setuid
306 o no startup files are sourced if running setuid or with -p
308 hhh. The documentation has been overhauled: the texinfo manual was
309 expanded, and HTML versions of the man page and texinfo manual
312 iii. Changes to Posix mode:
313 o Command lookup now finds special builtins before shell functions.
314 o Failure of a special builtin causes a non-interactive shell to
315 exit. Failures are defined in the POSIX.2 specification.
316 o If the `cd' builtin finds a directory to change to using $CDPATH,
317 the value assigned to PWD when `cd' completes does not contain
319 o A non-interactive shell exits if a variable assignment error
320 occurs when no command name follows the assignment statements.
321 o A non-interactive shell exits if the interation variable in a
322 `for' statement or the selection variable in a `select' statement
323 is read-only or another variable assignment error occurs.
324 o The `<>' redirection operator now opens a file for both stdin and
325 stdout by default, not just when in posix mode.
326 o Assignment statements preceding special builtins now persist in
327 the shell's environment when the builtin completes.
329 Posix mode is now completely POSIX.2-compliant (modulo bugs). When
330 invoked as sh, bash should be completely POSIX.2-compliant.
332 jjj. The default value of PS1 is now "\s-\v\$ ".
334 kkk. The ksh-like ((...)) arithmetic command syntax has been implemented.
335 This is exactly equivalent to `let "..."'.
337 lll. Integer constants have been extended to base 64.
339 mmm. The `ulimit' builtin now sets both hard and soft limits and reports the
340 soft limit by default.
342 2. New Features in Readline
344 a. New variables: enable-keypad, input-meta (new name for meta-flag),
345 mark-directories, visible-stats (now documented), disable-completion,
348 b. New bindable commands: kill-region, copy-region-as-kill,
349 copy-backward-word, copy-forward-word, set-mark, exchange-point-and-mark,
350 character-search, character-search-backward, insert-comment,
351 glob-expand-word, glob-list-expansions, dump-variables, dump-macros.
353 c. New emacs keybindings: delete-horizontal-space (M-\),
354 insert-completions (M-*), possible-completions (M-=).
356 d. The history-search-backward and history-search-forward commands were
357 modified to be the same as previous-line and next-line if point is at
358 the start of the line.
360 e. More file types are available for the visible-stats mode.
362 3. Changes of interest in the Bash implementation
364 a. There is a new autoconf-based configuration mechanism.
366 b. More things have been moved from Posix mode to standard shell behavior.
368 c. The trace output (set -x) now inserts quotes where necessary so it can
371 d. There is a compile-time option for a system-wide interactive shell
372 startup file (disabled by default).
374 e. The YACC grammar is smaller and tighter, and all 66 shift-reduce
375 conflicts are gone. Several parsing bugs have been fixed.
377 f. Builtin option parsing has been regularized (using internal_getopt()),
378 with the exception of `echo', `type', and `set'.
380 g. Builtins now return standard usage messages constructed from the
381 `short doc' used by the help builtin.
383 h. Completion now quotes using backslashes by default, but honors
384 user-supplied quotes.
386 i. The GNU libc malloc is available as a configure-time option.
388 j. There are more internationalization features; bash uses gettext if
389 it is available. The $"..." translation syntax uses the current
392 k. There is better reporting of job termination when the shell is not
395 l. The shell is somewhat more efficient: it uses a little less memory and
396 makes fewer system calls.
398 4. Changes of interest in the Readline implementation
400 a. There is now support for readline `callback' functions.
402 b. There is now support for user-supplied input, redisplay, and terminal
403 preparation functions.
405 c. Most of the shell-specific code in readline has been generalized or
408 d. Most of the annoying redisplay bugs have been fixed, notably the problems
409 with incremental search and excessive redrawing when special characters
410 appear in the prompt string.
412 e. There are new library functions and variables available to application
413 writers, most having to do with completion and quoting.
415 f. The NEWLINE character (^J) is now treated as a search terminator by the
416 incremental search functions.