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