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