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