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