]> git.ipfire.org Git - thirdparty/bash.git/blame - NEWS
Imported from ../bash-2.01.1.tar.gz.
[thirdparty/bash.git] / NEWS
CommitLineData
d166f048
JA
1This is a terse description of the new features added to bash-2.01 since
2the release of bash-2.0. As always, the manual page (doc/bash.1) is the
3place to look for complete descriptions.
4
51. New Features in Bash
6
7a. 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
102. New Features in Readline
11
12a. 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-------------------------------------------------------------------------------
ccc6cda3
JA
18This is a terse description of the new features added to bash-2.0 since
19the release of bash-1.14.7. As always, the manual page (doc/bash.1) is
20the place to look for complete descriptions.
726f6388 21
ccc6cda3 221. New Features in Bash
726f6388 23
ccc6cda3
JA
24a. There is a new invocation option, -D, that dumps translatable strings
25 in a script.
726f6388 26
ccc6cda3
JA
27b. The `long' invocation options must now be prefixed with `--'.
28
29c. New long invocation options: --dump-strings, --help, --verbose
30
31d. The `nolineediting' invocation option was renamed to `noediting'.
32
33e. The `nobraceexpansion' and `quiet' long invocation options were removed.
34
35f. The `--help' and `--version' long options now work as the GNU coding
36 standards specify.
37
38g. 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
43h. 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
48i. The $'...' quoting syntax expands ANSI-C escapes in ... and leaves the
49 result single-quoted.
50
51j. The $"..." quoting syntax performs locale-specific translation of ...
52 and leaves the result double-quoted.
53
54k. LINENO now works correctly in functions.
55
56l. New variables: DIRSTACK, PIPESTATUS, BASH_VERSINFO, HOSTNAME, SHELLOPTS,
57 MACHTYPE. The first three are array variables.
58
59m. The BASH_VERSION and BASH_VERSINFO variables now include the shell's
60 `release status' (alpha[N], beta[N], release).
61
62n. 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
68o. Bash now uses some new variables: LC_ALL, LC_MESSAGES, LC_CTYPE,
69 LC_COLLATE, LANG, GLOBIGNORE, HISTIGNORE.
70
71p. 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
76q. ${!var}: indirect variable expansion, equivalent to eval \${$var}.
77
78r. ${paramter:offset[:length]}: variable substring extraction.
79
80s. ${parameter/pattern[/[/]string]}: variable pattern substitution.
81
82t. The $[...] arithmetic expansion syntax is no longer supported, in
83 favor of $((...)).
84
85u. Aliases can now be expanded in shell scripts with a shell option
86 (shopt expand_aliases).
87
88v. History and history expansion can now be used in scripts with
89 set -o history and set -H.
90
91w. All builtins now return an exit status of 2 for incorrect usage.
92
93x. Interactive shells resend SIGHUP to all running or stopped children
94 if (and only if) they exit due to a SIGHUP.
95
96y. New prompting expansions: \a, \e, \H, \T, \@, \v, \V.
97
98z. Variable expansion in prompt strings is now controllable via a shell
99 option (shopt promptvars).
100
101aa. Bash now defaults to using command-oriented history.
102
103bb. The history file ($HISTFILE) is now truncated to $HISTFILESIZE after
104 being written.
105
106cc. The POSIX.2 conditional arithmetic evaluation syntax (expr ? expr : expr)
107 has been implemented.
108
109dd. Each builtin now accepts `--' to signify the end of the options, except
110 as documented (echo, etc.).
111
112ee. All builtins use -p to display values in a re-readable format where
113 appropriate, except as documented (echo, type, etc.).
114
115ff. The `alias' builtin has a new -p option.
116
117gg. 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
122hh. The `bye' synonym for `exit' was removed.
123
124ii. The -L and -P options to `cd' and `pwd' have been documented.
125
126jj. The `cd' builtin now does spelling correction on the directory name
127 by default. This is settable with a shell option (shopt cdspell).
128
129kk. The `declare' builtin has new options: -a, -F, -p.
130
131ll. The `dirs' builtin has new options: -c, -p, -v.
132
133mm. 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
137nn. The `echo' builtin has a new escape character: \e.
138
139oo. 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
144pp. The `-all' option to `enable' was removed in favor of `-a'.
145
146qq. The `exec' builtin has new options: -l, -c, -a.
147
148rr. The `hash' builtin has a new option: -p.
149
150ss. The `history' builtin has new options: -c, -p, -s.
151
152tt. The `jobs' builtin has new options: -r, -s.
153
154uu. The `kill' builtin has new options: -n signum, -l signame.
155
156vv. The `pushd' and `popd' builtins have a new option: -n.
157
158ww. The `read' builtin has new options: -p prompt, -e, -a.
159
160xx. The `readonly' builtin has a new -a option, and the -n option was removed.
161
162yy. 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
168zz. The new `shopt' builtin controls shell optional behavior previously
169 done by setting and unsetting certain shell variables.
170
171aaa. The `test' builtin has new operators: -o option, s1 == s2, s1 < s2,
172 and s1 > s2, where s1 and s2 are strings.
173
174bbb. There is a new trap, DEBUG, executed after every simple command.
175
176ccc. The `trap' builtin has a new -p option.
177
178ddd. The `ulimit' builtin has a new -l option on 4.4BSD-based systems.
179
180eee. The PS1, PS2, PATH, and IFS variables may now be unset.
181
182fff. The restricted shell mode has been expanded and is now documented.
183
184ggg. 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
189hhh. 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
193iii. 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
213jjj. The default value of PS1 is now "\s-\v\$ ".
214
215kkk. The ksh-like ((...)) arithmetic command syntax has been implemented.
216 This is exactly equivalent to `let "..."'.
217
218lll. Integer constants have been extended to base 64.
219
220mmm. The `ulimit' builtin now sets both hard and soft limits and reports the
221 soft limit by default.
222
2232. New Features in Readline
224
225a. New variables: enable-keypad, input-meta (new name for meta-flag),
226 mark-directories, visible-stats (now documented), disable-completion,
227 comment-begin.
228
229b. 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
234c. New emacs keybindings: delete-horizontal-space (M-\),
235 insert-completions (M-*), possible-completions (M-=).
236
237d. 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
241e. More file types are available for the visible-stats mode.
242
2433. Changes of interest in the Bash implementation
244
245a. There is a new autoconf-based configuration mechanism.
246
247b. More things have been moved from Posix mode to standard shell behavior.
248
249c. The trace output (set -x) now inserts quotes where necessary so it can
250 be reused as input.
251
252d. There is a compile-time option for a system-wide interactive shell
253 startup file (disabled by default).
254
255e. The YACC grammar is smaller and tighter, and all 66 shift-reduce
256 conflicts are gone. Several parsing bugs have been fixed.
257
258f. Builtin option parsing has been regularized (using internal_getopt()),
259 with the exception of `echo', `type', and `set'.
260
261g. Builtins now return standard usage messages constructed from the
262 `short doc' used by the help builtin.
263
264h. Completion now quotes using backslashes by default, but honors
265 user-supplied quotes.
266
267i. The GNU libc malloc is available as a configure-time option.
268
269j. There are more internationalization features; bash uses gettext if
270 it is available. The $"..." translation syntax uses the current
271 locale and gettext.
272
273k. There is better reporting of job termination when the shell is not
274 interactive.
275
276l. The shell is somewhat more efficient: it uses a little less memory and
277 makes fewer system calls.
278
2794. Changes of interest in the Readline implementation
280
281a. There is now support for readline `callback' functions.
282
283b. There is now support for user-supplied input, redisplay, and terminal
284 preparation functions.
285
286c. Most of the shell-specific code in readline has been generalized or
287 removed.
288
289d. 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
293e. There are new library functions and variables available to application
294 writers, most having to do with completion and quoting.
295
296f. The NEWLINE character (^J) is now treated as a search terminator by the
297 incremental search functions.