]> git.ipfire.org Git - thirdparty/bash.git/blob - NEWS
55a8dd2246aa78259b660d5bcc1e100d418618c3
[thirdparty/bash.git] / NEWS
1 This is a terse description of the new features added to bash-2.04 since
2 the release of bash-2.03. 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. The history builtin has a `-d offset' option to delete the history entry
8 at position `offset'.
9
10 b. The prompt expansion code has two new escape sequences: \j, the number of
11 active jobs; and \l, the basename of the shell's tty device name.
12
13 c. The `bind' builtin has a new `-x' option to bind key sequences to shell
14 commands.
15
16 d. There is a new shell option, no_empty_command_completion, which, when
17 enabled, disables command completion when TAB is typed on an empty line.
18
19 e. The `help' builtin has a `-s' option to just print a builtin's usage
20 synopsis.
21
22 f. There are several new arithmetic operators: id++, id-- (variable
23 post-increment/decrement), ++id, --id (variabl pre-increment/decrement),
24 expr1 , expr2 (comma operator).
25
26 g. There is a new ksh-93 style arithmetic for command:
27 for ((expr1 ; expr2; expr3 )); do list; done
28
29 h. The `read' builtin has a number of new options:
30 -t timeout only wait timeout seconds for input
31 -n nchars only read nchars from input instead of a full line
32 -d delim read until delim rather than newline
33 -s don't echo input chars as they are read
34
35 i. The redirection code now handles several filenames specially:
36 /dev/fd/N, /dev/stdin, /dev/stdout, and /dev/stderr, whether or
37 not they are present in the file system.
38
39 j. The redirection code now recognizes pathnames of the form
40 /dev/tcp/host/port and /dev/udp/host/port, and tries to open a socket
41 of the appropriate type to the specified port on the specified host.
42
43 k. The ksh-93 ${!prefix*} expansion, which expands to the names of all
44 shell variables with prefix PREFIX, has been implemented.
45
46 l. There is a new dynamic variable, FUNCNAME, which expands to the name of
47 a currently-executing function. Assignments to FUNCNAME have no effect.
48
49 m. The GROUPS variable is no longer readonly; assignments to it are silently
50 discarded. This means it can be unset.
51
52 n. A new programmable completion facility, with two new builtin commands:
53 complete and compgen.
54
55 o. configure has a new option, `--enable-progcomp', to compile in the
56 programmable completion features (enabled by default).
57
58 p. `shopt' has a new option, `progcomp', to enable and disable programmable
59 completion at runtime.
60
61 q. Unsetting HOSTFILE now clears the list of hostnames used for completion.
62
63 r. configure has a new option, `--enable-bash-malloc', replacing the old
64 `--with-gnu-malloc' (which is still present for backwards compatibility).
65
66 s. There is a new manual page describing rbash, the restricted shell.
67
68 t. `bashbug' has new `--help' and `--version' options.
69
70 u. `shopt' has a new `xpg_echo' option, which controls the behavior of
71 `echo' with respect to backslash-escaped characters at runtime.
72
73 v. If NON_INTERACTIVE_LOGIN_SHELLS is defined, all login shells read the
74 startup files, even if they are not interactive.
75
76 w. The LC_NUMERIC variable is now treated specially, and used to set the
77 LC_NUMERIC locale category for number formatting, e.g., when `printf'
78 displays floating-point numbers.
79
80 2. New features in Readline
81
82 a. Parentheses matching is now always compiled into readline, and enabled
83 or disabled when the value of the `blink-matching-paren' variable is
84 changed.
85
86 b. MS-DOS systems now use ~/_inputrc as the last-ditch inputrc filename.
87
88 c. MS-DOS systems now use ~/_history as the default history file.
89
90 d. history-search-{forward,backward} now leave the point at the end of the
91 line when the string to search for is empty, like
92 {reverse,forward}-search-history.
93
94 e. history-search-{forward,backward} now leave the last history line found
95 in the readline buffer if the second or subsequent search fails.
96
97 f. New function for use by applications: rl_on_new_line_with_prompt, used
98 when an application displays the prompt itself before calling readline().
99
100 g. New variable for use by applications: rl_already_prompted. An application
101 that displays the prompt itself before calling readline() must set this to
102 a non-zero value.
103
104 h. A new variable, rl_gnu_readline_p, always 1. The intent is that an
105 application can verify whether or not it is linked with the `real'
106 readline library or some substitute.
107
108 -------------------------------------------------------------------------------
109 This is a terse description of the new features added to bash-2.03 since
110 the release of bash-2.02. As always, the manual page (doc/bash.1) is
111 the place to look for complete descriptions.
112
113 1. New Features in Bash
114
115 a. New `shopt' option, `restricted_shell', indicating whether or not the
116 shell was started in restricted mode, for use in startup files.
117
118 b. Filename generation is now performed on the words between ( and ) in
119 array assignments (which it probably should have done all along).
120
121 c. OLDPWD is now auto-exported, as POSIX.2 seems to require.
122
123 d. ENV and BASH_ENV are read-only variables in a restricted shell.
124
125 e. A change was made to the startup file code so that any shell begun with
126 the `--login' option, even non-interactive shells, will source the login
127 shell startup files.
128
129 2. New Features in Readline
130
131 a. Many changes to the signal handling:
132 o Readline now catches SIGQUIT and cleans up the tty before returning;
133 o A new variable, rl_catch_signals, is available to application writers
134 to indicate to readline whether or not it should install its own
135 signal handlers for SIGINT, SIGTERM, SIGQUIT, SIGALRM, SIGTSTP,
136 SIGTTIN, and SIGTTOU;
137 o A new variable, rl_catch_sigwinch, is available to application
138 writers to indicate to readline whether or not it should install its
139 own signal handler for SIGWINCH, which will chain to the calling
140 applications's SIGWINCH handler, if one is installed;
141 o There is a new function, rl_free_line_state, for application signal
142 handlers to call to free up the state associated with the current
143 line after receiving a signal;
144 o There is a new function, rl_cleanup_after_signal, to clean up the
145 display and terminal state after receiving a signal;
146 o There is a new function, rl_reset_after_signal, to reinitialize the
147 terminal and display state after an application signal handler
148 returns and readline continues
149
150 b. There is a new function, rl_resize_terminal, to reset readline's idea of
151 the screen size after a SIGWINCH.
152
153 c. New public functions: rl_save_prompt and rl_restore_prompt. These were
154 previously private functions with a `_' prefix.
155
156 d. New function hook: rl_pre_input_hook, called just before readline starts
157 reading input, after initialization.
158
159 e. New function hook: rl_display_matches_hook, called when readline would
160 display the list of completion matches. The new function
161 rl_display_match_list is what readline uses internally, and is available
162 for use by application functions called via this hook.
163
164 f. New bindable function, delete-char-or-list, like tcsh.
165
166 g. A new variable, rl_erase_empty_line, which, if set by an application using
167 readline, will cause readline to erase, prompt and all, lines on which the
168 only thing typed was a newline.
169
170 h. New bindable variable: `isearch-terminators'.
171
172 i. New bindable function: `forward-backward-delete-char' (unbound by default).
173
174 -------------------------------------------------------------------------------
175 This is a terse description of the new features added to bash-2.02 since
176 the release of bash-2.01.1. As always, the manual page (doc/bash.1) is
177 the place to look for complete descriptions.
178
179 1. New Features in Bash
180
181 a. A new version of malloc, based on the older GNU malloc, that has many
182 changes, is more page-based, is more conservative with memory usage,
183 and does not `orphan' large blocks when they are freed.
184
185 b. A new version of gmalloc, based on the old GLIBC malloc, with many
186 changes and range checking included by default.
187
188 c. A new implementation of fnmatch(3) that includes full POSIX.2 Basic
189 Regular Expression matching, including character classes, collating
190 symbols, equivalence classes, and support for case-insensitive pattern
191 matching.
192
193 d. ksh-88 egrep-style extended pattern matching ([@+*?!](patlist)) has been
194 implemented, controlled by a new `shopt' option, `extglob'.
195
196 e. There is a new ksh-like `[[' compound command, which implements
197 extended `test' functionality.
198
199 f. There is a new `printf' builtin, implemented according to the POSIX.2
200 specification.
201
202 g. There is a new feature for command substitution: $(< filename) now expands
203 to the contents of `filename', with any trailing newlines removed
204 (equivalent to $(cat filename)).
205
206 h. There are new tilde prefixes which expand to directories from the
207 directory stack.
208
209 i. There is a new `**' arithmetic operator to do exponentiation.
210
211 j. There are new configuration options to control how bash is linked:
212 `--enable-profiling', to allow bash to be profiled with gprof, and
213 `--enable-static-link', to allow bash to be linked statically.
214
215 k. There is a new configuration option, `--enable-cond-command', which
216 controls whether or not the `[[' command is included. It is on by
217 default.
218
219 l. There is a new configuration option, `--enable-extended-glob', which
220 controls whether or not the ksh extended globbing feature is included.
221 It is enabled by default.
222
223 m. There is a new configuration #define in config.h.top that, when enabled,
224 will cause all login shells to source /etc/profile and one of the user-
225 specific login shell startup files, whether or not the shell is
226 interactive.
227
228 n. There is a new invocation option, `--dump-po-strings', to dump
229 a shell script's translatable strings ($"...") in GNU `po' format.
230
231 o. There is a new `shopt' option, `nocaseglob', to enable case-insensitive
232 pattern matching when globbing filenames and using the `case' construct.
233
234 p. There is a new `shopt' option, `huponexit', which, when enabled, causes
235 the shell to send SIGHUP to all jobs when an interactive login shell
236 exits.
237
238 q. `bind' has a new `-u' option, which takes a readline function name as an
239 argument and unbinds all key sequences bound to that function in a
240 specified keymap.
241
242 r. `disown' now has `-a' and `-r' options, to limit operation to all jobs
243 and running jobs, respectively.
244
245 s. The `shopt' `-p' option now causes output to be displayed in a reusable
246 format.
247
248 t. `test' has a new `-N' option, which returns true if the filename argument
249 has been modified since it was last accessed.
250
251 u. `umask' now has a `-p' option to print output in a reusable format.
252
253 v. A new escape sequence, `\xNNN', has been added to the `echo -e' and $'...'
254 translation code. It expands to the character whose ascii code is NNN
255 in hexadecimal.
256
257 w. The prompt string expansion code has a new `\r' escape sequence.
258
259 x. The shell may now be cross-compiled for the CYGWIN32 environment on
260 a Unix machine.
261
262 2. New Features in Readline
263
264 a. There is now an option for `iterative' yank-last-arg handline, so a user
265 can keep entering `M-.', yanking the last argument of successive history
266 lines.
267
268 b. New variable, `print-completions-horizontally', which causes completion
269 matches to be displayed across the screen (like `ls -x') rather than up
270 and down the screen (like `ls').
271
272 c. New variable, `completion-ignore-case', which causes filename completion
273 and matching to be performed case-insensitively.
274
275 d. There is a new bindable command, `magic-space', which causes history
276 expansion to be performed on the current readline buffer and a space to
277 be inserted into the result.
278
279 e. There is a new bindable command, `menu-complete', which enables tcsh-like
280 menu completion (successive executions of menu-complete insert a single
281 completion match, cycling through the list of possible completions).
282
283 f. There is a new bindable command, `paste-from-clipboard', for use on Win32
284 systems, to insert the text from the Win32 clipboard into the editing
285 buffer.
286
287 g. The key sequence translation code now understands printf-style backslash
288 escape sequences, including \NNN octal escapes. These escape sequences
289 may be used in key sequence definitions or macro values.
290
291 h. An `$include' inputrc file parser directive has been added.
292
293 -------------------------------------------------------------------------------
294 This is a terse description of the new features added to bash-2.01 since
295 the release of bash-2.0. As always, the manual page (doc/bash.1) is the
296 place to look for complete descriptions.
297
298 1. New Features in Bash
299
300 a. There is a new builtin array variable: GROUPS, the set of groups to which
301 the user belongs. This is used by the test suite.
302
303 2. New Features in Readline
304
305 a. If a key sequence bound to `universal-argument' is read while reading a
306 numeric argument started with `universal-argument', it terminates the
307 argument but is otherwise ignored. This provides a way to insert multiple
308 instances of a digit string, and is how GNU emacs does it.
309
310 -------------------------------------------------------------------------------
311 This is a terse description of the new features added to bash-2.0 since
312 the release of bash-1.14.7. As always, the manual page (doc/bash.1) is
313 the place to look for complete descriptions.
314
315 1. New Features in Bash
316
317 a. There is a new invocation option, -D, that dumps translatable strings
318 in a script.
319
320 b. The `long' invocation options must now be prefixed with `--'.
321
322 c. New long invocation options: --dump-strings, --help, --verbose
323
324 d. The `nolineediting' invocation option was renamed to `noediting'.
325
326 e. The `nobraceexpansion' and `quiet' long invocation options were removed.
327
328 f. The `--help' and `--version' long options now work as the GNU coding
329 standards specify.
330
331 g. If invoked as `sh', bash now enters posix mode after reading the
332 startup files, and reads and executes commands from the file named
333 by $ENV if interactive (as POSIX.2 specifies). A login shell invoked
334 as `sh' reads $ENV after /etc/profile and ~/.profile.
335
336 h. There is a new reserved word, `time', for timing pipelines, builtin
337 commands, and shell functions. It uses the value of the TIMEFORMAT
338 variable as a format string describing how to print the timing
339 statistics.
340
341 i. The $'...' quoting syntax expands ANSI-C escapes in ... and leaves the
342 result single-quoted.
343
344 j. The $"..." quoting syntax performs locale-specific translation of ...
345 and leaves the result double-quoted.
346
347 k. LINENO now works correctly in functions.
348
349 l. New variables: DIRSTACK, PIPESTATUS, BASH_VERSINFO, HOSTNAME, SHELLOPTS,
350 MACHTYPE. The first three are array variables.
351
352 m. The BASH_VERSION and BASH_VERSINFO variables now include the shell's
353 `release status' (alpha[N], beta[N], release).
354
355 n. Some variables have been removed: MAIL_WARNING, notify, history_control,
356 command_oriented_history, glob_dot_filenames, allow_null_glob_expansion,
357 nolinks, hostname_completion_file, noclobber, no_exit_on_failed_exec, and
358 cdable_vars. Most of them are now implemented with the new `shopt'
359 builtin; others were already implemented by `set'.
360
361 o. Bash now uses some new variables: LC_ALL, LC_MESSAGES, LC_CTYPE,
362 LC_COLLATE, LANG, GLOBIGNORE, HISTIGNORE.
363
364 p. The shell now supports integer-indexed arrays of unlimited length,
365 with a new compound assignment syntax and changes to the appropriate
366 builtin commands (declare/typeset, read, readonly, etc.). The array
367 index may be an arithmetic expression.
368
369 q. ${!var}: indirect variable expansion, equivalent to eval \${$var}.
370
371 r. ${paramter:offset[:length]}: variable substring extraction.
372
373 s. ${parameter/pattern[/[/]string]}: variable pattern substitution.
374
375 t. The $[...] arithmetic expansion syntax is no longer supported, in
376 favor of $((...)).
377
378 u. Aliases can now be expanded in shell scripts with a shell option
379 (shopt expand_aliases).
380
381 v. History and history expansion can now be used in scripts with
382 set -o history and set -H.
383
384 w. All builtins now return an exit status of 2 for incorrect usage.
385
386 x. Interactive shells resend SIGHUP to all running or stopped children
387 if (and only if) they exit due to a SIGHUP.
388
389 y. New prompting expansions: \a, \e, \H, \T, \@, \v, \V.
390
391 z. Variable expansion in prompt strings is now controllable via a shell
392 option (shopt promptvars).
393
394 aa. Bash now defaults to using command-oriented history.
395
396 bb. The history file ($HISTFILE) is now truncated to $HISTFILESIZE after
397 being written.
398
399 cc. The POSIX.2 conditional arithmetic evaluation syntax (expr ? expr : expr)
400 has been implemented.
401
402 dd. Each builtin now accepts `--' to signify the end of the options, except
403 as documented (echo, etc.).
404
405 ee. All builtins use -p to display values in a re-readable format where
406 appropriate, except as documented (echo, type, etc.).
407
408 ff. The `alias' builtin has a new -p option.
409
410 gg. Changes to the `bind' builtin:
411 o has new options: -psPSVr.
412 o the `-d' option was renamed to `-p'
413 o the `-v' option now dumps variables; the old `-v' is now `-P'
414
415 hh. The `bye' synonym for `exit' was removed.
416
417 ii. The -L and -P options to `cd' and `pwd' have been documented.
418
419 jj. The `cd' builtin now does spelling correction on the directory name
420 by default. This is settable with a shell option (shopt cdspell).
421
422 kk. The `declare' builtin has new options: -a, -F, -p.
423
424 ll. The `dirs' builtin has new options: -c, -p, -v.
425
426 mm. The new `disown' builtin removes jobs from the shell's jobs table
427 or inhibits the resending of SIGHUP when the shell receives a
428 SIGHUP.
429
430 nn. The `echo' builtin has a new escape character: \e.
431
432 oo. The `enable' builtin can now load new builtins dynamically from shared
433 objects on systems with the dlopen/dlsym interface. There are a number
434 of examples in the examples/loadables directory. There are also
435 new options: -d, -f, -s, -p.
436
437 pp. The `-all' option to `enable' was removed in favor of `-a'.
438
439 qq. The `exec' builtin has new options: -l, -c, -a.
440
441 rr. The `hash' builtin has a new option: -p.
442
443 ss. The `history' builtin has new options: -c, -p, -s.
444
445 tt. The `jobs' builtin has new options: -r, -s.
446
447 uu. The `kill' builtin has new options: -n signum, -l signame.
448
449 vv. The `pushd' and `popd' builtins have a new option: -n.
450
451 ww. The `read' builtin has new options: -p prompt, -e, -a.
452
453 xx. The `readonly' builtin has a new -a option, and the -n option was removed.
454
455 yy. Changes to the `set' builtin:
456 o new options: -B, -o keyword, -o onecmd, -o history
457 o options removed: -l, -d, -o nohash
458 o options changed: +o, -h, -o hashall
459 o now displays variables in a format that can be re-read as input
460
461 zz. The new `shopt' builtin controls shell optional behavior previously
462 done by setting and unsetting certain shell variables.
463
464 aaa. The `test' builtin has new operators: -o option, s1 == s2, s1 < s2,
465 and s1 > s2, where s1 and s2 are strings.
466
467 bbb. There is a new trap, DEBUG, executed after every simple command.
468
469 ccc. The `trap' builtin has a new -p option.
470
471 ddd. The `ulimit' builtin has a new -l option on 4.4BSD-based systems.
472
473 eee. The PS1, PS2, PATH, and IFS variables may now be unset.
474
475 fff. The restricted shell mode has been expanded and is now documented.
476
477 ggg. Security improvements:
478 o functions are not imported from the environment if running setuid
479 or with -p
480 o no startup files are sourced if running setuid or with -p
481
482 hhh. The documentation has been overhauled: the texinfo manual was
483 expanded, and HTML versions of the man page and texinfo manual
484 are included.
485
486 iii. Changes to Posix mode:
487 o Command lookup now finds special builtins before shell functions.
488 o Failure of a special builtin causes a non-interactive shell to
489 exit. Failures are defined in the POSIX.2 specification.
490 o If the `cd' builtin finds a directory to change to using $CDPATH,
491 the value assigned to PWD when `cd' completes does not contain
492 any symbolic links.
493 o A non-interactive shell exits if a variable assignment error
494 occurs when no command name follows the assignment statements.
495 o A non-interactive shell exits if the interation variable in a
496 `for' statement or the selection variable in a `select' statement
497 is read-only or another variable assignment error occurs.
498 o The `<>' redirection operator now opens a file for both stdin and
499 stdout by default, not just when in posix mode.
500 o Assignment statements preceding special builtins now persist in
501 the shell's environment when the builtin completes.
502
503 Posix mode is now completely POSIX.2-compliant (modulo bugs). When
504 invoked as sh, bash should be completely POSIX.2-compliant.
505
506 jjj. The default value of PS1 is now "\s-\v\$ ".
507
508 kkk. The ksh-like ((...)) arithmetic command syntax has been implemented.
509 This is exactly equivalent to `let "..."'.
510
511 lll. Integer constants have been extended to base 64.
512
513 mmm. The `ulimit' builtin now sets both hard and soft limits and reports the
514 soft limit by default.
515
516 2. New Features in Readline
517
518 a. New variables: enable-keypad, input-meta (new name for meta-flag),
519 mark-directories, visible-stats (now documented), disable-completion,
520 comment-begin.
521
522 b. New bindable commands: kill-region, copy-region-as-kill,
523 copy-backward-word, copy-forward-word, set-mark, exchange-point-and-mark,
524 character-search, character-search-backward, insert-comment,
525 glob-expand-word, glob-list-expansions, dump-variables, dump-macros.
526
527 c. New emacs keybindings: delete-horizontal-space (M-\),
528 insert-completions (M-*), possible-completions (M-=).
529
530 d. The history-search-backward and history-search-forward commands were
531 modified to be the same as previous-line and next-line if point is at
532 the start of the line.
533
534 e. More file types are available for the visible-stats mode.
535
536 3. Changes of interest in the Bash implementation
537
538 a. There is a new autoconf-based configuration mechanism.
539
540 b. More things have been moved from Posix mode to standard shell behavior.
541
542 c. The trace output (set -x) now inserts quotes where necessary so it can
543 be reused as input.
544
545 d. There is a compile-time option for a system-wide interactive shell
546 startup file (disabled by default).
547
548 e. The YACC grammar is smaller and tighter, and all 66 shift-reduce
549 conflicts are gone. Several parsing bugs have been fixed.
550
551 f. Builtin option parsing has been regularized (using internal_getopt()),
552 with the exception of `echo', `type', and `set'.
553
554 g. Builtins now return standard usage messages constructed from the
555 `short doc' used by the help builtin.
556
557 h. Completion now quotes using backslashes by default, but honors
558 user-supplied quotes.
559
560 i. The GNU libc malloc is available as a configure-time option.
561
562 j. There are more internationalization features; bash uses gettext if
563 it is available. The $"..." translation syntax uses the current
564 locale and gettext.
565
566 k. There is better reporting of job termination when the shell is not
567 interactive.
568
569 l. The shell is somewhat more efficient: it uses a little less memory and
570 makes fewer system calls.
571
572 4. Changes of interest in the Readline implementation
573
574 a. There is now support for readline `callback' functions.
575
576 b. There is now support for user-supplied input, redisplay, and terminal
577 preparation functions.
578
579 c. Most of the shell-specific code in readline has been generalized or
580 removed.
581
582 d. Most of the annoying redisplay bugs have been fixed, notably the problems
583 with incremental search and excessive redrawing when special characters
584 appear in the prompt string.
585
586 e. There are new library functions and variables available to application
587 writers, most having to do with completion and quoting.
588
589 f. The NEWLINE character (^J) is now treated as a search terminator by the
590 incremental search functions.