Imported from ../bash-2.0.tar.gz.
[platform/upstream/bash.git] / CHANGES
1 This document details the changes between this version, bash-2.0-release,
2 and the previous version, bash-2.0-beta3.
3
4 1.  Changes to Bash
5
6 a.  Fix to the `getopts' builtin so that it does the right thing when a
7     required option argument is not present.
8
9 b.  The completion code now updates the common prefix of matched names
10     after FIGNORE processing is done, since any names that were removed
11     may have changed the common prefix.
12
13 c.  Fixed a bug that made messages in MAILPATH entries not work correctly.
14
15 d.  Fixed a serious documentation error in the description of the new
16     ${parameter:offset[:length]} expansion.
17
18 e.  Fixes to make parameter substring expansion ({$param:offset[:length]})
19     work when within double quotes.
20
21 f.  Fixes to make ^A (CTLESC) survive an unquoted expansion of positional
22     parameters.
23
24 g.  Corrected a misspelling of `unlimited' in the output of `ulimit'.
25
26 h.  Fixed a bug that caused executable scripts without a leading `#!' to
27     occasionally pick up the wrong set of positional parameters.
28
29 i.  Linux systems now have a working `ulimit -v', using RLIMIT_AS.
30
31 j.  Updated config.guess so that many more machine types are recognized.
32
33 k.  Fixed a bug with backslash-quoted slashes in the ${param/pat[/sub]}
34     expansion.
35
36 l.  If the shell is named `-su', and `-c command' is supplied, read and
37     execute the login shell startup files even though the shell is not
38     interactive.  This is to support the `-' option to `su'.
39
40 m.  Fixed a bug that caused core dumps when the DEBUG trap was ignored
41     with `trap "" DEBUG' and a shell function was subsequently executed.
42
43 n.  Fixed a bug that caused core dumps in the read builtin when IFS was
44     set to the null string and the input had leading whitespace.
45
46 2.  Changes to Readline
47
48 a.  Fixed a bug that caused a numeric argument of 1024 to be ignored when
49     inserting text.
50
51 b.  Fixed the display code so that the numeric argument is displayed as it's
52     being entered.
53
54 c.  Fixed the numeric argument reading code so that `M-- command' is
55     equivalent to `M--1 command', as the prompt implies.
56
57 3.  New Features in Bash
58
59 a.  `ulimit' now sets both hard and soft limits and reports the soft limit
60     by default (when neither -H nor -S is specified).  This is compatible
61     with versions of sh and ksh that implement `ulimit'.
62
63 b.  Integer constants have been extended to base 64.
64
65 4.  New Features in Readline
66
67 a.  The `home' and `end' keys are now bound to beginning-of-line and
68     end-of-line, respectively, if the corresponding termcap capabilities
69     are present.
70
71 ------------------------------------------------------------------------------
72 This document details the changes between this version, bash-2.0-beta3,
73 and the previous version, bash-2.0-beta2.
74
75 1.  Changes to Bash
76
77 a.  System-specific changes for: AIX 4.2, SCO 3.2v[45], HP-UX.
78
79 b.  When in POSIX mode, variable assignments preceding a special builtin
80     persist in the shell environment after the builtin completes.
81
82 c.  Changed all calls to getwd() to getcwd().  Improved check for systems
83     where the libc getcwd() calls popen(), since that breaks on some
84     systems when job control is being used.
85
86 d.  Fixed a bug that caused seg faults when executing scripts with the
87     execute bit set but without a leading `#!'.
88
89 e.  The environment passed to executed commands is never sorted.
90
91 f.  A bug was fixed in the code that expands ${name[@]} to the number of
92     elements in an array variable.
93
94 g.  A bug was fixed in the array compound assignment code ( A=( ... ) ).
95
96 h.  Window size changes now correctly propagate down to readline if
97     the shopt `checkwinsize' option is enabled.
98
99 i.  A fix was made in the code that expands to the length of a variable
100     value (${#var}).
101
102 j.  A fix was made to the command builtin so that it did not turn on the
103     `no fork' flag inappropriately.
104
105 k.  A fix was made to make `set -n' work more reliably.
106
107 l.  A fix was made to the job control initialization code so that the
108     terminal process group is set to the shell's process group if the
109     shell changes its own process group.
110
111 2.  Changes to Readline
112
113 a.  System-specific changes for: SCO 3.2v[45].
114
115 b.  The behavior of the vi-mode `.' when redoing an `i' command was changed
116     to insert the text previously inserted by the `i' command rather than
117     simply entering insert mode.
118
119 3.  New features in Bash
120
121 a.  There is a new version of the autoload function package, in
122     examples/functions/autoload.v2, that uses arrays and provides more
123     functionality.
124
125 b.  Support for LC_COLLATE and locale-specific sorting of the results of
126     pathname expansion if strcoll() is available.
127
128 4.  New Features in Readline
129
130 a.  Support for locale-specific sorting of completion possibilities if
131     strcoll() is available.
132
133 ------------------------------------------------------------------------------
134 This document details the changes between this version, bash-2.0-beta2,
135 and the previous version, bash-2.0-beta1.
136
137 1.  Changes to Bash
138
139 a.  `pushd -' is once again equivalent to `pushd $OLDPWD'.
140
141 b.  OS-specific changes for: SCO 3.2v[45].
142
143 c.  A change was made to the fix for the recently-reported security hole
144     when reading characters with octal value 255 to make it work better on
145     systems with restartable system calls when not using readline.
146
147 d.  Some changes were made to the test suite so that it works if you
148     configure bash with --enable-usg-echo-default.
149
150 e.  A fix was made to the parsing of conditional arithmetic expressions.
151
152 f.  Illegal arithmetic bases now cause an arithmetic evaluation error rather
153     than being silently reset.
154
155 g.  Multiple arithmetic bases now cause an arithmetic evaluation error
156     instead of being ignored.
157
158 h.  A fix was made to the evaluation of ${param?word} to conform to POSIX.2.
159
160 i.  A bug that sometimes caused array indices to be evaluated twice (which
161     would cause errors when they contained assignment statements) was fixed.
162
163 j.  `ulimit' was rewritten to avoid problems with getrlimit(2) returning
164     unsigned values and to simplify the code.
165
166 k.  A bug in the command-oriented-history code that caused it to sometimes
167     put semicolons after right parens inappropriately was fixed.
168
169 l.  The values inserted into the prompt by the \w and \W escape sequences
170     are now quoted to prevent further expansion.
171
172 m.  An interactive shell invoked as `sh' now reads and executes commands
173     from the file named by $ENV when it starts up.  If it's a login shell,
174     it does this after reading /etc/profile and ~/.profile.
175
176 n.  The file named by $ENV is never read by non-interactive shells.
177
178 2.  Changes to Readline
179
180 a.  A few changes were made to hide some macros and functions that should not
181     be public.
182
183 b.  An off-by-one error that caused seg faults in the history expansion code
184     was fixed.
185
186 3.  New Features in Bash
187
188 a.  The ksh-style ((...)) arithmetic command was implemented.  It is exactly
189     identical to let "...".  This is controlled by a new option to configure,
190     `--enable-dparen-arithmetic', which is on by default.
191
192 b.  There is a new #define available in config.h.top: SYS_BASH_LOGOUT.  If
193     defined to a filename, bash reads and executes commands from that file
194     when a login shell exits.  It's commented out by default.
195
196 c.  `ulimit' has a `-l' option that reports the maximum amount of data that
197     may be locked into memory on 4.4BSD-based systems.
198
199 ------------------------------------------------------------------------------
200 This document details the changes between this version, bash-2.0-beta1,
201 and the previous version, bash-2.0-alpha4.
202
203 1.  Changes to Bash
204
205 a.  A bug that sometimes caused traps to be ignored on signals the
206     shell treats specially was fixed.
207
208 b.  The internationalization code was changed to track the values of
209     LC_* variables and call setlocale() as appropriate.  The TEXTDOMAIN
210     and TEXTDOMAINDIR variables are also tracked; changes cause calls
211     to textdomain() and bindtextdomain(), if available.
212
213 c.  A bug was fixed that sometimes caused double-quoted strings to be
214     parsed incorrectly.
215
216 d.  Changes were made so that the siglist code compiles correctly on
217     Solaris 2.5.
218
219 e.  Added `:' to the set of characters that cause word breaks for the
220     completion code so that pathnames in assignments to $PATH can be
221     completed.
222
223 f.  The `select' command was fixed to print $PS3 to stderr.
224
225 g.  Fixed an error in the manual page section describing the effect that
226     setting and unsetting GLOBIGNORE has on the setting of the `dotglob'
227     option.
228
229 h.  The time conversion code now uses CLK_TCK rather than CLOCKS_PER_SEC
230     on systems without gettimeofday() and resources.
231
232 i.  The getopt static variables are now initialized each time a subshell
233     is started, so subshells using `getopts' work right.
234
235 j.  A sign-extension bug that caused a possible security hole was fixed.
236
237 k.  The parser now reads characters between backquotes within a double-
238     quoted string as a single word, so double quotes in the backquoted
239     string don't terminate the enclosing double-quoted string.
240
241 l.  A bug that caused `^O' to work incorrectly when typed as the first
242     thing to an interactive shell was fixed.
243
244 m.  A rarely-exercised off-by-one error in the code that quotes variable
245     values was fixed.
246
247 n.  Some memory and file descriptor leaks encountered when running a
248     shell script that is executable but does not have a leading `#!'
249     were plugged.
250
251 2.  Changes to Readline
252
253 a.  A bug that sometimes caused incorrect results when trying to read
254     typeahead on systems without FIONREAD was fixed.
255
256 3.  New Features in Bash
257
258 a.  The command timing code now uses the value of the TIMEFORMAT variable
259     to format and display timing statistics.
260
261 b.  The `time' reserved word now accepts a `-p' option to force the
262     POSIX.2 output format.
263
264 c.  There are a couple of new and updated scripts to convert csh startup
265     files to bash format.
266
267 d.  There is a new builtin array variable: BASH_VERSINFO.  The various
268     members hold the parts of the version information in BASH_VERSION,
269     plus the value of MACHTYPE.
270
271 4.  New Features in Readline
272
273 a.  Setting LANG to `en_US.ISO8859-1' now causes readline to enter
274     eight-bit mode.
275
276 ------------------------------------------------------------------------------
277 This document details the changes between this version, bash-2.0-alpha4,
278 and the previous version, bash-2.0-alpha3.
279
280 1.  Changes to Bash
281
282 a.  There is better detection of rsh connections on Solaris 2.
283
284 b.  Assignments to read-only variables preceding a command name are now
285     variable assignment errors.  Variable assignment errors cause
286     non-interactive shells running in posix mode to exit.
287
288 c.  The word tokenizer was rewritten to handle nested quotes and pairs
289     ('', "", ``, ${...}, $(...), $[...], $'...', $"...", <(...), >(...))
290     correctly.  Some of the parameter expansion code was updated as a
291     consequence.
292
293 d.  A fix was made to `test' when given three arguments so that a binary
294     operator is checked for first, before checking that the first argument
295     is `!'.
296
297 e.  2''>/dev/null is no longer equivalent to 2>/dev/null.
298
299 f.  Parser error messages were regularized, and in most cases the name of
300     the shell script being read by a non-interactive shell is not printed
301     twice.
302
303 g.  A fix was made to the completion code so that it no longer removes the
304     text the user typed in some cases.
305
306 h.  The special glibc `getopt' environment variable is no longer put into
307     the environment on machines with small values of ARG_MAX.
308
309 i.  The expansion of ${...} now follows the POSIX.2 rules for finding the
310     closing `}'.
311
312 j.  The shell no longer displays spurious status messages for background
313     jobs in shell scripts that complete successfully when the script is
314     run from a terminal.
315
316 k.  `shopt -o' now correctly updates $SHELLOPTS.
317
318 l.  A bug that caused the $PATH searching code to return a non-executable
319     file even when an executable file with the same name appeared later in
320     $PATH was fixed.
321
322 m.  The shell now does tilde expansions on unquoted `:~' in assignment
323     statements when not in posix mode.
324
325 n.  Variable assignment errors when a command consists only of assignments
326     now cause non-interactive shells to exit when in posix mode.
327
328 o.  If the variable in a `for' or `select' command is read-only, or not a
329     legal shell identifier, a variable assignment error occurs.
330
331 p.  `test' now handles `-a' and `-o' as binary operators when three arguments
332     are supplied, and correctly parses `( word )' as equivalent to `word'.
333
334 q.  `test' was fixed so that file names of the form /dev/fd/NN mean the same
335     thing on all systems, even Linux.
336
337 r.  Fixed a bug in the globbing code that caused patterns with multiple
338     consecutive `*'s to not be matched correctly.
339
340 s.  Fixed a bug that caused $PS2 to not be printed when an interactive shell
341     not using readline is reading a here document.
342
343 t.  Fixed a bug that caused history expansion to be performed inappropriately
344     when a single-quoted string spanned more than one line.
345
346 u.  `getopts' now checks that the variable name passed by the user as the
347     second argument is a legal shell identifier and that the variable is
348     not read-only.
349
350 v.  Fixed `getopts' to obey POSIX.2 rules for setting $OPTIND when it
351     encounters an error.
352
353 w.  Fixed `set' to display variable values in a form that can be re-read.
354
355 x.  Fixed a bug in the code that keeps track of whether or not local variables
356     have been declared at the current level of function nesting.
357
358 y.  Non-interactive shells in posix mode now exit if the name in a function
359     declaration is not a legal identifier.
360
361 z.  The job control code now ignores stopped children when the shell is not
362     interactive.
363
364 aa. The `cd' builtin no longer attempts spelling correction on the directory
365     name if the shell is not interactive, regardless of the setting of the
366     `cdspell' option.
367
368 bb. Some OS-specific changes were made for SCO 3.2v[45] and AIX 4.2.
369
370 cc. `time' now prints its output to stderr, as POSIX.2 specifies.
371
372 2.  Fixes to Readline
373
374 a.  After printing possible completions, all lines of a multi-line prompt
375     are redisplayed.
376
377 b.  Some changes were made to the terminal handling code in rltty.c to
378     work around AIX 4.2 bugs.
379
380 3.  New Features in Bash
381
382 a.  There is a new loadable builtin: sprintf, with calling syntax
383                 sprintf var format [args]
384     This provides an easy way to simulate ksh left- and right-justified
385     variable values.
386
387 b.  The expansions of \h and \H in prompt strings were swapped.  \h now
388     expands to the hostname up to the first `.', as in bash-1.14.
389
390 4.  New Features in Readline
391
392 a.  The bash-1.14 behavior when ^M is typed while doing an incremental
393     search was restored.  ^J may now be used to terminate the search without
394     accepting the line.
395
396 b.  There is a new bindable variable: disable-completion.  This inhibits
397     word completion and causes the completion character to be inserted as
398     if it had been bound to self-insert.
399
400 ------------------------------------------------------------------------------
401 This document details the changes between this version, bash-2.0-alpha3,
402 and the previous version, bash-2.0-alpha2.
403
404 There is now a file `COMPAT' included in the distribution that lists the
405 user-visible incompatibilities between 1.14 and 2.0.
406
407 1. Changes to Bash
408
409 a. Some work was done so that word splitting of the rhs of assignment
410    statements conforms more closely to historical practice.
411
412 b. A couple of errant memory frees were fixed.
413
414 c. A fix was made to the test builtin so it recognizes `<' and `>' as
415    binary operators.
416
417 d. The GNU malloc in lib/malloc/malloc.c now scrambles memory as it's
418    allocated and freed.  This is to catch callers that refer to freed
419    memory or assume something about newly-allocated memory.
420
421 e. Fixed a problem with conversion to 12-hour time in the prompt
422    expansion code.
423
424 f. Fixed a problem with configure's argument parsing order.  Now you can
425    correctly turn on specific options after using --enable-minimal-config.
426
427 g. The configure script now automatically disables the use of GNU malloc
428    on systems where it's appropriate (better than having people read the
429    NOTES file and do it manually).
430
431 h. There are new prompt expansions (\v and \V) to insert version information
432    into the prompt strings.
433
434 i. The default prompt string now includes the version number.
435
436 j. Most of the builtins that take no options were changed to use the
437    internal getopt so they can produce proper error messages for -?
438    and incorrect options.
439
440 k. Some system-specific changes were made for SVR4.2 and Solaris 2.5.
441
442 l. Bash now uses PATH_MAX instead of MAXPATHLEN and NAME_MAX instead of
443    MAXNAMLEN.
444
445 m. A couple of problems caused by uninitialized variables were fixed.
446
447 n. There are a number of new loadable builtin examples: logname, basename,
448    dirname, tty, pathchk, tee, head, and rmdir.  All of these conform to
449    POSIX.2.
450
451 o. Bash now notices changes in TZ and calls tzset() if present, so
452    changing TZ will alter the time printed by prompt expansions.
453
454 p. The source was reorganized a bit so I don't have to wait so long for
455    some files to compile, and to facilitate the creation of a `shell
456    library' at some future point.
457
458 q. Bash no longer turns off job control if called as `sh', since the
459    POSIX.2 spec includes job control as a standard feature.
460
461 r. `bash -o posix' now works as intended.
462
463 s. Fixed a problem with the completion code: when completing a filename
464    that contained globbing characters, if show-all-if-ambiguous was set,
465    the completion code would remove the user's text.
466
467 t. Fixed ulimit so that (hopefully) the full range of limits is available
468    on HPUX systems.
469
470 u. A new `shopt' option (`hostcomplete') enables and disables hostname
471    completion.
472
473 v. The shell no longer attempts to save the history on an abort(),
474    which is usually called by programming_error().
475
476 w. The `-s' option to `fc' was changed to echo the command to be executed
477    to stderr instead of stdout.
478
479 x. If the editor invoked by `fc -e' exits with a non-zero status, no
480    commands are executed.
481
482 y. Fixed a bug that made the shopt `histverify' option work incorrectly.
483
484 z. There is a new variable `MACHTYPE' whose value is the GNU-style
485    `cpu-company-system' system description as set by configure.  (The
486    values of MACHTYPE and HOSTTYPE should really be swapped.)
487
488 aa. The `ulimit' builtin now allows the maximum virtual memory size to be
489     set via setrlimit(2) if RLIMIT_VMEM is defined.
490
491 bb. `bash -nc 'command'' no longer runs `command'.
492
493 2. Changes to Readline
494
495 a. Fixed a typo in the code that checked for FIONREAD in input.c.
496
497 b. Fixed a bug in the code that outputs keybindings, so things like C-\
498    are quoted properly.
499
500 c. Fixed a bug in the inputrc file parsing code to handle the problems
501    caused by inputrc files created from the output of `bind -p' in
502    previous versions of bash.  The problem was due to the bug fixed
503    in item b above.
504
505 d. Readline no longer turns off the terminal's meta key, and turns it on
506    once the first time it's called.
507
508 ------------------------------------------------------------------------------
509 This file documents the changes between this version, bash-2.0-alpha2,
510 and the previous version, bash-2.0-alpha.
511
512 1. Changes to Bash
513
514 a. The shell no longer thinks directories are executable.
515
516 b. `disown' has a new option, `h', which inhibits the resending of SIGHUP
517    but does not remove the job from the jobs table.
518
519 c. The varargs functions in error.c now use ANSI-C `stdarg' if available.
520
521 d. The build process now treats the `build version' in .build as local to
522    the build directory, so different versions built from the same source
523    tree have different `build versions'.
524
525 e. Some problems with the grammar have been fixed. (It used `list' in a few
526    productions where `compound_list' was needed.  A `list' must be terminated
527    with a newline or semicolon; a `compound_list' need not be.)
528
529 f. A fix was made to keep `wait' from hanging when waiting for all background
530    jobs.
531
532 g. `bash --help' now writes its output to stdout, like the GNU Coding Standards
533    specify, and includes the machine type (the value of MACHTYPE).
534
535 h. `bash --version' now prints more information and exits successfully, like
536    the GNU Coding Standards specify.
537
538 i. The output of `time' and `times' now prints fractional seconds with three
539    places after the decimal point.
540
541 j. A bug that caused process substitutions to screw up the pipeline printed
542    by `jobs' was fixed.
543
544 k. Fixes were made to the code that implements $'...' and $"..." so they
545    work as documented.
546
547 l. The process substitution code now opens named pipes for reading with
548    O_NONBLOCK to avoid hanging.
549
550 m. Fixes were made to the trap code so the shell cleans up correctly if the
551    trap command contains a `return' and we're executing a function or
552    sourcing a script with `.'.
553
554 n. Fixes to doc/Makefile.in so that it doesn't try to remake all of the
555    documentation (ps, dvi, etc.) on a `make install'.
556
557 o. Fixed an auto-increment error that caused bash -c args to sometimes dump
558    core.
559
560 p. Fixed a bug that caused $HISTIGNORE to fail when the history line
561    contained globbing characters.
562
563 2. Changes to Readline
564
565 a. There is a new string variable, rl_library_version, available for use by
566    applications.  The current value is "2.1".
567
568 b. A bug encountered when expand-tilde was enabled and file completion was
569    attempted on a word beginning with `~/' was fixed.
570
571 c. A slight change was made to the incremental search termination behavior.
572    ESC still terminates the search, but if input is pending or arrives
573    within 0.1 seconds (on systems with select(2)), it is used as a prefix
574    character.  This is intented to allow users to terminate searches with
575    the arrow keys and get the behavior they expect.