Imported from ../bash-2.01.tar.gz.
[platform/upstream/bash.git] / NEWS
1 This is a terse description of the new features added to bash-2.01 since
2 the release of bash-2.0.  As always, the manual page (doc/bash.1) is the
3 place to look for complete descriptions.
4
5 1. New Features in Bash
6
7 a.  There is a new builtin array variable: GROUPS, the set of groups to which
8     the user belongs.  This is used by the test suite.
9
10 2.  New Features in Readline
11
12 a.  If a key sequence bound to `universal-argument' is read while reading a
13     numeric argument started with `universal-argument', it terminates the
14     argument but is otherwise ignored.  This provides a way to insert multiple
15     instances of a digit string, and is how GNU emacs does it.
16
17 -------------------------------------------------------------------------------
18 This is a terse description of the new features added to bash-2.0 since
19 the release of bash-1.14.7.  As always, the manual page (doc/bash.1) is
20 the place to look for complete descriptions.
21
22 1.  New Features in Bash
23
24 a.  There is a new invocation option, -D, that dumps translatable strings
25     in a script.
26
27 b.  The `long' invocation options must now be prefixed with `--'.
28
29 c.  New long invocation options:  --dump-strings, --help, --verbose
30
31 d.  The `nolineediting' invocation option was renamed to `noediting'.
32
33 e.  The `nobraceexpansion' and `quiet' long invocation options were removed.
34
35 f.  The `--help' and `--version' long options now work as the GNU coding
36     standards specify.
37
38 g.  If invoked as `sh', bash now enters posix mode after reading the
39     startup files, and reads and executes commands from the file named
40     by $ENV if interactive (as POSIX.2 specifies).  A login shell invoked
41     as `sh' reads $ENV after /etc/profile and ~/.profile.
42
43 h.  There is a new reserved word, `time', for timing pipelines, builtin
44     commands, and shell functions.  It uses the value of the TIMEFORMAT
45     variable as a format string describing how to print the timing
46     statistics.
47
48 i.  The $'...' quoting syntax expands ANSI-C escapes in ... and leaves the
49     result single-quoted.
50
51 j.  The $"..." quoting syntax performs locale-specific translation of ...
52     and leaves the result double-quoted.
53
54 k.  LINENO now works correctly in functions.
55
56 l.  New variables: DIRSTACK, PIPESTATUS, BASH_VERSINFO, HOSTNAME, SHELLOPTS,
57     MACHTYPE.  The first three are array variables.
58
59 m.  The BASH_VERSION and BASH_VERSINFO variables now include the shell's
60     `release status' (alpha[N], beta[N], release).
61
62 n.  Some variables have been removed:  MAIL_WARNING, notify, history_control,
63     command_oriented_history, glob_dot_filenames, allow_null_glob_expansion,
64     nolinks, hostname_completion_file, noclobber, no_exit_on_failed_exec, and
65     cdable_vars.  Most of them are now implemented with the new `shopt'
66     builtin; others were already implemented by `set'.
67
68 o.  Bash now uses some new variables:  LC_ALL, LC_MESSAGES, LC_CTYPE,
69     LC_COLLATE, LANG, GLOBIGNORE, HISTIGNORE.
70
71 p.  The shell now supports integer-indexed arrays of unlimited length,
72     with a new compound assignment syntax and changes to the appropriate
73     builtin commands (declare/typeset, read, readonly, etc.).  The array
74     index may be an arithmetic expression.
75
76 q.  ${!var}: indirect variable expansion, equivalent to eval \${$var}.
77
78 r.  ${paramter:offset[:length]}: variable substring extraction.
79
80 s.  ${parameter/pattern[/[/]string]}: variable pattern substitution.
81
82 t.  The $[...] arithmetic expansion syntax is no longer supported, in
83     favor of $((...)).
84
85 u.  Aliases can now be expanded in shell scripts with a shell option
86     (shopt expand_aliases).
87
88 v.  History and history expansion can now be used in scripts with
89     set -o history and set -H.
90
91 w.  All builtins now return an exit status of 2 for incorrect usage.
92
93 x.  Interactive shells resend SIGHUP to all running or stopped children
94     if (and only if) they exit due to a SIGHUP.
95
96 y.  New prompting expansions: \a, \e, \H, \T, \@, \v, \V.
97
98 z.  Variable expansion in prompt strings is now controllable via a shell
99     option (shopt promptvars).
100
101 aa. Bash now defaults to using command-oriented history.
102
103 bb. The history file ($HISTFILE) is now truncated to $HISTFILESIZE after
104     being written.
105
106 cc. The POSIX.2 conditional arithmetic evaluation syntax (expr ? expr : expr)
107     has been implemented.
108
109 dd. Each builtin now accepts `--' to signify the end of the options, except
110     as documented (echo, etc.).
111
112 ee. All builtins use -p to display values in a re-readable format where
113     appropriate, except as documented (echo, type, etc.).
114
115 ff. The `alias' builtin has a new -p option.
116
117 gg. Changes to the `bind' builtin:
118         o has new options: -psPSVr.
119         o the `-d' option was renamed to `-p'
120         o the `-v' option now dumps variables; the old `-v' is now `-P'
121
122 hh. The `bye' synonym for `exit' was removed.
123
124 ii. The -L and -P options to `cd' and `pwd' have been documented.
125
126 jj. The `cd' builtin now does spelling correction on the directory name
127     by default.  This is settable with a shell option (shopt cdspell).
128
129 kk. The `declare' builtin has new options: -a, -F, -p.
130
131 ll. The `dirs' builtin has new options: -c, -p, -v.
132
133 mm. The new `disown' builtin removes jobs from the shell's jobs table
134     or inhibits the resending of SIGHUP when the shell receives a
135     SIGHUP.
136
137 nn. The `echo' builtin has a new escape character: \e.
138
139 oo. The `enable' builtin can now load new builtins dynamically from shared
140     objects on systems with the dlopen/dlsym interface.  There are a number
141     of examples in the examples/loadables directory.  There are also
142     new options: -d, -f, -s, -p.
143
144 pp. The `-all' option to `enable' was removed in favor of `-a'.
145
146 qq. The `exec' builtin has new options: -l, -c, -a.
147
148 rr. The `hash' builtin has a new option: -p.
149
150 ss. The `history' builtin has new options: -c, -p, -s.
151
152 tt. The `jobs' builtin has new options: -r, -s.
153
154 uu. The `kill' builtin has new options: -n signum, -l signame.
155
156 vv. The `pushd' and `popd' builtins have a new option: -n.
157
158 ww. The `read' builtin has new options: -p prompt, -e, -a.
159
160 xx. The `readonly' builtin has a new -a option, and the -n option was removed.
161
162 yy. Changes to the `set' builtin:
163         o new options: -B, -o keyword, -o onecmd, -o history
164         o options removed: -l, -d, -o nohash
165         o options changed: +o, -h, -o hashall
166         o now displays variables in a format that can be re-read as input
167
168 zz. The new `shopt' builtin controls shell optional behavior previously
169     done by setting and unsetting certain shell variables.
170
171 aaa. The `test' builtin has new operators: -o option, s1 == s2, s1 < s2,
172      and s1 > s2, where s1 and s2 are strings.
173
174 bbb. There is a new trap, DEBUG, executed after every simple command.
175
176 ccc. The `trap' builtin has a new -p option.
177
178 ddd. The `ulimit' builtin has a new -l option on 4.4BSD-based systems.
179
180 eee. The PS1, PS2, PATH, and IFS variables may now be unset.
181
182 fff. The restricted shell mode has been expanded and is now documented.
183
184 ggg. Security improvements:
185         o functions are not imported from the environment if running setuid
186           or with -p
187         o no startup files are sourced if running setuid or with -p
188
189 hhh. The documentation has been overhauled:  the texinfo manual was
190      expanded, and HTML versions of the man page and texinfo manual
191      are included.
192
193 iii. Changes to Posix mode:
194         o Command lookup now finds special builtins before shell functions.
195         o Failure of a special builtin causes a non-interactive shell to
196           exit.  Failures are defined in the POSIX.2 specification.
197         o If the `cd' builtin finds a directory to change to using $CDPATH,
198           the value assigned to PWD when `cd' completes does not contain
199           any symbolic links.
200         o A non-interactive shell exits if a variable assignment error
201           occurs when no command name follows the assignment statements.
202         o A non-interactive shell exits if the interation variable in a
203           `for' statement or the selection variable in a `select' statement
204           is read-only or another variable assignment error occurs.
205         o The `<>' redirection operator now opens a file for both stdin and
206           stdout by default, not just when in posix mode.
207         o Assignment statements preceding special builtins now persist in
208           the shell's environment when the builtin completes.
209
210      Posix mode is now completely POSIX.2-compliant (modulo bugs).  When
211      invoked as sh, bash should be completely POSIX.2-compliant.
212
213 jjj. The default value of PS1 is now "\s-\v\$ ".
214
215 kkk. The ksh-like ((...)) arithmetic command syntax has been implemented.
216      This is exactly equivalent to `let "..."'.
217
218 lll. Integer constants have been extended to base 64.
219
220 mmm. The `ulimit' builtin now sets both hard and soft limits and reports the
221      soft limit by default.
222
223 2.  New Features in Readline
224
225 a.  New variables:  enable-keypad, input-meta (new name for meta-flag),
226     mark-directories, visible-stats (now documented), disable-completion,
227     comment-begin.
228
229 b.  New bindable commands:  kill-region, copy-region-as-kill,
230     copy-backward-word, copy-forward-word, set-mark, exchange-point-and-mark,
231     character-search, character-search-backward, insert-comment,
232     glob-expand-word, glob-list-expansions, dump-variables, dump-macros.
233
234 c.  New emacs keybindings:  delete-horizontal-space (M-\),
235     insert-completions (M-*), possible-completions (M-=).
236
237 d.  The history-search-backward and history-search-forward commands were
238     modified to be the same as previous-line and next-line if point is at
239     the start of the line.
240
241 e.  More file types are available for the visible-stats mode.
242
243 3.  Changes of interest in the Bash implementation
244
245 a.  There is a new autoconf-based configuration mechanism.
246
247 b.  More things have been moved from Posix mode to standard shell behavior.
248
249 c.  The trace output (set -x) now inserts quotes where necessary so it can
250     be reused as input.
251
252 d.  There is a compile-time option for a system-wide interactive shell
253     startup file (disabled by default).
254
255 e.  The YACC grammar is smaller and tighter, and all 66 shift-reduce
256     conflicts are gone.  Several parsing bugs have been fixed.
257
258 f.  Builtin option parsing has been regularized (using internal_getopt()),
259     with the exception of `echo', `type', and `set'.
260
261 g.  Builtins now return standard usage messages constructed from the
262     `short doc' used by the help builtin.
263
264 h.  Completion now quotes using backslashes by default, but honors
265     user-supplied quotes.
266
267 i.  The GNU libc malloc is available as a configure-time option.
268
269 j.  There are more internationalization features; bash uses gettext if
270     it is available.  The $"..." translation syntax uses the current
271     locale and gettext.
272
273 k.  There is better reporting of job termination when the shell is not
274     interactive.
275
276 l.  The shell is somewhat more efficient: it uses a little less memory and
277     makes fewer system calls.
278
279 4.  Changes of interest in the Readline implementation
280
281 a.  There is now support for readline `callback' functions.
282
283 b.  There is now support for user-supplied input, redisplay, and terminal
284     preparation functions.
285
286 c.  Most of the shell-specific code in readline has been generalized or
287     removed.
288
289 d.  Most of the annoying redisplay bugs have been fixed, notably the problems
290     with incremental search and excessive redrawing when special characters
291     appear in the prompt string.
292
293 e.  There are new library functions and variables available to application
294     writers, most having to do with completion and quoting.
295
296 f.  The NEWLINE character (^J) is now treated as a search terminator by the
297     incremental search functions.