Skip to content

Commit 0001803

Browse files
author
Chet Ramey
committed
Bash-4.1 distribution source
1 parent 89a9286 commit 0001803

File tree

252 files changed

+33515
-19510
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

252 files changed

+33515
-19510
lines changed

AUTHORS

+1
Original file line numberDiff line numberDiff line change
@@ -334,6 +334,7 @@ examples/functions/manpage Tom Tromey
334334
examples/functions/fstty Chet Ramey
335335
examples/functions/jj.bash Chet Ramey
336336
examples/functions/notify.bash Chet Ramey
337+
examples/loadables/getconf.c J.T. Conklin
337338
examples/scripts/shprompt Chet Ramey
338339
examples/scripts/adventure.sh Chet Ramey, Doug Gwyn
339340
examples/scripts/bcsh.sh Chris Robertson, Chet Ramey

CHANGES

+373-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,375 @@
1+
This document details the changes between this version, bash-4.1-rc,
2+
and the previous version, bash-4.1-beta.
3+
4+
1. Changes to Bash
5+
6+
a. Fixed a bug that caused printf to not return a partial value when it
7+
encountered an error while converting an integer argument.
8+
9+
b. Fixed a bug that caused setting one of the compatNN options to not
10+
turn off the others.
11+
12+
c. The (undocumented) --wordexp option is no longer included by default.
13+
14+
d. Fixed a bug in conditional command execution that caused it to not
15+
correctly ignore the exit status under certain circumstances.
16+
17+
e. Added a configure-time check for correctly-working asprintf/snprintf.
18+
19+
f. Fixed some problems with line number calculation and display when sourcing
20+
a file in an interactive shell.
21+
22+
g. Fixed a bug that caused the shell to crash when using `declare -A foo=bar'.
23+
24+
h. Fixed a bug that caused an off-by-one error when calculating the directories
25+
to display with the PROMPT_DIRTRIM option.
26+
27+
2. Changes to Readline
28+
29+
a. Fixed a bug that caused applications using the callback interface to not
30+
react to SIGINT (or other signals) until another character arrived.
31+
32+
------------------------------------------------------------------------------
33+
This document details the changes between this version, bash-4.1-beta,
34+
and the previous version, bash-4.1-alpha.
35+
36+
1. Changes to Bash
37+
38+
a. Fixed a bug in mapfile that caused the shell to crash if it was passed the
39+
name of an associative array.
40+
41+
b. Fixed a bug that caused the shell to incorrectly split case patterns if
42+
they contained characters in $IFS.
43+
44+
c. Fixed a bug that caused the shell to set $? to the wrong value when using
45+
a construct ending with a variable assignment with set -x enabled and PS4
46+
containing a command substitution.
47+
48+
d. Fixed a bug that caused the shell to read commands incorrectly if an
49+
expansion error occurred under certain conditions in a user-specified
50+
subshell.
51+
52+
e. Fixed a bug that caused the shell to set $? incorrectly if a parse error
53+
occurred in an evaluation context ("eval", trap command, dot script, etc.)
54+
55+
f. Fixed a bug that caused the shell to attempt command substitution
56+
completion within a single-quoted string.
57+
58+
g. Fixed a bug that caused the shell to insert an extra single quote during
59+
word completion.
60+
61+
h. Fixed a bug that caused the shell to crash if invoked with the environment
62+
variable EMACS having a null value.
63+
64+
i. Fixed a bug that caused bash to incorrectly report the presence of new
65+
mail in a `maildir' environment.
66+
67+
j. Fixed a bug that caused the shell to not recognize a here-document ending
68+
delimiter inside a command substitution.
69+
70+
k. Fixed a bug that caused the shell to crash when a a dynamic array variable
71+
was assigned a scalar value.
72+
73+
2. Changes to Readline
74+
75+
3. New Features in Bash
76+
77+
a. The mapfile/readarray builtin no longer stores the commands it invokes via
78+
callbacks in the history list.
79+
80+
b. There is a new `compat40' shopt option.
81+
82+
c. The < and > operators to [[ do string comparisons using the current locale
83+
only if the compatibility level is greater than 40 (set to 41 by default).
84+
85+
4. New Features in Readline
86+
87+
------------------------------------------------------------------------------
88+
This document details the changes between this version, bash-4.1-alpha,
89+
and the previous version, bash-4.0-release.
90+
91+
1. Changes to Bash
92+
93+
a. Fixed bugs in the parser involving new parsing of the commands contained
94+
in command substitution when the substitution is read.
95+
96+
b. Fixed a bug that caused the shell to dump core when performing programmable
97+
completion using a shell function.
98+
99+
c. Fixed a bug in `mapfile' that caused it to invoke callbacks at the wrong
100+
time.
101+
102+
d. Fixed a bug that caused the shell to dump core when listing jobs in the
103+
`exit' builtin.
104+
105+
e. Fixed several bugs encountered when reading subscripts in associative
106+
array assignments and expansions.
107+
108+
f. Fixed a bug that under some circumstances caused an associative array to
109+
be converted to an indexed array.
110+
111+
g. Fixed a bug that caused syntax errors and SIGINT interrupts to not set
112+
$? to a value > 128.
113+
114+
h. Fixed a bug that caused the shell to remove FIFOs associated with process
115+
substitution inside shell functions.
116+
117+
i. Fixed a bug that caused terminal attributes to not be reset when the
118+
`read' builtin timed out.
119+
120+
j. Fixed a bug in brace expansion that caused unwanted zero padding of the
121+
expanded terms.
122+
123+
k. Fixed a bug that prevented the |& construct from working as intended when
124+
used with a simple command with additional redirections.
125+
126+
l. Fixed a bug with the case statment ;& terminator that caused the shell to
127+
dereference a NULL pointer.
128+
129+
m. Fixed a bug that caused assignment statements or redirections preceding
130+
a simple command name to inhibit alias expansion.
131+
132+
n. Fixed the behavior of `set -u' to conform to the latest Posix interpretation:
133+
every expansion of an unset variable except $@ and $* will cause the
134+
shell to exit.
135+
136+
o. Fixed a bug that caused double-quoted expansions of $* inside word
137+
expansions like ${x#$*} to not expand properly when $IFS is empty.
138+
139+
p. Fixed a bug that caused traps to set $LINENO to the wrong value when they
140+
execute.
141+
142+
q. Fixed a bug that caused off-by-one errors when computing history lines in
143+
the `fc' builtin.
144+
145+
r. Fixed a bug that caused some terminating signals to not exit the shell
146+
quickly enough, forcing the kernel to send the signal (e.g., SIGSEGV)
147+
multiple times.
148+
149+
s. Fixed a bug that caused the shell to attempt to add empty lines to the
150+
history list when reading here documents.
151+
152+
t. Made some internal changes that dramatically speeds up sequential indexed
153+
array access.
154+
155+
u. Fixed a bug that caused the shell to write past the end of a string when
156+
completing a double-quoted string ending in a backslash.
157+
158+
v. Fixed a bug that caused the shell to replace too many characters when a
159+
pattern match was null in a ${foo//bar} expansion.
160+
161+
w. Fixed bugs in the expansion of ** that caused duplicate directory names
162+
and the contents of the current directory to be omitted.
163+
164+
x. Fixed a bug that caused $? to not be set correctly when referencing an
165+
unset variable with set -u and set -e enabled.
166+
167+
y. Fixed a bug caused by executing an external program from the DEBUG trap
168+
while a pipeline was running. The effect was to disturb the pipeline
169+
state, occasionally causing it to hang.
170+
171+
z. Fixed a bug that caused the ** glob expansion to dump core if it
172+
encountered an unsearchable directory.
173+
174+
aa. Fixed a bug that caused `command -v' and `command -V' to not honor the
175+
path set by the -p option.
176+
177+
bb. Fixed a bug that caused brace expansion to take place too soon in some
178+
compound array assignments.
179+
180+
cc. Fixed a bug that caused programmable completion functions' changes to
181+
READLINE_POINT to not be reflected back to readline.
182+
183+
dd. Fixed a bug that caused the shell to dump core if a trap was executed
184+
during a shell assignment statement.
185+
186+
ee. Fixed an off-by-one error when computing the number of positional
187+
parameters for the ${@:0:n} expansion.
188+
189+
ff. Fixed a problem with setting COMP_CWORD for programmable completion
190+
functions that could leave it set to -1.
191+
192+
gg. Fixed a bug that caused the ERR trap to be triggered in some cases where
193+
`set -e' would not have caused the shell to exit.
194+
195+
hh. Fixed a bug that caused changes made by `compopt' to not persist past the
196+
completion function in which compopt was executed.
197+
198+
ii. Fixed a bug that caused the list of hostname completions to not be cleared
199+
when HOSTNAME was unset.
200+
201+
jj. Fixed a bug that caused variable expansion in here documents to look in
202+
any temporary environment.
203+
204+
kk. Bash and readline can now convert file names between precomposed and
205+
decomposed Unicode on Mac OS X ("keyboard" and file system forms,
206+
respectively). This affects filename completion (using new
207+
rl_filename_rewrite_hook), globbing, and readline redisplay.
208+
209+
ll. The ERR and EXIT traps now see a non-zero value for $? when a parser
210+
error after set -e has been enabled causes the shell to exit.
211+
212+
mm. Fixed a bug that in brace expansion that caused zero-prefixed terms to
213+
not contain the correct number of digits.
214+
215+
nn. Fixed a bug that caused the shell to free non-allocated memory when
216+
unsetting an associative array which had had a value implicitly assigned
217+
to index "0".
218+
219+
oo. Fixed a memory leak in the ${!prefix@} expansion.
220+
221+
pp. Fixed a bug that caused printf to not correctly report all write errors.
222+
223+
qq. Fixed a bug that caused single and double quotes to act as delimiters
224+
when splitting a command line into words for programmable completion.
225+
226+
rr. Fixed a bug that caused ** globbing that caused **/path/* to match every
227+
directory, not just those matching `path'.
228+
229+
ss. Fixed a bug that caused the shell to dump core when running `help' without
230+
arguments if the terminal width was fewer than 7 characters.
231+
232+
2. Changes to Readline
233+
234+
a. The SIGWINCH signal handler now avoids calling the redisplay code if
235+
one arrives while in the middle of redisplay.
236+
237+
b. Changes to the timeout code to make sure that timeout values greater
238+
than one second are handled better.
239+
240+
c. Fixed a bug in the redisplay code that was triggered by a prompt
241+
containing invisible characters exactly the width of the screen.
242+
243+
d. Fixed a bug in the redisplay code encountered when running in horizontal
244+
scroll mode.
245+
246+
e. Fixed a bug that prevented menu completion from properly completing
247+
filenames.
248+
249+
f. Fixed a redisplay bug caused by a multibyte character causing a line to
250+
wrap.
251+
252+
g. Fixed a bug that caused key sequences of two characters to not be
253+
recognized when a longer sequence identical in the first two characters
254+
was bound.
255+
256+
h. Fixed a bug that caused history expansion to be attempted on $'...'
257+
single-quoted strings.
258+
259+
i. Fixed a bug that caused incorrect redisplay when the prompt contained
260+
multibyte characters in an `invisible' sequence bracketed by \[ and
261+
\].
262+
263+
j. Fixed a bug that caused history expansion to short-circuit after
264+
encountering a multibyte character.
265+
266+
3. New Features in Bash
267+
268+
a. Here-documents within $(...) command substitutions may once more be
269+
delimited by the closing right paren, instead of requiring a newline.
270+
271+
b. Bash's file status checks (executable, readable, etc.) now take file
272+
system ACLs into account on file systems that support them.
273+
274+
c. Bash now passes environment variables with names that are not valid
275+
shell variable names through into the environment passed to child
276+
processes.
277+
278+
d. The `execute-unix-command' readline function now attempts to clear and
279+
reuse the current line rather than move to a new one after the command
280+
executes.
281+
282+
e. `printf -v' can now assign values to array indices.
283+
284+
f. New `complete -E' and `compopt -E' options that work on the "empty"
285+
completion: completion attempted on an empty command line.
286+
287+
g. New complete/compgen/compopt -D option to define a `default' completion:
288+
a completion to be invoked on command for which no completion has been
289+
defined. If this function returns 124, programmable completion is
290+
attempted again, allowing a user to dynamically build a set of completions
291+
as completion is attempted by having the default completion function
292+
install individual completion functions each time it is invoked.
293+
294+
h. When displaying associative arrays, subscripts are now quoted.
295+
296+
i. Changes to dabbrev-expand to make it more `emacs-like': no space appended
297+
after matches, completions are not sorted, and most recent history entries
298+
are presented first.
299+
300+
j. The [[ and (( commands are now subject to the setting of `set -e' and the
301+
ERR trap.
302+
303+
k. The source/. builtin now removes NUL bytes from the file before attempting
304+
to parse commands.
305+
306+
l. There is a new configuration option (in config-top.h) that forces bash to
307+
forward all history entries to syslog.
308+
309+
m. A new variable $BASHOPTS to export shell options settable using `shopt' to
310+
child processes.
311+
312+
n. There is a new confgure option that forces the extglob option to be
313+
enabled by default.
314+
315+
o. New variable $BASH_XTRACEFD; when set to an integer bash will write xtrace
316+
output to that file descriptor.
317+
318+
p. If the optional left-hand-side of a redirection is of the form {var}, the
319+
shell assigns the file descriptor used to $var or uses $var as the file
320+
descriptor to move or close, depending on the redirection operator.
321+
322+
q. The < and > operators to the [[ conditional command now do string
323+
comparison according to the current locale.
324+
325+
r. Programmable completion now uses the completion for `b' instead of `a'
326+
when completion is attempted on a line like: a $(b c.
327+
328+
s. Force extglob on temporarily when parsing the pattern argument to
329+
the == and != operators to the [[ command, for compatibility.
330+
331+
t. Changed the behavior of interrupting the wait builtin when a SIGCHLD is
332+
received and a trap on SIGCHLD is set to be Posix-mode only.
333+
334+
u. The read builtin has a new `-N nchars' option, which reads exactly NCHARS
335+
characters, ignoring delimiters like newline.
336+
337+
4. New Features in Readline
338+
339+
a. New bindable function: menu-complete-backward.
340+
341+
b. In the vi insertion keymap, C-n is now bound to menu-complete by default,
342+
and C-p to menu-complete-backward.
343+
344+
c. When in vi command mode, repeatedly hitting ESC now does nothing, even
345+
when ESC introduces a bound key sequence. This is closer to how
346+
historical vi behaves.
347+
348+
d. New bindable function: skip-csi-sequence. Can be used as a default to
349+
consume key sequences generated by keys like Home and End without having
350+
to bind all keys.
351+
352+
e. New application-settable function: rl_filename_rewrite_hook. Can be used
353+
to rewite or modify filenames read from the file system before they are
354+
compared to the word to be completed.
355+
356+
f. New bindable variable: skip-completed-text, active when completing in the
357+
middle of a word. If enabled, it means that characters in the completion
358+
that match characters in the remainder of the word are "skipped" rather
359+
than inserted into the line.
360+
361+
g. The pre-readline-6.0 version of menu completion is available as
362+
"old-menu-complete" for users who do not like the readline-6.0 version.
363+
364+
h. New bindable variable: echo-control-characters. If enabled, and the
365+
tty ECHOCTL bit is set, controls the echoing of characters corresponding
366+
to keyboard-generated signals.
367+
368+
i. New bindable variable: enable-meta-key. Controls whether or not readline
369+
sends the smm/rmm sequences if the terminal indicates it has a meta key
370+
that enables eight-bit characters.
371+
372+
------------------------------------------------------------------------------
1373
This document details the changes between this version, bash-4.0-release,
2374
and the previous version, bash-4.0-rc1.
3375

@@ -601,7 +973,7 @@ bb. The command assigned to a key sequence with `bind -x' now sets two new
601973
and cursor position by modifying READLINE_LINE_BUFFER and READLINE_POINT,
602974
respectively.
603975

604-
cc. There is a new >>& redirection operator, which appends the standard output
976+
cc. There is a new &>> redirection operator, which appends the standard output
605977
and standard error to the named file.
606978

607979
dd. The parser now understands `|&' as a synonym for `2>&1 |', which redirects

0 commit comments

Comments
 (0)