1 This is a terse description of the new features added to bash-2.05 since
2 the release of bash-2.04. 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. Added a new `--init-file' invocation argument as a synonym for `--rcfile',
8 per the new GNU coding standards.
10 b. The /dev/tcp and /dev/udp redirections now accept service names as well as
13 c. `complete' and `compgen' now take a `-o value' option, which controls some
14 of the aspects of that compspec. Valid values are:
16 default - perform bash default completion if programmable
17 completion produces no matches
18 dirnames - perform directory name completion if programmable
19 completion produces no matches
20 filenames - tell readline that the compspec produces filenames,
21 so it can do things like append slashes to
22 directory names and suppress trailing spaces
24 d. A new loadable builtin, realpath, which canonicalizes and expands symlinks
25 in pathname arguments.
27 e. When `set' is called without options, it prints function defintions in a
28 way that allows them to be reused as input. This affects `declare' and
29 `declare -p' as well. This only happens when the shell is not in POSIX
30 mode, since POSIX.2 forbids this behavior.
32 f. Bash-2.05 once again honors the current locale setting when processing
33 ranges within pattern matching bracket expressions (e.g., [A-Z]).
35 2. New Features in Readline
37 a. The blink timeout for paren matching is now settable by applications,
38 via the rl_set_paren_blink_timeout() function.
40 b. _rl_executing_macro has been renamed to rl_executing_macro, which means
41 it's now part of the public interface.
43 c. Readline has a new variable, rl_readline_state, which is a bitmap that
44 encapsulates the current state of the library; intended for use by
45 callbacks and hook functions.
47 d. New application-callable function rl_set_prompt(const char *prompt):
48 expands its prompt string argument and sets rl_prompt to the result.
50 e. New application-callable function rl_set_screen_size(int rows, int cols):
51 public method for applications to set readline's idea of the screen
54 f. New function, rl_get_screen_size (int *rows, int *columns), returns
55 readline's idea of the screen dimensions.
57 g. The timeout in rl_gather_tyi (readline keyboard input polling function)
58 is now settable via a function (rl_set_keyboard_input_timeout()).
60 h. Renamed the max_input_history variable to history_max_entries; the old
61 variable is maintained for backwards compatibility.
63 i. The list of characters that separate words for the history tokenizer is
64 now settable with a variable: history_word_delimiters. The default
67 -------------------------------------------------------------------------------
68 This is a terse description of the new features added to bash-2.04 since
69 the release of bash-2.03. As always, the manual page (doc/bash.1) is
70 the place to look for complete descriptions.
72 1. New Features in Bash
74 a. The history builtin has a `-d offset' option to delete the history entry
77 b. The prompt expansion code has two new escape sequences: \j, the number of
78 active jobs; and \l, the basename of the shell's tty device name.
80 c. The `bind' builtin has a new `-x' option to bind key sequences to shell
83 d. There is a new shell option, no_empty_command_completion, which, when
84 enabled, disables command completion when TAB is typed on an empty line.
86 e. The `help' builtin has a `-s' option to just print a builtin's usage
89 f. There are several new arithmetic operators: id++, id-- (variable
90 post-increment/decrement), ++id, --id (variabl pre-increment/decrement),
91 expr1 , expr2 (comma operator).
93 g. There is a new ksh-93 style arithmetic for command:
94 for ((expr1 ; expr2; expr3 )); do list; done
96 h. The `read' builtin has a number of new options:
97 -t timeout only wait timeout seconds for input
98 -n nchars only read nchars from input instead of a full line
99 -d delim read until delim rather than newline
100 -s don't echo input chars as they are read
102 i. The redirection code now handles several filenames specially:
103 /dev/fd/N, /dev/stdin, /dev/stdout, and /dev/stderr, whether or
104 not they are present in the file system.
106 j. The redirection code now recognizes pathnames of the form
107 /dev/tcp/host/port and /dev/udp/host/port, and tries to open a socket
108 of the appropriate type to the specified port on the specified host.
110 k. The ksh-93 ${!prefix*} expansion, which expands to the names of all
111 shell variables with prefix PREFIX, has been implemented.
113 l. There is a new dynamic variable, FUNCNAME, which expands to the name of
114 a currently-executing function. Assignments to FUNCNAME have no effect.
116 m. The GROUPS variable is no longer readonly; assignments to it are silently
117 discarded. This means it can be unset.
119 n. A new programmable completion facility, with two new builtin commands:
120 complete and compgen.
122 o. configure has a new option, `--enable-progcomp', to compile in the
123 programmable completion features (enabled by default).
125 p. `shopt' has a new option, `progcomp', to enable and disable programmable
126 completion at runtime.
128 q. Unsetting HOSTFILE now clears the list of hostnames used for completion.
130 r. configure has a new option, `--enable-bash-malloc', replacing the old
131 `--with-gnu-malloc' (which is still present for backwards compatibility).
133 s. There is a new manual page describing rbash, the restricted shell.
135 t. `bashbug' has new `--help' and `--version' options.
137 u. `shopt' has a new `xpg_echo' option, which controls the behavior of
138 `echo' with respect to backslash-escaped characters at runtime.
140 v. If NON_INTERACTIVE_LOGIN_SHELLS is defined, all login shells read the
141 startup files, even if they are not interactive.
143 w. The LC_NUMERIC variable is now treated specially, and used to set the
144 LC_NUMERIC locale category for number formatting, e.g., when `printf'
145 displays floating-point numbers.
147 2. New features in Readline
149 a. Parentheses matching is now always compiled into readline, and enabled
150 or disabled when the value of the `blink-matching-paren' variable is
153 b. MS-DOS systems now use ~/_inputrc as the last-ditch inputrc filename.
155 c. MS-DOS systems now use ~/_history as the default history file.
157 d. history-search-{forward,backward} now leave the point at the end of the
158 line when the string to search for is empty, like
159 {reverse,forward}-search-history.
161 e. history-search-{forward,backward} now leave the last history line found
162 in the readline buffer if the second or subsequent search fails.
164 f. New function for use by applications: rl_on_new_line_with_prompt, used
165 when an application displays the prompt itself before calling readline().
167 g. New variable for use by applications: rl_already_prompted. An application
168 that displays the prompt itself before calling readline() must set this to
171 h. A new variable, rl_gnu_readline_p, always 1. The intent is that an
172 application can verify whether or not it is linked with the `real'
173 readline library or some substitute.
175 -------------------------------------------------------------------------------
176 This is a terse description of the new features added to bash-2.03 since
177 the release of bash-2.02. As always, the manual page (doc/bash.1) is
178 the place to look for complete descriptions.
180 1. New Features in Bash
182 a. New `shopt' option, `restricted_shell', indicating whether or not the
183 shell was started in restricted mode, for use in startup files.
185 b. Filename generation is now performed on the words between ( and ) in
186 array assignments (which it probably should have done all along).
188 c. OLDPWD is now auto-exported, as POSIX.2 seems to require.
190 d. ENV and BASH_ENV are read-only variables in a restricted shell.
192 e. A change was made to the startup file code so that any shell begun with
193 the `--login' option, even non-interactive shells, will source the login
196 2. New Features in Readline
198 a. Many changes to the signal handling:
199 o Readline now catches SIGQUIT and cleans up the tty before returning;
200 o A new variable, rl_catch_signals, is available to application writers
201 to indicate to readline whether or not it should install its own
202 signal handlers for SIGINT, SIGTERM, SIGQUIT, SIGALRM, SIGTSTP,
203 SIGTTIN, and SIGTTOU;
204 o A new variable, rl_catch_sigwinch, is available to application
205 writers to indicate to readline whether or not it should install its
206 own signal handler for SIGWINCH, which will chain to the calling
207 applications's SIGWINCH handler, if one is installed;
208 o There is a new function, rl_free_line_state, for application signal
209 handlers to call to free up the state associated with the current
210 line after receiving a signal;
211 o There is a new function, rl_cleanup_after_signal, to clean up the
212 display and terminal state after receiving a signal;
213 o There is a new function, rl_reset_after_signal, to reinitialize the
214 terminal and display state after an application signal handler
215 returns and readline continues
217 b. There is a new function, rl_resize_terminal, to reset readline's idea of
218 the screen size after a SIGWINCH.
220 c. New public functions: rl_save_prompt and rl_restore_prompt. These were
221 previously private functions with a `_' prefix.
223 d. New function hook: rl_pre_input_hook, called just before readline starts
224 reading input, after initialization.
226 e. New function hook: rl_display_matches_hook, called when readline would
227 display the list of completion matches. The new function
228 rl_display_match_list is what readline uses internally, and is available
229 for use by application functions called via this hook.
231 f. New bindable function, delete-char-or-list, like tcsh.
233 g. A new variable, rl_erase_empty_line, which, if set by an application using
234 readline, will cause readline to erase, prompt and all, lines on which the
235 only thing typed was a newline.
237 h. New bindable variable: `isearch-terminators'.
239 i. New bindable function: `forward-backward-delete-char' (unbound by default).
241 -------------------------------------------------------------------------------
242 This is a terse description of the new features added to bash-2.02 since
243 the release of bash-2.01.1. As always, the manual page (doc/bash.1) is
244 the place to look for complete descriptions.
246 1. New Features in Bash
248 a. A new version of malloc, based on the older GNU malloc, that has many
249 changes, is more page-based, is more conservative with memory usage,
250 and does not `orphan' large blocks when they are freed.
252 b. A new version of gmalloc, based on the old GLIBC malloc, with many
253 changes and range checking included by default.
255 c. A new implementation of fnmatch(3) that includes full POSIX.2 Basic
256 Regular Expression matching, including character classes, collating
257 symbols, equivalence classes, and support for case-insensitive pattern
260 d. ksh-88 egrep-style extended pattern matching ([@+*?!](patlist)) has been
261 implemented, controlled by a new `shopt' option, `extglob'.
263 e. There is a new ksh-like `[[' compound command, which implements
264 extended `test' functionality.
266 f. There is a new `printf' builtin, implemented according to the POSIX.2
269 g. There is a new feature for command substitution: $(< filename) now expands
270 to the contents of `filename', with any trailing newlines removed
271 (equivalent to $(cat filename)).
273 h. There are new tilde prefixes which expand to directories from the
276 i. There is a new `**' arithmetic operator to do exponentiation.
278 j. There are new configuration options to control how bash is linked:
279 `--enable-profiling', to allow bash to be profiled with gprof, and
280 `--enable-static-link', to allow bash to be linked statically.
282 k. There is a new configuration option, `--enable-cond-command', which
283 controls whether or not the `[[' command is included. It is on by
286 l. There is a new configuration option, `--enable-extended-glob', which
287 controls whether or not the ksh extended globbing feature is included.
288 It is enabled by default.
290 m. There is a new configuration #define in config.h.top that, when enabled,
291 will cause all login shells to source /etc/profile and one of the user-
292 specific login shell startup files, whether or not the shell is
295 n. There is a new invocation option, `--dump-po-strings', to dump
296 a shell script's translatable strings ($"...") in GNU `po' format.
298 o. There is a new `shopt' option, `nocaseglob', to enable case-insensitive
299 pattern matching when globbing filenames and using the `case' construct.
301 p. There is a new `shopt' option, `huponexit', which, when enabled, causes
302 the shell to send SIGHUP to all jobs when an interactive login shell
305 q. `bind' has a new `-u' option, which takes a readline function name as an
306 argument and unbinds all key sequences bound to that function in a
309 r. `disown' now has `-a' and `-r' options, to limit operation to all jobs
310 and running jobs, respectively.
312 s. The `shopt' `-p' option now causes output to be displayed in a reusable
315 t. `test' has a new `-N' option, which returns true if the filename argument
316 has been modified since it was last accessed.
318 u. `umask' now has a `-p' option to print output in a reusable format.
320 v. A new escape sequence, `\xNNN', has been added to the `echo -e' and $'...'
321 translation code. It expands to the character whose ascii code is NNN
324 w. The prompt string expansion code has a new `\r' escape sequence.
326 x. The shell may now be cross-compiled for the CYGWIN32 environment on
329 2. New Features in Readline
331 a. There is now an option for `iterative' yank-last-arg handline, so a user
332 can keep entering `M-.', yanking the last argument of successive history
335 b. New variable, `print-completions-horizontally', which causes completion
336 matches to be displayed across the screen (like `ls -x') rather than up
337 and down the screen (like `ls').
339 c. New variable, `completion-ignore-case', which causes filename completion
340 and matching to be performed case-insensitively.
342 d. There is a new bindable command, `magic-space', which causes history
343 expansion to be performed on the current readline buffer and a space to
344 be inserted into the result.
346 e. There is a new bindable command, `menu-complete', which enables tcsh-like
347 menu completion (successive executions of menu-complete insert a single
348 completion match, cycling through the list of possible completions).
350 f. There is a new bindable command, `paste-from-clipboard', for use on Win32
351 systems, to insert the text from the Win32 clipboard into the editing
354 g. The key sequence translation code now understands printf-style backslash
355 escape sequences, including \NNN octal escapes. These escape sequences
356 may be used in key sequence definitions or macro values.
358 h. An `$include' inputrc file parser directive has been added.
360 -------------------------------------------------------------------------------
361 This is a terse description of the new features added to bash-2.01 since
362 the release of bash-2.0. As always, the manual page (doc/bash.1) is the
363 place to look for complete descriptions.
365 1. New Features in Bash
367 a. There is a new builtin array variable: GROUPS, the set of groups to which
368 the user belongs. This is used by the test suite.
370 2. New Features in Readline
372 a. If a key sequence bound to `universal-argument' is read while reading a
373 numeric argument started with `universal-argument', it terminates the
374 argument but is otherwise ignored. This provides a way to insert multiple
375 instances of a digit string, and is how GNU emacs does it.
377 -------------------------------------------------------------------------------
378 This is a terse description of the new features added to bash-2.0 since
379 the release of bash-1.14.7. As always, the manual page (doc/bash.1) is
380 the place to look for complete descriptions.
382 1. New Features in Bash
384 a. There is a new invocation option, -D, that dumps translatable strings
387 b. The `long' invocation options must now be prefixed with `--'.
389 c. New long invocation options: --dump-strings, --help, --verbose
391 d. The `nolineediting' invocation option was renamed to `noediting'.
393 e. The `nobraceexpansion' and `quiet' long invocation options were removed.
395 f. The `--help' and `--version' long options now work as the GNU coding
398 g. If invoked as `sh', bash now enters posix mode after reading the
399 startup files, and reads and executes commands from the file named
400 by $ENV if interactive (as POSIX.2 specifies). A login shell invoked
401 as `sh' reads $ENV after /etc/profile and ~/.profile.
403 h. There is a new reserved word, `time', for timing pipelines, builtin
404 commands, and shell functions. It uses the value of the TIMEFORMAT
405 variable as a format string describing how to print the timing
408 i. The $'...' quoting syntax expands ANSI-C escapes in ... and leaves the
409 result single-quoted.
411 j. The $"..." quoting syntax performs locale-specific translation of ...
412 and leaves the result double-quoted.
414 k. LINENO now works correctly in functions.
416 l. New variables: DIRSTACK, PIPESTATUS, BASH_VERSINFO, HOSTNAME, SHELLOPTS,
417 MACHTYPE. The first three are array variables.
419 m. The BASH_VERSION and BASH_VERSINFO variables now include the shell's
420 `release status' (alpha[N], beta[N], release).
422 n. Some variables have been removed: MAIL_WARNING, notify, history_control,
423 command_oriented_history, glob_dot_filenames, allow_null_glob_expansion,
424 nolinks, hostname_completion_file, noclobber, no_exit_on_failed_exec, and
425 cdable_vars. Most of them are now implemented with the new `shopt'
426 builtin; others were already implemented by `set'.
428 o. Bash now uses some new variables: LC_ALL, LC_MESSAGES, LC_CTYPE,
429 LC_COLLATE, LANG, GLOBIGNORE, HISTIGNORE.
431 p. The shell now supports integer-indexed arrays of unlimited length,
432 with a new compound assignment syntax and changes to the appropriate
433 builtin commands (declare/typeset, read, readonly, etc.). The array
434 index may be an arithmetic expression.
436 q. ${!var}: indirect variable expansion, equivalent to eval \${$var}.
438 r. ${paramter:offset[:length]}: variable substring extraction.
440 s. ${parameter/pattern[/[/]string]}: variable pattern substitution.
442 t. The $[...] arithmetic expansion syntax is no longer supported, in
445 u. Aliases can now be expanded in shell scripts with a shell option
446 (shopt expand_aliases).
448 v. History and history expansion can now be used in scripts with
449 set -o history and set -H.
451 w. All builtins now return an exit status of 2 for incorrect usage.
453 x. Interactive shells resend SIGHUP to all running or stopped children
454 if (and only if) they exit due to a SIGHUP.
456 y. New prompting expansions: \a, \e, \H, \T, \@, \v, \V.
458 z. Variable expansion in prompt strings is now controllable via a shell
459 option (shopt promptvars).
461 aa. Bash now defaults to using command-oriented history.
463 bb. The history file ($HISTFILE) is now truncated to $HISTFILESIZE after
466 cc. The POSIX.2 conditional arithmetic evaluation syntax (expr ? expr : expr)
467 has been implemented.
469 dd. Each builtin now accepts `--' to signify the end of the options, except
470 as documented (echo, etc.).
472 ee. All builtins use -p to display values in a re-readable format where
473 appropriate, except as documented (echo, type, etc.).
475 ff. The `alias' builtin has a new -p option.
477 gg. Changes to the `bind' builtin:
478 o has new options: -psPSVr.
479 o the `-d' option was renamed to `-p'
480 o the `-v' option now dumps variables; the old `-v' is now `-P'
482 hh. The `bye' synonym for `exit' was removed.
484 ii. The -L and -P options to `cd' and `pwd' have been documented.
486 jj. The `cd' builtin now does spelling correction on the directory name
487 by default. This is settable with a shell option (shopt cdspell).
489 kk. The `declare' builtin has new options: -a, -F, -p.
491 ll. The `dirs' builtin has new options: -c, -p, -v.
493 mm. The new `disown' builtin removes jobs from the shell's jobs table
494 or inhibits the resending of SIGHUP when the shell receives a
497 nn. The `echo' builtin has a new escape character: \e.
499 oo. The `enable' builtin can now load new builtins dynamically from shared
500 objects on systems with the dlopen/dlsym interface. There are a number
501 of examples in the examples/loadables directory. There are also
502 new options: -d, -f, -s, -p.
504 pp. The `-all' option to `enable' was removed in favor of `-a'.
506 qq. The `exec' builtin has new options: -l, -c, -a.
508 rr. The `hash' builtin has a new option: -p.
510 ss. The `history' builtin has new options: -c, -p, -s.
512 tt. The `jobs' builtin has new options: -r, -s.
514 uu. The `kill' builtin has new options: -n signum, -l signame.
516 vv. The `pushd' and `popd' builtins have a new option: -n.
518 ww. The `read' builtin has new options: -p prompt, -e, -a.
520 xx. The `readonly' builtin has a new -a option, and the -n option was removed.
522 yy. Changes to the `set' builtin:
523 o new options: -B, -o keyword, -o onecmd, -o history
524 o options removed: -l, -d, -o nohash
525 o options changed: +o, -h, -o hashall
526 o now displays variables in a format that can be re-read as input
528 zz. The new `shopt' builtin controls shell optional behavior previously
529 done by setting and unsetting certain shell variables.
531 aaa. The `test' builtin has new operators: -o option, s1 == s2, s1 < s2,
532 and s1 > s2, where s1 and s2 are strings.
534 bbb. There is a new trap, DEBUG, executed after every simple command.
536 ccc. The `trap' builtin has a new -p option.
538 ddd. The `ulimit' builtin has a new -l option on 4.4BSD-based systems.
540 eee. The PS1, PS2, PATH, and IFS variables may now be unset.
542 fff. The restricted shell mode has been expanded and is now documented.
544 ggg. Security improvements:
545 o functions are not imported from the environment if running setuid
547 o no startup files are sourced if running setuid or with -p
549 hhh. The documentation has been overhauled: the texinfo manual was
550 expanded, and HTML versions of the man page and texinfo manual
553 iii. Changes to Posix mode:
554 o Command lookup now finds special builtins before shell functions.
555 o Failure of a special builtin causes a non-interactive shell to
556 exit. Failures are defined in the POSIX.2 specification.
557 o If the `cd' builtin finds a directory to change to using $CDPATH,
558 the value assigned to PWD when `cd' completes does not contain
560 o A non-interactive shell exits if a variable assignment error
561 occurs when no command name follows the assignment statements.
562 o A non-interactive shell exits if the interation variable in a
563 `for' statement or the selection variable in a `select' statement
564 is read-only or another variable assignment error occurs.
565 o The `<>' redirection operator now opens a file for both stdin and
566 stdout by default, not just when in posix mode.
567 o Assignment statements preceding special builtins now persist in
568 the shell's environment when the builtin completes.
570 Posix mode is now completely POSIX.2-compliant (modulo bugs). When
571 invoked as sh, bash should be completely POSIX.2-compliant.
573 jjj. The default value of PS1 is now "\s-\v\$ ".
575 kkk. The ksh-like ((...)) arithmetic command syntax has been implemented.
576 This is exactly equivalent to `let "..."'.
578 lll. Integer constants have been extended to base 64.
580 mmm. The `ulimit' builtin now sets both hard and soft limits and reports the
581 soft limit by default.
583 2. New Features in Readline
585 a. New variables: enable-keypad, input-meta (new name for meta-flag),
586 mark-directories, visible-stats (now documented), disable-completion,
589 b. New bindable commands: kill-region, copy-region-as-kill,
590 copy-backward-word, copy-forward-word, set-mark, exchange-point-and-mark,
591 character-search, character-search-backward, insert-comment,
592 glob-expand-word, glob-list-expansions, dump-variables, dump-macros.
594 c. New emacs keybindings: delete-horizontal-space (M-\),
595 insert-completions (M-*), possible-completions (M-=).
597 d. The history-search-backward and history-search-forward commands were
598 modified to be the same as previous-line and next-line if point is at
599 the start of the line.
601 e. More file types are available for the visible-stats mode.
603 3. Changes of interest in the Bash implementation
605 a. There is a new autoconf-based configuration mechanism.
607 b. More things have been moved from Posix mode to standard shell behavior.
609 c. The trace output (set -x) now inserts quotes where necessary so it can
612 d. There is a compile-time option for a system-wide interactive shell
613 startup file (disabled by default).
615 e. The YACC grammar is smaller and tighter, and all 66 shift-reduce
616 conflicts are gone. Several parsing bugs have been fixed.
618 f. Builtin option parsing has been regularized (using internal_getopt()),
619 with the exception of `echo', `type', and `set'.
621 g. Builtins now return standard usage messages constructed from the
622 `short doc' used by the help builtin.
624 h. Completion now quotes using backslashes by default, but honors
625 user-supplied quotes.
627 i. The GNU libc malloc is available as a configure-time option.
629 j. There are more internationalization features; bash uses gettext if
630 it is available. The $"..." translation syntax uses the current
633 k. There is better reporting of job termination when the shell is not
636 l. The shell is somewhat more efficient: it uses a little less memory and
637 makes fewer system calls.
639 4. Changes of interest in the Readline implementation
641 a. There is now support for readline `callback' functions.
643 b. There is now support for user-supplied input, redisplay, and terminal
644 preparation functions.
646 c. Most of the shell-specific code in readline has been generalized or
649 d. Most of the annoying redisplay bugs have been fixed, notably the problems
650 with incremental search and excessive redrawing when special characters
651 appear in the prompt string.
653 e. There are new library functions and variables available to application
654 writers, most having to do with completion and quoting.
656 f. The NEWLINE character (^J) is now treated as a search terminator by the
657 incremental search functions.