]> git.ipfire.org Git - thirdparty/bash.git/blame - NEWS
Imported from ../bash-2.04.tar.gz.
[thirdparty/bash.git] / NEWS
CommitLineData
bb70624e
JA
1This is a terse description of the new features added to bash-2.04 since
2the release of bash-2.03. As always, the manual page (doc/bash.1) is
3the place to look for complete descriptions.
4
51. New Features in Bash
6
7a. The history builtin has a `-d offset' option to delete the history entry
8 at position `offset'.
9
10b. 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
13c. The `bind' builtin has a new `-x' option to bind key sequences to shell
14 commands.
15
16d. 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
19e. The `help' builtin has a `-s' option to just print a builtin's usage
20 synopsis.
21
22f. 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
26g. There is a new ksh-93 style arithmetic for command:
27 for ((expr1 ; expr2; expr3 )); do list; done
28
29h. 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
35i. 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
39j. 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
43k. The ksh-93 ${!prefix*} expansion, which expands to the names of all
44 shell variables with prefix PREFIX, has been implemented.
45
46l. 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
49m. The GROUPS variable is no longer readonly; assignments to it are silently
50 discarded. This means it can be unset.
51
52n. A new programmable completion facility, with two new builtin commands:
53 complete and compgen.
54
55o. configure has a new option, `--enable-progcomp', to compile in the
56 programmable completion features (enabled by default).
57
58p. `shopt' has a new option, `progcomp', to enable and disable programmable
59 completion at runtime.
60
61q. Unsetting HOSTFILE now clears the list of hostnames used for completion.
62
63r. configure has a new option, `--enable-bash-malloc', replacing the old
64 `--with-gnu-malloc' (which is still present for backwards compatibility).
65
66s. There is a new manual page describing rbash, the restricted shell.
67
68t. `bashbug' has new `--help' and `--version' options.
69
70u. `shopt' has a new `xpg_echo' option, which controls the behavior of
71 `echo' with respect to backslash-escaped characters at runtime.
72
73v. If NON_INTERACTIVE_LOGIN_SHELLS is defined, all login shells read the
74 startup files, even if they are not interactive.
75
76w. 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
802. New features in Readline
81
82a. 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
86b. MS-DOS systems now use ~/_inputrc as the last-ditch inputrc filename.
87
88c. MS-DOS systems now use ~/_history as the default history file.
89
90d. 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
94e. history-search-{forward,backward} now leave the last history line found
95 in the readline buffer if the second or subsequent search fails.
96
97f. 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
100g. 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
104h. 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-------------------------------------------------------------------------------
b72432fd
JA
109This is a terse description of the new features added to bash-2.03 since
110the release of bash-2.02. As always, the manual page (doc/bash.1) is
111the place to look for complete descriptions.
112
1131. New Features in Bash
114
115a. New `shopt' option, `restricted_shell', indicating whether or not the
116 shell was started in restricted mode, for use in startup files.
117
118b. Filename generation is now performed on the words between ( and ) in
119 array assignments (which it probably should have done all along).
120
121c. OLDPWD is now auto-exported, as POSIX.2 seems to require.
122
123d. ENV and BASH_ENV are read-only variables in a restricted shell.
124
125e. 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
1292. New Features in Readline
130
131a. 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
150b. There is a new function, rl_resize_terminal, to reset readline's idea of
151 the screen size after a SIGWINCH.
152
153c. New public functions: rl_save_prompt and rl_restore_prompt. These were
154 previously private functions with a `_' prefix.
155
156d. New function hook: rl_pre_input_hook, called just before readline starts
157 reading input, after initialization.
158
159e. 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
164f. New bindable function, delete-char-or-list, like tcsh.
165
166g. 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
170h. New bindable variable: `isearch-terminators'.
171
172i. New bindable function: `forward-backward-delete-char' (unbound by default).
173
174-------------------------------------------------------------------------------
cce855bc
JA
175This is a terse description of the new features added to bash-2.02 since
176the release of bash-2.01.1. As always, the manual page (doc/bash.1) is
177the place to look for complete descriptions.
178
1791. New Features in Bash
180
181a. 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
185b. A new version of gmalloc, based on the old GLIBC malloc, with many
186 changes and range checking included by default.
187
188c. 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
193d. ksh-88 egrep-style extended pattern matching ([@+*?!](patlist)) has been
194 implemented, controlled by a new `shopt' option, `extglob'.
195
196e. There is a new ksh-like `[[' compound command, which implements
197 extended `test' functionality.
198
199f. There is a new `printf' builtin, implemented according to the POSIX.2
200 specification.
201
202g. 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
206h. There are new tilde prefixes which expand to directories from the
207 directory stack.
208
209i. There is a new `**' arithmetic operator to do exponentiation.
210
211j. 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
215k. 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
219l. 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
223m. 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
228n. There is a new invocation option, `--dump-po-strings', to dump
229 a shell script's translatable strings ($"...") in GNU `po' format.
230
231o. There is a new `shopt' option, `nocaseglob', to enable case-insensitive
232 pattern matching when globbing filenames and using the `case' construct.
233
234p. 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
238q. `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
242r. `disown' now has `-a' and `-r' options, to limit operation to all jobs
243 and running jobs, respectively.
244
245s. The `shopt' `-p' option now causes output to be displayed in a reusable
246 format.
247
248t. `test' has a new `-N' option, which returns true if the filename argument
249 has been modified since it was last accessed.
250
251u. `umask' now has a `-p' option to print output in a reusable format.
252
253v. 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
257w. The prompt string expansion code has a new `\r' escape sequence.
258
259x. The shell may now be cross-compiled for the CYGWIN32 environment on
260 a Unix machine.
261
2622. New Features in Readline
263
264a. 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
268b. 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
272c. New variable, `completion-ignore-case', which causes filename completion
273 and matching to be performed case-insensitively.
274
275d. 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
279e. 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
283f. 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
287g. 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
291h. An `$include' inputrc file parser directive has been added.
292
293-------------------------------------------------------------------------------
d166f048
JA
294This is a terse description of the new features added to bash-2.01 since
295the release of bash-2.0. As always, the manual page (doc/bash.1) is the
296place to look for complete descriptions.
297
2981. New Features in Bash
299
300a. 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
3032. New Features in Readline
304
305a. 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-------------------------------------------------------------------------------
ccc6cda3
JA
311This is a terse description of the new features added to bash-2.0 since
312the release of bash-1.14.7. As always, the manual page (doc/bash.1) is
313the place to look for complete descriptions.
726f6388 314
ccc6cda3 3151. New Features in Bash
726f6388 316
ccc6cda3
JA
317a. There is a new invocation option, -D, that dumps translatable strings
318 in a script.
726f6388 319
ccc6cda3
JA
320b. The `long' invocation options must now be prefixed with `--'.
321
322c. New long invocation options: --dump-strings, --help, --verbose
323
324d. The `nolineediting' invocation option was renamed to `noediting'.
325
326e. The `nobraceexpansion' and `quiet' long invocation options were removed.
327
328f. The `--help' and `--version' long options now work as the GNU coding
329 standards specify.
330
331g. 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
336h. 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
341i. The $'...' quoting syntax expands ANSI-C escapes in ... and leaves the
342 result single-quoted.
343
344j. The $"..." quoting syntax performs locale-specific translation of ...
345 and leaves the result double-quoted.
346
347k. LINENO now works correctly in functions.
348
349l. New variables: DIRSTACK, PIPESTATUS, BASH_VERSINFO, HOSTNAME, SHELLOPTS,
350 MACHTYPE. The first three are array variables.
351
352m. The BASH_VERSION and BASH_VERSINFO variables now include the shell's
353 `release status' (alpha[N], beta[N], release).
354
355n. 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
361o. Bash now uses some new variables: LC_ALL, LC_MESSAGES, LC_CTYPE,
362 LC_COLLATE, LANG, GLOBIGNORE, HISTIGNORE.
363
364p. 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
369q. ${!var}: indirect variable expansion, equivalent to eval \${$var}.
370
371r. ${paramter:offset[:length]}: variable substring extraction.
372
373s. ${parameter/pattern[/[/]string]}: variable pattern substitution.
374
375t. The $[...] arithmetic expansion syntax is no longer supported, in
376 favor of $((...)).
377
378u. Aliases can now be expanded in shell scripts with a shell option
379 (shopt expand_aliases).
380
381v. History and history expansion can now be used in scripts with
382 set -o history and set -H.
383
384w. All builtins now return an exit status of 2 for incorrect usage.
385
386x. Interactive shells resend SIGHUP to all running or stopped children
387 if (and only if) they exit due to a SIGHUP.
388
389y. New prompting expansions: \a, \e, \H, \T, \@, \v, \V.
390
391z. Variable expansion in prompt strings is now controllable via a shell
392 option (shopt promptvars).
393
394aa. Bash now defaults to using command-oriented history.
395
396bb. The history file ($HISTFILE) is now truncated to $HISTFILESIZE after
397 being written.
398
399cc. The POSIX.2 conditional arithmetic evaluation syntax (expr ? expr : expr)
400 has been implemented.
401
402dd. Each builtin now accepts `--' to signify the end of the options, except
403 as documented (echo, etc.).
404
405ee. All builtins use -p to display values in a re-readable format where
406 appropriate, except as documented (echo, type, etc.).
407
408ff. The `alias' builtin has a new -p option.
409
410gg. 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
415hh. The `bye' synonym for `exit' was removed.
416
417ii. The -L and -P options to `cd' and `pwd' have been documented.
418
419jj. The `cd' builtin now does spelling correction on the directory name
420 by default. This is settable with a shell option (shopt cdspell).
421
422kk. The `declare' builtin has new options: -a, -F, -p.
423
424ll. The `dirs' builtin has new options: -c, -p, -v.
425
426mm. 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
430nn. The `echo' builtin has a new escape character: \e.
431
432oo. 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
437pp. The `-all' option to `enable' was removed in favor of `-a'.
438
439qq. The `exec' builtin has new options: -l, -c, -a.
440
441rr. The `hash' builtin has a new option: -p.
442
443ss. The `history' builtin has new options: -c, -p, -s.
444
445tt. The `jobs' builtin has new options: -r, -s.
446
447uu. The `kill' builtin has new options: -n signum, -l signame.
448
449vv. The `pushd' and `popd' builtins have a new option: -n.
450
451ww. The `read' builtin has new options: -p prompt, -e, -a.
452
453xx. The `readonly' builtin has a new -a option, and the -n option was removed.
454
455yy. 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
461zz. The new `shopt' builtin controls shell optional behavior previously
462 done by setting and unsetting certain shell variables.
463
464aaa. The `test' builtin has new operators: -o option, s1 == s2, s1 < s2,
465 and s1 > s2, where s1 and s2 are strings.
466
467bbb. There is a new trap, DEBUG, executed after every simple command.
468
469ccc. The `trap' builtin has a new -p option.
470
471ddd. The `ulimit' builtin has a new -l option on 4.4BSD-based systems.
472
473eee. The PS1, PS2, PATH, and IFS variables may now be unset.
474
475fff. The restricted shell mode has been expanded and is now documented.
476
477ggg. 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
482hhh. 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
486iii. 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
506jjj. The default value of PS1 is now "\s-\v\$ ".
507
508kkk. The ksh-like ((...)) arithmetic command syntax has been implemented.
509 This is exactly equivalent to `let "..."'.
510
511lll. Integer constants have been extended to base 64.
512
513mmm. The `ulimit' builtin now sets both hard and soft limits and reports the
514 soft limit by default.
515
5162. New Features in Readline
517
518a. New variables: enable-keypad, input-meta (new name for meta-flag),
519 mark-directories, visible-stats (now documented), disable-completion,
520 comment-begin.
521
522b. 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
527c. New emacs keybindings: delete-horizontal-space (M-\),
528 insert-completions (M-*), possible-completions (M-=).
529
530d. 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
534e. More file types are available for the visible-stats mode.
535
5363. Changes of interest in the Bash implementation
537
538a. There is a new autoconf-based configuration mechanism.
539
540b. More things have been moved from Posix mode to standard shell behavior.
541
542c. The trace output (set -x) now inserts quotes where necessary so it can
543 be reused as input.
544
545d. There is a compile-time option for a system-wide interactive shell
546 startup file (disabled by default).
547
548e. The YACC grammar is smaller and tighter, and all 66 shift-reduce
549 conflicts are gone. Several parsing bugs have been fixed.
550
551f. Builtin option parsing has been regularized (using internal_getopt()),
552 with the exception of `echo', `type', and `set'.
553
554g. Builtins now return standard usage messages constructed from the
555 `short doc' used by the help builtin.
556
557h. Completion now quotes using backslashes by default, but honors
558 user-supplied quotes.
559
560i. The GNU libc malloc is available as a configure-time option.
561
562j. There are more internationalization features; bash uses gettext if
563 it is available. The $"..." translation syntax uses the current
564 locale and gettext.
565
566k. There is better reporting of job termination when the shell is not
567 interactive.
568
569l. The shell is somewhat more efficient: it uses a little less memory and
570 makes fewer system calls.
571
5724. Changes of interest in the Readline implementation
573
574a. There is now support for readline `callback' functions.
575
576b. There is now support for user-supplied input, redisplay, and terminal
577 preparation functions.
578
579c. Most of the shell-specific code in readline has been generalized or
580 removed.
581
582d. 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
586e. There are new library functions and variables available to application
587 writers, most having to do with completion and quoting.
588
589f. The NEWLINE character (^J) is now treated as a search terminator by the
590 incremental search functions.