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