]> git.ipfire.org Git - thirdparty/bash.git/blame - NEWS
Imported from ../bash-3.1.tar.gz.
[thirdparty/bash.git] / NEWS
CommitLineData
95732b49
JA
1This is a terse description of the new features added to bash-3.1 since
2the release of bash-3.0. As always, the manual page (doc/bash.1) is
3the place to look for complete descriptions.
4
51. New Features in Bash
6
7a. Bash now understands LC_TIME as a special variable so that time display
8 tracks the current locale.
9
10b. BASH_ARGC, BASH_ARGV, BASH_SOURCE, and BASH_LINENO are no longer created
11 as `invisible' variables and may not be unset.
12
13c. In POSIX mode, if `xpg_echo' option is enabled, the `echo' builtin doesn't
14 try to interpret any options at all, as POSIX requires.
15
16d. The `bg' builtin now accepts multiple arguments, as POSIX seems to specify.
17
18e. Fixed vi-mode word completion and glob expansion to perform tilde
19 expansion.
20
21f. The `**' mathematic exponentiation operator is now right-associative.
22
23g. The `ulimit' builtin has new options: -i (max number of pending signals),
24 -q (max size of POSIX message queues), and -x (max number of file locks).
25
26h. A bare `%' once again expands to the current job when used as a job
27 specifier.
28
29i. The `+=' assignment operator (append to the value of a string or array) is
30 now supported for assignment statements and arguments to builtin commands
31 that accept assignment statements.
32
33j. BASH_COMMAND now preserves its value when a DEBUG trap is executed.
34
35k. The `gnu_errfmt' option is enabled automatically if the shell is running
36 in an emacs terminal window.
37
38l. New configuration option: --single-help-strings. Causes long help text
39 to be written as a single string; intended to ease translation.
40
41m. The COMP_WORDBREAKS variable now causes the list of word break characters
42 to be emptied when the variable is unset.
43
44n. An unquoted expansion of $* when $IFS is empty now causes the positional
45 parameters to be concatenated if the expansion doesn't undergo word
46 splitting.
47
48o. Bash now inherits $_ from the environment if it appears there at startup.
49
50p. New shell option: nocasematch. If non-zero, shell pattern matching ignores
51 case when used by `case' and `[[' commands.
52
53q. The `printf' builtin takes a new option: -v var. That causes the output
54 to be placed into var instead of on stdout.
55
56r. By default, the shell no longer reports processes dying from SIGPIPE.
57
58s. Bash now sets the extern variable `environ' to the export environment it
59 creates, so C library functions that call getenv() (and can't use the
60 shell-provided replacement) get current values of environment variables.
61
62t. A new configuration option, `--enable-strict-posix-default', which will
63 build bash to be POSIX conforming by default.
64
65u. If compiled for strict POSIX conformance, LINES and COLUMNS may now
66 override the true terminal size.
67
682. New Features in Readline
69
70a. The key sequence sent by the keypad `delete' key is now automatically
71 bound to delete-char.
72
73b. A negative argument to menu-complete now cycles backward through the
74 completion list.
75
76c. A new bindable readline variable: bind-tty-special-chars. If non-zero,
77 readline will bind the terminal special characters to their readline
78 equivalents when it's called (on by default).
79
80d. New bindable command: vi-rubout. Saves deleted text for possible
81 reinsertion, as with any vi-mode `text modification' command; `X' is bound
82 to this in vi command mode.
83
84e. A new external application-controllable variable that allows the LINES
85 and COLUMNS environment variables to set the window size regardless of
86 what the kernel returns: rl_prefer_env_winsize
87
88-------------------------------------------------------------------------------
b80f6443
JA
89This is a terse description of the new features added to bash-3.0 since
90the release of bash-2.05b. As always, the manual page (doc/bash.1) is
91the place to look for complete descriptions.
92
931. New Features in Bash
94
95a. ANSI string expansion now implements the \x{hexdigits} escape.
96
97b. There is a new loadable `strftime' builtin.
98
99c. New variable, COMP_WORDBREAKS, which controls the readline completer's
100 idea of word break characters.
101
102d. The `type' builtin no longer reports on aliases unless alias expansion
103 will actually be performed.
104
105e. HISTCONTROL is now a colon-separated list of values, which permits
106 more extensibility and backwards compatibility.
107
108f. HISTCONTROL may now include the `erasedups' option, which causes all lines
109 matching a line being added to be removed from the history list.
110
111g. `configure' has a new `--enable-multibyte' argument that permits multibyte
112 character support to be disabled even on systems that support it.
113
114h. New variables to support the bash debugger: BASH_ARGC, BASH_ARGV,
115 BASH_SOURCE, BASH_LINENO, BASH_SUBSHELL, BASH_EXECUTION_STRING,
116 BASH_COMMAND
117
118i. FUNCNAME has been changed to support the debugger: it's now an array
119 variable.
120
121j. for, case, select, arithmetic commands now keep line number information
122 for the debugger.
123
124k. There is a new `RETURN' trap executed when a function or sourced script
125 returns (not inherited child processes; inherited by command substitution
126 if function tracing is enabled and the debugger is active).
127
128l. New invocation option: --debugger. Enables debugging and turns on new
129 `extdebug' shell option.
130
131m. New `functrace' and `errtrace' options to `set -o' cause DEBUG and ERR
132 traps, respectively, to be inherited by shell functions. Equivalent to
133 `set -T' and `set -E' respectively. The `functrace' option also controls
134 whether or not the DEBUG trap is inherited by sourced scripts.
135
136n. The DEBUG trap is run before binding the variable and running the action
137 list in a `for' command, binding the selection variable and running the
138 query in a `select' command, and before attempting a match in a `case'
139 command.
140
141o. New `--enable-debugger' option to `configure' to compile in the debugger
142 support code.
143
144p. `declare -F' now prints out extra line number and source file information
145 if the `extdebug' option is set.
146
147q. If `extdebug' is enabled, a non-zero return value from a DEBUG trap causes
148 the next command to be skipped, and a return value of 2 while in a
149 function or sourced script forces a `return'.
150
151r. New `caller' builtin to provide a call stack for the bash debugger.
152
153s. The DEBUG trap is run just before the first command in a function body is
154 executed, for the debugger.
155
156t. `for', `select', and `case' command heads are printed when `set -x' is
157 enabled.
158
159u. There is a new {x..y} brace expansion, which is shorthand for {x.x+1,
160 x+2,...,y}. x and y can be integers or single characters; the sequence
161 may ascend or descend; the increment is always 1.
162
163v. New ksh93-like ${!array[@]} expansion, expands to all the keys (indices)
164 of array.
165
166w. New `force_fignore' shopt option; if enabled, suffixes specified by
167 FIGNORE cause words to be ignored when performing word completion even
168 if they're the only possibilities.
169
170x. New `gnu_errfmt' shopt option; if enabled, error messages follow the `gnu
171 style' (filename:lineno:message) format.
172
173y. New `-o bashdefault' option to complete and compgen; if set, causes the
174 whole set of bash completions to be performed if the compspec doesn't
175 result in a match.
176
177z. New `-o plusdirs' option to complete and compgen; if set, causes directory
178 name completion to be performed and the results added to the rest of the
179 possible completions.
180
181aa. `kill' is available as a builtin even when the shell is built without
182 job control.
183
184bb. New HISTTIMEFORMAT variable; value is a format string to pass to
185 strftime(3). If set and not null, the `history' builtin prints out
186 timestamp information according to the specified format when displaying
187 history entries. If set, bash tells the history library to write out
188 timestamp information when the history file is written.
189
190cc. The [[ ... ]] command has a new binary `=~' operator that performs
191 extended regular expression (egrep-like) matching.
192
193dd. `configure' has a new `--enable-cond-regexp' option (enabled by default)
194 to enable the =~ operator and regexp matching in [[ ... ]].
195
196ee. Subexpressions matched by the =~ operator are placed in the new
197 BASH_REMATCH array variable.
198
199ff. New `failglob' option that causes an expansion error when pathname
200 expansion fails to produce a match.
201
202gg. New `set -o pipefail' option that causes a pipeline to return a failure
203 status if any of the processes in the pipeline fail, not just the last
204 one.
205
206hh. printf builtin understands two new escape sequences: \" and \?.
207
208ii. `echo -e' understands two new escape sequences: \" and \?.
209
210jj. The GNU `gettext' package and libintl have been integrated; the shell's
211 messages can be translated into different languages.
212
213kk. The `\W' prompt expansion now abbreviates $HOME as `~', like `\w'.
214
215ll. The error message printed when bash cannot open a shell script supplied
216 as argument 1 now includes the name of the shell, to better identify
217 the error as coming from bash.
218
219mm. The parameter pattern removal and substitution expansions are now much
220 faster and more efficient when using multibyte characters.
221
222nn. The `jobs', `kill', and `wait' builtins now accept job control notation
223 even if job control is not enabled.
224
225oo. The historical behavior of `trap' that allows a missing `action' argument
226 to cause each specified signal's handling to be reset to its default is
227 now only supported when `trap' is given a single non-option argument.
228
2292. New Features in Readline
230
231a. History expansion has a new `a' modifier equivalent to the `g' modifier
232 for compatibility with the BSD csh.
233
234b. History expansion has a new `G' modifier equivalent to the BSD csh `g'
235 modifier, which performs a substitution once per word.
236
237c. All non-incremental search operations may now undo the operation of
238 replacing the current line with the history line.
239
240d. The text inserted by an `a' command in vi mode can be reinserted with
241 `.'.
242
243e. New bindable variable, `show-all-if-unmodified'. If set, the readline
244 completer will list possible completions immediately if there is more
245 than one completion and partial completion cannot be performed.
246
247f. There is a new application-callable `free_history_entry()' function.
248
249g. History list entries now contain timestamp information; the history file
250 functions know how to read and write timestamp information associated
251 with each entry.
252
253h. Four new key binding functions have been added:
254
255 rl_bind_key_if_unbound()
256 rl_bind_key_if_unbound_in_map()
257 rl_bind_keyseq_if_unbound()
258 rl_bind_keyseq_if_unbound_in_map()
259
260i. New application variable, rl_completion_quote_character, set to any
261 quote character readline finds before it calls the application completion
262 function.
263
264j. New application variable, rl_completion_suppress_quote, settable by an
265 application completion function. If set to non-zero, readline does not
266 attempt to append a closing quote to a completed word.
267
268k. New application variable, rl_completion_found_quote, set to a non-zero
269 value if readline determines that the word to be completed is quoted.
270 Set before readline calls any application completion function.
271
272l. New function hook, rl_completion_word_break_hook, called when readline
273 needs to break a line into words when completion is attempted. Allows
274 the word break characters to vary based on position in the line.
275
276m. New bindable command: unix-filename-rubout. Does the same thing as
277 unix-word-rubout, but adds `/' to the set of word delimiters.
278
279n. When listing completions, directories have a `/' appended if the
280 `mark-directories' option has been enabled.
281
282-------------------------------------------------------------------------------
7117c2d2
JA
283This is a terse description of the new features added to bash-2.05b since
284the release of bash-2.05a. As always, the manual page (doc/bash.1) is
285the place to look for complete descriptions.
286
2871. New Features in Bash
288
289a. If set, TMOUT is the default timeout for the `read' builtin.
290
291b. `type' has two new options: `-f' suppresses shell function lookup, and
292 `-P' forces a $PATH search.
293
294c. New code to handle multibyte characters.
295
296d. `select' was changed to be more ksh-compatible, in that the menu is
297 reprinted each time through the loop only if REPLY is set to NULL.
298 The previous behavior is available as a compile-time option.
299
300e. `complete -d' and `complete -o dirnames' now force a slash to be
301 appended to names which are symlinks to directories.
302
303f. There is now a bindable edit-and-execute-command readline command,
304 like the vi-mode `v' command, bound to C-xC-e in emacs mode.
305
306g. Added support for ksh93-like [:word:] character class in pattern matching.
307
308h. The $'...' quoting construct now expands \cX to Control-X.
309
310i. A new \D{...} prompt expansion; passes the `...' to strftime and inserts
311 the result into the expanded prompt.
312
313j. The shell now performs arithmetic in the largest integer size the
314 machine supports (intmax_t), instead of long.
315
316k. If a numeric argument is supplied to one of the bash globbing completion
317 functions, a `*' is appended to the word before expansion is attempted.
318
319l. The bash globbing completion functions now allow completions to be listed
320 with double tabs or if `show-all-if-ambiguous' is set.
321
322m. New `-o nospace' option for `complete' and `compgen' builtins; suppresses
323 readline's appending a space to the completed word.
324
325n. New `here-string' redirection operator: <<< word.
326
327o. When displaying variables, function attributes and definitions are shown
328 separately, allowing them to be re-used as input (attempting to re-use
329 the old output would result in syntax errors).
330
331p. There is a new configuration option `--enable-mem-scramble', controls
332 bash malloc behavior of writing garbage characters into memory at
333 allocation and free time.
334
335q. The `complete' and `compgen' builtins now have a new `-s/-A service'
336 option to complete on names from /etc/services.
337
338r. `read' has a new `-u fd' option to read from a specified file descriptor.
339
340s. Fix the completion code so that expansion errors in a directory name
341 don't cause a longjmp back to the command loop.
342
343t. Fixed word completion inside command substitution to work a little more
344 intuitively.
345
346u. The `printf' %q format specifier now uses $'...' quoting to print the
347 argument if it contains non-printing characters.
348
349v. The `declare' and `typeset' builtins have a new `-t' option. When applied
350 to functions, it causes the DEBUG trap to be inherited by the named
351 function. Currently has no effect on variables.
352
353w. The DEBUG trap is now run *before* simple commands, ((...)) commands,
354 [[...]] conditional commands, and for ((...)) loops.
355
356x. The expansion of $LINENO inside a shell function is only relative to the
357 function start if the shell is interactive -- if the shell is running a
358 script, $LINENO expands to the line number in the script. This is as
359 POSIX-2001 requires.
360
361y. The bash debugger in examples/bashdb has been modified to work with the
362 new DEBUG trap semantics, the command set has been made more gdb-like,
363 and the changes to $LINENO make debugging functions work better. Code
364 from Gary Vaughan.
365
366z. New [n]<&word- and [n]>&word- redirections from ksh93 -- move fds (dup
367 and close).
368
369aa. There is a new `-l' invocation option, equivalent to `--login'.
370
371bb. The `hash' builtin has a new `-l' option to list contents in a reusable
372 format, and a `-d' option to remove a name from the hash table.
373
374cc. There is now support for placing the long help text into separate files
375 installed into ${datadir}/bash. Not enabled by default; can be turned
376 on with `--enable-separate-helpfiles' option to configure.
377
378dd. All builtins that take operands accept a `--' pseudo-option, except
379 `echo'.
380
381ee. The `echo' builtin now accepts \0xxx (zero to three octal digits following
382 the `0') in addition to \xxx (one to three octal digits) for SUSv3/XPG6/
383 POSIX.1-2001 compliance.
384
385
3862. New Features in Readline
387
388a. Support for key `subsequences': allows, e.g., ESC and ESC-a to both
389 be bound to readline functions. Now the arrow keys may be used in vi
390 insert mode.
391
392b. When listing completions, and the number of lines displayed is more than
393 the screen length, readline uses an internal pager to display the results.
394 This is controlled by the `page-completions' variable (default on).
395
396c. New code to handle editing and displaying multibyte characters.
397
398d. The behavior introduced in bash-2.05a of deciding whether or not to
399 append a slash to a completed name that is a symlink to a directory has
400 been made optional, controlled by the `mark-symlinked-directories'
401 variable (default is the 2.05a behavior).
402
403e. The `insert-comment' command now acts as a toggle if given a numeric
404 argument: if the first characters on the line don't specify a
405 comment, insert one; if they do, delete the comment text
406
407f. New application-settable completion variable:
408 rl_completion_mark_symlink_dirs, allows an application's completion
409 function to temporarily override the user's preference for appending
410 slashes to names which are symlinks to directories.
411
412g. New function available to application completion functions:
413 rl_completion_mode, to tell how the completion function was invoked
414 and decide which argument to supply to rl_complete_internal (to list
415 completions, etc.).
416
417h. Readline now has an overwrite mode, toggled by the `overwrite-mode'
418 bindable command, which could be bound to `Insert'.
419
420i. New application-settable completion variable:
421 rl_completion_suppress_append, inhibits appending of
422 rl_completion_append_character to completed words.
423
424j. New key bindings when reading an incremental search string: ^W yanks
425 the currently-matched word out of the current line into the search
426 string; ^Y yanks the rest of the current line into the search string,
427 DEL or ^H deletes characters from the search string.
428
429-------------------------------------------------------------------------------
f73dda09
JA
430This is a terse description of the new features added to bash-2.05a since
431the release of bash-2.05. As always, the manual page (doc/bash.1) is
432the place to look for complete descriptions.
433
4341. New Features in Bash
435
436a. Added support for DESTDIR installation root prefix, so you can do a
437 `make install DESTDIR=bash-root' and do easier binary packaging.
438
439b. Added support for builtin printf "'" flag character as per latest POSIX
440 drafts.
441
442c. Support for POSIX.2 printf(1) length specifiers `j', `t', and `z' (from
443 ISO C99).
444
445d. New autoconf macro, RL_LIB_READLINE_VERSION, for use by other applications
446 (bash doesn't use very much of what it returns).
447
448e. `set [-+]o nolog' is recognized as required by the latest POSIX drafts,
449 but ignored.
450
451f. New read-only `shopt' option: login_shell. Set to non-zero value if the
452 shell is a login shell.
453
454g. New `\A' prompt string escape sequence; expands to time in 24 HH:MM format.
455
456h. New `-A group/-g' option to complete and compgen; does group name
457 completion.
458
459i. New `-t' option to `hash' to list hash values for each filename argument.
460
461j. New [-+]O invocation option to set and unset `shopt' options at startup.
462
463k. configure's `--with-installed-readline' option now takes an optional
464 `=PATH' suffix to set the root of the tree where readline is installed
465 to PATH.
466
467l. The ksh-like `ERR' trap has been added. The `ERR' trap will be run
468 whenever the shell would have exited if the -e option were enabled.
469 It is not inherited by shell functions.
470
471m. `readonly', `export', and `declare' now print variables which have been
472 given attributes but not set by assigning a value as just a command and
473 a variable name (like `export foo') when listing, as the latest POSIX
474 drafts require.
475
476n. `bashbug' now requires that the subject be changed from the default.
477
478o. configure has a new `--enable-largefile' option, like other GNU utilities.
479
480p. `for' loops now allow empty word lists after `in', like the latest POSIX
481 drafts require.
482
483q. The builtin `ulimit' now takes two new non-numeric arguments: `hard',
484 meaning the current hard limit, and `soft', meaning the current soft
485 limit, in addition to `unlimited'
486
487r. `ulimit' now prints the option letter associated with a particular
488 resource when printing more than one limit.
489
490s. `ulimit' prints `hard' or `soft' when a value is not `unlimited' but is
491 one of RLIM_SAVED_MAX or RLIM_SAVED_CUR, respectively.
492
493t. The `printf' builtin now handles the %a and %A conversions if they're
494 implemented by printf(3).
495
496u. The `printf' builtin now handles the %F conversion (just about like %f).
497
498v. The `printf' builtin now handles the %n conversion like printf(3). The
499 corresponding argument is the name of a shell variable to which the
500 value is assigned.
501
5022. New Features in Readline
503
504a. Added extern declaration for rl_get_termcap to readline.h, making it a
505 public function (it was always there, just not in readline.h).
506
507b. New #defines in readline.h: RL_READLINE_VERSION, currently 0x0402,
508 RL_VERSION_MAJOR, currently 4, and RL_VERSION_MINOR, currently 2.
509
510c. New readline variable: rl_readline_version, mirrors RL_READLINE_VERSION.
511
512d. New bindable boolean readline variable: match-hidden-files. Controls
513 completion of files beginning with a `.' (on Unix). Enabled by default.
514
515e. The history expansion code now allows any character to terminate a
516 `:first-' modifier, like csh.
517
518f. New bindable variable `history-preserve-point'. If set, the history
519 code attempts to place the user at the same location on each history
520 line retrived with previous-history or next-history.
521
522-------------------------------------------------------------------------------
28ef6c31
JA
523This is a terse description of the new features added to bash-2.05 since
524the release of bash-2.04. As always, the manual page (doc/bash.1) is
525the place to look for complete descriptions.
526
5271. New Features in Bash
528
529a. Added a new `--init-file' invocation argument as a synonym for `--rcfile',
530 per the new GNU coding standards.
531
532b. The /dev/tcp and /dev/udp redirections now accept service names as well as
533 port numbers.
534
535c. `complete' and `compgen' now take a `-o value' option, which controls some
536 of the aspects of that compspec. Valid values are:
537
538 default - perform bash default completion if programmable
539 completion produces no matches
540 dirnames - perform directory name completion if programmable
541 completion produces no matches
542 filenames - tell readline that the compspec produces filenames,
543 so it can do things like append slashes to
544 directory names and suppress trailing spaces
545
546d. A new loadable builtin, realpath, which canonicalizes and expands symlinks
547 in pathname arguments.
548
549e. When `set' is called without options, it prints function defintions in a
550 way that allows them to be reused as input. This affects `declare' and
551 `declare -p' as well. This only happens when the shell is not in POSIX
552 mode, since POSIX.2 forbids this behavior.
553
554f. Bash-2.05 once again honors the current locale setting when processing
555 ranges within pattern matching bracket expressions (e.g., [A-Z]).
556
5572. New Features in Readline
558
559a. The blink timeout for paren matching is now settable by applications,
560 via the rl_set_paren_blink_timeout() function.
561
562b. _rl_executing_macro has been renamed to rl_executing_macro, which means
563 it's now part of the public interface.
564
565c. Readline has a new variable, rl_readline_state, which is a bitmap that
566 encapsulates the current state of the library; intended for use by
567 callbacks and hook functions.
568
569d. New application-callable function rl_set_prompt(const char *prompt):
570 expands its prompt string argument and sets rl_prompt to the result.
571
572e. New application-callable function rl_set_screen_size(int rows, int cols):
573 public method for applications to set readline's idea of the screen
574 dimensions.
575
576f. New function, rl_get_screen_size (int *rows, int *columns), returns
577 readline's idea of the screen dimensions.
578
579g. The timeout in rl_gather_tyi (readline keyboard input polling function)
580 is now settable via a function (rl_set_keyboard_input_timeout()).
581
582h. Renamed the max_input_history variable to history_max_entries; the old
583 variable is maintained for backwards compatibility.
584
585i. The list of characters that separate words for the history tokenizer is
586 now settable with a variable: history_word_delimiters. The default
587 value is as before.
588
589-------------------------------------------------------------------------------
bb70624e
JA
590This is a terse description of the new features added to bash-2.04 since
591the release of bash-2.03. As always, the manual page (doc/bash.1) is
592the place to look for complete descriptions.
593
5941. New Features in Bash
595
596a. The history builtin has a `-d offset' option to delete the history entry
597 at position `offset'.
598
599b. The prompt expansion code has two new escape sequences: \j, the number of
600 active jobs; and \l, the basename of the shell's tty device name.
601
602c. The `bind' builtin has a new `-x' option to bind key sequences to shell
603 commands.
604
605d. There is a new shell option, no_empty_command_completion, which, when
606 enabled, disables command completion when TAB is typed on an empty line.
607
608e. The `help' builtin has a `-s' option to just print a builtin's usage
609 synopsis.
610
611f. There are several new arithmetic operators: id++, id-- (variable
f73dda09 612 post-increment/decrement), ++id, --id (variable pre-increment/decrement),
bb70624e
JA
613 expr1 , expr2 (comma operator).
614
615g. There is a new ksh-93 style arithmetic for command:
616 for ((expr1 ; expr2; expr3 )); do list; done
617
618h. The `read' builtin has a number of new options:
619 -t timeout only wait timeout seconds for input
620 -n nchars only read nchars from input instead of a full line
621 -d delim read until delim rather than newline
622 -s don't echo input chars as they are read
623
624i. The redirection code now handles several filenames specially:
625 /dev/fd/N, /dev/stdin, /dev/stdout, and /dev/stderr, whether or
626 not they are present in the file system.
627
628j. The redirection code now recognizes pathnames of the form
629 /dev/tcp/host/port and /dev/udp/host/port, and tries to open a socket
630 of the appropriate type to the specified port on the specified host.
631
632k. The ksh-93 ${!prefix*} expansion, which expands to the names of all
633 shell variables with prefix PREFIX, has been implemented.
634
635l. There is a new dynamic variable, FUNCNAME, which expands to the name of
636 a currently-executing function. Assignments to FUNCNAME have no effect.
637
638m. The GROUPS variable is no longer readonly; assignments to it are silently
639 discarded. This means it can be unset.
640
641n. A new programmable completion facility, with two new builtin commands:
642 complete and compgen.
643
644o. configure has a new option, `--enable-progcomp', to compile in the
645 programmable completion features (enabled by default).
646
647p. `shopt' has a new option, `progcomp', to enable and disable programmable
648 completion at runtime.
649
650q. Unsetting HOSTFILE now clears the list of hostnames used for completion.
651
652r. configure has a new option, `--enable-bash-malloc', replacing the old
653 `--with-gnu-malloc' (which is still present for backwards compatibility).
654
655s. There is a new manual page describing rbash, the restricted shell.
656
657t. `bashbug' has new `--help' and `--version' options.
658
659u. `shopt' has a new `xpg_echo' option, which controls the behavior of
660 `echo' with respect to backslash-escaped characters at runtime.
661
662v. If NON_INTERACTIVE_LOGIN_SHELLS is defined, all login shells read the
663 startup files, even if they are not interactive.
664
665w. The LC_NUMERIC variable is now treated specially, and used to set the
666 LC_NUMERIC locale category for number formatting, e.g., when `printf'
667 displays floating-point numbers.
668
6692. New features in Readline
670
671a. Parentheses matching is now always compiled into readline, and enabled
672 or disabled when the value of the `blink-matching-paren' variable is
673 changed.
674
675b. MS-DOS systems now use ~/_inputrc as the last-ditch inputrc filename.
676
677c. MS-DOS systems now use ~/_history as the default history file.
678
679d. history-search-{forward,backward} now leave the point at the end of the
680 line when the string to search for is empty, like
681 {reverse,forward}-search-history.
682
683e. history-search-{forward,backward} now leave the last history line found
684 in the readline buffer if the second or subsequent search fails.
685
686f. New function for use by applications: rl_on_new_line_with_prompt, used
687 when an application displays the prompt itself before calling readline().
688
689g. New variable for use by applications: rl_already_prompted. An application
690 that displays the prompt itself before calling readline() must set this to
691 a non-zero value.
692
693h. A new variable, rl_gnu_readline_p, always 1. The intent is that an
694 application can verify whether or not it is linked with the `real'
695 readline library or some substitute.
696
697-------------------------------------------------------------------------------
b72432fd
JA
698This is a terse description of the new features added to bash-2.03 since
699the release of bash-2.02. As always, the manual page (doc/bash.1) is
700the place to look for complete descriptions.
701
7021. New Features in Bash
703
704a. New `shopt' option, `restricted_shell', indicating whether or not the
705 shell was started in restricted mode, for use in startup files.
706
707b. Filename generation is now performed on the words between ( and ) in
708 array assignments (which it probably should have done all along).
709
710c. OLDPWD is now auto-exported, as POSIX.2 seems to require.
711
712d. ENV and BASH_ENV are read-only variables in a restricted shell.
713
714e. A change was made to the startup file code so that any shell begun with
715 the `--login' option, even non-interactive shells, will source the login
716 shell startup files.
717
7182. New Features in Readline
719
720a. Many changes to the signal handling:
721 o Readline now catches SIGQUIT and cleans up the tty before returning;
722 o A new variable, rl_catch_signals, is available to application writers
723 to indicate to readline whether or not it should install its own
724 signal handlers for SIGINT, SIGTERM, SIGQUIT, SIGALRM, SIGTSTP,
725 SIGTTIN, and SIGTTOU;
726 o A new variable, rl_catch_sigwinch, is available to application
727 writers to indicate to readline whether or not it should install its
728 own signal handler for SIGWINCH, which will chain to the calling
729 applications's SIGWINCH handler, if one is installed;
730 o There is a new function, rl_free_line_state, for application signal
731 handlers to call to free up the state associated with the current
732 line after receiving a signal;
733 o There is a new function, rl_cleanup_after_signal, to clean up the
734 display and terminal state after receiving a signal;
735 o There is a new function, rl_reset_after_signal, to reinitialize the
736 terminal and display state after an application signal handler
737 returns and readline continues
738
739b. There is a new function, rl_resize_terminal, to reset readline's idea of
740 the screen size after a SIGWINCH.
741
742c. New public functions: rl_save_prompt and rl_restore_prompt. These were
743 previously private functions with a `_' prefix.
744
745d. New function hook: rl_pre_input_hook, called just before readline starts
746 reading input, after initialization.
747
748e. New function hook: rl_display_matches_hook, called when readline would
749 display the list of completion matches. The new function
750 rl_display_match_list is what readline uses internally, and is available
751 for use by application functions called via this hook.
752
753f. New bindable function, delete-char-or-list, like tcsh.
754
755g. A new variable, rl_erase_empty_line, which, if set by an application using
756 readline, will cause readline to erase, prompt and all, lines on which the
757 only thing typed was a newline.
758
759h. New bindable variable: `isearch-terminators'.
760
761i. New bindable function: `forward-backward-delete-char' (unbound by default).
762
763-------------------------------------------------------------------------------
cce855bc
JA
764This is a terse description of the new features added to bash-2.02 since
765the release of bash-2.01.1. As always, the manual page (doc/bash.1) is
766the place to look for complete descriptions.
767
7681. New Features in Bash
769
770a. A new version of malloc, based on the older GNU malloc, that has many
771 changes, is more page-based, is more conservative with memory usage,
772 and does not `orphan' large blocks when they are freed.
773
774b. A new version of gmalloc, based on the old GLIBC malloc, with many
775 changes and range checking included by default.
776
777c. A new implementation of fnmatch(3) that includes full POSIX.2 Basic
778 Regular Expression matching, including character classes, collating
779 symbols, equivalence classes, and support for case-insensitive pattern
780 matching.
781
782d. ksh-88 egrep-style extended pattern matching ([@+*?!](patlist)) has been
783 implemented, controlled by a new `shopt' option, `extglob'.
784
785e. There is a new ksh-like `[[' compound command, which implements
786 extended `test' functionality.
787
788f. There is a new `printf' builtin, implemented according to the POSIX.2
789 specification.
790
791g. There is a new feature for command substitution: $(< filename) now expands
792 to the contents of `filename', with any trailing newlines removed
793 (equivalent to $(cat filename)).
794
795h. There are new tilde prefixes which expand to directories from the
796 directory stack.
797
798i. There is a new `**' arithmetic operator to do exponentiation.
799
800j. There are new configuration options to control how bash is linked:
801 `--enable-profiling', to allow bash to be profiled with gprof, and
802 `--enable-static-link', to allow bash to be linked statically.
803
804k. There is a new configuration option, `--enable-cond-command', which
805 controls whether or not the `[[' command is included. It is on by
806 default.
807
808l. There is a new configuration option, `--enable-extended-glob', which
809 controls whether or not the ksh extended globbing feature is included.
810 It is enabled by default.
811
812m. There is a new configuration #define in config.h.top that, when enabled,
813 will cause all login shells to source /etc/profile and one of the user-
814 specific login shell startup files, whether or not the shell is
815 interactive.
816
817n. There is a new invocation option, `--dump-po-strings', to dump
818 a shell script's translatable strings ($"...") in GNU `po' format.
819
820o. There is a new `shopt' option, `nocaseglob', to enable case-insensitive
821 pattern matching when globbing filenames and using the `case' construct.
822
823p. There is a new `shopt' option, `huponexit', which, when enabled, causes
824 the shell to send SIGHUP to all jobs when an interactive login shell
825 exits.
826
827q. `bind' has a new `-u' option, which takes a readline function name as an
828 argument and unbinds all key sequences bound to that function in a
829 specified keymap.
830
831r. `disown' now has `-a' and `-r' options, to limit operation to all jobs
832 and running jobs, respectively.
833
834s. The `shopt' `-p' option now causes output to be displayed in a reusable
835 format.
836
837t. `test' has a new `-N' option, which returns true if the filename argument
838 has been modified since it was last accessed.
839
840u. `umask' now has a `-p' option to print output in a reusable format.
841
842v. A new escape sequence, `\xNNN', has been added to the `echo -e' and $'...'
843 translation code. It expands to the character whose ascii code is NNN
844 in hexadecimal.
845
846w. The prompt string expansion code has a new `\r' escape sequence.
847
848x. The shell may now be cross-compiled for the CYGWIN32 environment on
849 a Unix machine.
850
8512. New Features in Readline
852
853a. There is now an option for `iterative' yank-last-arg handline, so a user
854 can keep entering `M-.', yanking the last argument of successive history
855 lines.
856
857b. New variable, `print-completions-horizontally', which causes completion
858 matches to be displayed across the screen (like `ls -x') rather than up
859 and down the screen (like `ls').
860
861c. New variable, `completion-ignore-case', which causes filename completion
862 and matching to be performed case-insensitively.
863
864d. There is a new bindable command, `magic-space', which causes history
865 expansion to be performed on the current readline buffer and a space to
866 be inserted into the result.
867
868e. There is a new bindable command, `menu-complete', which enables tcsh-like
869 menu completion (successive executions of menu-complete insert a single
870 completion match, cycling through the list of possible completions).
871
872f. There is a new bindable command, `paste-from-clipboard', for use on Win32
873 systems, to insert the text from the Win32 clipboard into the editing
874 buffer.
875
876g. The key sequence translation code now understands printf-style backslash
877 escape sequences, including \NNN octal escapes. These escape sequences
878 may be used in key sequence definitions or macro values.
879
880h. An `$include' inputrc file parser directive has been added.
881
882-------------------------------------------------------------------------------
d166f048
JA
883This is a terse description of the new features added to bash-2.01 since
884the release of bash-2.0. As always, the manual page (doc/bash.1) is the
885place to look for complete descriptions.
886
8871. New Features in Bash
888
889a. There is a new builtin array variable: GROUPS, the set of groups to which
890 the user belongs. This is used by the test suite.
891
8922. New Features in Readline
893
894a. If a key sequence bound to `universal-argument' is read while reading a
895 numeric argument started with `universal-argument', it terminates the
896 argument but is otherwise ignored. This provides a way to insert multiple
897 instances of a digit string, and is how GNU emacs does it.
898
899-------------------------------------------------------------------------------
ccc6cda3
JA
900This is a terse description of the new features added to bash-2.0 since
901the release of bash-1.14.7. As always, the manual page (doc/bash.1) is
902the place to look for complete descriptions.
726f6388 903
ccc6cda3 9041. New Features in Bash
726f6388 905
ccc6cda3
JA
906a. There is a new invocation option, -D, that dumps translatable strings
907 in a script.
726f6388 908
ccc6cda3
JA
909b. The `long' invocation options must now be prefixed with `--'.
910
911c. New long invocation options: --dump-strings, --help, --verbose
912
913d. The `nolineediting' invocation option was renamed to `noediting'.
914
915e. The `nobraceexpansion' and `quiet' long invocation options were removed.
916
917f. The `--help' and `--version' long options now work as the GNU coding
918 standards specify.
919
920g. If invoked as `sh', bash now enters posix mode after reading the
921 startup files, and reads and executes commands from the file named
922 by $ENV if interactive (as POSIX.2 specifies). A login shell invoked
923 as `sh' reads $ENV after /etc/profile and ~/.profile.
924
925h. There is a new reserved word, `time', for timing pipelines, builtin
926 commands, and shell functions. It uses the value of the TIMEFORMAT
927 variable as a format string describing how to print the timing
928 statistics.
929
930i. The $'...' quoting syntax expands ANSI-C escapes in ... and leaves the
931 result single-quoted.
932
933j. The $"..." quoting syntax performs locale-specific translation of ...
934 and leaves the result double-quoted.
935
936k. LINENO now works correctly in functions.
937
938l. New variables: DIRSTACK, PIPESTATUS, BASH_VERSINFO, HOSTNAME, SHELLOPTS,
939 MACHTYPE. The first three are array variables.
940
941m. The BASH_VERSION and BASH_VERSINFO variables now include the shell's
942 `release status' (alpha[N], beta[N], release).
943
944n. Some variables have been removed: MAIL_WARNING, notify, history_control,
945 command_oriented_history, glob_dot_filenames, allow_null_glob_expansion,
946 nolinks, hostname_completion_file, noclobber, no_exit_on_failed_exec, and
947 cdable_vars. Most of them are now implemented with the new `shopt'
948 builtin; others were already implemented by `set'.
949
950o. Bash now uses some new variables: LC_ALL, LC_MESSAGES, LC_CTYPE,
951 LC_COLLATE, LANG, GLOBIGNORE, HISTIGNORE.
952
953p. The shell now supports integer-indexed arrays of unlimited length,
954 with a new compound assignment syntax and changes to the appropriate
955 builtin commands (declare/typeset, read, readonly, etc.). The array
956 index may be an arithmetic expression.
957
958q. ${!var}: indirect variable expansion, equivalent to eval \${$var}.
959
960r. ${paramter:offset[:length]}: variable substring extraction.
961
962s. ${parameter/pattern[/[/]string]}: variable pattern substitution.
963
964t. The $[...] arithmetic expansion syntax is no longer supported, in
965 favor of $((...)).
966
967u. Aliases can now be expanded in shell scripts with a shell option
968 (shopt expand_aliases).
969
970v. History and history expansion can now be used in scripts with
971 set -o history and set -H.
972
973w. All builtins now return an exit status of 2 for incorrect usage.
974
975x. Interactive shells resend SIGHUP to all running or stopped children
976 if (and only if) they exit due to a SIGHUP.
977
978y. New prompting expansions: \a, \e, \H, \T, \@, \v, \V.
979
980z. Variable expansion in prompt strings is now controllable via a shell
981 option (shopt promptvars).
982
983aa. Bash now defaults to using command-oriented history.
984
985bb. The history file ($HISTFILE) is now truncated to $HISTFILESIZE after
986 being written.
987
988cc. The POSIX.2 conditional arithmetic evaluation syntax (expr ? expr : expr)
989 has been implemented.
990
991dd. Each builtin now accepts `--' to signify the end of the options, except
992 as documented (echo, etc.).
993
994ee. All builtins use -p to display values in a re-readable format where
995 appropriate, except as documented (echo, type, etc.).
996
997ff. The `alias' builtin has a new -p option.
998
999gg. Changes to the `bind' builtin:
1000 o has new options: -psPSVr.
1001 o the `-d' option was renamed to `-p'
1002 o the `-v' option now dumps variables; the old `-v' is now `-P'
1003
1004hh. The `bye' synonym for `exit' was removed.
1005
1006ii. The -L and -P options to `cd' and `pwd' have been documented.
1007
1008jj. The `cd' builtin now does spelling correction on the directory name
1009 by default. This is settable with a shell option (shopt cdspell).
1010
1011kk. The `declare' builtin has new options: -a, -F, -p.
1012
1013ll. The `dirs' builtin has new options: -c, -p, -v.
1014
1015mm. The new `disown' builtin removes jobs from the shell's jobs table
1016 or inhibits the resending of SIGHUP when the shell receives a
1017 SIGHUP.
1018
1019nn. The `echo' builtin has a new escape character: \e.
1020
1021oo. The `enable' builtin can now load new builtins dynamically from shared
1022 objects on systems with the dlopen/dlsym interface. There are a number
1023 of examples in the examples/loadables directory. There are also
1024 new options: -d, -f, -s, -p.
1025
1026pp. The `-all' option to `enable' was removed in favor of `-a'.
1027
1028qq. The `exec' builtin has new options: -l, -c, -a.
1029
1030rr. The `hash' builtin has a new option: -p.
1031
1032ss. The `history' builtin has new options: -c, -p, -s.
1033
1034tt. The `jobs' builtin has new options: -r, -s.
1035
1036uu. The `kill' builtin has new options: -n signum, -l signame.
1037
1038vv. The `pushd' and `popd' builtins have a new option: -n.
1039
1040ww. The `read' builtin has new options: -p prompt, -e, -a.
1041
1042xx. The `readonly' builtin has a new -a option, and the -n option was removed.
1043
1044yy. Changes to the `set' builtin:
1045 o new options: -B, -o keyword, -o onecmd, -o history
1046 o options removed: -l, -d, -o nohash
1047 o options changed: +o, -h, -o hashall
1048 o now displays variables in a format that can be re-read as input
1049
1050zz. The new `shopt' builtin controls shell optional behavior previously
1051 done by setting and unsetting certain shell variables.
1052
1053aaa. The `test' builtin has new operators: -o option, s1 == s2, s1 < s2,
1054 and s1 > s2, where s1 and s2 are strings.
1055
1056bbb. There is a new trap, DEBUG, executed after every simple command.
1057
1058ccc. The `trap' builtin has a new -p option.
1059
1060ddd. The `ulimit' builtin has a new -l option on 4.4BSD-based systems.
1061
1062eee. The PS1, PS2, PATH, and IFS variables may now be unset.
1063
1064fff. The restricted shell mode has been expanded and is now documented.
1065
1066ggg. Security improvements:
1067 o functions are not imported from the environment if running setuid
1068 or with -p
1069 o no startup files are sourced if running setuid or with -p
1070
1071hhh. The documentation has been overhauled: the texinfo manual was
1072 expanded, and HTML versions of the man page and texinfo manual
1073 are included.
1074
1075iii. Changes to Posix mode:
1076 o Command lookup now finds special builtins before shell functions.
1077 o Failure of a special builtin causes a non-interactive shell to
1078 exit. Failures are defined in the POSIX.2 specification.
1079 o If the `cd' builtin finds a directory to change to using $CDPATH,
1080 the value assigned to PWD when `cd' completes does not contain
1081 any symbolic links.
1082 o A non-interactive shell exits if a variable assignment error
1083 occurs when no command name follows the assignment statements.
1084 o A non-interactive shell exits if the interation variable in a
1085 `for' statement or the selection variable in a `select' statement
1086 is read-only or another variable assignment error occurs.
1087 o The `<>' redirection operator now opens a file for both stdin and
1088 stdout by default, not just when in posix mode.
1089 o Assignment statements preceding special builtins now persist in
1090 the shell's environment when the builtin completes.
1091
1092 Posix mode is now completely POSIX.2-compliant (modulo bugs). When
1093 invoked as sh, bash should be completely POSIX.2-compliant.
1094
1095jjj. The default value of PS1 is now "\s-\v\$ ".
1096
1097kkk. The ksh-like ((...)) arithmetic command syntax has been implemented.
1098 This is exactly equivalent to `let "..."'.
1099
1100lll. Integer constants have been extended to base 64.
1101
1102mmm. The `ulimit' builtin now sets both hard and soft limits and reports the
1103 soft limit by default.
1104
11052. New Features in Readline
1106
1107a. New variables: enable-keypad, input-meta (new name for meta-flag),
1108 mark-directories, visible-stats (now documented), disable-completion,
1109 comment-begin.
1110
1111b. New bindable commands: kill-region, copy-region-as-kill,
1112 copy-backward-word, copy-forward-word, set-mark, exchange-point-and-mark,
1113 character-search, character-search-backward, insert-comment,
1114 glob-expand-word, glob-list-expansions, dump-variables, dump-macros.
1115
1116c. New emacs keybindings: delete-horizontal-space (M-\),
1117 insert-completions (M-*), possible-completions (M-=).
1118
1119d. The history-search-backward and history-search-forward commands were
1120 modified to be the same as previous-line and next-line if point is at
1121 the start of the line.
1122
1123e. More file types are available for the visible-stats mode.
1124
11253. Changes of interest in the Bash implementation
1126
1127a. There is a new autoconf-based configuration mechanism.
1128
1129b. More things have been moved from Posix mode to standard shell behavior.
1130
1131c. The trace output (set -x) now inserts quotes where necessary so it can
1132 be reused as input.
1133
1134d. There is a compile-time option for a system-wide interactive shell
1135 startup file (disabled by default).
1136
1137e. The YACC grammar is smaller and tighter, and all 66 shift-reduce
1138 conflicts are gone. Several parsing bugs have been fixed.
1139
1140f. Builtin option parsing has been regularized (using internal_getopt()),
1141 with the exception of `echo', `type', and `set'.
1142
1143g. Builtins now return standard usage messages constructed from the
1144 `short doc' used by the help builtin.
1145
1146h. Completion now quotes using backslashes by default, but honors
1147 user-supplied quotes.
1148
1149i. The GNU libc malloc is available as a configure-time option.
1150
1151j. There are more internationalization features; bash uses gettext if
1152 it is available. The $"..." translation syntax uses the current
1153 locale and gettext.
1154
1155k. There is better reporting of job termination when the shell is not
1156 interactive.
1157
1158l. The shell is somewhat more efficient: it uses a little less memory and
1159 makes fewer system calls.
1160
11614. Changes of interest in the Readline implementation
1162
1163a. There is now support for readline `callback' functions.
1164
1165b. There is now support for user-supplied input, redisplay, and terminal
1166 preparation functions.
1167
1168c. Most of the shell-specific code in readline has been generalized or
1169 removed.
1170
1171d. Most of the annoying redisplay bugs have been fixed, notably the problems
1172 with incremental search and excessive redrawing when special characters
1173 appear in the prompt string.
1174
1175e. There are new library functions and variables available to application
1176 writers, most having to do with completion and quoting.
1177
1178f. The NEWLINE character (^J) is now treated as a search terminator by the
1179 incremental search functions.