]> git.ipfire.org Git - thirdparty/bash.git/blob - NEWS
977d9a3356682c76b2ccaf127256ebd4c0373140
[thirdparty/bash.git] / NEWS
1 This is a terse description of the new features added to bash-3.1 since
2 the release of bash-3.0. As always, the manual page (doc/bash.1) is
3 the place to look for complete descriptions.
4
5 1. New Features in Bash
6
7 a. Bash now understands LC_TIME as a special variable so that time display
8 tracks the current locale.
9
10 b. BASH_ARGC, BASH_ARGV, BASH_SOURCE, and BASH_LINENO are no longer created
11 as `invisible' variables and may not be unset.
12
13 c. 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
16 d. The `bg' builtin now accepts multiple arguments, as POSIX seems to specify.
17
18 e. Fixed vi-mode word completion and glob expansion to perform tilde
19 expansion.
20
21 f. The `**' mathematic exponentiation operator is now right-associative.
22
23 g. 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
26 h. A bare `%' once again expands to the current job when used as a job
27 specifier.
28
29 i. 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
33 j. BASH_COMMAND now preserves its value when a DEBUG trap is executed.
34
35 k. The `gnu_errfmt' option is enabled automatically if the shell is running
36 in an emacs terminal window.
37
38 l. New configuration option: --single-help-strings. Causes long help text
39 to be written as a single string; intended to ease translation.
40
41 m. The COMP_WORDBREAKS variable now causes the list of word break characters
42 to be emptied when the variable is unset.
43
44 n. 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
48 o. Bash now inherits $_ from the environment if it appears there at startup.
49
50 p. New shell option: nocasematch. If non-zero, shell pattern matching ignores
51 case when used by `case' and `[[' commands.
52
53 q. The `printf' builtin takes a new option: -v var. That causes the output
54 to be placed into var instead of on stdout.
55
56 r. By default, the shell no longer reports processes dying from SIGPIPE.
57
58 s. 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
62 t. A new configuration option, `--enable-strict-posix-default', which will
63 build bash to be POSIX conforming by default.
64
65 u. If compiled for strict POSIX conformance, LINES and COLUMNS may now
66 override the true terminal size.
67
68 2. New Features in Readline
69
70 a. The key sequence sent by the keypad `delete' key is now automatically
71 bound to delete-char.
72
73 b. A negative argument to menu-complete now cycles backward through the
74 completion list.
75
76 c. 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
80 d. 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
84 e. 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 -------------------------------------------------------------------------------
89 This is a terse description of the new features added to bash-3.0 since
90 the release of bash-2.05b. As always, the manual page (doc/bash.1) is
91 the place to look for complete descriptions.
92
93 1. New Features in Bash
94
95 a. ANSI string expansion now implements the \x{hexdigits} escape.
96
97 b. There is a new loadable `strftime' builtin.
98
99 c. New variable, COMP_WORDBREAKS, which controls the readline completer's
100 idea of word break characters.
101
102 d. The `type' builtin no longer reports on aliases unless alias expansion
103 will actually be performed.
104
105 e. HISTCONTROL is now a colon-separated list of values, which permits
106 more extensibility and backwards compatibility.
107
108 f. 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
111 g. `configure' has a new `--enable-multibyte' argument that permits multibyte
112 character support to be disabled even on systems that support it.
113
114 h. 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
118 i. FUNCNAME has been changed to support the debugger: it's now an array
119 variable.
120
121 j. for, case, select, arithmetic commands now keep line number information
122 for the debugger.
123
124 k. 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
128 l. New invocation option: --debugger. Enables debugging and turns on new
129 `extdebug' shell option.
130
131 m. 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
136 n. 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
141 o. New `--enable-debugger' option to `configure' to compile in the debugger
142 support code.
143
144 p. `declare -F' now prints out extra line number and source file information
145 if the `extdebug' option is set.
146
147 q. 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
151 r. New `caller' builtin to provide a call stack for the bash debugger.
152
153 s. The DEBUG trap is run just before the first command in a function body is
154 executed, for the debugger.
155
156 t. `for', `select', and `case' command heads are printed when `set -x' is
157 enabled.
158
159 u. 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
163 v. New ksh93-like ${!array[@]} expansion, expands to all the keys (indices)
164 of array.
165
166 w. 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
170 x. New `gnu_errfmt' shopt option; if enabled, error messages follow the `gnu
171 style' (filename:lineno:message) format.
172
173 y. 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
177 z. 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
181 aa. `kill' is available as a builtin even when the shell is built without
182 job control.
183
184 bb. 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
190 cc. The [[ ... ]] command has a new binary `=~' operator that performs
191 extended regular expression (egrep-like) matching.
192
193 dd. `configure' has a new `--enable-cond-regexp' option (enabled by default)
194 to enable the =~ operator and regexp matching in [[ ... ]].
195
196 ee. Subexpressions matched by the =~ operator are placed in the new
197 BASH_REMATCH array variable.
198
199 ff. New `failglob' option that causes an expansion error when pathname
200 expansion fails to produce a match.
201
202 gg. 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
206 hh. printf builtin understands two new escape sequences: \" and \?.
207
208 ii. `echo -e' understands two new escape sequences: \" and \?.
209
210 jj. The GNU `gettext' package and libintl have been integrated; the shell's
211 messages can be translated into different languages.
212
213 kk. The `\W' prompt expansion now abbreviates $HOME as `~', like `\w'.
214
215 ll. 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
219 mm. The parameter pattern removal and substitution expansions are now much
220 faster and more efficient when using multibyte characters.
221
222 nn. The `jobs', `kill', and `wait' builtins now accept job control notation
223 even if job control is not enabled.
224
225 oo. 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
229 2. New Features in Readline
230
231 a. History expansion has a new `a' modifier equivalent to the `g' modifier
232 for compatibility with the BSD csh.
233
234 b. History expansion has a new `G' modifier equivalent to the BSD csh `g'
235 modifier, which performs a substitution once per word.
236
237 c. All non-incremental search operations may now undo the operation of
238 replacing the current line with the history line.
239
240 d. The text inserted by an `a' command in vi mode can be reinserted with
241 `.'.
242
243 e. 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
247 f. There is a new application-callable `free_history_entry()' function.
248
249 g. 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
253 h. 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
260 i. New application variable, rl_completion_quote_character, set to any
261 quote character readline finds before it calls the application completion
262 function.
263
264 j. 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
268 k. 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
272 l. 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
276 m. New bindable command: unix-filename-rubout. Does the same thing as
277 unix-word-rubout, but adds `/' to the set of word delimiters.
278
279 n. When listing completions, directories have a `/' appended if the
280 `mark-directories' option has been enabled.
281
282 -------------------------------------------------------------------------------
283 This is a terse description of the new features added to bash-2.05b since
284 the release of bash-2.05a. As always, the manual page (doc/bash.1) is
285 the place to look for complete descriptions.
286
287 1. New Features in Bash
288
289 a. If set, TMOUT is the default timeout for the `read' builtin.
290
291 b. `type' has two new options: `-f' suppresses shell function lookup, and
292 `-P' forces a $PATH search.
293
294 c. New code to handle multibyte characters.
295
296 d. `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
300 e. `complete -d' and `complete -o dirnames' now force a slash to be
301 appended to names which are symlinks to directories.
302
303 f. 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
306 g. Added support for ksh93-like [:word:] character class in pattern matching.
307
308 h. The $'...' quoting construct now expands \cX to Control-X.
309
310 i. A new \D{...} prompt expansion; passes the `...' to strftime and inserts
311 the result into the expanded prompt.
312
313 j. The shell now performs arithmetic in the largest integer size the
314 machine supports (intmax_t), instead of long.
315
316 k. 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
319 l. The bash globbing completion functions now allow completions to be listed
320 with double tabs or if `show-all-if-ambiguous' is set.
321
322 m. New `-o nospace' option for `complete' and `compgen' builtins; suppresses
323 readline's appending a space to the completed word.
324
325 n. New `here-string' redirection operator: <<< word.
326
327 o. 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
331 p. 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
335 q. The `complete' and `compgen' builtins now have a new `-s/-A service'
336 option to complete on names from /etc/services.
337
338 r. `read' has a new `-u fd' option to read from a specified file descriptor.
339
340 s. Fix the completion code so that expansion errors in a directory name
341 don't cause a longjmp back to the command loop.
342
343 t. Fixed word completion inside command substitution to work a little more
344 intuitively.
345
346 u. The `printf' %q format specifier now uses $'...' quoting to print the
347 argument if it contains non-printing characters.
348
349 v. 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
353 w. The DEBUG trap is now run *before* simple commands, ((...)) commands,
354 [[...]] conditional commands, and for ((...)) loops.
355
356 x. 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
361 y. 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
366 z. New [n]<&word- and [n]>&word- redirections from ksh93 -- move fds (dup
367 and close).
368
369 aa. There is a new `-l' invocation option, equivalent to `--login'.
370
371 bb. 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
374 cc. 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
378 dd. All builtins that take operands accept a `--' pseudo-option, except
379 `echo'.
380
381 ee. 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
386 2. New Features in Readline
387
388 a. 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
392 b. 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
396 c. New code to handle editing and displaying multibyte characters.
397
398 d. 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
403 e. 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
407 f. 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
412 g. 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
417 h. Readline now has an overwrite mode, toggled by the `overwrite-mode'
418 bindable command, which could be bound to `Insert'.
419
420 i. New application-settable completion variable:
421 rl_completion_suppress_append, inhibits appending of
422 rl_completion_append_character to completed words.
423
424 j. 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 -------------------------------------------------------------------------------
430 This is a terse description of the new features added to bash-2.05a since
431 the release of bash-2.05. As always, the manual page (doc/bash.1) is
432 the place to look for complete descriptions.
433
434 1. New Features in Bash
435
436 a. Added support for DESTDIR installation root prefix, so you can do a
437 `make install DESTDIR=bash-root' and do easier binary packaging.
438
439 b. Added support for builtin printf "'" flag character as per latest POSIX
440 drafts.
441
442 c. Support for POSIX.2 printf(1) length specifiers `j', `t', and `z' (from
443 ISO C99).
444
445 d. New autoconf macro, RL_LIB_READLINE_VERSION, for use by other applications
446 (bash doesn't use very much of what it returns).
447
448 e. `set [-+]o nolog' is recognized as required by the latest POSIX drafts,
449 but ignored.
450
451 f. New read-only `shopt' option: login_shell. Set to non-zero value if the
452 shell is a login shell.
453
454 g. New `\A' prompt string escape sequence; expands to time in 24 HH:MM format.
455
456 h. New `-A group/-g' option to complete and compgen; does group name
457 completion.
458
459 i. New `-t' option to `hash' to list hash values for each filename argument.
460
461 j. New [-+]O invocation option to set and unset `shopt' options at startup.
462
463 k. 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
467 l. 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
471 m. `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
476 n. `bashbug' now requires that the subject be changed from the default.
477
478 o. configure has a new `--enable-largefile' option, like other GNU utilities.
479
480 p. `for' loops now allow empty word lists after `in', like the latest POSIX
481 drafts require.
482
483 q. 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
487 r. `ulimit' now prints the option letter associated with a particular
488 resource when printing more than one limit.
489
490 s. `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
493 t. The `printf' builtin now handles the %a and %A conversions if they're
494 implemented by printf(3).
495
496 u. The `printf' builtin now handles the %F conversion (just about like %f).
497
498 v. 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
502 2. New Features in Readline
503
504 a. 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
507 b. New #defines in readline.h: RL_READLINE_VERSION, currently 0x0402,
508 RL_VERSION_MAJOR, currently 4, and RL_VERSION_MINOR, currently 2.
509
510 c. New readline variable: rl_readline_version, mirrors RL_READLINE_VERSION.
511
512 d. New bindable boolean readline variable: match-hidden-files. Controls
513 completion of files beginning with a `.' (on Unix). Enabled by default.
514
515 e. The history expansion code now allows any character to terminate a
516 `:first-' modifier, like csh.
517
518 f. 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 -------------------------------------------------------------------------------
523 This is a terse description of the new features added to bash-2.05 since
524 the release of bash-2.04. As always, the manual page (doc/bash.1) is
525 the place to look for complete descriptions.
526
527 1. New Features in Bash
528
529 a. Added a new `--init-file' invocation argument as a synonym for `--rcfile',
530 per the new GNU coding standards.
531
532 b. The /dev/tcp and /dev/udp redirections now accept service names as well as
533 port numbers.
534
535 c. `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
546 d. A new loadable builtin, realpath, which canonicalizes and expands symlinks
547 in pathname arguments.
548
549 e. 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
554 f. Bash-2.05 once again honors the current locale setting when processing
555 ranges within pattern matching bracket expressions (e.g., [A-Z]).
556
557 2. New Features in Readline
558
559 a. The blink timeout for paren matching is now settable by applications,
560 via the rl_set_paren_blink_timeout() function.
561
562 b. _rl_executing_macro has been renamed to rl_executing_macro, which means
563 it's now part of the public interface.
564
565 c. 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
569 d. New application-callable function rl_set_prompt(const char *prompt):
570 expands its prompt string argument and sets rl_prompt to the result.
571
572 e. 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
576 f. New function, rl_get_screen_size (int *rows, int *columns), returns
577 readline's idea of the screen dimensions.
578
579 g. The timeout in rl_gather_tyi (readline keyboard input polling function)
580 is now settable via a function (rl_set_keyboard_input_timeout()).
581
582 h. Renamed the max_input_history variable to history_max_entries; the old
583 variable is maintained for backwards compatibility.
584
585 i. 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 -------------------------------------------------------------------------------
590 This is a terse description of the new features added to bash-2.04 since
591 the release of bash-2.03. As always, the manual page (doc/bash.1) is
592 the place to look for complete descriptions.
593
594 1. New Features in Bash
595
596 a. The history builtin has a `-d offset' option to delete the history entry
597 at position `offset'.
598
599 b. 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
602 c. The `bind' builtin has a new `-x' option to bind key sequences to shell
603 commands.
604
605 d. 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
608 e. The `help' builtin has a `-s' option to just print a builtin's usage
609 synopsis.
610
611 f. There are several new arithmetic operators: id++, id-- (variable
612 post-increment/decrement), ++id, --id (variable pre-increment/decrement),
613 expr1 , expr2 (comma operator).
614
615 g. There is a new ksh-93 style arithmetic for command:
616 for ((expr1 ; expr2; expr3 )); do list; done
617
618 h. 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
624 i. 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
628 j. 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
632 k. The ksh-93 ${!prefix*} expansion, which expands to the names of all
633 shell variables with prefix PREFIX, has been implemented.
634
635 l. 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
638 m. The GROUPS variable is no longer readonly; assignments to it are silently
639 discarded. This means it can be unset.
640
641 n. A new programmable completion facility, with two new builtin commands:
642 complete and compgen.
643
644 o. configure has a new option, `--enable-progcomp', to compile in the
645 programmable completion features (enabled by default).
646
647 p. `shopt' has a new option, `progcomp', to enable and disable programmable
648 completion at runtime.
649
650 q. Unsetting HOSTFILE now clears the list of hostnames used for completion.
651
652 r. configure has a new option, `--enable-bash-malloc', replacing the old
653 `--with-gnu-malloc' (which is still present for backwards compatibility).
654
655 s. There is a new manual page describing rbash, the restricted shell.
656
657 t. `bashbug' has new `--help' and `--version' options.
658
659 u. `shopt' has a new `xpg_echo' option, which controls the behavior of
660 `echo' with respect to backslash-escaped characters at runtime.
661
662 v. If NON_INTERACTIVE_LOGIN_SHELLS is defined, all login shells read the
663 startup files, even if they are not interactive.
664
665 w. 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
669 2. New features in Readline
670
671 a. 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
675 b. MS-DOS systems now use ~/_inputrc as the last-ditch inputrc filename.
676
677 c. MS-DOS systems now use ~/_history as the default history file.
678
679 d. 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
683 e. history-search-{forward,backward} now leave the last history line found
684 in the readline buffer if the second or subsequent search fails.
685
686 f. 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
689 g. 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
693 h. 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 -------------------------------------------------------------------------------
698 This is a terse description of the new features added to bash-2.03 since
699 the release of bash-2.02. As always, the manual page (doc/bash.1) is
700 the place to look for complete descriptions.
701
702 1. New Features in Bash
703
704 a. New `shopt' option, `restricted_shell', indicating whether or not the
705 shell was started in restricted mode, for use in startup files.
706
707 b. Filename generation is now performed on the words between ( and ) in
708 array assignments (which it probably should have done all along).
709
710 c. OLDPWD is now auto-exported, as POSIX.2 seems to require.
711
712 d. ENV and BASH_ENV are read-only variables in a restricted shell.
713
714 e. 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
718 2. New Features in Readline
719
720 a. 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
739 b. There is a new function, rl_resize_terminal, to reset readline's idea of
740 the screen size after a SIGWINCH.
741
742 c. New public functions: rl_save_prompt and rl_restore_prompt. These were
743 previously private functions with a `_' prefix.
744
745 d. New function hook: rl_pre_input_hook, called just before readline starts
746 reading input, after initialization.
747
748 e. 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
753 f. New bindable function, delete-char-or-list, like tcsh.
754
755 g. 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
759 h. New bindable variable: `isearch-terminators'.
760
761 i. New bindable function: `forward-backward-delete-char' (unbound by default).
762
763 -------------------------------------------------------------------------------
764 This is a terse description of the new features added to bash-2.02 since
765 the release of bash-2.01.1. As always, the manual page (doc/bash.1) is
766 the place to look for complete descriptions.
767
768 1. New Features in Bash
769
770 a. 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
774 b. A new version of gmalloc, based on the old GLIBC malloc, with many
775 changes and range checking included by default.
776
777 c. 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
782 d. ksh-88 egrep-style extended pattern matching ([@+*?!](patlist)) has been
783 implemented, controlled by a new `shopt' option, `extglob'.
784
785 e. There is a new ksh-like `[[' compound command, which implements
786 extended `test' functionality.
787
788 f. There is a new `printf' builtin, implemented according to the POSIX.2
789 specification.
790
791 g. 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
795 h. There are new tilde prefixes which expand to directories from the
796 directory stack.
797
798 i. There is a new `**' arithmetic operator to do exponentiation.
799
800 j. 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
804 k. 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
808 l. 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
812 m. 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
817 n. There is a new invocation option, `--dump-po-strings', to dump
818 a shell script's translatable strings ($"...") in GNU `po' format.
819
820 o. There is a new `shopt' option, `nocaseglob', to enable case-insensitive
821 pattern matching when globbing filenames and using the `case' construct.
822
823 p. 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
827 q. `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
831 r. `disown' now has `-a' and `-r' options, to limit operation to all jobs
832 and running jobs, respectively.
833
834 s. The `shopt' `-p' option now causes output to be displayed in a reusable
835 format.
836
837 t. `test' has a new `-N' option, which returns true if the filename argument
838 has been modified since it was last accessed.
839
840 u. `umask' now has a `-p' option to print output in a reusable format.
841
842 v. 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
846 w. The prompt string expansion code has a new `\r' escape sequence.
847
848 x. The shell may now be cross-compiled for the CYGWIN32 environment on
849 a Unix machine.
850
851 2. New Features in Readline
852
853 a. 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
857 b. 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
861 c. New variable, `completion-ignore-case', which causes filename completion
862 and matching to be performed case-insensitively.
863
864 d. 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
868 e. 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
872 f. 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
876 g. 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
880 h. An `$include' inputrc file parser directive has been added.
881
882 -------------------------------------------------------------------------------
883 This is a terse description of the new features added to bash-2.01 since
884 the release of bash-2.0. As always, the manual page (doc/bash.1) is the
885 place to look for complete descriptions.
886
887 1. New Features in Bash
888
889 a. 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
892 2. New Features in Readline
893
894 a. 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 -------------------------------------------------------------------------------
900 This is a terse description of the new features added to bash-2.0 since
901 the release of bash-1.14.7. As always, the manual page (doc/bash.1) is
902 the place to look for complete descriptions.
903
904 1. New Features in Bash
905
906 a. There is a new invocation option, -D, that dumps translatable strings
907 in a script.
908
909 b. The `long' invocation options must now be prefixed with `--'.
910
911 c. New long invocation options: --dump-strings, --help, --verbose
912
913 d. The `nolineediting' invocation option was renamed to `noediting'.
914
915 e. The `nobraceexpansion' and `quiet' long invocation options were removed.
916
917 f. The `--help' and `--version' long options now work as the GNU coding
918 standards specify.
919
920 g. 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
925 h. 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
930 i. The $'...' quoting syntax expands ANSI-C escapes in ... and leaves the
931 result single-quoted.
932
933 j. The $"..." quoting syntax performs locale-specific translation of ...
934 and leaves the result double-quoted.
935
936 k. LINENO now works correctly in functions.
937
938 l. New variables: DIRSTACK, PIPESTATUS, BASH_VERSINFO, HOSTNAME, SHELLOPTS,
939 MACHTYPE. The first three are array variables.
940
941 m. The BASH_VERSION and BASH_VERSINFO variables now include the shell's
942 `release status' (alpha[N], beta[N], release).
943
944 n. 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
950 o. Bash now uses some new variables: LC_ALL, LC_MESSAGES, LC_CTYPE,
951 LC_COLLATE, LANG, GLOBIGNORE, HISTIGNORE.
952
953 p. 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
958 q. ${!var}: indirect variable expansion, equivalent to eval \${$var}.
959
960 r. ${paramter:offset[:length]}: variable substring extraction.
961
962 s. ${parameter/pattern[/[/]string]}: variable pattern substitution.
963
964 t. The $[...] arithmetic expansion syntax is no longer supported, in
965 favor of $((...)).
966
967 u. Aliases can now be expanded in shell scripts with a shell option
968 (shopt expand_aliases).
969
970 v. History and history expansion can now be used in scripts with
971 set -o history and set -H.
972
973 w. All builtins now return an exit status of 2 for incorrect usage.
974
975 x. Interactive shells resend SIGHUP to all running or stopped children
976 if (and only if) they exit due to a SIGHUP.
977
978 y. New prompting expansions: \a, \e, \H, \T, \@, \v, \V.
979
980 z. Variable expansion in prompt strings is now controllable via a shell
981 option (shopt promptvars).
982
983 aa. Bash now defaults to using command-oriented history.
984
985 bb. The history file ($HISTFILE) is now truncated to $HISTFILESIZE after
986 being written.
987
988 cc. The POSIX.2 conditional arithmetic evaluation syntax (expr ? expr : expr)
989 has been implemented.
990
991 dd. Each builtin now accepts `--' to signify the end of the options, except
992 as documented (echo, etc.).
993
994 ee. All builtins use -p to display values in a re-readable format where
995 appropriate, except as documented (echo, type, etc.).
996
997 ff. The `alias' builtin has a new -p option.
998
999 gg. 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
1004 hh. The `bye' synonym for `exit' was removed.
1005
1006 ii. The -L and -P options to `cd' and `pwd' have been documented.
1007
1008 jj. The `cd' builtin now does spelling correction on the directory name
1009 by default. This is settable with a shell option (shopt cdspell).
1010
1011 kk. The `declare' builtin has new options: -a, -F, -p.
1012
1013 ll. The `dirs' builtin has new options: -c, -p, -v.
1014
1015 mm. 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
1019 nn. The `echo' builtin has a new escape character: \e.
1020
1021 oo. 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
1026 pp. The `-all' option to `enable' was removed in favor of `-a'.
1027
1028 qq. The `exec' builtin has new options: -l, -c, -a.
1029
1030 rr. The `hash' builtin has a new option: -p.
1031
1032 ss. The `history' builtin has new options: -c, -p, -s.
1033
1034 tt. The `jobs' builtin has new options: -r, -s.
1035
1036 uu. The `kill' builtin has new options: -n signum, -l signame.
1037
1038 vv. The `pushd' and `popd' builtins have a new option: -n.
1039
1040 ww. The `read' builtin has new options: -p prompt, -e, -a.
1041
1042 xx. The `readonly' builtin has a new -a option, and the -n option was removed.
1043
1044 yy. 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
1050 zz. The new `shopt' builtin controls shell optional behavior previously
1051 done by setting and unsetting certain shell variables.
1052
1053 aaa. The `test' builtin has new operators: -o option, s1 == s2, s1 < s2,
1054 and s1 > s2, where s1 and s2 are strings.
1055
1056 bbb. There is a new trap, DEBUG, executed after every simple command.
1057
1058 ccc. The `trap' builtin has a new -p option.
1059
1060 ddd. The `ulimit' builtin has a new -l option on 4.4BSD-based systems.
1061
1062 eee. The PS1, PS2, PATH, and IFS variables may now be unset.
1063
1064 fff. The restricted shell mode has been expanded and is now documented.
1065
1066 ggg. 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
1071 hhh. 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
1075 iii. 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
1095 jjj. The default value of PS1 is now "\s-\v\$ ".
1096
1097 kkk. The ksh-like ((...)) arithmetic command syntax has been implemented.
1098 This is exactly equivalent to `let "..."'.
1099
1100 lll. Integer constants have been extended to base 64.
1101
1102 mmm. The `ulimit' builtin now sets both hard and soft limits and reports the
1103 soft limit by default.
1104
1105 2. New Features in Readline
1106
1107 a. New variables: enable-keypad, input-meta (new name for meta-flag),
1108 mark-directories, visible-stats (now documented), disable-completion,
1109 comment-begin.
1110
1111 b. 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
1116 c. New emacs keybindings: delete-horizontal-space (M-\),
1117 insert-completions (M-*), possible-completions (M-=).
1118
1119 d. 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
1123 e. More file types are available for the visible-stats mode.
1124
1125 3. Changes of interest in the Bash implementation
1126
1127 a. There is a new autoconf-based configuration mechanism.
1128
1129 b. More things have been moved from Posix mode to standard shell behavior.
1130
1131 c. The trace output (set -x) now inserts quotes where necessary so it can
1132 be reused as input.
1133
1134 d. There is a compile-time option for a system-wide interactive shell
1135 startup file (disabled by default).
1136
1137 e. The YACC grammar is smaller and tighter, and all 66 shift-reduce
1138 conflicts are gone. Several parsing bugs have been fixed.
1139
1140 f. Builtin option parsing has been regularized (using internal_getopt()),
1141 with the exception of `echo', `type', and `set'.
1142
1143 g. Builtins now return standard usage messages constructed from the
1144 `short doc' used by the help builtin.
1145
1146 h. Completion now quotes using backslashes by default, but honors
1147 user-supplied quotes.
1148
1149 i. The GNU libc malloc is available as a configure-time option.
1150
1151 j. There are more internationalization features; bash uses gettext if
1152 it is available. The $"..." translation syntax uses the current
1153 locale and gettext.
1154
1155 k. There is better reporting of job termination when the shell is not
1156 interactive.
1157
1158 l. The shell is somewhat more efficient: it uses a little less memory and
1159 makes fewer system calls.
1160
1161 4. Changes of interest in the Readline implementation
1162
1163 a. There is now support for readline `callback' functions.
1164
1165 b. There is now support for user-supplied input, redisplay, and terminal
1166 preparation functions.
1167
1168 c. Most of the shell-specific code in readline has been generalized or
1169 removed.
1170
1171 d. 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
1175 e. There are new library functions and variables available to application
1176 writers, most having to do with completion and quoting.
1177
1178 f. The NEWLINE character (^J) is now treated as a search terminator by the
1179 incremental search functions.