fix coproc code to close previous coproc file descriptors if another one is created; start at setting additional coproc states; change release status to bash-5.3-alpha

This commit is contained in:
Chet Ramey
2024-04-06 16:06:11 -04:00
parent 03c8c43b79
commit e6795c05dd
125 changed files with 70438 additions and 50267 deletions
+637
View File
@@ -1,3 +1,640 @@
This document details the changes between this version, bash-5.3-alpha, and
the previous version, bash-5.2-release.
1. Changes to Bash
a. Stop checking for new mail if an interactive shell is in the middle of
programmable completion or readline command dispatching.
b. Changes to multibyte character translation to handle shift states better.
c. Fixed a bug with subshell command execution that caused it to set LINENO
incorrectly.
d. Fixed a bug that caused some array subscript references in arithmetic
expansions to seg fault.
e. Don't report on foreground jobs that we won't notify the user about if
jobs is run from a trap handler or a `bind -x' command.
f. Fixed a bug where temporarily turning on `extglob' while parsing a command
substitution in compatibility mode could leave it set.
g. Fixed a bug where nested word expansions confused the state parser and
resulted in quotes being required where they should not have been.
h. Fixed a bug where nested function definitions resulted in `display -F'
printing incorrect line numbers.
i. Fixed the message printed when the shell gets ENOENT from execve: specific
message about a bad interpreter before the generic error message.
j. Fixed a spurious debug message when errexit is set and the shell is
exiting from an eval command in a shell function.
k. Fixed a bug where a pending signal would cause pattern matching to fail in
an exit trap.
l. Fixed a crash caused by a null replacement string in pattern replacement.
m. Fixed a bug in interactive shells where a SIGINT received while parsing a
command substitution would leave the expand_aliases option disabled.
n. Fixed a bug with command printing when printing multiple shell functions
with here-documents inside a command substitution.
o. Fixed a bug with expanding aliases while parsing command substitutions
inside another word expansion.
p. Fixed a bug with alias expansion in posix mode in an eval command inside a
command substitution.
q. Fixed a bug that caused the parser not to reset correctly if it encountered
a syntax error while trying to read a WORD token.
r. Fixed a bug that caused `<(' and `>(' to trigger process substitution inside
an arithmetic expression.
s. Fixed a bug that caused the shell to unlink FIFOs used for process
substitution before a compound command completes.
t. Fixed a bug that caused the read builtin to not recognize some negative
fractional arguments.
u. Fixed a bug that caused subshells not to run the EXIT trap if a signal
arrived after the command and before returning to the caller.
v. Fixed a bug where `wait' without arguments could wait for inherited
process substitutions, which are not children of this shell.
w. Fixed a bug with expanding $* in a here-document body.
x. Fixed a bug where `declare -p' in a shell function would show the wrong
command for `local -'.
y. Change for POSIX interpretation 1602 about the default return status for
`return' in a trap command.
z. Fixed a bug that caused double evaluation of a dynamic variable like
$RANDOM when using certain parameter expansions.
aa. Fixed a bug where `read -e -t' would cause an interactive shell to exit.
bb. Fixed a number of bugs with pathname expansion/pattern matching and
slashes in bracket expressions.
cc. Fixed several bugs with optimizing out forks.
dd. Fixed a memory leak when referencing unset associative array elements.
ee. System-specific changes for: WIN32
ff. Perform more cleanup if the shell exceeds maximum function nesting level.
gg. Fixed a bug that caused `eval' to run the ERR trap in commands where it
should not.
hh. Fixed nameref expansion where nameref values are valid length expansion
expressions but invalid identifiers.
ii. Fixed an error that caused syntax errors when expanding nested word
expansions inside a here-document.
jj. POSIX special builtins now exit the shell in posix mode on more failure
cases.
kk. Brace expansion is interruptible at more spots, so long expansions can
be interrupted more quickly.
ll. Fixed a crash caused by running `set -o emacs' in `bash -c command'.
mm. Fixed a bug that caused bash to reset the terminal process group before
a command exited if it received a SIGINT in a non-interactive shell.
nn. Significant changes to the source code to make it C23-conformant, including
C23 undefined behavior.
oo. Treat read(2) errors while reading input as immediately fatal errors
instead of the traditional EOF; POSIX interp 1629
pp. Fix to allow asynchronous commands to use `trap' to reset signals that
are ignored during the command; POSIX interp 751.
qq. Fix a posix-mode bug with alias expansion when checking for reserved
words and the previous alias expansion ends with a space.
rr. Programmable completion now creates empty elements in COMP_WORDS if the
cursor is on whitespace just preceding a word.
ss. Fixed a bug that prevented aliases ending with a space from alias
expanding the next word if more than two aliases are expanded from a
single word.
tt. Fixed a bug that caused the shell to give the terminal to the shell's
process group when reaping a background job.
uu. Command printing is more consistent when to print `function' before a
shell function name.
vv. Fixed a bug that caused unset not to remove a function named a[b] if
there was no array variable a.
ww. Posix mode doesn't perform function lookup for function names containing
a slash.
xx. <( and >( can now be used in funtion names.
yy. Fixed a bug that caused tilde expansion not to be performed on some
array subscripts.
zz. Fixed key-value pair associative array assignment to be more consistent
with compound array assignment, and indexed array assignment (a=(zero one))
to be more consistent with explicitly assigning indices one by one.
aaa. In posix mode, extra arguments to `fc' are now an error.
bbb. The bash readline commands that perform history and alias expansion try
to place point closer to where it was in the unexpanded line.
ccc. Fixed multiple invocations of `local -' in the same shell function to
have the same effect as one.
ddd. Don't export $_ if allexport is set.
eee. Don't add extra newlines to the history if parsing a delimited construct.
fff. Dynamically-loaded builtins cannot have slashes in their names, since
they'll never be called.
ggg. Fixed a bug that could cause reading EOF while parsing a quoted string
to terminate the shell.
hhh. Fixed a bug that caused local variables with the same name as variables
in `declare's temporary environment to be propagated back to the caller.
iii. Don't try to perform brace expansion on assignment statements in compound
assignments.
jjj. Fixed a bug that could cause a crash while evaluating an arithmetic for
command if one of the expressions expands to NULL.
kkk. In posix mode, cd tries to change to what the user typed if the
canonicalized version of that pathname is longer than PATH_MAX.
lll. Fixes for some errors revealed by address sanitizer.
mmm. If fork(2) fails, kill the current pipeline processes with SIGKILL after
SIGTERM, in case they're ignoring SIGTERM.
nnn. Fix to adding command substitutions to history to avoid adding semicolons
where they shouldn't be.
ooo. Programmable completion and compgen honor the setting of `dotglob'.
ppp. Use gettimeofday(2) to get time information instead of using time(3).
qqq. Save and restore readline variables affecting filename completions in
case someone runs `compgen' in the foreground.
rrr. Treat the failure to open file in $(<file) as a non-fatal expansion
error instead of a fatal redirection error.
sss. In posix mode, command substitution doesn't affect $? except when
specified for commands consisting solely of assignment statements.
ttt. Fix {var}>&- so it doesn't silently close stdin if var is not a number.
uuu. Follow namerefs in ${name=word} so the shell can implement the POSIX
semantics of returning "the final value of parameter."
vvv. Bash performs better nameref loop detection in several lookup cases.
www. SIGINT will now break out of loops if a process executed in the loop dies
due to SIGINT, not just if the loop body is a list. This is no longer
dependent on the compatibility level.
xxx. FIGNORE suffixes can now match the entire pathname, like tcsh, instead
of requiring a non-empty prefix.
yyy. Fix bug that caused FUNCNAME not to be reset after a parse error with
compound assignments to local variables.
zzz. Fix bug that caused `jobs' not to remove jobs from the list in a SIGCHLD
trap.
aaaa. Fix bug that caused `ignoreeof' to be ignored if EOF is read at a
secondary prompt or while parsing a command substitution.
bbbb. Fixes to removing jobs from the jobs table when the user isn't notified;
has effects of fixing issues with `wait -n' not finding jobs.
cccc. Fixes to loadable builtin processing so that we never pass a null
pathname or try to load a builtin that's not found if the -n option is
supplied.
dddd. Work around system-specific problems (macOS) where isblank(3) returns
true for characters >= 0x80 in a UTF-8 locale.
eeee. Fix for crash while parsing alias expansions that include compound
assignments.
ffff. Fixe for non-interactive shells reading a script file that ends with
backslash preceding EOF.
gggg. Fix to command printing when here-documents are attached to compound
commands in lists.
hhhh. Fix bug with sourcing `files' created by process substitutions inside
a `.' script.
iiii. Fixes to declare builtin to treat arguments to declare -f that look like
assignment statements or array references as function names.
jjjj. Fixed a variable conversion problem when exporting a variable in the
temporary environment back to the calling scope.
kkkk. BASH_REMATCH can now be a local variable.
llll. Subshell commands clear process substitutions so anything created by a
redirection doesn't affect the subshell.
mmmm. Fixes for several small memory leaks.
nnnn. The shell simply ignores attempts to assign to `noassign' variables
instead of treating them as an assignment error and possibly causing
the shell to exit.
oooo. If the cd builtin uses $OLDPWD, allow it to use $CDPATH if the user has
set it to something that's not a full pathname.
pppp. The test builtin only supports the optional argument to -t if parsing
an expression with more than four aguments and not in posix mode.
qqqq. Changes to filename quoting and rewriting to deal with NFC and NFD
Unicode forms (primarily for macOS).
rrrr. Send SIGCONT to a job we've just restarted with fg or bg, even if we
think it's already running.
ssss. Fixes for setting the line number associated with a simple command.
tttt. Many changes for integer overflow and out-of-range arguments to printf.
uuuu. Fixes for the read builtin and unescaped backslashes preceding NULs or
the end of the input.
vvvv. The -[anrw] options to the history builtin should have no effect if
HISTFILE is unset or null.
wwww. If programmable completion uses something different than what the user
typed as the command name (full pathname, alias, etc.), display what's
actually used in `compopt' output.
xxxx. Fix bug with closing /dev/fd process substitutions in shell functions.
yyyy. Fix bug with `declare -g' trying to convert a global associative array
to an indexed array.
zzzz. Fix bash history expansion characters so we don't get empty history
events.
aaaaa. Allow `time' and `!' reserved words to be followed by `&', which POSIX
interp 267 says is required.
bbbbb. Upgrade intl library to the one from gettext-0.21.1.
ccccc. Fix line number in the event that a simple command jumps back to the
top level on error.
ddddd. Make the order of setting BASH_COMMAND, running the DEBUG trap, and
printing PS4 consistent across all command types.
eeeee. Rely on child processes to set the terminal process group instead of
having the parent do it as well.
fffff. Fix `printf' to consume entire multibyte characters in the format string,
in case the encoding contains `/' or `%'.
ggggg. Fix `hash' to return 1 if -d is supplied and the hash table is empty.
hhhhh. Fix `select' command to be like `for' in that an invalid selection
variable is a fatal error in posix mode.
iiiii. Fix to parameter length expansion to avoid expanding dynamic variables
(e.g., RANDOM) more than once.
jjjjj. Fix to `shift', `break', and `continue' to skip over a `--' when
printing an invalid argument error message.
kkkkk. Fix bug that caused an invalid arithmetic expression in an arithmetic
`for' command to leave the loop level set to the wrong value, preventing
`break' and `continue' from working.
lllll. Fix problem with removing escapes in the `E' variable transformation.
mmmmm. Fix bug with word splitting if `read' assigns to IFS.
nnnnn. Fix posix-mode cases where failure of special builtins did not cause
the shell to exit.
ooooo. Some fixes to cases where the shell quotes characters that are special
internally.
ppppp. Fix error with read builtin trying to assign to a readonly variable.
qqqqq. Fix a slight race condition when bash receives a SIGINT while waiting
for a foreground job.
rrrrr. Fix integer parsing to accept more whitespace characters after the
digit string -- the same ones we accept before the digits.
sssss. Fix a crash when attempting to brace-expand a very large list of
strings fails.
ttttt. Fix dynamic loading of builtins not to look in the current directory
if looking in BASH_LOADABLES_PATH is not successful, like $PATH
searching.
uuuuu. Fix `bind -x' commands to understand negative argument counts.
vvvvv. Disable fork optimization if the shell is running startup files because
SSH_SOURCE_BASHRC was enabled; prevents infinite recursion.
wwwww. Fix `unset' builtin to implement POSIX interp 1009, which says that
unsetting a variable in the temporary environment unsets the variable
in the enclosing scope also, in posix mode.
xxxxx. Fix parser to read here-document body from the current alias, if that's
where input is being read from.
yyyyy. Fix an off-by-one error that caused completion to fail for certain
pathnames containing backslash-quoted single-quotes.
zzzzz. Fix command printing to print a coproc name only if the coproc command
is not a simple command.
aaaaaa. Fix prompt string decoding to preserve the value of $_.
bbbbbb. In posix mode, supplying a non-identifier as a function name to `export'
or `readonly' should cause the shell to exit, since these are special
builtins.
cccccc. Fix a crash that happens due to accessing freed memory if the parser
encounters a syntax error while parsing an alias or a compound
assignment.
dddddd. Fix a bug that could cause errors while executing a DEBUG trap in a
pipeline.
eeeeee. Fix a bug where exiting a subshell should not try to restore the
terminal settings if that subshell didn't reinitialize them.
ffffff. Remove long-lived workaround for old AFS bug that causes problems with
modern implementations.
gggggg. Fix a bug that caused an assignment error to BASHOPTS or SHELLOPTS to
remove the variable's readonly attribute.
hhhhhh. Fix for a crash if a pathname argument to `cd' is NULL and the current
directory has been removed.
iiiiii. Fix a bug with shell-expand-line readline command that caused it to
interpret quoted single quotes incorrectly when inside $'...'.
jjjjjj. Fix to the declare builtin to catch more invalid option combinations.
kkkkkk. Fix to avoid unsafe execution of the EXIT trap if a terminating signal
arrives while bash is waiting for a foreground process.
llllll. Fixed a bug that allowed attribute changes to readonly variables that
changed the effects of attempted assignments.
mmmmmm. Fix bug that caused quoting errors if $* was expanded in a context
where word splitting was not performed.
oooooo. Fix bug that caused declare commands with `-' and `+' options and an
assignment statement to be misinterpreted.
pppppp. Retry opening startup files if the open is interrupted by a signal
and is not automatically restarted.
qqqqqq. Fix printing a case command where one of the case command lists begins
with the word `esac'.
rrrrrr. Fix for history and command number expansion when expanding a prompt
string that contains the @P variable transformation.
ssssss. Fix a bug that could cause the shell to hang if a script used multiple
coprocesses without manually closing file descriptors associated with
existing coprocesses.
2. Changes to Readline
a. Fixed a bug in clearing the visible line structure before redisplay.
b. Fix a bug where setlocale(3) returning NULL caused a crash.
c. Fixed signal checking in callback mode to handle signals that arrive before
readline restore's the application's signal handlers.
d. Fixed a bug with word completion where the directory name needs to be
dequoted and tilde-expanded.
e. Fixed a bug that caused compilation to fail on systems with select but not
pselect.
f. System-specific changes for: WIN32, z/OS, Cygwin, MSYS
g. Fixed a bug that caused word completion mismatches if the quoted text the
user typed was longer than the unquoted match.
h. Fixes for freeing undo lists that might appear in history list entries
after non-incremental searches.
i. Fixes for some errors revealed by address sanitizer.
j. In vi mode, if an `f' or `F' move command associated with a `c' or `C'
command fails, don't enter insert mode.
k. Fixed bug with truncating a history file containing timestamps that caused
the timestamp associated with the first history entry not to be written.
l. Fix vi-mode so that a motion command attached to d/D, y/Y, or t/T must
consume or delete at least one character.
m. Fix a redisplay error when displaying meta characters as octal sequences
and other C locale issues.
n. Fix error that caused characters composing an incomplete multibyte
character not to be inserted into the line.
o. In callback mode, let the application echo the signal characters (e.g., ^C)
when the application's signal handlers are installed.
p. Added some support for lines that consume more than the physical number of
screen lines.
q. Make sure dump-variables returns the string values for active-region-start-color
and active-region-end-color if they're set.
r. Fixes to how characters between 128 and 159 are printed when displaying
macro values (use symbolic notation instead of directly printing the
character).
s. Don't convert meta characters that contain NULL (\M-\C-@) to actual NULs,
which prematurely terminates the macro value.
t. Fix typo in the readline color prefix extension that it uses for coloring
filename prefixes when displaying possible completions.
u. Call the filename rewrite hook on the word being completed before comparing
it against possible completions from the file system to get consistent
strings.
v. Fix infinite recursion that can happen if someone binds a key that doesn't
have a different upper and lower case represenation to do-lowercase-version.
w. Check for non-ANSI (dumb) terminals a little more thoroughly.
x. Don't attempt to history-expand the `quick substitution' character at the
beginning of a line if the application has set the quoting state to single
quotes.
y. Fix small memory leak if non-incremental or incremental search is
interrupted by a signal.
z. Loading very large history files should be much faster.
aa. Retry opening startup files if the open is interrupted by a signal
and is not automatically restarted.
3. New Features in Bash
a. When checking whether a script file argument is a binary file, check the
first two lines of a script if the first line begins with `#!'.
b. Bash does a better job of preserving user-supplied quotes around a word
completion, instead of requoting it.
c. Bash reports the starting line number in an error message about an
unterminated compound command like `if' without a `fi'.
d. Implement the POSIX requirement that running the `jobs' builtin removes
jobs from the jobs list.
f. Call bash signal handlers while executing programmable completion commands,
instead of readline's.
g. Print an error message if a regular expression used with [[ fails to compile.
h. The `umask' builtin now has additional features for full POSIX conformance.
i. `type -a -P' reports both hashed pathnames and the result of a $PATH search.
j. `trap' has a new -P option that prints the trap action associated with each
signal argument.
k. The `command' builtin preceding a declaration builtin (e.g., `declare')
preserves the special asisgnment statement parsing for the declation
builtin. This is a new POSIX requirement.
l. `printf' uses the `alternate form' for %q and %Q to force single quoting.
m. `printf' now interprets %ls (%S) and %lc (%C)nas referring to wide strings
and characters, respectively, when in a multibyte locale.
n. The shell can be compiled with a different default value for the
patsub_replacement option.
o. Check for window size changes during trap commands, `bind -x' commands,
and programmable completion.
p. Treat a NULL value for $PATH as equivalent to ".".
p. New loadable builtins: kv, strptime
q. GLOBSORT: new variable to specify how to sort the results of pathname
expansion (name, size, blocks, mtime, atime, ctime, none) in ascending
or descending order.
r. `compgen' has a new option: -V varname. If supplied, it stores the generated
completions into VARNAME instead of printing them on stdout.
s. New form of command substitution: ${ command; } or ${|command;} to capture
the output of COMMAND without forking a child process and using pipes.
t. array_expand_once: new shopt option, replaces assoc_expand_once
u. complete/compopt new option: fullquote; sets rl_full_quoting_desired so all
possible completions are quoted as if they were filenames.
v. Command timing now allows precisions up to 6 digits instead of 3 in
$TIMEFORMAT.
w. BASH_MONOSECONDS: new dynamic variable that returns the value of the
system's monotonic clock, if one is available.
x. BASH_TRAPSIG: new variable, set to the numeric signal number of the trap
being executed while it's running.
y. The checkwinsize option can be used in subshell commands started from
interactive shells.
z. In posix mode, the test command < and > binary primaries compare strings
using the current locale.
aa. bind -x allows new key binding syntax: separate the key sequence and the
command string with whitespace, but require the command string to be
double-quoted if this is used. This allows different quoting options for
the command string.
bb. Print commands bound to key sequences using `bind -x' with the new key
binding syntax it allows.
cc. `read' has a new `-E' option to use readline but with the default bash
completion (including programmable completion).
dd. New bindable readline command name: `bash-vi-complete'.
ee. New test builtin behavior when parsing a parenthesized subexpression and
test was given more than 4 arguments: scan forward for a closing paren and
call posixtest() if there are 4 or fewer arguments between the parentheses.
Added for compatibility with coreutils test, dependent on the shell
compatibility level. Such expressions remain ambiguous.
4. New Features in Readline
a. Output a newline if there is no prompt and readline reads an empty line.
b. The history library falls back to stdio when writing the history list if
mmap fails.
c. New bindable variable `search-ignore-case', causes readline to perform
case-insensitive incremental and non-incremental history searches.
d. rl_full_quoting_desired: new application-settable variable, causes all
completions to be quoted as if they were filenames.
e. rl_macro_display_hook: new application-settable function pointer, used if
the application wants to print macro values itself instead of letting
readline do it
f. rl_reparse_colors: new application-callable function, reparses $LS_COLORS
(presumably after the user changes it)
g. rl_completion_rewrite_hook: new application-settable function pointer,
called to modify the word being completed before comparing it against
pathnames from the file system.
h. execute-named-command: a new bindable command that reads the name of a
readline command from the standard input and executes it. Bound to M-x
in emacs mode by default.
i. Incremental and non-incremental searches now allow ^V/^Q (or, in the former
case, anything bound to quoted-insert) to quote characters in the search
string.
------------------------------------------------------------------------------
This document details the changes between this version, bash-5.2-release, and
the previous version, bash-5.2-rc4.
+635
View File
@@ -0,0 +1,635 @@
This document details the changes between this version, bash-5.3-alpha, and
the previous version, bash-5.2-release.
1. Changes to Bash
a. Stop checking for new mail if an interactive shell is in the middle of
programmable completion or readline command dispatching.
b. Changes to multibyte character translation to handle shift states better.
c. Fixed a bug with subshell command execution that caused it to set LINENO
incorrectly.
d. Fixed a bug that caused some array subscript references in arithmetic
expansions to seg fault.
e. Don't report on foreground jobs that we won't notify the user about if
jobs is run from a trap handler or a `bind -x' command.
f. Fixed a bug where temporarily turning on `extglob' while parsing a command
substitution in compatibility mode could leave it set.
g. Fixed a bug where nested word expansions confused the state parser and
resulted in quotes being required where they should not have been.
h. Fixed a bug where nested function definitions resulted in `display -F'
printing incorrect line numbers.
i. Fixed the message printed when the shell gets ENOENT from execve: specific
message about a bad interpreter before the generic error message.
j. Fixed a spurious debug message when errexit is set and the shell is
exiting from an eval command in a shell function.
k. Fixed a bug where a pending signal would cause pattern matching to fail in
an exit trap.
l. Fixed a crash caused by a null replacement string in pattern replacement.
m. Fixed a bug in interactive shells where a SIGINT received while parsing a
command substitution would leave the expand_aliases option disabled.
n. Fixed a bug with command printing when printing multiple shell functions
with here-documents inside a command substitution.
o. Fixed a bug with expanding aliases while parsing command substitutions
inside another word expansion.
p. Fixed a bug with alias expansion in posix mode in an eval command inside a
command substitution.
q. Fixed a bug that caused the parser not to reset correctly if it encountered
a syntax error while trying to read a WORD token.
r. Fixed a bug that caused `<(' and `>(' to trigger process substitution inside
an arithmetic expression.
s. Fixed a bug that caused the shell to unlink FIFOs used for process
substitution before a compound command completes.
t. Fixed a bug that caused the read builtin to not recognize some negative
fractional arguments.
u. Fixed a bug that caused subshells not to run the EXIT trap if a signal
arrived after the command and before returning to the caller.
v. Fixed a bug where `wait' without arguments could wait for inherited
process substitutions, which are not children of this shell.
w. Fixed a bug with expanding $* in a here-document body.
x. Fixed a bug where `declare -p' in a shell function would show the wrong
command for `local -'.
y. Change for POSIX interpretation 1602 about the default return status for
`return' in a trap command.
z. Fixed a bug that caused double evaluation of a dynamic variable like
$RANDOM when using certain parameter expansions.
aa. Fixed a bug where `read -e -t' would cause an interactive shell to exit.
bb. Fixed a number of bugs with pathname expansion/pattern matching and
slashes in bracket expressions.
cc. Fixed several bugs with optimizing out forks.
dd. Fixed a memory leak when referencing unset associative array elements.
ee. System-specific changes for: WIN32
ff. Perform more cleanup if the shell exceeds maximum function nesting level.
gg. Fixed a bug that caused `eval' to run the ERR trap in commands where it
should not.
hh. Fixed nameref expansion where nameref values are valid length expansion
expressions but invalid identifiers.
ii. Fixed an error that caused syntax errors when expanding nested word
expansions inside a here-document.
jj. POSIX special builtins now exit the shell in posix mode on more failure
cases.
kk. Brace expansion is interruptible at more spots, so long expansions can
be interrupted more quickly.
ll. Fixed a crash caused by running `set -o emacs' in `bash -c command'.
mm. Fixed a bug that caused bash to reset the terminal process group before
a command exited if it received a SIGINT in a non-interactive shell.
nn. Significant changes to the source code to make it C23-conformant, including
C23 undefined behavior.
oo. Treat read(2) errors while reading input as immediately fatal errors
instead of the traditional EOF; POSIX interp 1629
pp. Fix to allow asynchronous commands to use `trap' to reset signals that
are ignored during the command; POSIX interp 751.
qq. Fix a posix-mode bug with alias expansion when checking for reserved
words and the previous alias expansion ends with a space.
rr. Programmable completion now creates empty elements in COMP_WORDS if the
cursor is on whitespace just preceding a word.
ss. Fixed a bug that prevented aliases ending with a space from alias
expanding the next word if more than two aliases are expanded from a
single word.
tt. Fixed a bug that caused the shell to give the terminal to the shell's
process group when reaping a background job.
uu. Command printing is more consistent when to print `function' before a
shell function name.
vv. Fixed a bug that caused unset not to remove a function named a[b] if
there was no array variable a.
ww. Posix mode doesn't perform function lookup for function names containing
a slash.
xx. <( and >( can now be used in funtion names.
yy. Fixed a bug that caused tilde expansion not to be performed on some
array subscripts.
zz. Fixed key-value pair associative array assignment to be more consistent
with compound array assignment, and indexed array assignment (a=(zero one))
to be more consistent with explicitly assigning indices one by one.
aaa. In posix mode, extra arguments to `fc' are now an error.
bbb. The bash readline commands that perform history and alias expansion try
to place point closer to where it was in the unexpanded line.
ccc. Fixed multiple invocations of `local -' in the same shell function to
have the same effect as one.
ddd. Don't export $_ if allexport is set.
eee. Don't add extra newlines to the history if parsing a delimited construct.
fff. Dynamically-loaded builtins cannot have slashes in their names, since
they'll never be called.
ggg. Fixed a bug that could cause reading EOF while parsing a quoted string
to terminate the shell.
hhh. Fixed a bug that caused local variables with the same name as variables
in `declare's temporary environment to be propagated back to the caller.
iii. Don't try to perform brace expansion on assignment statements in compound
assignments.
jjj. Fixed a bug that could cause a crash while evaluating an arithmetic for
command if one of the expressions expands to NULL.
kkk. In posix mode, cd tries to change to what the user typed if the
canonicalized version of that pathname is longer than PATH_MAX.
lll. Fixes for some errors revealed by address sanitizer.
mmm. If fork(2) fails, kill the current pipeline processes with SIGKILL after
SIGTERM, in case they're ignoring SIGTERM.
nnn. Fix to adding command substitutions to history to avoid adding semicolons
where they shouldn't be.
ooo. Programmable completion and compgen honor the setting of `dotglob'.
ppp. Use gettimeofday(2) to get time information instead of using time(3).
qqq. Save and restore readline variables affecting filename completions in
case someone runs `compgen' in the foreground.
rrr. Treat the failure to open file in $(<file) as a non-fatal expansion
error instead of a fatal redirection error.
sss. In posix mode, command substitution doesn't affect $? except when
specified for commands consisting solely of assignment statements.
ttt. Fix {var}>&- so it doesn't silently close stdin if var is not a number.
uuu. Follow namerefs in ${name=word} so the shell can implement the POSIX
semantics of returning "the final value of parameter."
vvv. Bash performs better nameref loop detection in several lookup cases.
www. SIGINT will now break out of loops if a process executed in the loop dies
due to SIGINT, not just if the loop body is a list. This is no longer
dependent on the compatibility level.
xxx. FIGNORE suffixes can now match the entire pathname, like tcsh, instead
of requiring a non-empty prefix.
yyy. Fix bug that caused FUNCNAME not to be reset after a parse error with
compound assignments to local variables.
zzz. Fix bug that caused `jobs' not to remove jobs from the list in a SIGCHLD
trap.
aaaa. Fix bug that caused `ignoreeof' to be ignored if EOF is read at a
secondary prompt or while parsing a command substitution.
bbbb. Fixes to removing jobs from the jobs table when the user isn't notified;
has effects of fixing issues with `wait -n' not finding jobs.
cccc. Fixes to loadable builtin processing so that we never pass a null
pathname or try to load a builtin that's not found if the -n option is
supplied.
dddd. Work around system-specific problems (macOS) where isblank(3) returns
true for characters >= 0x80 in a UTF-8 locale.
eeee. Fix for crash while parsing alias expansions that include compound
assignments.
ffff. Fixe for non-interactive shells reading a script file that ends with
backslash preceding EOF.
gggg. Fix to command printing when here-documents are attached to compound
commands in lists.
hhhh. Fix bug with sourcing `files' created by process substitutions inside
a `.' script.
iiii. Fixes to declare builtin to treat arguments to declare -f that look like
assignment statements or array references as function names.
jjjj. Fixed a variable conversion problem when exporting a variable in the
temporary environment back to the calling scope.
kkkk. BASH_REMATCH can now be a local variable.
llll. Subshell commands clear process substitutions so anything created by a
redirection doesn't affect the subshell.
mmmm. Fixes for several small memory leaks.
nnnn. The shell simply ignores attempts to assign to `noassign' variables
instead of treating them as an assignment error and possibly causing
the shell to exit.
oooo. If the cd builtin uses $OLDPWD, allow it to use $CDPATH if the user has
set it to something that's not a full pathname.
pppp. The test builtin only supports the optional argument to -t if parsing
an expression with more than four aguments and not in posix mode.
qqqq. Changes to filename quoting and rewriting to deal with NFC and NFD
Unicode forms (primarily for macOS).
rrrr. Send SIGCONT to a job we've just restarted with fg or bg, even if we
think it's already running.
ssss. Fixes for setting the line number associated with a simple command.
tttt. Many changes for integer overflow and out-of-range arguments to printf.
uuuu. Fixes for the read builtin and unescaped backslashes preceding NULs or
the end of the input.
vvvv. The -[anrw] options to the history builtin should have no effect if
HISTFILE is unset or null.
wwww. If programmable completion uses something different than what the user
typed as the command name (full pathname, alias, etc.), display what's
actually used in `compopt' output.
xxxx. Fix bug with closing /dev/fd process substitutions in shell functions.
yyyy. Fix bug with `declare -g' trying to convert a global associative array
to an indexed array.
zzzz. Fix bash history expansion characters so we don't get empty history
events.
aaaaa. Allow `time' and `!' reserved words to be followed by `&', which POSIX
interp 267 says is required.
bbbbb. Upgrade intl library to the one from gettext-0.21.1.
ccccc. Fix line number in the event that a simple command jumps back to the
top level on error.
ddddd. Make the order of setting BASH_COMMAND, running the DEBUG trap, and
printing PS4 consistent across all command types.
eeeee. Rely on child processes to set the terminal process group instead of
having the parent do it as well.
fffff. Fix `printf' to consume entire multibyte characters in the format string,
in case the encoding contains `/' or `%'.
ggggg. Fix `hash' to return 1 if -d is supplied and the hash table is empty.
hhhhh. Fix `select' command to be like `for' in that an invalid selection
variable is a fatal error in posix mode.
iiiii. Fix to parameter length expansion to avoid expanding dynamic variables
(e.g., RANDOM) more than once.
jjjjj. Fix to `shift', `break', and `continue' to skip over a `--' when
printing an invalid argument error message.
kkkkk. Fix bug that caused an invalid arithmetic expression in an arithmetic
`for' command to leave the loop level set to the wrong value, preventing
`break' and `continue' from working.
lllll. Fix problem with removing escapes in the `E' variable transformation.
mmmmm. Fix bug with word splitting if `read' assigns to IFS.
nnnnn. Fix posix-mode cases where failure of special builtins did not cause
the shell to exit.
ooooo. Some fixes to cases where the shell quotes characters that are special
internally.
ppppp. Fix error with read builtin trying to assign to a readonly variable.
qqqqq. Fix a slight race condition when bash receives a SIGINT while waiting
for a foreground job.
rrrrr. Fix integer parsing to accept more whitespace characters after the
digit string -- the same ones we accept before the digits.
sssss. Fix a crash when attempting to brace-expand a very large list of
strings fails.
ttttt. Fix dynamic loading of builtins not to look in the current directory
if looking in BASH_LOADABLES_PATH is not successful, like $PATH
searching.
uuuuu. Fix `bind -x' commands to understand negative argument counts.
vvvvv. Disable fork optimization if the shell is running startup files because
SSH_SOURCE_BASHRC was enabled; prevents infinite recursion.
wwwww. Fix `unset' builtin to implement POSIX interp 1009, which says that
unsetting a variable in the temporary environment unsets the variable
in the enclosing scope also, in posix mode.
xxxxx. Fix parser to read here-document body from the current alias, if that's
where input is being read from.
yyyyy. Fix an off-by-one error that caused completion to fail for certain
pathnames containing backslash-quoted single-quotes.
zzzzz. Fix command printing to print a coproc name only if the coproc command
is not a simple command.
aaaaaa. Fix prompt string decoding to preserve the value of $_.
bbbbbb. In posix mode, supplying a non-identifier as a function name to `export'
or `readonly' should cause the shell to exit, since these are special
builtins.
cccccc. Fix a crash that happens due to accessing freed memory if the parser
encounters a syntax error while parsing an alias or a compound
assignment.
dddddd. Fix a bug that could cause errors while executing a DEBUG trap in a
pipeline.
eeeeee. Fix a bug where exiting a subshell should not try to restore the
terminal settings if that subshell didn't reinitialize them.
ffffff. Remove long-lived workaround for old AFS bug that causes problems with
modern implementations.
gggggg. Fix a bug that caused an assignment error to BASHOPTS or SHELLOPTS to
remove the variable's readonly attribute.
hhhhhh. Fix for a crash if a pathname argument to `cd' is NULL and the current
directory has been removed.
iiiiii. Fix a bug with shell-expand-line readline command that caused it to
interpret quoted single quotes incorrectly when inside $'...'.
jjjjjj. Fix to the declare builtin to catch more invalid option combinations.
kkkkkk. Fix to avoid unsafe execution of the EXIT trap if a terminating signal
arrives while bash is waiting for a foreground process.
llllll. Fixed a bug that allowed attribute changes to readonly variables that
changed the effects of attempted assignments.
mmmmmm. Fix bug that caused quoting errors if $* was expanded in a context
where word splitting was not performed.
oooooo. Fix bug that caused declare commands with `-' and `+' options and an
assignment statement to be misinterpreted.
pppppp. Retry opening startup files if the open is interrupted by a signal
and is not automatically restarted.
qqqqqq. Fix printing a case command where one of the case command lists begins
with the word `esac'.
rrrrrr. Fix for history and command number expansion when expanding a prompt
string that contains the @P variable transformation.
ssssss. Fix a bug that could cause the shell to hang if a script used multiple
coprocesses without manually closing file descriptors associated with
existing coprocesses.
2. Changes to Readline
a. Fixed a bug in clearing the visible line structure before redisplay.
b. Fix a bug where setlocale(3) returning NULL caused a crash.
c. Fixed signal checking in callback mode to handle signals that arrive before
readline restore's the application's signal handlers.
d. Fixed a bug with word completion where the directory name needs to be
dequoted and tilde-expanded.
e. Fixed a bug that caused compilation to fail on systems with select but not
pselect.
f. System-specific changes for: WIN32, z/OS, Cygwin, MSYS
g. Fixed a bug that caused word completion mismatches if the quoted text the
user typed was longer than the unquoted match.
h. Fixes for freeing undo lists that might appear in history list entries
after non-incremental searches.
i. Fixes for some errors revealed by address sanitizer.
j. In vi mode, if an `f' or `F' move command associated with a `c' or `C'
command fails, don't enter insert mode.
k. Fixed bug with truncating a history file containing timestamps that caused
the timestamp associated with the first history entry not to be written.
l. Fix vi-mode so that a motion command attached to d/D, y/Y, or t/T must
consume or delete at least one character.
m. Fix a redisplay error when displaying meta characters as octal sequences
and other C locale issues.
n. Fix error that caused characters composing an incomplete multibyte
character not to be inserted into the line.
o. In callback mode, let the application echo the signal characters (e.g., ^C)
when the application's signal handlers are installed.
p. Added some support for lines that consume more than the physical number of
screen lines.
q. Make sure dump-variables returns the string values for active-region-start-color
and active-region-end-color if they're set.
r. Fixes to how characters between 128 and 159 are printed when displaying
macro values (use symbolic notation instead of directly printing the
character).
s. Don't convert meta characters that contain NULL (\M-\C-@) to actual NULs,
which prematurely terminates the macro value.
t. Fix typo in the readline color prefix extension that it uses for coloring
filename prefixes when displaying possible completions.
u. Call the filename rewrite hook on the word being completed before comparing
it against possible completions from the file system to get consistent
strings.
v. Fix infinite recursion that can happen if someone binds a key that doesn't
have a different upper and lower case represenation to do-lowercase-version.
w. Check for non-ANSI (dumb) terminals a little more thoroughly.
x. Don't attempt to history-expand the `quick substitution' character at the
beginning of a line if the application has set the quoting state to single
quotes.
y. Fix small memory leak if non-incremental or incremental search is
interrupted by a signal.
z. Loading very large history files should be much faster.
aa. Retry opening startup files if the open is interrupted by a signal
and is not automatically restarted.
3. New Features in Bash
a. When checking whether a script file argument is a binary file, check the
first two lines of a script if the first line begins with `#!'.
b. Bash does a better job of preserving user-supplied quotes around a word
completion, instead of requoting it.
c. Bash reports the starting line number in an error message about an
unterminated compound command like `if' without a `fi'.
d. Implement the POSIX requirement that running the `jobs' builtin removes
jobs from the jobs list.
f. Call bash signal handlers while executing programmable completion commands,
instead of readline's.
g. Print an error message if a regular expression used with [[ fails to compile.
h. The `umask' builtin now has additional features for full POSIX conformance.
i. `type -a -P' reports both hashed pathnames and the result of a $PATH search.
j. `trap' has a new -P option that prints the trap action associated with each
signal argument.
k. The `command' builtin preceding a declaration builtin (e.g., `declare')
preserves the special asisgnment statement parsing for the declation
builtin. This is a new POSIX requirement.
l. `printf' uses the `alternate form' for %q and %Q to force single quoting.
m. `printf' now interprets %ls (%S) and %lc (%C)nas referring to wide strings
and characters, respectively, when in a multibyte locale.
n. The shell can be compiled with a different default value for the
patsub_replacement option.
o. Check for window size changes during trap commands, `bind -x' commands,
and programmable completion.
p. Treat a NULL value for $PATH as equivalent to ".".
p. New loadable builtins: kv, strptime
q. GLOBSORT: new variable to specify how to sort the results of pathname
expansion (name, size, blocks, mtime, atime, ctime, none) in ascending
or descending order.
r. `compgen' has a new option: -V varname. If supplied, it stores the generated
completions into VARNAME instead of printing them on stdout.
s. New form of command substitution: ${ command; } or ${|command;} to capture
the output of COMMAND without forking a child process and using pipes.
t. array_expand_once: new shopt option, replaces assoc_expand_once
u. complete/compopt new option: fullquote; sets rl_full_quoting_desired so all
possible completions are quoted as if they were filenames.
v. Command timing now allows precisions up to 6 digits instead of 3 in
$TIMEFORMAT.
w. BASH_MONOSECONDS: new dynamic variable that returns the value of the
system's monotonic clock, if one is available.
x. BASH_TRAPSIG: new variable, set to the numeric signal number of the trap
being executed while it's running.
y. The checkwinsize option can be used in subshell commands started from
interactive shells.
z. In posix mode, the test command < and > binary primaries compare strings
using the current locale.
aa. bind -x allows new key binding syntax: separate the key sequence and the
command string with whitespace, but require the command string to be
double-quoted if this is used. This allows different quoting options for
the command string.
bb. Print commands bound to key sequences using `bind -x' with the new key
binding syntax it allows.
cc. `read' has a new `-E' option to use readline but with the default bash
completion (including programmable completion).
dd. New bindable readline command name: `bash-vi-complete'.
ee. New test builtin behavior when parsing a parenthesized subexpression and
test was given more than 4 arguments: scan forward for a closing paren and
call posixtest() if there are 4 or fewer arguments between the parentheses.
Added for compatibility with coreutils test, dependent on the shell
compatibility level. Such expressions remain ambiguous.
4. New Features in Readline
a. Output a newline if there is no prompt and readline reads an empty line.
b. The history library falls back to stdio when writing the history list if
mmap fails.
c. New bindable variable `search-ignore-case', causes readline to perform
case-insensitive incremental and non-incremental history searches.
d. rl_full_quoting_desired: new application-settable variable, causes all
completions to be quoted as if they were filenames.
e. rl_macro_display_hook: new application-settable function pointer, used if
the application wants to print macro values itself instead of letting
readline do it
f. rl_reparse_colors: new application-callable function, reparses $LS_COLORS
(presumably after the user changes it)
g. rl_completion_rewrite_hook: new application-settable function pointer,
called to modify the word being completed before comparing it against
pathnames from the file system.
h. execute-named-command: a new bindable command that reads the name of a
readline command from the standard input and executes it. Bound to M-x
in emacs mode by default.
i. Incremental and non-incremental searches now allow ^V/^Q (or, in the former
case, anything bound to quoted-insert) to quote characters in the search
string.
+16 -6
View File
@@ -2,13 +2,13 @@ Compatibility with previous versions
====================================
This document details the incompatibilities between this version of bash,
bash-5.2, and the previous widely-available versions, bash-3.2 (which is
bash-5.3, and the previous widely-available versions, bash-3.2 (which is
still the `standard' version for Mac OS X), 4.2/4.3 (which are still
standard on a few Linux distributions), and bash-4.4/bash-5.0/bash-5.1,
the current widely-available versions. These were discovered by users of
bash-2.x through 5.x, so this list is not comprehensive. Some of these
incompatibilities occur between the current version and versions 2.0 and
above.
standard on a few Linux distributions), and bash-4.4 and
bash-5.0/bash-5.1/bash-5.2, the current widely-available versions.
These were discovered by users of bash-2.x through 5.x, so this list is not
comprehensive. Some of these incompatibilities occur between the current
version and versions 2.0 and above.
1. Bash uses a new quoting syntax, $"...", to do locale-specific
string translation. Users who have relied on the (undocumented)
@@ -422,6 +422,12 @@ above.
differently than previous versions, and differently depending on whether
the array is indexed or associative.
67. The `test' builtin in bash-5.3 treats parenthesized subexpressions when
given more than four arguments differently. It scans forward for a
closing paren and counts the number of arguments between the parens. If
there are four or fewer, it uses the posix test algorithm on the
subexpression.
Shell Compatibility Level
=========================
@@ -578,6 +584,10 @@ compat51 (set using BASH_COMPAT)
expansion time if extglob hasn't been enabled by the time the
command is executed.
compat52 (set using BASH_COMPAT)
- the test builtin uses its historical algorithm for parsing
expressions composed of five or more primaries.
-------------------------------------------------------------------------------
Copying and distribution of this file, with or without modification,
+54
View File
@@ -9051,3 +9051,57 @@ lib/readline/doc/history.3
- fix some paragraph spacing and other layout/spacing/hyphenation
issues
Fixes from G. Branden Robinson <g.branden.robinson@gmail.com>
4/1
---
execute_cmd.c
- shell_execve: minor changes to code that checks the #! interpreter
name
execute_cmd.c
- execute_coproc: if MULTIPLE_COPROCS is not defined, close any old
file descriptors corresponding to sh_coproc. The user can still
copy them from the coproc array if desired; this prevents the shell
from hanging if a second coproc inherits file descriptors from a
previous one
From a report by Carl Edquist <edquist@cs.wisc.edu>
jobs.c,nojobs.c,jobs.h
- process_exit_status: no longer static, public function with an
extern declaration
4/2
---
execute_cmd.c,execute_cmd.h
- coproc_pidchk: now takes a full WAIT status word as a second
argument instead of just the exit status; arranged the prototype
to only be included if the source file includes posixwait.h for WAIT
jobs.c
- waitchld: call coproc_pidchk with a WAIT second argument (like
nojobs.c does)
command.h
- COPROC_STOPPED,COPROC_FOREGROUND: new flags values for coproc
execute_cmd.c
- coproc_setstatus: now takes a full WAIT status word as the second
argument, passed from coproc_pidchk
- coproc_setstatus: use process_exit_status to translate a WAIT into
an int status, doing proper termsig+128 handling
- coproc_getstate: take a WAIT and return the appropriate COPROC_
status flag (DEAD, STOPPED, etc.)
- coproc_setstatus: use coproc_getstate to set cp->c_flags
4/4
---
configure.ac
- changed release status to bash-5.3-alpha
- AC_PROG_GCC_TRADITIONAL: removed, since it no longer is supported
in autoconf-2.72 (which MacPorts upgraded me to)
test.c
- term: made change of 3/25 dependent on the compatibility level
support/config.guess,support/config.sub,support/config.rpath
- new versions, imported from gnulib
+215 -215
View File
@@ -5,45 +5,45 @@ These are installation instructions for Bash.
The simplest way to compile Bash is:
1. 'cd' to the directory containing the source code and type
'./configure' to configure Bash for your system. If you're using
'csh' on an old version of System V, you might need to type 'sh
./configure' instead to prevent 'csh' from trying to execute
'configure' itself.
1. cd to the directory containing the source code and type
./configure to configure Bash for your system. If you're using
csh on an old version of System V, you might need to type sh
./configure instead to prevent csh from trying to execute
configure itself.
Running 'configure' takes some time. While running, it prints
Running configure takes some time. While running, it prints
messages telling which features it is checking for.
2. Type 'make' to compile Bash and build the 'bashbug' bug reporting
2. Type make to compile Bash and build the bashbug bug reporting
script.
3. Optionally, type 'make tests' to run the Bash test suite.
3. Optionally, type make tests to run the Bash test suite.
4. Type 'make install' to install 'bash' and 'bashbug'. This will
4. Type make install to install bash and bashbug. This will
also install the manual pages and Info file, message translation
files, some supplemental documentation, a number of example
loadable builtin commands, and a set of header files for developing
loadable builtins. You may need additional privileges to install
'bash' to your desired destination, so 'sudo make install' might be
bash to your desired destination, so sudo make install might be
required. More information about controlling the locations where
'bash' and other files are installed is below (*note Installation
bash and other files are installed is below (*note Installation
Names::).
The 'configure' shell script attempts to guess correct values for
The configure shell script attempts to guess correct values for
various system-dependent variables used during compilation. It uses
those values to create a 'Makefile' in each directory of the package
(the top directory, the 'builtins', 'doc', 'po', and 'support'
directories, each directory under 'lib', and several others). It also
creates a 'config.h' file containing system-dependent definitions.
Finally, it creates a shell script named 'config.status' that you can
those values to create a Makefile in each directory of the package
(the top directory, the builtins, doc, po, and support
directories, each directory under lib, and several others). It also
creates a config.h file containing system-dependent definitions.
Finally, it creates a shell script named config.status that you can
run in the future to recreate the current configuration, a file
'config.cache' that saves the results of its tests to speed up
reconfiguring, and a file 'config.log' containing compiler output
(useful mainly for debugging 'configure'). If at some point
'config.cache' contains results you don't want to keep, you may remove
config.cache that saves the results of its tests to speed up
reconfiguring, and a file config.log containing compiler output
(useful mainly for debugging configure). If at some point
config.cache contains results you don't want to keep, you may remove
or edit it.
To find out more about the options and arguments that the 'configure'
To find out more about the options and arguments that the configure
script understands, type
bash-4.2$ ./configure --help
@@ -53,8 +53,8 @@ at the Bash prompt in your Bash source directory.
If you want to build Bash in a directory separate from the source
directory - to build for multiple architectures, for example - just use
the full path to the configure script. The following commands will
build Bash in a directory under '/usr/local/build' from the source code
in '/usr/local/src/bash-4.4':
build Bash in a directory under /usr/local/build from the source code
in /usr/local/src/bash-4.4:
mkdir /usr/local/build/bash-4.4
cd /usr/local/build/bash-4.4
@@ -65,32 +65,32 @@ See *note Compiling For Multiple Architectures:: for more information
about building in a directory separate from the source.
If you need to do unusual things to compile Bash, please try to figure
out how 'configure' could check whether or not to do them, and mail
out how configure could check whether or not to do them, and mail
diffs or instructions to <bash-maintainers@gnu.org> so they can be
considered for the next release.
The file 'configure.ac' is used to create 'configure' by a program
called Autoconf. You only need 'configure.ac' if you want to change it
or regenerate 'configure' using a newer version of Autoconf. If you do
The file configure.ac is used to create configure by a program
called Autoconf. You only need configure.ac if you want to change it
or regenerate configure using a newer version of Autoconf. If you do
this, make sure you are using Autoconf version 2.69 or newer.
You can remove the program binaries and object files from the source
code directory by typing 'make clean'. To also remove the files that
'configure' created (so you can compile Bash for a different kind of
computer), type 'make distclean'.
code directory by typing make clean. To also remove the files that
configure created (so you can compile Bash for a different kind of
computer), type make distclean.
Compilers and Options
=====================
Some systems require unusual options for compilation or linking that the
'configure' script does not know about. You can give 'configure'
configure script does not know about. You can give configure
initial values for variables by setting them in the environment. Using
a Bourne-compatible shell, you can do that on the command line like
this:
CC=c89 CFLAGS=-O2 LIBS=-lposix ./configure
On systems that have the 'env' program, you can do it like this:
On systems that have the env program, you can do it like this:
env CPPFLAGS=-I/usr/local/include LDFLAGS=-s ./configure
@@ -101,69 +101,69 @@ Compiling For Multiple Architectures
You can compile Bash for more than one kind of computer at the same
time, by placing the object files for each architecture in their own
directory. To do this, you must use a version of 'make' that supports
the 'VPATH' variable, such as GNU 'make'. 'cd' to the directory where
you want the object files and executables to go and run the 'configure'
directory. To do this, you must use a version of make that supports
the VPATH variable, such as GNU make. cd to the directory where
you want the object files and executables to go and run the configure
script from the source directory (*note Basic Installation::). You may
need to supply the '--srcdir=PATH' argument to tell 'configure' where
the source files are. 'configure' automatically checks for the source
code in the directory that 'configure' is in and in '..'.
need to supply the --srcdir=PATH argument to tell configure where
the source files are. configure automatically checks for the source
code in the directory that configure is in and in '..'.
If you have to use a 'make' that does not support the 'VPATH' variable,
If you have to use a make that does not support the VPATH variable,
you can compile Bash for one architecture at a time in the source code
directory. After you have installed Bash for one architecture, use
'make distclean' before reconfiguring for another architecture.
make distclean before reconfiguring for another architecture.
Alternatively, if your system supports symbolic links, you can use the
'support/mkclone' script to create a build tree which has symbolic links
support/mkclone script to create a build tree which has symbolic links
back to each file in the source directory. Here's an example that
creates a build directory in the current directory from a source
directory '/usr/gnu/src/bash-2.0':
directory /usr/gnu/src/bash-2.0:
bash /usr/gnu/src/bash-2.0/support/mkclone -s /usr/gnu/src/bash-2.0 .
The 'mkclone' script requires Bash, so you must have already built Bash
The mkclone script requires Bash, so you must have already built Bash
for at least one architecture before you can create build directories
for other architectures.
Installation Names
==================
By default, 'make install' will install into '/usr/local/bin',
'/usr/local/man', etc.; that is, the "installation prefix" defaults to
'/usr/local'. You can specify an installation prefix other than
'/usr/local' by giving 'configure' the option '--prefix=PATH', or by
specifying a value for the 'prefix' 'make' variable when running 'make
install' (e.g., 'make install prefix=PATH'). The 'prefix' variable
provides a default for 'exec_prefix' and other variables used when
By default, make install will install into /usr/local/bin,
/usr/local/man, etc.; that is, the installation prefix defaults to
/usr/local. You can specify an installation prefix other than
/usr/local by giving configure the option --prefix=PATH, or by
specifying a value for the prefix make variable when running make
install (e.g., make install prefix=PATH). The prefix variable
provides a default for exec_prefix and other variables used when
installing Bash.
You can specify separate installation prefixes for architecture-specific
files and architecture-independent files. If you give 'configure' the
option '--exec-prefix=PATH', 'make install' will use PATH as the prefix
files and architecture-independent files. If you give configure the
option --exec-prefix=PATH, make install will use PATH as the prefix
for installing programs and libraries. Documentation and other data
files will still use the regular prefix.
If you would like to change the installation locations for a single run,
you can specify these variables as arguments to 'make': 'make install
exec_prefix=/' will install 'bash' and 'bashbug' into '/bin' instead of
the default '/usr/local/bin'.
you can specify these variables as arguments to make: make install
exec_prefix=/ will install bash and bashbug into /bin instead of
the default /usr/local/bin.
If you want to see the files Bash will install and where it will install
them without changing anything on your system, specify the variable
'DESTDIR' as an argument to 'make'. Its value should be the absolute
DESTDIR as an argument to make. Its value should be the absolute
directory path you'd like to use as the root of your sample installation
tree. For example,
mkdir /fs1/bash-install
make install DESTDIR=/fs1/bash-install
will install 'bash' into '/fs1/bash-install/usr/local/bin/bash', the
will install bash into /fs1/bash-install/usr/local/bin/bash, the
documentation into directories within
'/fs1/bash-install/usr/local/share', the example loadable builtins into
'/fs1/bash-install/usr/local/lib/bash', and so on. You can use the
usual 'exec_prefix' and 'prefix' variables to alter the directory paths
beneath the value of 'DESTDIR'.
/fs1/bash-install/usr/local/share, the example loadable builtins into
/fs1/bash-install/usr/local/lib/bash, and so on. You can use the
usual exec_prefix and prefix variables to alter the directory paths
beneath the value of DESTDIR.
The GNU Makefile standards provide a more complete description of these
variables and their effects.
@@ -171,325 +171,325 @@ variables and their effects.
Specifying the System Type
==========================
There may be some features 'configure' can not figure out automatically,
There may be some features configure can not figure out automatically,
but needs to determine by the type of host Bash will run on. Usually
'configure' can figure that out, but if it prints a message saying it
can not guess the host type, give it the '--host=TYPE' option. 'TYPE'
can either be a short name for the system type, such as 'sun4', or a
canonical name with three fields: 'CPU-COMPANY-SYSTEM' (e.g.,
'i386-unknown-freebsd4.2').
configure can figure that out, but if it prints a message saying it
can not guess the host type, give it the --host=TYPE option. TYPE
can either be a short name for the system type, such as sun4, or a
canonical name with three fields: CPU-COMPANY-SYSTEM (e.g.,
i386-unknown-freebsd4.2).
See the file 'support/config.sub' for the possible values of each field.
See the file support/config.sub for the possible values of each field.
Sharing Defaults
================
If you want to set default values for 'configure' scripts to share, you
can create a site shell script called 'config.site' that gives default
values for variables like 'CC', 'cache_file', and 'prefix'. 'configure'
looks for 'PREFIX/share/config.site' if it exists, then
'PREFIX/etc/config.site' if it exists. Or, you can set the
'CONFIG_SITE' environment variable to the location of the site script.
A warning: the Bash 'configure' looks for a site script, but not all
'configure' scripts do.
If you want to set default values for configure scripts to share, you
can create a site shell script called config.site that gives default
values for variables like CC, cache_file, and prefix. configure
looks for PREFIX/share/config.site if it exists, then
PREFIX/etc/config.site if it exists. Or, you can set the
CONFIG_SITE environment variable to the location of the site script.
A warning: the Bash configure looks for a site script, but not all
configure scripts do.
Operation Controls
==================
'configure' recognizes the following options to control how it operates.
configure recognizes the following options to control how it operates.
'--cache-file=FILE'
--cache-file=FILE
Use and save the results of the tests in FILE instead of
'./config.cache'. Set FILE to '/dev/null' to disable caching, for
debugging 'configure'.
./config.cache. Set FILE to /dev/null to disable caching, for
debugging configure.
'--help'
Print a summary of the options to 'configure', and exit.
--help
Print a summary of the options to configure, and exit.
'--quiet'
'--silent'
'-q'
--quiet
--silent
-q
Do not print messages saying which checks are being made.
'--srcdir=DIR'
--srcdir=DIR
Look for the Bash source code in directory DIR. Usually
'configure' can determine that directory automatically.
configure can determine that directory automatically.
'--version'
Print the version of Autoconf used to generate the 'configure'
--version
Print the version of Autoconf used to generate the configure
script, and exit.
'configure' also accepts some other, not widely used, boilerplate
options. 'configure --help' prints the complete list.
configure also accepts some other, not widely used, boilerplate
options. configure --help prints the complete list.
Optional Features
=================
The Bash 'configure' has a number of '--enable-FEATURE' options, where
The Bash configure has a number of --enable-FEATURE options, where
FEATURE indicates an optional part of Bash. There are also several
'--with-PACKAGE' options, where PACKAGE is something like 'bash-malloc'
or 'purify'. To turn off the default use of a package, use
'--without-PACKAGE'. To configure Bash without a feature that is
enabled by default, use '--disable-FEATURE'.
--with-PACKAGE options, where PACKAGE is something like bash-malloc
or purify. To turn off the default use of a package, use
--without-PACKAGE. To configure Bash without a feature that is
enabled by default, use --disable-FEATURE.
Here is a complete list of the '--enable-' and '--with-' options that
the Bash 'configure' recognizes.
Here is a complete list of the --enable- and --with- options that
the Bash configure recognizes.
'--with-afs'
--with-afs
Define if you are using the Andrew File System from Transarc.
'--with-bash-malloc'
Use the Bash version of 'malloc' in the directory 'lib/malloc'.
This is not the same 'malloc' that appears in GNU libc, but an
older version originally derived from the 4.2 BSD 'malloc'. This
'malloc' is very fast, but wastes some space on each allocation.
This option is enabled by default. The 'NOTES' file contains a
--with-bash-malloc
Use the Bash version of malloc in the directory lib/malloc.
This is not the same malloc that appears in GNU libc, but an
older version originally derived from the 4.2 BSD malloc. This
malloc is very fast, but wastes some space on each allocation.
This option is enabled by default. The NOTES file contains a
list of systems for which this should be turned off, and
'configure' disables this option automatically for a number of
configure disables this option automatically for a number of
systems.
'--with-curses'
--with-curses
Use the curses library instead of the termcap library. This should
be supplied if your system has an inadequate or incomplete termcap
database.
'--with-gnu-malloc'
A synonym for '--with-bash-malloc'.
--with-gnu-malloc
A synonym for --with-bash-malloc.
'--with-installed-readline[=PREFIX]'
--with-installed-readline[=PREFIX]
Define this to make Bash link with a locally-installed version of
Readline rather than the version in 'lib/readline'. This works
only with Readline 5.0 and later versions. If PREFIX is 'yes' or
not supplied, 'configure' uses the values of the make variables
'includedir' and 'libdir', which are subdirectories of 'prefix' by
Readline rather than the version in lib/readline. This works
only with Readline 5.0 and later versions. If PREFIX is yes or
not supplied, configure uses the values of the make variables
includedir and libdir, which are subdirectories of prefix by
default, to find the installed version of Readline if it is not in
the standard system include and library directories. If PREFIX is
'no', Bash links with the version in 'lib/readline'. If PREFIX is
set to any other value, 'configure' treats it as a directory
no, Bash links with the version in lib/readline. If PREFIX is
set to any other value, configure treats it as a directory
pathname and looks for the installed version of Readline in
subdirectories of that directory (include files in PREFIX/'include'
and the library in PREFIX/'lib').
subdirectories of that directory (include files in PREFIX/include
and the library in PREFIX/lib).
'--with-libintl-prefix[=PREFIX]'
--with-libintl-prefix[=PREFIX]
Define this to make Bash link with a locally-installed version of
the libintl library instead of the version in 'lib/intl'.
the libintl library instead of the version in lib/intl.
'--with-libiconv-prefix[=PREFIX]'
--with-libiconv-prefix[=PREFIX]
Define this to make Bash look for libiconv in PREFIX instead of the
standard system locations. There is no version included with Bash.
'--enable-minimal-config'
--enable-minimal-config
This produces a shell with minimal features, close to the
historical Bourne shell.
There are several '--enable-' options that alter how Bash is compiled,
There are several --enable- options that alter how Bash is compiled,
linked, and installed, rather than changing run-time features.
'--enable-largefile'
--enable-largefile
Enable support for large files
(http://www.unix.org/version2/whatsnew/lfs20mar.html) if the
operating system requires special compiler options to build
programs which can access large files. This is enabled by default,
if the operating system provides large file support.
'--enable-profiling'
--enable-profiling
This builds a Bash binary that produces profiling information to be
processed by 'gprof' each time it is executed.
processed by gprof each time it is executed.
'--enable-separate-helpfiles'
Use external files for the documentation displayed by the 'help'
--enable-separate-helpfiles
Use external files for the documentation displayed by the help
builtin instead of storing the text internally.
'--enable-static-link'
This causes Bash to be linked statically, if 'gcc' is being used.
--enable-static-link
This causes Bash to be linked statically, if gcc is being used.
This could be used to build a version to use as root's shell.
The 'minimal-config' option can be used to disable all of the following
The minimal-config option can be used to disable all of the following
options, but it is processed first, so individual options may be enabled
using 'enable-FEATURE'.
using enable-FEATURE.
All of the following options except for 'alt-array-implementation',
'disabled-builtins', 'direxpand-default', 'strict-posix-default', and
'xpg-echo-default' are enabled by default, unless the operating system
All of the following options except for alt-array-implementation,
disabled-builtins, direxpand-default, strict-posix-default, and
xpg-echo-default are enabled by default, unless the operating system
does not provide the necessary support.
'--enable-alias'
Allow alias expansion and include the 'alias' and 'unalias'
--enable-alias
Allow alias expansion and include the alias and unalias
builtins (*note Aliases::).
'--enable-alt-array-implementation'
--enable-alt-array-implementation
This builds Bash using an alternate implementation of arrays (*note
Arrays::) that provides faster access at the expense of using more
memory (sometimes many times more, depending on how sparse an array
is).
'--enable-arith-for-command'
Include support for the alternate form of the 'for' command that
behaves like the C language 'for' statement (*note Looping
--enable-arith-for-command
Include support for the alternate form of the for command that
behaves like the C language for statement (*note Looping
Constructs::).
'--enable-array-variables'
--enable-array-variables
Include support for one-dimensional array shell variables (*note
Arrays::).
'--enable-bang-history'
Include support for 'csh'-like history substitution (*note History
--enable-bang-history
Include support for csh-like history substitution (*note History
Interaction::).
'--enable-brace-expansion'
Include 'csh'-like brace expansion ( 'b{a,b}c' ==> 'bac bbc' ).
See *note Brace Expansion::, for a complete description.
--enable-brace-expansion
Include csh-like brace expansion ( b{a,b}cbac bbc ). See
*note Brace Expansion::, for a complete description.
'--enable-casemod-attributes'
Include support for case-modifying attributes in the 'declare'
builtin and assignment statements. Variables with the 'uppercase'
--enable-casemod-attributes
Include support for case-modifying attributes in the declare
builtin and assignment statements. Variables with the uppercase
attribute, for example, will have their values converted to
uppercase upon assignment.
'--enable-casemod-expansion'
--enable-casemod-expansion
Include support for case-modifying word expansions.
'--enable-command-timing'
Include support for recognizing 'time' as a reserved word and for
displaying timing statistics for the pipeline following 'time'
--enable-command-timing
Include support for recognizing time as a reserved word and for
displaying timing statistics for the pipeline following time
(*note Pipelines::). This allows pipelines as well as shell
builtins and functions to be timed.
'--enable-cond-command'
Include support for the '[[' conditional command. (*note
--enable-cond-command
Include support for the [[ conditional command. (*note
Conditional Constructs::).
'--enable-cond-regexp'
--enable-cond-regexp
Include support for matching POSIX regular expressions using the
'=~' binary operator in the '[[' conditional command. (*note
=~ binary operator in the [[ conditional command. (*note
Conditional Constructs::).
'--enable-coprocesses'
Include support for coprocesses and the 'coproc' reserved word
--enable-coprocesses
Include support for coprocesses and the coproc reserved word
(*note Pipelines::).
'--enable-debugger'
--enable-debugger
Include support for the Bash debugger (distributed separately).
'--enable-dev-fd-stat-broken'
If calling 'stat' on /dev/fd/N returns different results than
calling 'fstat' on file descriptor N, supply this option to enable
--enable-dev-fd-stat-broken
If calling stat on /dev/fd/N returns different results than
calling fstat on file descriptor N, supply this option to enable
a workaround. This has implications for conditional commands that
test file attributes.
'--enable-direxpand-default'
Cause the 'direxpand' shell option (*note The Shopt Builtin::) to
--enable-direxpand-default
Cause the direxpand shell option (*note The Shopt Builtin::) to
be enabled by default when the shell starts. It is normally
disabled by default.
'--enable-directory-stack'
Include support for a 'csh'-like directory stack and the 'pushd',
'popd', and 'dirs' builtins (*note The Directory Stack::).
--enable-directory-stack
Include support for a csh-like directory stack and the pushd,
popd, and dirs builtins (*note The Directory Stack::).
'--enable-disabled-builtins'
Allow builtin commands to be invoked via 'builtin xxx' even after
'xxx' has been disabled using 'enable -n xxx'. See *note Bash
Builtins::, for details of the 'builtin' and 'enable' builtin
--enable-disabled-builtins
Allow builtin commands to be invoked via builtin xxx even after
xxx has been disabled using enable -n xxx. See *note Bash
Builtins::, for details of the builtin and enable builtin
commands.
'--enable-dparen-arithmetic'
Include support for the '((...))' command (*note Conditional
--enable-dparen-arithmetic
Include support for the ((...)) command (*note Conditional
Constructs::).
'--enable-extended-glob'
--enable-extended-glob
Include support for the extended pattern matching features
described above under *note Pattern Matching::.
'--enable-extended-glob-default'
Set the default value of the 'extglob' shell option described above
--enable-extended-glob-default
Set the default value of the extglob shell option described above
under *note The Shopt Builtin:: to be enabled.
'--enable-function-import'
--enable-function-import
Include support for importing function definitions exported by
another instance of the shell from the environment. This option is
enabled by default.
'--enable-glob-asciirange-default'
Set the default value of the 'globasciiranges' shell option
--enable-glob-asciiranges-default
Set the default value of the globasciiranges shell option
described above under *note The Shopt Builtin:: to be enabled.
This controls the behavior of character ranges when used in pattern
matching bracket expressions.
'--enable-help-builtin'
Include the 'help' builtin, which displays help on shell builtins
--enable-help-builtin
Include the help builtin, which displays help on shell builtins
and variables (*note Bash Builtins::).
'--enable-history'
Include command history and the 'fc' and 'history' builtin commands
--enable-history
Include command history and the fc and history builtin commands
(*note Bash History Facilities::).
'--enable-job-control'
--enable-job-control
This enables the job control features (*note Job Control::), if the
operating system supports them.
'--enable-multibyte'
--enable-multibyte
This enables support for multibyte characters if the operating
system provides the necessary support.
'--enable-net-redirections'
--enable-net-redirections
This enables the special handling of filenames of the form
'/dev/tcp/HOST/PORT' and '/dev/udp/HOST/PORT' when used in
/dev/tcp/HOST/PORT and /dev/udp/HOST/PORT when used in
redirections (*note Redirections::).
'--enable-process-substitution'
--enable-process-substitution
This enables process substitution (*note Process Substitution::) if
the operating system provides the necessary support.
'--enable-progcomp'
--enable-progcomp
Enable the programmable completion facilities (*note Programmable
Completion::). If Readline is not enabled, this option has no
effect.
'--enable-prompt-string-decoding'
--enable-prompt-string-decoding
Turn on the interpretation of a number of backslash-escaped
characters in the '$PS0', '$PS1', '$PS2', and '$PS4' prompt
characters in the $PS0, $PS1, $PS2, and $PS4 prompt
strings. See *note Controlling the Prompt::, for a complete list
of prompt string escape sequences.
'--enable-readline'
--enable-readline
Include support for command-line editing and history with the Bash
version of the Readline library (*note Command Line Editing::).
'--enable-restricted'
Include support for a "restricted shell". If this is enabled,
Bash, when called as 'rbash', enters a restricted mode. See *note
--enable-restricted
Include support for a restricted shell. If this is enabled,
Bash, when called as rbash, enters a restricted mode. See *note
The Restricted Shell::, for a description of restricted mode.
'--enable-select'
Include the 'select' compound command, which allows the generation
--enable-select
Include the select compound command, which allows the generation
of simple menus (*note Conditional Constructs::).
'--enable-single-help-strings'
Store the text displayed by the 'help' builtin as a single string
--enable-single-help-strings
Store the text displayed by the help builtin as a single string
for each help topic. This aids in translating the text to
different languages. You may need to disable this if your compiler
cannot handle very long string literals.
'--enable-strict-posix-default'
--enable-strict-posix-default
Make Bash POSIX-conformant by default (*note Bash POSIX Mode::).
'--enable-translatable-strings'
Enable support for '$"STRING"' translatable strings (*note Locale
--enable-translatable-strings
Enable support for $"STRING" translatable strings (*note Locale
Translation::).
'--enable-usg-echo-default'
A synonym for '--enable-xpg-echo-default'.
--enable-usg-echo-default
A synonym for --enable-xpg-echo-default.
'--enable-xpg-echo-default'
Make the 'echo' builtin expand backslash-escaped characters by
default, without requiring the '-e' option. This sets the default
value of the 'xpg_echo' shell option to 'on', which makes the Bash
'echo' behave more like the version specified in the Single Unix
--enable-xpg-echo-default
Make the echo builtin expand backslash-escaped characters by
default, without requiring the -e option. This sets the default
value of the xpg_echo shell option to on, which makes the Bash
echo behave more like the version specified in the Single Unix
Specification, version 3. *Note Bash Builtins::, for a description
of the escape sequences that 'echo' recognizes.
of the escape sequences that echo recognizes.
The file 'config-top.h' contains C Preprocessor '#define' statements for
options which are not settable from 'configure'. Some of these are not
The file config-top.h contains C Preprocessor #define statements for
options which are not settable from configure. Some of these are not
meant to be changed; beware of the consequences if you do. Read the
comments associated with each definition for more information about its
effect.
+132
View File
@@ -1,3 +1,135 @@
This is a terse description of the new features added to bash-5.3 since
the release of bash-5.2. As always, the manual page (doc/bash.1) is
the place to look for complete descriptions.
1. New Features in Bash
a. When checking whether a script file argument is a binary file, check the
first two lines of a script if the first line begins with `#!'.
b. Bash does a better job of preserving user-supplied quotes around a word
completion, instead of requoting it.
c. Bash reports the starting line number in an error message about an
unterminated compound command like `if' without a `fi'.
d. Implement the POSIX requirement that running the `jobs' builtin removes
jobs from the jobs list.
f. Call bash signal handlers while executing programmable completion commands,
instead of readline's.
g. Print an error message if a regular expression used with [[ fails to compile.
h. The `umask' builtin now has additional features for full POSIX conformance.
i. `type -a -P' reports both hashed pathnames and the result of a $PATH search.
j. `trap' has a new -P option that prints the trap action associated with each
signal argument.
k. The `command' builtin preceding a declaration builtin (e.g., `declare')
preserves the special asisgnment statement parsing for the declation
builtin. This is a new POSIX requirement.
l. `printf' uses the `alternate form' for %q and %Q to force single quoting.
m. `printf' now interprets %ls (%S) and %lc (%C)nas referring to wide strings
and characters, respectively, when in a multibyte locale.
n. The shell can be compiled with a different default value for the
patsub_replacement option.
o. Check for window size changes during trap commands, `bind -x' commands,
and programmable completion.
p. Treat a NULL value for $PATH as equivalent to ".".
p. New loadable builtins: kv, strptime
q. GLOBSORT: new variable to specify how to sort the results of pathname
expansion (name, size, blocks, mtime, atime, ctime, none) in ascending
or descending order.
r. `compgen' has a new option: -V varname. If supplied, it stores the generated
completions into VARNAME instead of printing them on stdout.
s. New form of command substitution: ${ command; } or ${|command;} to capture
the output of COMMAND without forking a child process and using pipes.
t. array_expand_once: new shopt option, replaces assoc_expand_once
u. complete/compopt new option: fullquote; sets rl_full_quoting_desired so all
possible completions are quoted as if they were filenames.
v. Command timing now allows precisions up to 6 digits instead of 3 in
$TIMEFORMAT.
w. BASH_MONOSECONDS: new dynamic variable that returns the value of the
system's monotonic clock, if one is available.
x. BASH_TRAPSIG: new variable, set to the numeric signal number of the trap
being executed while it's running.
y. The checkwinsize option can be used in subshell commands started from
interactive shells.
z. In posix mode, the test command < and > binary primaries compare strings
using the current locale.
aa. bind -x allows new key binding syntax: separate the key sequence and the
command string with whitespace, but require the command string to be
double-quoted if this is used. This allows different quoting options for
the command string.
bb. Print commands bound to key sequences using `bind -x' with the new key
binding syntax it allows.
cc. `read' has a new `-E' option to use readline but with the default bash
completion (including programmable completion).
dd. New bindable readline command name: `bash-vi-complete'.
ee. New test builtin behavior when parsing a parenthesized subexpression and
test was given more than 4 arguments: scan forward for a closing paren and
call posixtest() if there are 4 or fewer arguments between the parentheses.
Added for compatibility with coreutils test, dependent on the shell
compatibility level. Such expressions remain ambiguous.
2. New Features in Readline
a. Output a newline if there is no prompt and readline reads an empty line.
b. The history library falls back to stdio when writing the history list if
mmap fails.
c. New bindable variable `search-ignore-case', causes readline to perform
case-insensitive incremental and non-incremental history searches.
d. rl_full_quoting_desired: new application-settable variable, causes all
completions to be quoted as if they were filenames.
e. rl_macro_display_hook: new application-settable function pointer, used if
the application wants to print macro values itself instead of letting
readline do it
f. rl_reparse_colors: new application-callable function, reparses $LS_COLORS
(presumably after the user changes it)
g. rl_completion_rewrite_hook: new application-settable function pointer,
called to modify the word being completed before comparing it against
pathnames from the file system.
h. execute-named-command: a new bindable command that reads the name of a
readline command from the standard input and executes it. Bound to M-x
in emacs mode by default.
i. Incremental and non-incremental searches now allow ^V/^Q (or, in the former
case, anything bound to quoted-insert) to quote characters in the search
string.
-------------------------------------------------------------------------------
This is a terse description of the new features added to bash-5.2 since
the release of bash-5.1. As always, the manual page (doc/bash.1) is
the place to look for complete descriptions.
+129
View File
@@ -0,0 +1,129 @@
This is a terse description of the new features added to bash-5.3 since
the release of bash-5.2. As always, the manual page (doc/bash.1) is
the place to look for complete descriptions.
1. New Features in Bash
a. When checking whether a script file argument is a binary file, check the
first two lines of a script if the first line begins with `#!'.
b. Bash does a better job of preserving user-supplied quotes around a word
completion, instead of requoting it.
c. Bash reports the starting line number in an error message about an
unterminated compound command like `if' without a `fi'.
d. Implement the POSIX requirement that running the `jobs' builtin removes
jobs from the jobs list.
f. Call bash signal handlers while executing programmable completion commands,
instead of readline's.
g. Print an error message if a regular expression used with [[ fails to compile.
h. The `umask' builtin now has additional features for full POSIX conformance.
i. `type -a -P' reports both hashed pathnames and the result of a $PATH search.
j. `trap' has a new -P option that prints the trap action associated with each
signal argument.
k. The `command' builtin preceding a declaration builtin (e.g., `declare')
preserves the special asisgnment statement parsing for the declation
builtin. This is a new POSIX requirement.
l. `printf' uses the `alternate form' for %q and %Q to force single quoting.
m. `printf' now interprets %ls (%S) and %lc (%C)nas referring to wide strings
and characters, respectively, when in a multibyte locale.
n. The shell can be compiled with a different default value for the
patsub_replacement option.
o. Check for window size changes during trap commands, `bind -x' commands,
and programmable completion.
p. Treat a NULL value for $PATH as equivalent to ".".
p. New loadable builtins: kv, strptime
q. GLOBSORT: new variable to specify how to sort the results of pathname
expansion (name, size, blocks, mtime, atime, ctime, none) in ascending
or descending order.
r. `compgen' has a new option: -V varname. If supplied, it stores the generated
completions into VARNAME instead of printing them on stdout.
s. New form of command substitution: ${ command; } or ${|command;} to capture
the output of COMMAND without forking a child process and using pipes.
t. array_expand_once: new shopt option, replaces assoc_expand_once
u. complete/compopt new option: fullquote; sets rl_full_quoting_desired so all
possible completions are quoted as if they were filenames.
v. Command timing now allows precisions up to 6 digits instead of 3 in
$TIMEFORMAT.
w. BASH_MONOSECONDS: new dynamic variable that returns the value of the
system's monotonic clock, if one is available.
x. BASH_TRAPSIG: new variable, set to the numeric signal number of the trap
being executed while it's running.
y. The checkwinsize option can be used in subshell commands started from
interactive shells.
z. In posix mode, the test command < and > binary primaries compare strings
using the current locale.
aa. bind -x allows new key binding syntax: separate the key sequence and the
command string with whitespace, but require the command string to be
double-quoted if this is used. This allows different quoting options for
the command string.
bb. Print commands bound to key sequences using `bind -x' with the new key
binding syntax it allows.
cc. `read' has a new `-E' option to use readline but with the default bash
completion (including programmable completion).
dd. New bindable readline command name: `bash-vi-complete'.
ee. New test builtin behavior when parsing a parenthesized subexpression and
test was given more than 4 arguments: scan forward for a closing paren and
call posixtest() if there are 4 or fewer arguments between the parentheses.
Added for compatibility with coreutils test, dependent on the shell
compatibility level. Such expressions remain ambiguous.
2. New Features in Readline
a. Output a newline if there is no prompt and readline reads an empty line.
b. The history library falls back to stdio when writing the history list if
mmap fails.
c. New bindable variable `search-ignore-case', causes readline to perform
case-insensitive incremental and non-incremental history searches.
d. rl_full_quoting_desired: new application-settable variable, causes all
completions to be quoted as if they were filenames.
e. rl_macro_display_hook: new application-settable function pointer, used if
the application wants to print macro values itself instead of letting
readline do it
f. rl_reparse_colors: new application-callable function, reparses $LS_COLORS
(presumably after the user changes it)
g. rl_completion_rewrite_hook: new application-settable function pointer,
called to modify the word being completed before comparing it against
pathnames from the file system.
h. execute-named-command: a new bindable command that reads the name of a
readline command from the standard input and executes it. Bound to M-x
in emacs mode by default.
i. Incremental and non-incremental searches now allow ^V/^Q (or, in the former
case, anything bound to quoted-insert) to quote characters in the search
string.
+111 -110
View File
@@ -31,10 +31,10 @@ variable expansion, and quoting.
The special builtins, which must be implemented as part of the shell to
provide the desired functionality, are specified as being part of the
shell; examples of these are 'eval' and 'export'. Other utilities
shell; examples of these are eval and export. Other utilities
appear in the sections of POSIX not devoted to the shell which are
commonly (and in some cases must be) implemented as builtin commands,
such as 'read' and 'test'. POSIX also specifies aspects of the shell's
such as read and test. POSIX also specifies aspects of the shell's
interactive behavior, including job control and command line editing.
Only vi-style line editing commands have been standardized; emacs
editing commands were left out due to objections.
@@ -44,35 +44,35 @@ editing commands were left out due to objections.
Although Bash is an implementation of the POSIX shell specification,
there are areas where the Bash default behavior differs from the
specification. The Bash "posix mode" changes the Bash behavior in these
specification. The Bash posix mode changes the Bash behavior in these
areas so that it conforms to the standard more closely.
Starting Bash with the '--posix' command-line option or executing 'set
-o posix' while Bash is running will cause Bash to conform more closely
Starting Bash with the --posix command-line option or executing set
-o posix while Bash is running will cause Bash to conform more closely
to the POSIX standard by changing the behavior to match that specified
by POSIX in areas where the Bash default differs.
When invoked as 'sh', Bash enters POSIX mode after reading the startup
When invoked as sh, Bash enters POSIX mode after reading the startup
files.
The following list is what's changed when 'POSIX mode' is in effect:
1. Bash ensures that the 'POSIXLY_CORRECT' variable is set.
1. Bash ensures that the POSIXLY_CORRECT variable is set.
2. When a command in the hash table no longer exists, Bash will
re-search '$PATH' to find the new location. This is also available
with 'shopt -s checkhash'.
re-search $PATH to find the new location. This is also available
with shopt -s checkhash.
3. Bash will not insert a command without the execute bit set into the
command hash table, even if it returns it as a (last-ditch) result
from a '$PATH' search.
from a $PATH search.
4. The message printed by the job control code and builtins when a job
exits with a non-zero status is 'Done(status)'.
5. The message printed by the job control code and builtins when a job
is stopped is 'Stopped(SIGNAME)', where SIGNAME is, for example,
'SIGTSTP'.
SIGTSTP.
6. Alias expansion is always enabled, even in non-interactive shells.
@@ -86,19 +86,19 @@ The following list is what's changed when 'POSIX mode' is in effect:
the command substitution is initially parsed (e.g., as part of a
function definition).
9. The POSIX 'PS1' and 'PS2' expansions of '!' to the history number
and '!!' to '!' are enabled, and parameter expansion is performed
on the values of 'PS1' and 'PS2' regardless of the setting of the
'promptvars' option.
9. The POSIX PS1 and PS2 expansions of ! to the history number
and !! to ! are enabled, and parameter expansion is performed
on the values of PS1 and PS2 regardless of the setting of the
promptvars option.
10. The POSIX startup files are executed ('$ENV') rather than the
10. The POSIX startup files are executed ($ENV) rather than the
normal Bash files.
11. Tilde expansion is only performed on assignments preceding a
command name, rather than on all assignment statements on the line.
12. The default history file is '~/.sh_history' (this is the default
value the shell assigns to '$HISTFILE').
12. The default history file is ~/.sh_history (this is the default
value the shell assigns to $HISTFILE).
13. Redirection operators do not perform filename expansion on the
word in the redirection unless the shell is interactive.
@@ -106,7 +106,7 @@ The following list is what's changed when 'POSIX mode' is in effect:
14. Redirection operators do not perform word splitting on the word in
the redirection.
15. Function names must be valid shell 'name's. That is, they may not
15. Function names must be valid shell names. That is, they may not
contain characters other than letters, digits, and underscores, and
may not start with a digit. Declaring a function with an invalid
name causes a fatal syntax error in non-interactive shells.
@@ -119,19 +119,19 @@ The following list is what's changed when 'POSIX mode' is in effect:
whose name contains one or more slashes.
18. POSIX special builtins are found before shell functions during
command lookup, including output printed by the 'type' and
'command' builtins.
command lookup, including output printed by the type and
command builtins.
19. When printing shell function definitions (e.g., by 'type'), Bash
does not print the 'function' keyword.
19. When printing shell function definitions (e.g., by type), Bash
does not print the function keyword.
20. Literal tildes that appear as the first character in elements of
the 'PATH' variable are not expanded as described above under *note
the PATH variable are not expanded as described above under *note
Tilde Expansion::.
21. The 'time' reserved word may be used by itself as a command. When
21. The time reserved word may be used by itself as a command. When
used in this way, it displays timing statistics for the shell and
its completed children. The 'TIMEFORMAT' variable controls the
its completed children. The TIMEFORMAT variable controls the
format of the timing information.
22. When parsing and expanding a ${...} expansion that appears within
@@ -140,11 +140,11 @@ The following list is what's changed when 'POSIX mode' is in effect:
the operator is one of those defined to perform pattern removal.
In this case, they do not have to appear as matched pairs.
23. The parser does not recognize 'time' as a reserved word if the
next token begins with a '-'.
23. The parser does not recognize time as a reserved word if the
next token begins with a -.
24. The '!' character does not introduce history expansion within a
double-quoted string, even if the 'histexpand' option is enabled.
24. The ! character does not introduce history expansion within a
double-quoted string, even if the histexpand option is enabled.
25. If a POSIX special builtin returns an error status, a
non-interactive shell exits. The fatal errors are those listed in
@@ -152,13 +152,13 @@ The following list is what's changed when 'POSIX mode' is in effect:
options, redirection errors, variable assignment errors for
assignments preceding the command name, and so on.
26. The 'unset' builtin with the '-v' option specified returns a fatal
error if it attempts to unset a 'readonly' or 'non-unsettable'
26. The unset builtin with the -v option specified returns a fatal
error if it attempts to unset a readonly or non-unsettable
variable, or encounters a variable name argument that is an invalid
identifier, which causes a non-interactive shell to exit.
27. When asked to unset a variable that appears in an assignment
statement preceding the command, the 'unset' builtin attempts to
statement preceding the command, the unset builtin attempts to
unset a variable of the same name in the current or previous scope
as well. This implements the required "if an assigned variable is
further modified by the utility, the modifications made by the
@@ -178,11 +178,11 @@ The following list is what's changed when 'POSIX mode' is in effect:
occurred").
30. A non-interactive shell exits with an error status if the
iteration variable in a 'for' statement or the selection variable
in a 'select' statement is a readonly variable or has an invalid
iteration variable in a for statement or the selection variable
in a select statement is a readonly variable or has an invalid
name.
31. Non-interactive shells exit if FILENAME in '.' FILENAME is not
31. Non-interactive shells exit if FILENAME in . FILENAME is not
found.
32. Non-interactive shells exit if a syntax error in an arithmetic
@@ -191,151 +191,152 @@ The following list is what's changed when 'POSIX mode' is in effect:
33. Non-interactive shells exit if a parameter expansion error occurs.
34. Non-interactive shells exit if there is a syntax error in a script
read with the '.' or 'source' builtins, or in a string processed by
the 'eval' builtin.
read with the . or source builtins, or in a string processed by
the eval builtin.
35. While variable indirection is available, it may not be applied to
the '#' and '?' special parameters.
the # and ? special parameters.
36. Expanding the '*' special parameter in a pattern context where the
expansion is double-quoted does not treat the '$*' as if it were
36. Expanding the * special parameter in a pattern context where the
expansion is double-quoted does not treat the $* as if it were
double-quoted.
37. Assignment statements preceding POSIX special builtins persist in
the shell environment after the builtin completes.
38. The 'command' builtin does not prevent builtins that take
38. The command builtin does not prevent builtins that take
assignment statements as arguments from expanding them as
assignment statements; when not in POSIX mode, assignment builtins
lose their assignment statement expansion properties when preceded
by 'command'.
by command.
39. The 'bg' builtin uses the required format to describe each job
39. The bg builtin uses the required format to describe each job
placed in the background, which does not include an indication of
whether the job is the current or previous job.
40. The output of 'kill -l' prints all the signal names on a single
line, separated by spaces, without the 'SIG' prefix.
40. The output of kill -l prints all the signal names on a single
line, separated by spaces, without the SIG prefix.
41. The 'kill' builtin does not accept signal names with a 'SIG'
41. The kill builtin does not accept signal names with a SIG
prefix.
42. The 'export' and 'readonly' builtin commands display their output
42. The export and readonly builtin commands display their output
in the format required by POSIX.
43. If the 'export' and 'readonly' builtin commands get an argument
43. If the export and readonly builtin commands get an argument
that is not a valid identifier, and they are not operating on shell
functions, they return an error. This will cause a non-interactive
shell to exit because these are special builtins.
44. The 'trap' builtin displays signal names without the leading
'SIG'.
44. The trap builtin displays signal names without the leading
SIG.
45. The 'trap' builtin doesn't check the first argument for a possible
45. The trap builtin doesn't check the first argument for a possible
signal specification and revert the signal handling to the original
disposition if it is, unless that argument consists solely of
digits and is a valid signal number. If users want to reset the
handler for a given signal to the original disposition, they should
use '-' as the first argument.
use - as the first argument.
46. 'trap -p' without arguments displays signals whose dispositions
46. trap -p without arguments displays signals whose dispositions
are set to SIG_DFL and those that were ignored when the shell
started, not just trapped signals.
47. The '.' and 'source' builtins do not search the current directory
for the filename argument if it is not found by searching 'PATH'.
47. The . and source builtins do not search the current directory
for the filename argument if it is not found by searching PATH.
48. Enabling POSIX mode has the effect of setting the
'inherit_errexit' option, so subshells spawned to execute command
substitutions inherit the value of the '-e' option from the parent
shell. When the 'inherit_errexit' option is not enabled, Bash
clears the '-e' option in such subshells.
inherit_errexit option, so subshells spawned to execute command
substitutions inherit the value of the -e option from the parent
shell. When the inherit_errexit option is not enabled, Bash
clears the -e option in such subshells.
49. Enabling POSIX mode has the effect of setting the 'shift_verbose'
option, so numeric arguments to 'shift' that exceed the number of
49. Enabling POSIX mode has the effect of setting the shift_verbose
option, so numeric arguments to shift that exceed the number of
positional parameters will result in an error message.
50. When the 'alias' builtin displays alias definitions, it does not
display them with a leading 'alias ' unless the '-p' option is
50. When the alias builtin displays alias definitions, it does not
display them with a leading alias unless the -p option is
supplied.
51. When the 'set' builtin is invoked without options, it does not
51. When the set builtin is invoked without options, it does not
display shell function names and definitions.
52. When the 'set' builtin is invoked without options, it displays
52. When the set builtin is invoked without options, it displays
variable values without quotes, unless they contain shell
metacharacters, even if the result contains nonprinting characters.
53. When the 'cd' builtin is invoked in logical mode, and the pathname
constructed from '$PWD' and the directory name supplied as an
argument does not refer to an existing directory, 'cd' will fail
53. When the cd builtin is invoked in logical mode, and the pathname
constructed from $PWD and the directory name supplied as an
argument does not refer to an existing directory, cd will fail
instead of falling back to physical mode.
54. When the 'cd' builtin cannot change a directory because the length
of the pathname constructed from '$PWD' and the directory name
supplied as an argument exceeds 'PATH_MAX' when all symbolic links
are expanded, 'cd' will fail instead of attempting to use only the
supplied directory name.
54. When the cd builtin cannot change a directory because the length
of the pathname constructed from $PWD and the directory name
supplied as an argument exceeds PATH_MAX when canonicalized, cd
will attempt to use the supplied directory name.
55. The 'pwd' builtin verifies that the value it prints is the same as
55. The pwd builtin verifies that the value it prints is the same as
the current directory, even if it is not asked to check the file
system with the '-P' option.
system with the -P option.
56. When listing the history, the 'fc' builtin does not include an
56. When listing the history, the fc builtin does not include an
indication of whether or not a history entry has been modified.
57. The default editor used by 'fc' is 'ed'.
57. The default editor used by fc is ed.
58. If there are too many arguments supplied to 'fc -s', 'fc' prints
58. fc treats extra arguments as an error instead of ignoring them.
59. If there are too many arguments supplied to fc -s, fc prints
an error message and returns failure.
59. The 'type' and 'command' builtins will not report a non-executable
60. The type and command builtins will not report a non-executable
file as having been found, though the shell will attempt to execute
such a file if it is the only so-named file found in '$PATH'.
such a file if it is the only so-named file found in $PATH.
60. The 'vi' editing mode will invoke the 'vi' editor directly when
the 'v' command is run, instead of checking '$VISUAL' and
'$EDITOR'.
61. The vi editing mode will invoke the vi editor directly when
the v command is run, instead of checking $VISUAL and
$EDITOR.
61. When the 'xpg_echo' option is enabled, Bash does not attempt to
interpret any arguments to 'echo' as options. Each argument is
62. When the xpg_echo option is enabled, Bash does not attempt to
interpret any arguments to echo as options. Each argument is
displayed, after escape characters are converted.
62. The 'ulimit' builtin uses a block size of 512 bytes for the '-c'
and '-f' options.
63. The ulimit builtin uses a block size of 512 bytes for the -c
and -f options.
63. The arrival of 'SIGCHLD' when a trap is set on 'SIGCHLD' does not
interrupt the 'wait' builtin and cause it to return immediately.
64. The arrival of SIGCHLD when a trap is set on SIGCHLD does not
interrupt the wait builtin and cause it to return immediately.
The trap command is run once for each child that exits.
64. The 'read' builtin may be interrupted by a signal for which a trap
65. The read builtin may be interrupted by a signal for which a trap
has been set. If Bash receives a trapped signal while executing
'read', the trap handler executes and 'read' returns an exit status
read, the trap handler executes and read returns an exit status
greater than 128.
65. The 'printf' builtin uses 'double' (via 'strtod') to convert
66. The printf builtin uses double (via strtod) to convert
arguments corresponding to floating point conversion specifiers,
instead of 'long double' if it's available. The 'L' length
modifier forces 'printf' to use 'long double' if it's available.
instead of long double if it's available. The L length
modifier forces printf to use long double if it's available.
66. Bash removes an exited background process's status from the list
of such statuses after the 'wait' builtin is used to obtain it.
67. Bash removes an exited background process's status from the list
of such statuses after the wait builtin is used to obtain it.
67. A double quote character ('"') is treated specially when it
68. A double quote character (") is treated specially when it
appears in a backquoted command substitution in the body of a
here-document that undergoes expansion. That means, for example,
that a backslash preceding a double quote character will escape it
and the backslash will be removed.
68. The 'test' builtin compares strings using the current locale when
processing the '<' and '>' binary operators.
69. The test builtin compares strings using the current locale when
processing the < and > binary operators.
69. The 'test' builtin's '-t' unary primary requires an argument.
Historical versions of 'test' made the argument optional in certain
70. The test builtin's -t unary primary requires an argument.
Historical versions of test made the argument optional in certain
cases, and Bash attempts to accommodate those for backwards
compatibility.
70. Command substitutions don't set the '?' special parameter. The
71. Command substitutions don't set the ? special parameter. The
exit status of a simple command without a command word is still the
exit status of the last command substitution that occurred while
evaluating the variable assignments and redirections in that
@@ -345,18 +346,18 @@ The following list is what's changed when 'POSIX mode' is in effect:
There is other POSIX behavior that Bash does not implement by default
even when in POSIX mode. Specifically:
1. The 'fc' builtin checks '$EDITOR' as a program to edit history
entries if 'FCEDIT' is unset, rather than defaulting directly to
'ed'. 'fc' uses 'ed' if 'EDITOR' is unset.
1. The fc builtin checks $EDITOR as a program to edit history
entries if FCEDIT is unset, rather than defaulting directly to
ed. fc uses ed if EDITOR is unset.
2. A non-interactive shell does not exit if a variable assignment
preceding the 'command' builtin or another non-special builtin
preceding the command builtin or another non-special builtin
fails.
3. As noted above, Bash requires the 'xpg_echo' option to be enabled
for the 'echo' builtin to be fully conformant.
3. As noted above, Bash requires the xpg_echo option to be enabled
for the echo builtin to be fully conformant.
Bash can be configured to be POSIX-conformant by default, by specifying
the '--enable-strict-posix-default' to 'configure' when building (*note
the --enable-strict-posix-default to configure when building (*note
Optional Features::).
+26 -26
View File
@@ -1,52 +1,52 @@
6.10 The Restricted Shell
=========================
If Bash is started with the name 'rbash', or the '--restricted' or '-r'
If Bash is started with the name rbash, or the --restricted or -r
option is supplied at invocation, the shell becomes restricted. A
restricted shell is used to set up an environment more controlled than
the standard shell. A restricted shell behaves identically to 'bash'
the standard shell. A restricted shell behaves identically to bash
with the exception that the following are disallowed or not performed:
* Changing directories with the 'cd' builtin.
* Setting or unsetting the values of the 'SHELL', 'PATH', 'HISTFILE',
'ENV', or 'BASH_ENV' variables.
* Specifying command names containing slashes.
* Specifying a filename containing a slash as an argument to the '.'
Changing directories with the cd builtin.
Setting or unsetting the values of the SHELL, PATH, HISTFILE,
ENV, or BASH_ENV variables.
Specifying command names containing slashes.
Specifying a filename containing a slash as an argument to the .
builtin command.
* Specifying a filename containing a slash as an argument to the
'history' builtin command.
* Specifying a filename containing a slash as an argument to the '-p'
option to the 'hash' builtin command.
* Importing function definitions from the shell environment at
Specifying a filename containing a slash as an argument to the
history builtin command.
Specifying a filename containing a slash as an argument to the -p
option to the hash builtin command.
Importing function definitions from the shell environment at
startup.
* Parsing the value of 'SHELLOPTS' from the shell environment at
Parsing the value of SHELLOPTS from the shell environment at
startup.
* Redirecting output using the '>', '>|', '<>', '>&', '&>', and '>>'
Redirecting output using the >, >|, <>, >&, &>, and >>
redirection operators.
* Using the 'exec' builtin to replace the shell with another command.
* Adding or deleting builtin commands with the '-f' and '-d' options
to the 'enable' builtin.
* Using the 'enable' builtin command to enable disabled shell
Using the exec builtin to replace the shell with another command.
Adding or deleting builtin commands with the -f and -d options
to the enable builtin.
Using the enable builtin command to enable disabled shell
builtins.
* Specifying the '-p' option to the 'command' builtin.
* Turning off restricted mode with 'set +r' or 'shopt -u
restricted_shell'.
Specifying the -p option to the command builtin.
Turning off restricted mode with set +r or shopt -u
restricted_shell.
These restrictions are enforced after any startup files are read.
When a command that is found to be a shell script is executed (*note
Shell Scripts::), 'rbash' turns off any restrictions in the shell
Shell Scripts::), rbash turns off any restrictions in the shell
spawned to execute the script.
The restricted shell mode is only one component of a useful restricted
environment. It should be accompanied by setting 'PATH' to a value that
environment. It should be accompanied by setting PATH to a value that
allows execution of only a few verified commands (commands that allow
shell escapes are particularly vulnerable), changing the current
directory to a non-writable directory other than '$HOME' after login,
directory to a non-writable directory other than $HOME after login,
not allowing the restricted shell to execute shell scripts, and cleaning
the environment of variables that cause some commands to modify their
behavior (e.g., 'VISUAL' or 'PAGER').
behavior (e.g., VISUAL or PAGER).
Modern systems provide more secure ways to implement a restricted
environment, such as 'jails', 'zones', or 'containers'.
environment, such as jails, zones, or containers.
+1 -1
View File
@@ -1,7 +1,7 @@
Introduction
============
This is GNU Bash, version 5.2. Bash is the GNU Project's Bourne
This is GNU Bash, version 5.3. Bash is the GNU Project's Bourne
Again SHell, a complete implementation of the POSIX shell spec,
but also with interactive command line editing, job control on
architectures that support it, csh-like features such as history
+2
View File
@@ -366,6 +366,8 @@ typedef struct subshell_com {
#define COPROC_RUNNING 0x01
#define COPROC_DEAD 0x02
#define COPROC_STOPPED 0x04
#define COPROC_FOREGROUND 0x08 /* why would you want to do this? */
typedef struct coproc {
char *c_name;
Vendored
+3279 -2568
View File
File diff suppressed because it is too large Load Diff
+3 -2
View File
@@ -24,7 +24,7 @@ dnl Process this file with autoconf to produce a configure script.
AC_REVISION([for Bash 5.3, version 5.063])dnl
define(bashvers, 5.3)
define(relstatus, devel)
define(relstatus, alpha)
AC_INIT([bash], bashvers-relstatus, [bug-bash@gnu.org])
@@ -568,7 +568,8 @@ AC_SUBST(CPPFLAGS_FOR_BUILD)
AC_SUBST(LDFLAGS_FOR_BUILD)
AC_SUBST(LIBS_FOR_BUILD)
AC_PROG_GCC_TRADITIONAL
dnl This macro is obsolete
dnl AC_PROG_GCC_TRADITIONAL
dnl BEGIN READLINE and HISTORY LIBRARY SECTION
dnl prepare to allow bash to be linked against an already-installed readline
+3100 -3099
View File
File diff suppressed because it is too large Load Diff
+22 -11
View File
@@ -3,7 +3,7 @@
</HEAD>
<BODY><TABLE WIDTH=100%>
<TR>
<TH ALIGN=LEFT width=33%>BASH(1)<TH ALIGN=CENTER width=33%>2024 February 5<TH ALIGN=RIGHT width=33%>BASH(1)
<TH ALIGN=LEFT width=33%>BASH(1)<TH ALIGN=CENTER width=33%>2024 March 29<TH ALIGN=RIGHT width=33%>BASH(1)
</TR>
</TABLE>
<BR><A HREF="#index">Index</A>
@@ -53,6 +53,8 @@
@@ -85,6 +87,7 @@ also incorporates useful features from the <I>Korn</I> and <I>C</I>
shells (<B>ksh</B> and <B>csh</B>).
<P>
POSIX is the name for a family of computing standards based on Unix.
<B>Bash</B>
is intended to be a conformant implementation of the
@@ -3030,7 +3033,13 @@ after reading any startup files.
<DD>
A colon-separated list of patterns used to decide which command lines
should be saved on the history list. Each pattern is anchored at the
should be saved on the history list.
If a command line matches one of the patterns in the value of
<FONT SIZE=-1><B>HISTIGNORE</B>,
</FONT>
it is not saved on the history list.
Each pattern is anchored at the
beginning of the line and must match the complete line
(<B>bash</B> will not implicitly append a
@@ -3810,7 +3819,7 @@ words. The shell performs these expansions:
<I>pathname expansion</I>,
and
<I>quote removal .</I>
<I>quote removal</I>.
<P>
@@ -4569,6 +4578,7 @@ Produces a possibly-quoted version of the value of <I>parameter</I>,
except that it prints the values of
indexed and associative arrays as a sequence of quoted key-value pairs
(see <B>Arrays</B> above).
The keys and values are quoted in a format that can be reused as input.
<DT><B>a</B>
<DD>
@@ -7508,12 +7518,13 @@ builtin.
<H4>Readline Notation</H4>
In this section, the Emacs-style notation is used to denote
keystrokes. Control keys are denoted by C-<I>key</I>, e.g., C-n
means Control-N. Similarly,
keystrokes.
Control keys are denoted by C-<I>key</I>, e.g., C-n means Control-N.
Similarly,
<I>meta</I>
keys are denoted by M-<I>key</I>, so M-x means Meta-X. (On keyboards
without a
keys are denoted by M-<I>key</I>, so M-x means Meta-X.
(On keyboards without a
<I>meta</I>
key, M-<I>x</I> means ESC <I>x</I>, i.e., press the Escape key
@@ -10112,7 +10123,7 @@ the last
<I>string</I>
in a
<B>!?</B><I>string</I><B>[?]</B>
<B>!?</B><I>string</I>[?]
search.
If
@@ -15460,7 +15471,7 @@ There may be only one active coprocess at a time.
<HR>
<TABLE WIDTH=100%>
<TR>
<TH ALIGN=LEFT width=33%>GNU Bash 5.3<TH ALIGN=CENTER width=33%>2024 February 5<TH ALIGN=RIGHT width=33%>BASH(1)
<TH ALIGN=LEFT width=33%>GNU Bash 5.3<TH ALIGN=CENTER width=33%>2024 March 29<TH ALIGN=RIGHT width=33%>BASH(1)
</TR>
</TABLE>
<HR>
@@ -15566,7 +15577,7 @@ There may be only one active coprocess at a time.
<DT><A HREF="#lbDI">BUGS</A><DD>
</DL>
<HR>
This document was created by man2html from /usr/local/src/bash/bash-20240209/doc/bash.1.<BR>
Time: 13 February 2024 10:19:05 EST
This document was created by man2html from /usr/local/src/bash/bash-20240402/doc/bash.1.<BR>
Time: 04 April 2024 17:50:28 EDT
</BODY>
</HTML>
+200 -155
View File
@@ -1,9 +1,9 @@
This is bash.info, produced by makeinfo version 7.1 from bashref.texi.
This text is a brief description of the features that are present in the
Bash shell (version 5.3, 25 March 2024).
Bash shell (version 5.3, 5 April 2024).
This is Edition 5.3, last updated 25 March 2024, of The GNU Bash
This is Edition 5.3, last updated 5 April 2024, of The GNU Bash
Reference Manual, for Bash, Version 5.3.
Copyright © 1988-2023 Free Software Foundation, Inc.
@@ -26,10 +26,10 @@ Bash Features
*************
This text is a brief description of the features that are present in the
Bash shell (version 5.3, 25 March 2024). The Bash home page is
Bash shell (version 5.3, 5 April 2024). The Bash home page is
<http://www.gnu.org/software/bash/>.
This is Edition 5.3, last updated 25 March 2024, of The GNU Bash
This is Edition 5.3, last updated 5 April 2024, of The GNU Bash
Reference Manual, for Bash, Version 5.3.
Bash contains features that appear in other popular shells, and some
@@ -7529,9 +7529,8 @@ startup files.
54. When the cd builtin cannot change a directory because the length
of the pathname constructed from $PWD and the directory name
supplied as an argument exceeds PATH_MAX when all symbolic links
are expanded, cd will fail instead of attempting to use only the
supplied directory name.
supplied as an argument exceeds PATH_MAX when canonicalized, cd
will attempt to use the supplied directory name.
55. The pwd builtin verifies that the value it prints is the same as
the current directory, even if it is not asked to check the file
@@ -7542,56 +7541,58 @@ startup files.
57. The default editor used by fc is ed.
58. If there are too many arguments supplied to fc -s, fc prints
58. fc treats extra arguments as an error instead of ignoring them.
59. If there are too many arguments supplied to fc -s, fc prints
an error message and returns failure.
59. The type and command builtins will not report a non-executable
60. The type and command builtins will not report a non-executable
file as having been found, though the shell will attempt to execute
such a file if it is the only so-named file found in $PATH.
60. The vi editing mode will invoke the vi editor directly when
61. The vi editing mode will invoke the vi editor directly when
the v command is run, instead of checking $VISUAL and
$EDITOR.
61. When the xpg_echo option is enabled, Bash does not attempt to
62. When the xpg_echo option is enabled, Bash does not attempt to
interpret any arguments to echo as options. Each argument is
displayed, after escape characters are converted.
62. The ulimit builtin uses a block size of 512 bytes for the -c
63. The ulimit builtin uses a block size of 512 bytes for the -c
and -f options.
63. The arrival of SIGCHLD when a trap is set on SIGCHLD does not
64. The arrival of SIGCHLD when a trap is set on SIGCHLD does not
interrupt the wait builtin and cause it to return immediately.
The trap command is run once for each child that exits.
64. The read builtin may be interrupted by a signal for which a trap
65. The read builtin may be interrupted by a signal for which a trap
has been set. If Bash receives a trapped signal while executing
read, the trap handler executes and read returns an exit status
greater than 128.
65. The printf builtin uses double (via strtod) to convert
66. The printf builtin uses double (via strtod) to convert
arguments corresponding to floating point conversion specifiers,
instead of long double if it's available. The L length
modifier forces printf to use long double if it's available.
66. Bash removes an exited background process's status from the list
67. Bash removes an exited background process's status from the list
of such statuses after the wait builtin is used to obtain it.
67. A double quote character (") is treated specially when it
68. A double quote character (") is treated specially when it
appears in a backquoted command substitution in the body of a
here-document that undergoes expansion. That means, for example,
that a backslash preceding a double quote character will escape it
and the backslash will be removed.
68. The test builtin compares strings using the current locale when
69. The test builtin compares strings using the current locale when
processing the < and > binary operators.
69. The test builtin's -t unary primary requires an argument.
70. The test builtin's -t unary primary requires an argument.
Historical versions of test made the argument optional in certain
cases, and Bash attempts to accommodate those for backwards
compatibility.
70. Command substitutions don't set the ? special parameter. The
71. Command substitutions don't set the ? special parameter. The
exit status of a simple command without a command word is still the
exit status of the last command substitution that occurred while
evaluating the variable assignments and redirections in that
@@ -7772,6 +7773,11 @@ required for bash-5.1 and later versions.
word expansion time if extglob hasn't been enabled by the time
the command is executed.
compat52 (set using BASH_COMPAT)
• The test builtin uses its historical algorithm to parse
parenthesized subexpressions when given five or more
arguments.

File: bash.info, Node: Job Control, Next: Command Line Editing, Prev: Bash Features, Up: Top
@@ -11386,21 +11392,30 @@ the baseline reference.
• The expansion ${VAR/[/]PATTERN[/REPLACEMENT]}, which matches
PATTERN and replaces it with REPLACEMENT in the value of VAR, is
available (*note Shell Parameter Expansion::).
available (*note Shell Parameter Expansion::), with a mechanism to
use the matched text in REPLACEMENT.
• The expansion ${!PREFIX*} expansion, which expands to the names
of all shell variables whose names begin with PREFIX, is available
(*note Shell Parameter Expansion::).
• Bash has indirect variable expansion using ${!word} (*note Shell
Parameter Expansion::).
Parameter Expansion::) and implements the nameref variable
attribute for automatic indirect variable expansion.
• Bash can expand positional parameters beyond $9 using ${NUM}.
• Bash includes a set of parameter transformation word expansions of
the form ${var@X}, where X specifies the transformation.
• The POSIX $() form of command substitution is implemented (*note
Command Substitution::), and preferred to the Bourne shell's ``
(which is also implemented for backwards compatibility).
• Bash implements a variant of command substitution that runs the
enclosed command in the current shell execution environment (${
COMMAND;}).
• Bash has process substitution (*note Process Substitution::).
• Bash automatically assigns variables that provide information about
@@ -11409,6 +11424,12 @@ the baseline reference.
instance of Bash that is running (BASH, BASH_VERSION, and
BASH_VERSINFO). *Note Bash Variables::, for details.
• Bash uses many variables to provide functionality and customize
shell behavior that the Bourne shell does not. Examples include
RANDOM, SRANDOM, EPOCHSECONDS, GLOBSORT, TIMEFORMAT,
BASHPID, BASH_XTRACEFD, GLOBIGNORE, HISTIGNORE, and
BASH_VERSION. *Note Bash Variables::, for a complete list.
• The IFS variable is used to split only the results of expansion,
not all words (*note Word Splitting::). This closes a longstanding
shell security hole.
@@ -11445,7 +11466,7 @@ the baseline reference.
same file (*note Redirections::).
• Bash includes the <<< redirection operator, allowing a string to
be used as the standard input to a command.
be used as the standard input to a command (*note Redirections::).
• Bash implements the [n]<&WORD and [n]>&WORD redirection
operators, which move one file descriptor to another.
@@ -11469,6 +11490,9 @@ the baseline reference.
function via the builtin and command builtins (*note Bash
Builtins::).
• Bash implements support for dynamically loading builtin commands
from shared objects.
• The command builtin allows selective disabling of functions when
command lookup is performed (*note Bash Builtins::).
@@ -11483,6 +11507,15 @@ the baseline reference.
• Shell functions may be exported to children via the environment
using export -f (*note Shell Functions::).
• Bash decodes a number of backslash-escape sequences in the prompt
string variables (PS0, PS1, PS2, and PS4).
• Bash expands and displays the PS0 prompt string variable.
• Bash runs commands from the PROMPT_COMMAND array variable before
issuing each primary prompt.
• Bash decodes a number of backslash-escaped characters
• The Bash export, readonly, and declare builtins can take a
-f option to act on shell functions, a -p option to display
variables with various attributes set in a format that can be used
@@ -11498,6 +11531,9 @@ the baseline reference.
• Bash includes a help builtin for quick reference to shell
facilities (*note Bash Builtins::).
• Bash includes the mapfile builtin to quickly read the contents of
a file into an indexed array variable.
• The printf builtin is available to display formatted output
(*note Bash Builtins::).
@@ -11534,6 +11570,11 @@ the baseline reference.
different, as it implements the POSIX algorithm, which specifies
the behavior based on the number of arguments.
• The Bash wait builtin has a -n option to wait for the next
child to exit, possibly selecting from a list of supplied jobs, and
the -p option to store information about a terminated child
process in a shell variable.
• Bash includes the caller builtin, which displays the context of
any active subroutine call (a shell function or a script executed
with the . or source builtins). This supports the Bash
@@ -11645,6 +11686,10 @@ many of the limitations of the SVR4.2 shell. For instance:
• The SVR4.2 shell behaves differently when invoked as jsh (it
turns on job control).
• If the lastpipe option is enabled, and job control is not active,
Bash runs the last element of a pipeline in the current shell
execution environment.

File: bash.info, Node: GNU Free Documentation License, Next: Indexes, Prev: Major Differences From The Bourne Shell, Up: Top
@@ -12924,138 +12969,138 @@ D.5 Concept Index

Tag Table:
Node: Top895
Node: Introduction2830
Node: What is Bash?3043
Node: What is a shell?4184
Node: Definitions6763
Node: Basic Shell Features9939
Node: Shell Syntax11159
Node: Shell Operation12186
Node: Quoting13484
Node: Escape Character14797
Node: Single Quotes15295
Node: Double Quotes15644
Node: ANSI-C Quoting16987
Node: Locale Translation18372
Node: Creating Internationalized Scripts19716
Node: Comments23914
Node: Shell Commands24549
Node: Reserved Words25488
Node: Simple Commands26353
Node: Pipelines27012
Node: Lists30075
Node: Compound Commands31947
Node: Looping Constructs32956
Node: Conditional Constructs35500
Node: Command Grouping50404
Node: Coprocesses51891
Node: GNU Parallel54587
Node: Shell Functions55505
Node: Shell Parameters63611
Node: Positional Parameters68144
Node: Special Parameters69079
Node: Shell Expansions72386
Node: Brace Expansion74575
Node: Tilde Expansion77238
Node: Shell Parameter Expansion80004
Node: Command Substitution99111
Node: Arithmetic Expansion102644
Node: Process Substitution103609
Node: Word Splitting104746
Node: Filename Expansion106887
Node: Pattern Matching109983
Node: Quote Removal115216
Node: Redirections115520
Node: Executing Commands125329
Node: Simple Command Expansion125996
Node: Command Search and Execution128107
Node: Command Execution Environment130515
Node: Environment133824
Node: Exit Status135528
Node: Signals137313
Node: Shell Scripts140927
Node: Shell Builtin Commands144019
Node: Bourne Shell Builtins146130
Node: Bash Builtins170534
Node: Modifying Shell Behavior205139
Node: The Set Builtin205481
Node: The Shopt Builtin216996
Node: Special Builtins233732
Node: Shell Variables234721
Node: Bourne Shell Variables235155
Node: Bash Variables237348
Node: Bash Features273898
Node: Invoking Bash274912
Node: Bash Startup Files281311
Node: Interactive Shells286623
Node: What is an Interactive Shell?287031
Node: Is this Shell Interactive?287697
Node: Interactive Shell Behavior288521
Node: Bash Conditional Expressions292275
Node: Shell Arithmetic297449
Node: Aliases300531
Node: Arrays303486
Node: The Directory Stack310285
Node: Directory Stack Builtins311082
Node: Controlling the Prompt315531
Node: The Restricted Shell318669
Node: Bash POSIX Mode321456
Node: Shell Compatibility Mode338937
Node: Job Control347423
Node: Job Control Basics347880
Node: Job Control Builtins353054
Node: Job Control Variables359014
Node: Command Line Editing360191
Node: Introduction and Notation361895
Node: Readline Interaction363539
Node: Readline Bare Essentials364727
Node: Readline Movement Commands366545
Node: Readline Killing Commands367542
Node: Readline Arguments369520
Node: Searching370577
Node: Readline Init File372806
Node: Readline Init File Syntax374088
Node: Conditional Init Constructs399026
Node: Sample Init File403391
Node: Bindable Readline Commands406512
Node: Commands For Moving407737
Node: Commands For History409837
Node: Commands For Text414920
Node: Commands For Killing418995
Node: Numeric Arguments421796
Node: Commands For Completion422948
Node: Keyboard Macros427264
Node: Miscellaneous Commands427965
Node: Readline vi Mode434619
Node: Programmable Completion435571
Node: Programmable Completion Builtins443528
Node: A Programmable Completion Example455094
Node: Using History Interactively460439
Node: Bash History Facilities461120
Node: Bash History Builtins464232
Node: History Interaction469475
Node: Event Designators473800
Node: Word Designators475383
Node: Modifiers477369
Node: Installing Bash479278
Node: Basic Installation480412
Node: Compilers and Options484291
Node: Compiling For Multiple Architectures485041
Node: Installation Names486790
Node: Specifying the System Type489024
Node: Sharing Defaults489770
Node: Operation Controls490484
Node: Optional Features491503
Node: Reporting Bugs503305
Node: Major Differences From The Bourne Shell504654
Node: GNU Free Documentation License522463
Node: Indexes547640
Node: Builtin Index548091
Node: Reserved Word Index555189
Node: Variable Index557634
Node: Function Index574765
Node: Concept Index588621
Node: Top893
Node: Introduction2826
Node: What is Bash?3039
Node: What is a shell?4180
Node: Definitions6759
Node: Basic Shell Features9935
Node: Shell Syntax11155
Node: Shell Operation12182
Node: Quoting13480
Node: Escape Character14793
Node: Single Quotes15291
Node: Double Quotes15640
Node: ANSI-C Quoting16983
Node: Locale Translation18368
Node: Creating Internationalized Scripts19712
Node: Comments23910
Node: Shell Commands24545
Node: Reserved Words25484
Node: Simple Commands26349
Node: Pipelines27008
Node: Lists30071
Node: Compound Commands31943
Node: Looping Constructs32952
Node: Conditional Constructs35496
Node: Command Grouping50400
Node: Coprocesses51887
Node: GNU Parallel54583
Node: Shell Functions55501
Node: Shell Parameters63607
Node: Positional Parameters68140
Node: Special Parameters69075
Node: Shell Expansions72382
Node: Brace Expansion74571
Node: Tilde Expansion77234
Node: Shell Parameter Expansion80000
Node: Command Substitution99107
Node: Arithmetic Expansion102640
Node: Process Substitution103605
Node: Word Splitting104742
Node: Filename Expansion106883
Node: Pattern Matching109979
Node: Quote Removal115212
Node: Redirections115516
Node: Executing Commands125325
Node: Simple Command Expansion125992
Node: Command Search and Execution128103
Node: Command Execution Environment130511
Node: Environment133820
Node: Exit Status135524
Node: Signals137309
Node: Shell Scripts140923
Node: Shell Builtin Commands144015
Node: Bourne Shell Builtins146126
Node: Bash Builtins170530
Node: Modifying Shell Behavior205135
Node: The Set Builtin205477
Node: The Shopt Builtin216992
Node: Special Builtins233728
Node: Shell Variables234717
Node: Bourne Shell Variables235151
Node: Bash Variables237344
Node: Bash Features273894
Node: Invoking Bash274908
Node: Bash Startup Files281307
Node: Interactive Shells286619
Node: What is an Interactive Shell?287027
Node: Is this Shell Interactive?287693
Node: Interactive Shell Behavior288517
Node: Bash Conditional Expressions292271
Node: Shell Arithmetic297445
Node: Aliases300527
Node: Arrays303482
Node: The Directory Stack310281
Node: Directory Stack Builtins311078
Node: Controlling the Prompt315527
Node: The Restricted Shell318665
Node: Bash POSIX Mode321452
Node: Shell Compatibility Mode338963
Node: Job Control347647
Node: Job Control Basics348104
Node: Job Control Builtins353278
Node: Job Control Variables359238
Node: Command Line Editing360415
Node: Introduction and Notation362119
Node: Readline Interaction363763
Node: Readline Bare Essentials364951
Node: Readline Movement Commands366769
Node: Readline Killing Commands367766
Node: Readline Arguments369744
Node: Searching370801
Node: Readline Init File373030
Node: Readline Init File Syntax374312
Node: Conditional Init Constructs399250
Node: Sample Init File403615
Node: Bindable Readline Commands406736
Node: Commands For Moving407961
Node: Commands For History410061
Node: Commands For Text415144
Node: Commands For Killing419219
Node: Numeric Arguments422020
Node: Commands For Completion423172
Node: Keyboard Macros427488
Node: Miscellaneous Commands428189
Node: Readline vi Mode434843
Node: Programmable Completion435795
Node: Programmable Completion Builtins443752
Node: A Programmable Completion Example455318
Node: Using History Interactively460663
Node: Bash History Facilities461344
Node: Bash History Builtins464456
Node: History Interaction469699
Node: Event Designators474024
Node: Word Designators475607
Node: Modifiers477593
Node: Installing Bash479502
Node: Basic Installation480636
Node: Compilers and Options484515
Node: Compiling For Multiple Architectures485265
Node: Installation Names487014
Node: Specifying the System Type489248
Node: Sharing Defaults489994
Node: Operation Controls490708
Node: Optional Features491727
Node: Reporting Bugs503529
Node: Major Differences From The Bourne Shell504878
Node: GNU Free Documentation License524613
Node: Indexes549790
Node: Builtin Index550241
Node: Reserved Word Index557339
Node: Variable Index559784
Node: Function Index576915
Node: Concept Index590771

End Tag Table
BIN
View File
Binary file not shown.
+8029 -7873
View File
File diff suppressed because it is too large Load Diff
BIN
View File
Binary file not shown.
+67 -13
View File
@@ -4,9 +4,9 @@
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<!-- This text is a brief description of the features that are present in
the Bash shell (version 5.3, 2 February 2024).
the Bash shell (version 5.3, 5 April 2024).
This is Edition 5.3, last updated 2 February 2024,
This is Edition 5.3, last updated 5 April 2024,
of The GNU Bash Reference Manual,
for Bash, Version 5.3.
@@ -77,10 +77,10 @@ Next: <a href="#Introduction" accesskey="n" rel="next">Introduction</a>, Previou
<h1 class="top" id="Bash-Features-1"><span>Bash Features<a class="copiable-link" href="#Bash-Features-1"> &para;</a></span></h1>
<p>This text is a brief description of the features that are present in
the Bash shell (version 5.3, 2 February 2024).
the Bash shell (version 5.3, 5 April 2024).
The Bash home page is <a class="url" href="http://www.gnu.org/software/bash/">http://www.gnu.org/software/bash/</a>.
</p>
<p>This is Edition 5.3, last updated 2 February 2024,
<p>This is Edition 5.3, last updated 5 April 2024,
of <cite class="cite">The GNU Bash Reference Manual</cite>,
for <code class="code">Bash</code>, Version 5.3.
</p>
@@ -827,7 +827,7 @@ and <code class="code">TEXTDOMAIN</code> shell variables, as explained below.
See the gettext documentation for additional details not covered here.
If the current locale is <code class="code">C</code> or <code class="code">POSIX</code>,
if there are no translations available,
of if the string is not translated,
or if the string is not translated,
the dollar sign is ignored.
Since this is a form of double quoting, the string remains double-quoted
by default, whether or not it is translated and replaced.
@@ -3021,6 +3021,7 @@ evaluated, will recreate <var class="var">parameter</var> with its attributes an
except that it prints the values of
indexed and associative arrays as a sequence of quoted key-value pairs
(see <a class="pxref" href="#Arrays">Arrays</a>).
The keys and values are quoted in a format that can be reused as input.
</p></dd>
<dt><code class="code">a</code></dt>
<dd><p>The expansion is a string consisting of flag values representing
@@ -7577,6 +7578,8 @@ after reading any startup files.
<dt><a id="index-HISTIGNORE"></a><span><code class="code">HISTIGNORE</code><a class="copiable-link" href="#index-HISTIGNORE"> &para;</a></span></dt>
<dd><p>A colon-separated list of patterns used to decide which command
lines should be saved on the history list.
If a command line matches one of the patterns in the value of
<code class="code">HISTIGNORE</code>, it is not saved on the history list.
Each pattern is
anchored at the beginning of the line and must match the complete
line (Bash will not implicitly append a &lsquo;<samp class="samp">*</samp>&rsquo;).
@@ -9730,8 +9733,8 @@ falling back to physical mode.
</li><li> When the <code class="code">cd</code> builtin cannot change a directory because the
length of the pathname
constructed from <code class="code">$PWD</code> and the directory name supplied as an argument
exceeds <code class="code">PATH_MAX</code> when all symbolic links are expanded, <code class="code">cd</code> will
fail instead of attempting to use only the supplied directory name.
exceeds <code class="code">PATH_MAX</code> when canonicalized, <code class="code">cd</code> will
attempt to use the supplied directory name.
</li><li> The <code class="code">pwd</code> builtin verifies that the value it prints is the same as the
current directory, even if it is not asked to check the file system with the
@@ -9742,6 +9745,8 @@ indication of whether or not a history entry has been modified.
</li><li> The default editor used by <code class="code">fc</code> is <code class="code">ed</code>.
</li><li> <code class="code">fc</code> treats extra arguments as an error instead of ignoring them.
</li><li> If there are too many arguments supplied to <code class="code">fc -s</code>, <code class="code">fc</code> prints
an error message and returns failure.
@@ -10010,6 +10015,14 @@ and word expansions are performed.
It will fail at word expansion time if extglob hasn&rsquo;t been
enabled by the time the command is executed.
</li></ul>
</dd>
<dt><code class="code">compat52 (set using BASH_COMPAT)</code></dt>
<dd><ul class="itemize mark-bullet">
<li>The <code class="code">test</code> builtin uses its historical algorithm to parse parenthesized
subexpressions when given five or more arguments.
</li></ul>
</dd>
</dl>
@@ -14542,31 +14555,47 @@ which expands to the substring of <code class="code">var</code>&rsquo;s value of
</li><li>The expansion
<code class="code">${<var class="var">var</var>/[/]</code><var class="var">pattern</var><code class="code">[/</code><var class="var">replacement</var><code class="code">]}</code>,
which matches <var class="var">pattern</var> and replaces it with <var class="var">replacement</var> in
the value of <var class="var">var</var>, is available (see <a class="pxref" href="#Shell-Parameter-Expansion">Shell Parameter Expansion</a>).
the value of <var class="var">var</var>, is available (see <a class="pxref" href="#Shell-Parameter-Expansion">Shell Parameter Expansion</a>),
with a mechanism to use the matched text in <var class="var">replacement</var>.
</li><li>The expansion <code class="code">${!<var class="var">prefix</var>*}</code> expansion, which expands to
the names of all shell variables whose names begin with <var class="var">prefix</var>,
is available (see <a class="pxref" href="#Shell-Parameter-Expansion">Shell Parameter Expansion</a>).
</li><li>Bash has indirect variable expansion using <code class="code">${!word}</code>
(see <a class="pxref" href="#Shell-Parameter-Expansion">Shell Parameter Expansion</a>).
(see <a class="pxref" href="#Shell-Parameter-Expansion">Shell Parameter Expansion</a>) and implements the <code class="code">nameref</code>
variable attribute for automatic indirect variable expansion.
</li><li>Bash can expand positional parameters beyond <code class="code">$9</code> using
<code class="code">${<var class="var">num</var>}</code>.
</li><li>Bash includes a set of parameter transformation word expansions of the
form <code class="code">${var@X}</code>, where &lsquo;<samp class="samp">X</samp>&rsquo; specifies the transformation.
</li><li>The <small class="sc">POSIX</small> <code class="code">$()</code> form of command substitution
is implemented (see <a class="pxref" href="#Command-Substitution">Command Substitution</a>),
and preferred to the Bourne shell&rsquo;s <code class="code">``</code> (which
is also implemented for backwards compatibility).
</li><li>Bash implements a variant of command substitution that runs the enclosed
command in the current shell execution environment
(<code class="code">${ <var class="var">command</var>;}</code>).
</li><li>Bash has process substitution (see <a class="pxref" href="#Process-Substitution">Process Substitution</a>).
</li><li>Bash automatically assigns variables that provide information about the
current user (<code class="env">UID</code>, <code class="env">EUID</code>, and <code class="env">GROUPS</code>), the current host
(<code class="env">HOSTTYPE</code>, <code class="env">OSTYPE</code>, <code class="env">MACHTYPE</code>, and <code class="env">HOSTNAME</code>),
and the instance of Bash that is running (<code class="env">BASH</code>,
<code class="env">BASH_VERSION</code>, and <code class="env">BASH_VERSINFO</code>). See <a class="xref" href="#Bash-Variables">Bash Variables</a>,
for details.
<code class="env">BASH_VERSION</code>, and <code class="env">BASH_VERSINFO</code>).
See <a class="xref" href="#Bash-Variables">Bash Variables</a>, for details.
</li><li>Bash uses many variables to provide functionality and customize shell
behavior that the Bourne shell does not.
Examples include <code class="env">RANDOM</code>, <code class="env">SRANDOM</code>, <code class="env">EPOCHSECONDS</code>,
<code class="env">GLOBSORT</code>, <code class="env">TIMEFORMAT</code>, <code class="env">BASHPID</code>, <code class="env">BASH_XTRACEFD</code>,
<code class="env">GLOBIGNORE</code>, <code class="env">HISTIGNORE</code>, and <code class="env">BASH_VERSION</code>.
See <a class="xref" href="#Bash-Variables">Bash Variables</a>, for a complete list.
</li><li>The <code class="env">IFS</code> variable is used to split only the results of expansion,
not all words (see <a class="pxref" href="#Word-Splitting">Word Splitting</a>).
@@ -14605,7 +14634,7 @@ operator, for directing standard output and standard error to the same
file (see <a class="pxref" href="#Redirections">Redirections</a>).
</li><li>Bash includes the &lsquo;<samp class="samp">&lt;&lt;&lt;</samp>&rsquo; redirection operator, allowing a string to
be used as the standard input to a command.
be used as the standard input to a command (see <a class="pxref" href="#Redirections">Redirections</a>).
</li><li>Bash implements the &lsquo;<samp class="samp">[n]&lt;&amp;<var class="var">word</var></samp>&rsquo; and &lsquo;<samp class="samp">[n]&gt;&amp;<var class="var">word</var></samp>&rsquo;
redirection operators, which move one file descriptor to another.
@@ -14628,6 +14657,9 @@ physical modes.
access to that builtin&rsquo;s functionality within the function via the
<code class="code">builtin</code> and <code class="code">command</code> builtins (see <a class="pxref" href="#Bash-Builtins">Bash Builtin Commands</a>).
</li><li>Bash implements support for dynamically loading builtin commands from
shared objects.
</li><li>The <code class="code">command</code> builtin allows selective disabling of functions
when command lookup is performed (see <a class="pxref" href="#Bash-Builtins">Bash Builtin Commands</a>).
@@ -14642,6 +14674,15 @@ command, and what the zeroth argument to the command is to be
</li><li>Shell functions may be exported to children via the environment
using <code class="code">export -f</code> (see <a class="pxref" href="#Shell-Functions">Shell Functions</a>).
</li><li>Bash decodes a number of backslash-escape sequences in the prompt string
variables (<code class="code">PS0</code>, <code class="code">PS1</code>, <code class="code">PS2</code>, and <code class="code">PS4</code>).
</li><li>Bash expands and displays the <code class="code">PS0</code> prompt string variable.
</li><li>Bash runs commands from the <code class="code">PROMPT_COMMAND</code> array variable before
issuing each primary prompt.
</li><li>Bash decodes a number of backslash-escaped characters
</li><li>The Bash <code class="code">export</code>, <code class="code">readonly</code>, and <code class="code">declare</code> builtins can
take a <samp class="option">-f</samp> option to act on shell functions, a <samp class="option">-p</samp> option to
display variables with various attributes set in a format that can be
@@ -14657,6 +14698,9 @@ searching the <code class="env">$PATH</code>, using &lsquo;<samp class="samp">ha
</li><li>Bash includes a <code class="code">help</code> builtin for quick reference to shell
facilities (see <a class="pxref" href="#Bash-Builtins">Bash Builtin Commands</a>).
</li><li>Bash includes the <code class="code">mapfile</code> builtin to quickly read the contents
of a file into an indexed array variable.
</li><li>The <code class="code">printf</code> builtin is available to display formatted output
(see <a class="pxref" href="#Bash-Builtins">Bash Builtin Commands</a>).
@@ -14687,7 +14731,7 @@ to be set and unset at shell invocation (see <a class="pxref" href="#Invoking-Ba
</li><li>Bash has much more optional behavior controllable with the <code class="code">set</code>
builtin (see <a class="pxref" href="#The-Set-Builtin">The Set Builtin</a>).
</li><li>The &lsquo;<samp class="samp">-x</samp>&rsquo; (<samp class="option">xtrace</samp>) option displays commands other than
</li><li>The <samp class="option">-x</samp> (<samp class="option">xtrace</samp>) option displays commands other than
simple commands when performing an execution trace
(see <a class="pxref" href="#The-Set-Builtin">The Set Builtin</a>).
@@ -14695,6 +14739,11 @@ simple commands when performing an execution trace
is slightly different, as it implements the <small class="sc">POSIX</small> algorithm,
which specifies the behavior based on the number of arguments.
</li><li>The Bash <code class="code">wait</code> builtin has a <samp class="option">-n</samp> option to wait for the
next child to exit, possibly selecting from a list of supplied jobs,
and the <samp class="option">-p</samp> option to store information about a terminated
child process in a shell variable.
</li><li>Bash includes the <code class="code">caller</code> builtin, which displays the context of
any active subroutine call (a shell function or a script executed with
the <code class="code">.</code> or <code class="code">source</code> builtins). This supports the Bash
@@ -14820,6 +14869,11 @@ only for certain failures, as enumerated in the <small class="sc">POSIX</small>
</li><li>The SVR4.2 shell behaves differently when invoked as <code class="code">jsh</code>
(it turns on job control).
</li><li>If the <code class="code">lastpipe</code> option is enabled, and job control is not active,
Bash runs the last element of a pipeline in the current shell execution
environment.
</li></ul>
<hr>
+200 -155
View File
@@ -2,9 +2,9 @@ This is bashref.info, produced by makeinfo version 7.1 from
bashref.texi.
This text is a brief description of the features that are present in the
Bash shell (version 5.3, 25 March 2024).
Bash shell (version 5.3, 5 April 2024).
This is Edition 5.3, last updated 25 March 2024, of The GNU Bash
This is Edition 5.3, last updated 5 April 2024, of The GNU Bash
Reference Manual, for Bash, Version 5.3.
Copyright © 1988-2023 Free Software Foundation, Inc.
@@ -27,10 +27,10 @@ Bash Features
*************
This text is a brief description of the features that are present in the
Bash shell (version 5.3, 25 March 2024). The Bash home page is
Bash shell (version 5.3, 5 April 2024). The Bash home page is
<http://www.gnu.org/software/bash/>.
This is Edition 5.3, last updated 25 March 2024, of The GNU Bash
This is Edition 5.3, last updated 5 April 2024, of The GNU Bash
Reference Manual, for Bash, Version 5.3.
Bash contains features that appear in other popular shells, and some
@@ -7530,9 +7530,8 @@ startup files.
54. When the cd builtin cannot change a directory because the length
of the pathname constructed from $PWD and the directory name
supplied as an argument exceeds PATH_MAX when all symbolic links
are expanded, cd will fail instead of attempting to use only the
supplied directory name.
supplied as an argument exceeds PATH_MAX when canonicalized, cd
will attempt to use the supplied directory name.
55. The pwd builtin verifies that the value it prints is the same as
the current directory, even if it is not asked to check the file
@@ -7543,56 +7542,58 @@ startup files.
57. The default editor used by fc is ed.
58. If there are too many arguments supplied to fc -s, fc prints
58. fc treats extra arguments as an error instead of ignoring them.
59. If there are too many arguments supplied to fc -s, fc prints
an error message and returns failure.
59. The type and command builtins will not report a non-executable
60. The type and command builtins will not report a non-executable
file as having been found, though the shell will attempt to execute
such a file if it is the only so-named file found in $PATH.
60. The vi editing mode will invoke the vi editor directly when
61. The vi editing mode will invoke the vi editor directly when
the v command is run, instead of checking $VISUAL and
$EDITOR.
61. When the xpg_echo option is enabled, Bash does not attempt to
62. When the xpg_echo option is enabled, Bash does not attempt to
interpret any arguments to echo as options. Each argument is
displayed, after escape characters are converted.
62. The ulimit builtin uses a block size of 512 bytes for the -c
63. The ulimit builtin uses a block size of 512 bytes for the -c
and -f options.
63. The arrival of SIGCHLD when a trap is set on SIGCHLD does not
64. The arrival of SIGCHLD when a trap is set on SIGCHLD does not
interrupt the wait builtin and cause it to return immediately.
The trap command is run once for each child that exits.
64. The read builtin may be interrupted by a signal for which a trap
65. The read builtin may be interrupted by a signal for which a trap
has been set. If Bash receives a trapped signal while executing
read, the trap handler executes and read returns an exit status
greater than 128.
65. The printf builtin uses double (via strtod) to convert
66. The printf builtin uses double (via strtod) to convert
arguments corresponding to floating point conversion specifiers,
instead of long double if it's available. The L length
modifier forces printf to use long double if it's available.
66. Bash removes an exited background process's status from the list
67. Bash removes an exited background process's status from the list
of such statuses after the wait builtin is used to obtain it.
67. A double quote character (") is treated specially when it
68. A double quote character (") is treated specially when it
appears in a backquoted command substitution in the body of a
here-document that undergoes expansion. That means, for example,
that a backslash preceding a double quote character will escape it
and the backslash will be removed.
68. The test builtin compares strings using the current locale when
69. The test builtin compares strings using the current locale when
processing the < and > binary operators.
69. The test builtin's -t unary primary requires an argument.
70. The test builtin's -t unary primary requires an argument.
Historical versions of test made the argument optional in certain
cases, and Bash attempts to accommodate those for backwards
compatibility.
70. Command substitutions don't set the ? special parameter. The
71. Command substitutions don't set the ? special parameter. The
exit status of a simple command without a command word is still the
exit status of the last command substitution that occurred while
evaluating the variable assignments and redirections in that
@@ -7773,6 +7774,11 @@ required for bash-5.1 and later versions.
word expansion time if extglob hasn't been enabled by the time
the command is executed.
compat52 (set using BASH_COMPAT)
• The test builtin uses its historical algorithm to parse
parenthesized subexpressions when given five or more
arguments.

File: bashref.info, Node: Job Control, Next: Command Line Editing, Prev: Bash Features, Up: Top
@@ -11387,21 +11393,30 @@ the baseline reference.
• The expansion ${VAR/[/]PATTERN[/REPLACEMENT]}, which matches
PATTERN and replaces it with REPLACEMENT in the value of VAR, is
available (*note Shell Parameter Expansion::).
available (*note Shell Parameter Expansion::), with a mechanism to
use the matched text in REPLACEMENT.
• The expansion ${!PREFIX*} expansion, which expands to the names
of all shell variables whose names begin with PREFIX, is available
(*note Shell Parameter Expansion::).
• Bash has indirect variable expansion using ${!word} (*note Shell
Parameter Expansion::).
Parameter Expansion::) and implements the nameref variable
attribute for automatic indirect variable expansion.
• Bash can expand positional parameters beyond $9 using ${NUM}.
• Bash includes a set of parameter transformation word expansions of
the form ${var@X}, where X specifies the transformation.
• The POSIX $() form of command substitution is implemented (*note
Command Substitution::), and preferred to the Bourne shell's ``
(which is also implemented for backwards compatibility).
• Bash implements a variant of command substitution that runs the
enclosed command in the current shell execution environment (${
COMMAND;}).
• Bash has process substitution (*note Process Substitution::).
• Bash automatically assigns variables that provide information about
@@ -11410,6 +11425,12 @@ the baseline reference.
instance of Bash that is running (BASH, BASH_VERSION, and
BASH_VERSINFO). *Note Bash Variables::, for details.
• Bash uses many variables to provide functionality and customize
shell behavior that the Bourne shell does not. Examples include
RANDOM, SRANDOM, EPOCHSECONDS, GLOBSORT, TIMEFORMAT,
BASHPID, BASH_XTRACEFD, GLOBIGNORE, HISTIGNORE, and
BASH_VERSION. *Note Bash Variables::, for a complete list.
• The IFS variable is used to split only the results of expansion,
not all words (*note Word Splitting::). This closes a longstanding
shell security hole.
@@ -11446,7 +11467,7 @@ the baseline reference.
same file (*note Redirections::).
• Bash includes the <<< redirection operator, allowing a string to
be used as the standard input to a command.
be used as the standard input to a command (*note Redirections::).
• Bash implements the [n]<&WORD and [n]>&WORD redirection
operators, which move one file descriptor to another.
@@ -11470,6 +11491,9 @@ the baseline reference.
function via the builtin and command builtins (*note Bash
Builtins::).
• Bash implements support for dynamically loading builtin commands
from shared objects.
• The command builtin allows selective disabling of functions when
command lookup is performed (*note Bash Builtins::).
@@ -11484,6 +11508,15 @@ the baseline reference.
• Shell functions may be exported to children via the environment
using export -f (*note Shell Functions::).
• Bash decodes a number of backslash-escape sequences in the prompt
string variables (PS0, PS1, PS2, and PS4).
• Bash expands and displays the PS0 prompt string variable.
• Bash runs commands from the PROMPT_COMMAND array variable before
issuing each primary prompt.
• Bash decodes a number of backslash-escaped characters
• The Bash export, readonly, and declare builtins can take a
-f option to act on shell functions, a -p option to display
variables with various attributes set in a format that can be used
@@ -11499,6 +11532,9 @@ the baseline reference.
• Bash includes a help builtin for quick reference to shell
facilities (*note Bash Builtins::).
• Bash includes the mapfile builtin to quickly read the contents of
a file into an indexed array variable.
• The printf builtin is available to display formatted output
(*note Bash Builtins::).
@@ -11535,6 +11571,11 @@ the baseline reference.
different, as it implements the POSIX algorithm, which specifies
the behavior based on the number of arguments.
• The Bash wait builtin has a -n option to wait for the next
child to exit, possibly selecting from a list of supplied jobs, and
the -p option to store information about a terminated child
process in a shell variable.
• Bash includes the caller builtin, which displays the context of
any active subroutine call (a shell function or a script executed
with the . or source builtins). This supports the Bash
@@ -11646,6 +11687,10 @@ many of the limitations of the SVR4.2 shell. For instance:
• The SVR4.2 shell behaves differently when invoked as jsh (it
turns on job control).
• If the lastpipe option is enabled, and job control is not active,
Bash runs the last element of a pipeline in the current shell
execution environment.

File: bashref.info, Node: GNU Free Documentation License, Next: Indexes, Prev: Major Differences From The Bourne Shell, Up: Top
@@ -12925,138 +12970,138 @@ D.5 Concept Index

Tag Table:
Node: Top898
Node: Introduction2836
Node: What is Bash?3052
Node: What is a shell?4196
Node: Definitions6778
Node: Basic Shell Features9957
Node: Shell Syntax11180
Node: Shell Operation12210
Node: Quoting13511
Node: Escape Character14827
Node: Single Quotes15328
Node: Double Quotes15680
Node: ANSI-C Quoting17026
Node: Locale Translation18414
Node: Creating Internationalized Scripts19761
Node: Comments23962
Node: Shell Commands24600
Node: Reserved Words25542
Node: Simple Commands26410
Node: Pipelines27072
Node: Lists30138
Node: Compound Commands32013
Node: Looping Constructs33025
Node: Conditional Constructs35572
Node: Command Grouping50479
Node: Coprocesses51969
Node: GNU Parallel54668
Node: Shell Functions55589
Node: Shell Parameters63698
Node: Positional Parameters68234
Node: Special Parameters69172
Node: Shell Expansions72482
Node: Brace Expansion74674
Node: Tilde Expansion77340
Node: Shell Parameter Expansion80109
Node: Command Substitution99219
Node: Arithmetic Expansion102755
Node: Process Substitution103723
Node: Word Splitting104863
Node: Filename Expansion107007
Node: Pattern Matching110106
Node: Quote Removal115342
Node: Redirections115649
Node: Executing Commands125461
Node: Simple Command Expansion126131
Node: Command Search and Execution128245
Node: Command Execution Environment130656
Node: Environment133968
Node: Exit Status135675
Node: Signals137463
Node: Shell Scripts141080
Node: Shell Builtin Commands144175
Node: Bourne Shell Builtins146289
Node: Bash Builtins170696
Node: Modifying Shell Behavior205304
Node: The Set Builtin205649
Node: The Shopt Builtin217167
Node: Special Builtins233906
Node: Shell Variables234898
Node: Bourne Shell Variables235335
Node: Bash Variables237531
Node: Bash Features274084
Node: Invoking Bash275101
Node: Bash Startup Files281503
Node: Interactive Shells286818
Node: What is an Interactive Shell?287229
Node: Is this Shell Interactive?287898
Node: Interactive Shell Behavior288725
Node: Bash Conditional Expressions292482
Node: Shell Arithmetic297659
Node: Aliases300744
Node: Arrays303702
Node: The Directory Stack310504
Node: Directory Stack Builtins311304
Node: Controlling the Prompt315756
Node: The Restricted Shell318897
Node: Bash POSIX Mode321687
Node: Shell Compatibility Mode339171
Node: Job Control347660
Node: Job Control Basics348120
Node: Job Control Builtins353297
Node: Job Control Variables359260
Node: Command Line Editing360440
Node: Introduction and Notation362147
Node: Readline Interaction363794
Node: Readline Bare Essentials364985
Node: Readline Movement Commands366806
Node: Readline Killing Commands367806
Node: Readline Arguments369787
Node: Searching370847
Node: Readline Init File373079
Node: Readline Init File Syntax374364
Node: Conditional Init Constructs399305
Node: Sample Init File403673
Node: Bindable Readline Commands406797
Node: Commands For Moving408025
Node: Commands For History410128
Node: Commands For Text415214
Node: Commands For Killing419292
Node: Numeric Arguments422096
Node: Commands For Completion423251
Node: Keyboard Macros427570
Node: Miscellaneous Commands428274
Node: Readline vi Mode434931
Node: Programmable Completion435886
Node: Programmable Completion Builtins443846
Node: A Programmable Completion Example455415
Node: Using History Interactively460763
Node: Bash History Facilities461447
Node: Bash History Builtins464562
Node: History Interaction469808
Node: Event Designators474136
Node: Word Designators475722
Node: Modifiers477711
Node: Installing Bash479623
Node: Basic Installation480760
Node: Compilers and Options484642
Node: Compiling For Multiple Architectures485395
Node: Installation Names487147
Node: Specifying the System Type489384
Node: Sharing Defaults490133
Node: Operation Controls490850
Node: Optional Features491872
Node: Reporting Bugs503677
Node: Major Differences From The Bourne Shell505029
Node: GNU Free Documentation License522841
Node: Indexes548021
Node: Builtin Index548475
Node: Reserved Word Index555576
Node: Variable Index558024
Node: Function Index575158
Node: Concept Index589017
Node: Top896
Node: Introduction2832
Node: What is Bash?3048
Node: What is a shell?4192
Node: Definitions6774
Node: Basic Shell Features9953
Node: Shell Syntax11176
Node: Shell Operation12206
Node: Quoting13507
Node: Escape Character14823
Node: Single Quotes15324
Node: Double Quotes15676
Node: ANSI-C Quoting17022
Node: Locale Translation18410
Node: Creating Internationalized Scripts19757
Node: Comments23958
Node: Shell Commands24596
Node: Reserved Words25538
Node: Simple Commands26406
Node: Pipelines27068
Node: Lists30134
Node: Compound Commands32009
Node: Looping Constructs33021
Node: Conditional Constructs35568
Node: Command Grouping50475
Node: Coprocesses51965
Node: GNU Parallel54664
Node: Shell Functions55585
Node: Shell Parameters63694
Node: Positional Parameters68230
Node: Special Parameters69168
Node: Shell Expansions72478
Node: Brace Expansion74670
Node: Tilde Expansion77336
Node: Shell Parameter Expansion80105
Node: Command Substitution99215
Node: Arithmetic Expansion102751
Node: Process Substitution103719
Node: Word Splitting104859
Node: Filename Expansion107003
Node: Pattern Matching110102
Node: Quote Removal115338
Node: Redirections115645
Node: Executing Commands125457
Node: Simple Command Expansion126127
Node: Command Search and Execution128241
Node: Command Execution Environment130652
Node: Environment133964
Node: Exit Status135671
Node: Signals137459
Node: Shell Scripts141076
Node: Shell Builtin Commands144171
Node: Bourne Shell Builtins146285
Node: Bash Builtins170692
Node: Modifying Shell Behavior205300
Node: The Set Builtin205645
Node: The Shopt Builtin217163
Node: Special Builtins233902
Node: Shell Variables234894
Node: Bourne Shell Variables235331
Node: Bash Variables237527
Node: Bash Features274080
Node: Invoking Bash275097
Node: Bash Startup Files281499
Node: Interactive Shells286814
Node: What is an Interactive Shell?287225
Node: Is this Shell Interactive?287894
Node: Interactive Shell Behavior288721
Node: Bash Conditional Expressions292478
Node: Shell Arithmetic297655
Node: Aliases300740
Node: Arrays303698
Node: The Directory Stack310500
Node: Directory Stack Builtins311300
Node: Controlling the Prompt315752
Node: The Restricted Shell318893
Node: Bash POSIX Mode321683
Node: Shell Compatibility Mode339197
Node: Job Control347884
Node: Job Control Basics348344
Node: Job Control Builtins353521
Node: Job Control Variables359484
Node: Command Line Editing360664
Node: Introduction and Notation362371
Node: Readline Interaction364018
Node: Readline Bare Essentials365209
Node: Readline Movement Commands367030
Node: Readline Killing Commands368030
Node: Readline Arguments370011
Node: Searching371071
Node: Readline Init File373303
Node: Readline Init File Syntax374588
Node: Conditional Init Constructs399529
Node: Sample Init File403897
Node: Bindable Readline Commands407021
Node: Commands For Moving408249
Node: Commands For History410352
Node: Commands For Text415438
Node: Commands For Killing419516
Node: Numeric Arguments422320
Node: Commands For Completion423475
Node: Keyboard Macros427794
Node: Miscellaneous Commands428498
Node: Readline vi Mode435155
Node: Programmable Completion436110
Node: Programmable Completion Builtins444070
Node: A Programmable Completion Example455639
Node: Using History Interactively460987
Node: Bash History Facilities461671
Node: Bash History Builtins464786
Node: History Interaction470032
Node: Event Designators474360
Node: Word Designators475946
Node: Modifiers477935
Node: Installing Bash479847
Node: Basic Installation480984
Node: Compilers and Options484866
Node: Compiling For Multiple Architectures485619
Node: Installation Names487371
Node: Specifying the System Type489608
Node: Sharing Defaults490357
Node: Operation Controls491074
Node: Optional Features492096
Node: Reporting Bugs503901
Node: Major Differences From The Bourne Shell505253
Node: GNU Free Documentation License524991
Node: Indexes550171
Node: Builtin Index550625
Node: Reserved Word Index557726
Node: Variable Index560174
Node: Function Index577308
Node: Concept Index591167

End Tag Table
+55 -31
View File
@@ -1,12 +1,11 @@
This is pdfTeX, Version 3.141592653-2.6-1.40.25 (TeX Live 2023/MacPorts 2023.66589_3) (preloaded format=etex 2024.1.2) 9 FEB 2024 10:34
This is pdfTeX, Version 3.141592653-2.6-1.40.26 (TeX Live 2024/MacPorts 2024.70613_0) (preloaded format=pdfetex 2024.4.2) 5 APR 2024 12:10
entering extended mode
restricted \write18 enabled.
file:line:error style messages enabled.
%&-line parsing enabled.
**\nonstopmode \input /usr/local/src/bash/bash-20240209/doc/bashref.texi \input
/usr/local/src/bash/bash-20240209/doc/bashref.texi
(/usr/local/src/bash/bash-20240209/doc/bashref.texi
(/usr/local/src/bash/bash-20240209/doc/texinfo.tex
**\input /usr/local/src/bash/bash-20240402/doc/bashref.texi
(/usr/local/src/bash/bash-20240402/doc/bashref.texi
(/usr/local/src/bash/bash-20240402/doc/texinfo.tex
Loading texinfo [version 2015-11-22.14]:
\outerhsize=\dimen16
\outervsize=\dimen17
@@ -162,20 +161,23 @@ This is `epsf.tex' v2.7.4 <14 February 2011>
texinfo.tex: doing @include of version.texi
(/usr/local/src/bash/bash-20240209/doc/version.texi) [1] [2]
(/usr/local/build/bash/bash-20240209/doc/bashref.toc [-1] [-2] [-3]) [-4]
Chapter 1
(/usr/local/src/bash/bash-20240402/doc/version.texi) [1{/opt/local/var/db/texmf
/fonts/map/pdftex/updmap/pdftex.map}] [2]
(/usr/local/build/bash/bash-20240402/doc/bashref.toc [-1] [-2] [-3]) [-4]
(/usr/local/build/bash/bash-20240402/doc/bashref.toc)
(/usr/local/build/bash/bash-20240402/doc/bashref.toc) Chapter 1
\openout0 = `bashref.toc'.
(/usr/local/build/bash/bash-20240209/doc/bashref.aux)
(/usr/local/build/bash/bash-20240402/doc/bashref.aux)
\openout1 = `bashref.aux'.
Chapter 2
[1] [2]
Chapter 2 [1] [2]
@cpindfile=@write2
\openout2 = `bashref.cp'.
[3] Chapter 3 [4] [5] [6] [7]
[3] Chapter 3 [4] [5] [6] [7]
@vrindfile=@write3
\openout3 = `bashref.vr'.
@@ -218,16 +220,17 @@ Overfull \hbox (5.95723pt too wide) in paragraph at lines 724--725
@rwindfile=@write4
\openout4 = `bashref.rw'.
[9] [10] [11] [12] [13] [14] [15] [16] [17] [18] [19] [20] [21] [22] [23]
[24] [25] [26] [27] [28] [29] [30] [31] [32] [33] [34] [35] [36] [37] [38]
[39] [40] [41] [42] [43] [44] [45] [46] [47] Chapter 4 [48]
[9] [10] [11] [12] [13] [14] [15] [16] [17] [18] [19{/opt/local/share/texmf-tex
live/fonts/enc/dvips/cm-super/cm-super-t1.enc}] [20] [21] [22] [23] [24]
[25] [26] [27] [28] [29] [30] [31] [32] [33] [34] [35] [36] [37] [38] [39]
[40] [41] [42] [43] [44] [45] [46] [47] Chapter 4 [48]
@btindfile=@write5
\openout5 = `bashref.bt'.
[49] [50] [51]
[52] [53] [54] [55] [56] [57] [58] [59] [60] [61] [62] [63] [64] [65] [66]
[67] [68]
Overfull \hbox (38.26585pt too wide) in paragraph at lines 5435--5435
[49] [50] [51] [52]
[53] [54] [55] [56] [57] [58] [59] [60] [61] [62] [63] [64] [65] [66] [67]
[68]
Overfull \hbox (38.26585pt too wide) in paragraph at lines 5436--5436
[]@texttt set [-abefhkmnptuvxBCEHPT] [-o @textttsl option-name@texttt ] [--] [
-] [@textttsl ar-gu-ment []@texttt ][]
@@ -240,7 +243,7 @@ Overfull \hbox (38.26585pt too wide) in paragraph at lines 5435--5435
.etc.
Overfull \hbox (38.26585pt too wide) in paragraph at lines 5436--5436
Overfull \hbox (38.26585pt too wide) in paragraph at lines 5437--5437
[]@texttt set [+abefhkmnptuvxBCEHPT] [+o @textttsl option-name@texttt ] [--] [
-] [@textttsl ar-gu-ment []@texttt ][]
@@ -259,7 +262,7 @@ Overfull \hbox (38.26585pt too wide) in paragraph at lines 5436--5436
[119] [120]
texinfo.tex: doing @include of rluser.texi
(/usr/local/src/bash/bash-20240209/lib/readline/doc/rluser.texi
(/usr/local/src/bash/bash-20240402/lib/readline/doc/rluser.texi
Chapter 8 [121] [122] [123] [124] [125] [126] [127] [128] [129] [130] [131]
[132]
Underfull \hbox (badness 7540) in paragraph at lines 882--888
@@ -309,10 +312,10 @@ gnored[]
texinfo.tex: doing @include of hsuser.texi
(/usr/local/src/bash/bash-20240209/lib/readline/doc/hsuser.texi Chapter 9
(/usr/local/src/bash/bash-20240402/lib/readline/doc/hsuser.texi Chapter 9
[158] [159] [160] [161] [162] [163]) Chapter 10 [164] [165] [166] [167]
[168]
Underfull \hbox (badness 10000) in paragraph at lines 9801--9810
Underfull \hbox (badness 10000) in paragraph at lines 9815--9824
[]@textrm All of the fol-low-ing op-tions ex-cept for `@texttt alt-array-implem
entation[]@textrm '[],
@@ -325,7 +328,7 @@ entation[]@textrm '[],
.etc.
Underfull \hbox (badness 10000) in paragraph at lines 9801--9810
Underfull \hbox (badness 10000) in paragraph at lines 9815--9824
@textrm `@texttt disabled-builtins[]@textrm '[], `@texttt direxpand-default[]@t
extrm '[], `@texttt strict-posix-default[]@textrm '[], and
@@ -341,16 +344,37 @@ extrm '[], `@texttt strict-posix-default[]@textrm '[], and
[178] [179] Appendix C [180]
texinfo.tex: doing @include of fdl.texi
(/usr/local/src/bash/bash-20240209/doc/fdl.texi
(/usr/local/src/bash/bash-20240402/doc/fdl.texi
[181] [182] [183] [184] [185] [186] [187]) Appendix D [188] [189] [190]
[191] [192] [193] [194] [195] [196] [197] )
Here is how much of TeX's memory you used:
3531 strings out of 495850
40273 string characters out of 6172145
89057 words of memory out of 5000000
4879 multiletter control sequences out of 15000+600000
4105 strings out of 495840
47629 string characters out of 6171739
143196 words of memory out of 5000000
5048 multiletter control sequences out of 15000+600000
34315 words of font info for 116 fonts, out of 8000000 for 9000
701 hyphenation exceptions out of 8191
16i,6n,16p,402b,942s stack positions out of 10000i,1000n,20000p,200000b,200000s
16i,6n,16p,331b,983s stack positions out of 10000i,1000n,20000p,200000b,200000s
</opt/local/share/texmf-texlive/font
s/type1/public/amsfonts/cm/cmbx12.pfb></opt/local/share/texmf-texlive/fonts/typ
e1/public/amsfonts/cm/cmcsc10.pfb></opt/local/share/texmf-texlive/fonts/type1/p
ublic/amsfonts/cm/cmmi10.pfb></opt/local/share/texmf-texlive/fonts/type1/public
/amsfonts/cm/cmmi12.pfb></opt/local/share/texmf-texlive/fonts/type1/public/amsf
onts/cm/cmmi9.pfb></opt/local/share/texmf-texlive/fonts/type1/public/amsfonts/c
m/cmr10.pfb></opt/local/share/texmf-texlive/fonts/type1/public/amsfonts/cm/cmr9
.pfb></opt/local/share/texmf-texlive/fonts/type1/public/amsfonts/cm/cmsl10.pfb>
</opt/local/share/texmf-texlive/fonts/type1/public/amsfonts/cm/cmsltt10.pfb></o
pt/local/share/texmf-texlive/fonts/type1/public/amsfonts/cm/cmsy10.pfb></opt/lo
cal/share/texmf-texlive/fonts/type1/public/amsfonts/cm/cmti10.pfb></opt/local/s
hare/texmf-texlive/fonts/type1/public/amsfonts/cm/cmtt10.pfb></opt/local/share/
texmf-texlive/fonts/type1/public/amsfonts/cm/cmtt12.pfb></opt/local/share/texmf
-texlive/fonts/type1/public/amsfonts/cm/cmtt9.pfb></opt/local/share/texmf-texli
ve/fonts/type1/public/cm-super/sfrm1095.pfb></opt/local/share/texmf-texlive/fon
ts/type1/public/cm-super/sfrm1440.pfb>
Output written on bashref.pdf (203 pages, 818717 bytes).
PDF statistics:
2832 PDF objects out of 2984 (max. 8388607)
2582 compressed objects within 26 object streams
331 named destinations out of 1000 (max. 500000)
1157 words of extra memory for PDF output out of 10000 (max. 10000000)
Output written on bashref.dvi (203 pages, 851140 bytes).
BIN
View File
Binary file not shown.
+501 -437
View File
File diff suppressed because it is too large Load Diff
+71 -8
View File
@@ -8767,8 +8767,8 @@ falling back to physical mode.
When the @code{cd} builtin cannot change a directory because the
length of the pathname
constructed from @code{$PWD} and the directory name supplied as an argument
exceeds @code{PATH_MAX} when all symbolic links are expanded, @code{cd} will
fail instead of attempting to use only the supplied directory name.
exceeds @code{PATH_MAX} when canonicalized, @code{cd} will
attempt to use the supplied directory name.
@item
The @code{pwd} builtin verifies that the value it prints is the same as the
@@ -8782,6 +8782,9 @@ indication of whether or not a history entry has been modified.
@item
The default editor used by @code{fc} is @code{ed}.
@item
@code{fc} treats extra arguments as an error instead of ignoring them.
@item
If there are too many arguments supplied to @code{fc -s}, @code{fc} prints
an error message and returns failure.
@@ -9076,6 +9079,14 @@ and word expansions are performed.
It will fail at word expansion time if extglob hasn't been
enabled by the time the command is executed.
@end itemize
@item compat52 (set using BASH_COMPAT)
@itemize @bullet
@item
The @code{test} builtin uses its historical algorithm to parse parenthesized
subexpressions when given five or more arguments.
@end itemize
@end table
@node Job Control
@@ -10170,7 +10181,8 @@ which expands to the substring of @code{var}'s value of length
The expansion
@code{$@{@var{var}/[/]}@var{pattern}@code{[/}@var{replacement}@code{]@}},
which matches @var{pattern} and replaces it with @var{replacement} in
the value of @var{var}, is available (@pxref{Shell Parameter Expansion}).
the value of @var{var}, is available (@pxref{Shell Parameter Expansion}),
with a mechanism to use the matched text in @var{replacement}.
@item
The expansion @code{$@{!@var{prefix}*@}} expansion, which expands to
@@ -10179,18 +10191,28 @@ is available (@pxref{Shell Parameter Expansion}).
@item
Bash has indirect variable expansion using @code{$@{!word@}}
(@pxref{Shell Parameter Expansion}).
(@pxref{Shell Parameter Expansion}) and implements the @code{nameref}
variable attribute for automatic indirect variable expansion.
@item
Bash can expand positional parameters beyond @code{$9} using
@code{$@{@var{num}@}}.
@item
Bash includes a set of parameter transformation word expansions of the
form @code{$@{var@@X@}}, where @samp{X} specifies the transformation.
@item
The @sc{posix} @code{$()} form of command substitution
is implemented (@pxref{Command Substitution}),
and preferred to the Bourne shell's @code{``} (which
is also implemented for backwards compatibility).
@item
Bash implements a variant of command substitution that runs the enclosed
command in the current shell execution environment
(@code{$@{ @var{command};@}}).
@item
Bash has process substitution (@pxref{Process Substitution}).
@@ -10199,8 +10221,16 @@ Bash automatically assigns variables that provide information about the
current user (@env{UID}, @env{EUID}, and @env{GROUPS}), the current host
(@env{HOSTTYPE}, @env{OSTYPE}, @env{MACHTYPE}, and @env{HOSTNAME}),
and the instance of Bash that is running (@env{BASH},
@env{BASH_VERSION}, and @env{BASH_VERSINFO}). @xref{Bash Variables},
for details.
@env{BASH_VERSION}, and @env{BASH_VERSINFO}).
@xref{Bash Variables}, for details.
@item
Bash uses many variables to provide functionality and customize shell
behavior that the Bourne shell does not.
Examples include @env{RANDOM}, @env{SRANDOM}, @env{EPOCHSECONDS},
@env{GLOBSORT}, @env{TIMEFORMAT}, @env{BASHPID}, @env{BASH_XTRACEFD},
@env{GLOBIGNORE}, @env{HISTIGNORE}, and @env{BASH_VERSION}.
@xref{Bash Variables}, for a complete list.
@item
The @env{IFS} variable is used to split only the results of expansion,
@@ -10249,7 +10279,7 @@ file (@pxref{Redirections}).
@item
Bash includes the @samp{<<<} redirection operator, allowing a string to
be used as the standard input to a command.
be used as the standard input to a command (@pxref{Redirections}).
@item
Bash implements the @samp{[n]<&@var{word}} and @samp{[n]>&@var{word}}
@@ -10278,6 +10308,10 @@ Bash allows a function to override a builtin with the same name, and provides
access to that builtin's functionality within the function via the
@code{builtin} and @code{command} builtins (@pxref{Bash Builtins}).
@item
Bash implements support for dynamically loading builtin commands from
shared objects.
@item
The @code{command} builtin allows selective disabling of functions
when command lookup is performed (@pxref{Bash Builtins}).
@@ -10296,6 +10330,19 @@ command, and what the zeroth argument to the command is to be
Shell functions may be exported to children via the environment
using @code{export -f} (@pxref{Shell Functions}).
@item
Bash decodes a number of backslash-escape sequences in the prompt string
variables (@code{PS0}, @code{PS1}, @code{PS2}, and @code{PS4}).
@item
Bash expands and displays the @code{PS0} prompt string variable.
@item
Bash runs commands from the @code{PROMPT_COMMAND} array variable before
issuing each primary prompt.
@item
Bash decodes a number of backslash-escaped characters
@item
The Bash @code{export}, @code{readonly}, and @code{declare} builtins can
take a @option{-f} option to act on shell functions, a @option{-p} option to
@@ -10314,6 +10361,10 @@ searching the @env{$PATH}, using @samp{hash -p}
Bash includes a @code{help} builtin for quick reference to shell
facilities (@pxref{Bash Builtins}).
@item
Bash includes the @code{mapfile} builtin to quickly read the contents
of a file into an indexed array variable.
@item
The @code{printf} builtin is available to display formatted output
(@pxref{Bash Builtins}).
@@ -10350,7 +10401,7 @@ Bash has much more optional behavior controllable with the @code{set}
builtin (@pxref{The Set Builtin}).
@item
The @samp{-x} (@option{xtrace}) option displays commands other than
The @option{-x} (@option{xtrace}) option displays commands other than
simple commands when performing an execution trace
(@pxref{The Set Builtin}).
@@ -10359,6 +10410,12 @@ The @code{test} builtin (@pxref{Bourne Shell Builtins})
is slightly different, as it implements the @sc{posix} algorithm,
which specifies the behavior based on the number of arguments.
@item
The Bash @code{wait} builtin has a @option{-n} option to wait for the
next child to exit, possibly selecting from a list of supplied jobs,
and the @option{-p} option to store information about a terminated
child process in a shell variable.
@item
Bash includes the @code{caller} builtin, which displays the context of
any active subroutine call (a shell function or a script executed with
@@ -10505,6 +10562,12 @@ only for certain failures, as enumerated in the @sc{posix} standard.
@item
The SVR4.2 shell behaves differently when invoked as @code{jsh}
(it turns on job control).
@item
If the @code{lastpipe} option is enabled, and job control is not active,
Bash runs the last element of a pipeline in the current shell execution
environment.
@end itemize
@node GNU Free Documentation License
+1 -1
View File
@@ -133,7 +133,7 @@
@numsecentry{Optional Features}{10.8}{Optional Features}{168}
@appentry{Reporting Bugs}{A}{Reporting Bugs}{174}
@appentry{Major Differences From The Bourne Shell}{B}{Major Differences From The Bourne Shell}{175}
@appsecentry{Implementation Differences From The SVR4.2 Shell}{B.1}{}{179}
@appsecentry{Implementation Differences From The SVR4.2 Shell}{B.1}{}{180}
@appentry{GNU Free Documentation License}{C}{GNU Free Documentation License}{181}
@appentry{Indexes}{D}{Indexes}{189}
@appsecentry{Index of Shell Builtin Commands}{D.1}{Builtin Index}{189}
+2881 -2796
View File
File diff suppressed because it is too large Load Diff
+72 -38
View File
@@ -1,9 +1,10 @@
%!PS-Adobe-3.0
%%Creator: groff version 1.22.4
%%CreationDate: Sun Sep 10 17:14:43 2023
%%DocumentNeededResources: font Times-Roman
%%Creator: groff version 1.23.0
%%CreationDate: Thu Apr 4 17:50:31 2024
%%DocumentNeededResources: font Times-Italic
%%+ font Times-Roman
%%+ font Times-Bold
%%DocumentSuppliedResources: procset grops 1.22 4
%%DocumentSuppliedResources: procset grops 1.23 0
%%Pages: 1
%%PageOrder: Ascend
%%DocumentMedia: Default 612 792 0 () ()
@@ -13,7 +14,7 @@
%%PageMedia: Default
%%EndDefaults
%%BeginProlog
%%BeginResource: procset grops 1.22 4
%%BeginResource: procset grops 1.23 0
%!PS-Adobe-3.0 Resource-ProcSet
/setpacking where{
pop
@@ -21,6 +22,7 @@ currentpacking
true setpacking
}if
/grops 120 dict dup begin
% The ASCII code of the space character.
/SC 32 def
/A/show load def
/B{0 SC 3 -1 roll widthshow}bind def
@@ -42,16 +44,18 @@ true setpacking
/R{moveto 0 SC 3 -1 roll widthshow}bind def
/S{moveto 0 exch ashow}bind def
/T{moveto 0 exch 0 SC 5 2 roll awidthshow}bind def
% name size font SF -
/SF{
findfont exch
[exch dup 0 exch 0 exch neg 0 0]makefont
dup setfont
[exch/setfont cvx]cvx bind def
}bind def
% name a c d font MF -
/MF{
findfont
[5 2 roll
0 3 1 roll
0 3 1 roll % b
neg 0 0]makefont
dup setfont
[exch/setfont cvx]cvx bind def
@@ -60,13 +64,19 @@ dup setfont
/RES 0 def
/PL 0 def
/LS 0 def
% Enable manual feed.
% MANUAL -
/MANUAL{
statusdict begin/manualfeed true store end
}bind def
% Guess the page length.
% This assumes that the imageable area is vertically centered on the page.
% PLG - length
/PLG{
gsave newpath clippath pathbbox grestore
exch pop add exch pop
}bind def
% BP -
/BP{
/level0 save def
1 setlinecap
@@ -84,47 +94,61 @@ LS{
level0 restore
showpage
}def
% centerx centery radius startangle endangle DA -
/DA{
newpath arcn stroke
}bind def
% x y SN - x' y'
% round a position to nearest (pixel + (.25,.25))
/SN{
transform
.25 sub exch .25 sub exch
round .25 add exch round .25 add exch
itransform
}bind def
% endx endy startx starty DL -
% we round the endpoints of the line, so that parallel horizontal
% and vertical lines will appear even
/DL{
SN
moveto
SN
lineto stroke
}bind def
% centerx centery radius DC -
/DC{
newpath 0 360 arc closepath
}bind def
/TM matrix def
% width height centerx centery DE -
/DE{
TM currentmatrix pop
translate scale newpath 0 0 .5 0 360 arc closepath
TM setmatrix
}bind def
% these are for splines
/RC/rcurveto load def
/RL/rlineto load def
/ST/stroke load def
/MT/moveto load def
/CL/closepath load def
% fill the last path
% r g b Fr -
/Fr{
setrgbcolor fill
}bind def
% c m y k Fk -
/setcmykcolor where{
pop
/Fk{
setcmykcolor fill
}bind def
}if
% g Fg -
/Fg{
setgray fill
}bind def
% fill with the "current color"
/FL/fill load def
/LW/setlinewidth load def
/Cr/setrgbcolor load def
@@ -133,6 +157,7 @@ pop
/Ck/setcmykcolor load def
}if
/Cg/setgray load def
% new_font_name encoding_vector old_font_name RE -
/RE{
findfont
dup maxlength 1 index/FontName known not{1 add}if dict begin
@@ -147,6 +172,7 @@ dup/FontName exch def
currentdict end definefont pop
}bind def
/DEFS 0 def
% hpos vpos EBEGIN -
/EBEGIN{
moveto
DEFS begin
@@ -154,11 +180,13 @@ DEFS begin
/EEND/end load def
/CNT 0 def
/level1 0 def
% llx lly newwid wid newht ht newllx newlly PBEGIN -
/PBEGIN{
/level1 save def
translate
div 3 1 roll div exch scale
neg exch neg exch translate
% set the graphics state to default values
0 setgray
0 setlinecap
1 setlinewidth
@@ -177,6 +205,10 @@ newpath
/CNT countdictstack def
userdict begin
/showpage{}def
%
% Any included setpagedevice should be ignored.
% See: http://www.w-beer.de/doc/ps/.
%
/setpagedevice{}def
mark
}bind def
@@ -196,6 +228,7 @@ setpacking
%%BeginFeature: *PageSize Default
<< /PageSize [ 612 792 ] /ImagingBBox null >> setpagedevice
%%EndFeature
%%IncludeResource: font Times-Italic
%%IncludeResource: font Times-Roman
%%IncludeResource: font Times-Bold
grops begin/DEFS 1 dict def DEFS begin/u{.001 mul}bind def end/RES 72
@@ -227,63 +260,64 @@ def/PL 792 def/LS false def/ENC0[/asciicircum/asciitilde/Scaron/Zcaron
/eth/ntilde/ograve/oacute/ocircumflex/otilde/odieresis/divide/oslash
/ugrave/uacute/ucircumflex/udieresis/yacute/thorn/ydieresis]def
/Times-Bold@0 ENC0/Times-Bold RE/Times-Roman@0 ENC0/Times-Roman RE
/Times-Italic@0 ENC0/Times-Italic RE
%%EndSetup
%%Page: 1 1
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@0 SF(RB)72 48 Q 130.47(ASH\(1\) General)-.35 F
(Commands Manual)2.5 E(RB)132.97 E(ASH\(1\))-.35 E/F1 10.95/Times-Bold@0
SF -.219(NA)72 84 S(ME).219 E F0(rbash \255 restricted bash, see)108 96
Q/F2 10/Times-Bold@0 SF(bash)2.5 E F0(\(1\))A F1(RESTRICTED SHELL)72
112.8 Q F0(If)108 124.8 Q F2(bash)3.582 E F0 1.081
(is started with the name)3.581 F F2(rbash)3.581 E F0 3.581(,o)C 3.581
(rt)-3.581 G(he)-3.581 E F2<ad72>3.581 E F0 1.081
/F0 10/Times-Italic@0 SF(RB)72.63 48 Q(ASH)-.25 E/F1 10/Times-Roman@0 SF
131.58(\(1\) General).95 F(Commands Manual)2.5 E F0(RB)134.71 E(ASH)-.25
E F1(\(1\)).95 E/F2 10.95/Times-Bold@0 SF -.219(NA)72 84 S(ME).219 E F1
(rbash \255 restricted bash, see)108 96 Q/F3 10/Times-Bold@0 SF(bash)2.5
E F1(\(1\))A F2(RESTRICTED SHELL)72 112.8 Q F1(If)108 124.8 Q F3(bash)
3.582 E F1 1.081(is started with the name)3.581 F F3(rbash)3.581 E F1
3.581(,o)C 3.581(rt)-3.581 G(he)-3.581 E F3<ad72>3.581 E F1 1.081
(option is supplied at in)3.581 F -.2(vo)-.4 G 1.081
(cation, the shell becomes re-).2 F 2.976(stricted. A)108 136.8 R .476
(restricted shell is used to set up an en)2.976 F .476
(vironment more controlled than the standard shell.)-.4 F .477(It be-)
5.477 F(ha)108 148.8 Q -.15(ve)-.2 G 2.5(si).15 G(dentically to)-2.5 E
F2(bash)2.5 E F0(with the e)2.5 E(xception that the follo)-.15 E
F3(bash)2.5 E F1(with the e)2.5 E(xception that the follo)-.15 E
(wing are disallo)-.25 E(wed or not performed:)-.25 E<83>108 165.6 Q
(changing directories with)144 165.6 Q F2(cd)2.5 E F0<83>108 182.4 Q
(setting or unsetting the v)144 182.4 Q(alues of)-.25 E/F3 9
/Times-Bold@0 SF(SHELL)2.5 E/F4 9/Times-Roman@0 SF(,)A F3 -.666(PA)2.25
G(TH)-.189 E F4(,)A F3(HISTFILE)2.25 E F4(,)A F3(ENV)2.25 E F4(,)A F0
(or)2.25 E F3 -.27(BA)2.5 G(SH_ENV).27 E F0<83>108 199.2 Q
(specifying command names containing)144 199.2 Q F2(/)2.5 E F0<83>108
216 Q(specifying a \214lename containing a)144 216 Q F2(/)2.5 E F0
(as an ar)2.5 E(gument to the)-.18 E F2(.)2.5 E F0 -.2(bu)5 G
(changing directories with)144 165.6 Q F3(cd)2.5 E F1<83>108 182.4 Q
(setting or unsetting the v)144 182.4 Q(alues of)-.25 E/F4 9
/Times-Bold@0 SF(SHELL)2.5 E/F5 9/Times-Roman@0 SF(,)A F4 -.666(PA)2.25
G(TH)-.189 E F5(,)A F4(HISTFILE)2.25 E F5(,)A F4(ENV)2.25 E F5(,)A F1
(or)2.25 E F4 -.27(BA)2.5 G(SH_ENV).27 E F1<83>108 199.2 Q
(specifying command names containing)144 199.2 Q F3(/)2.5 E F1<83>108
216 Q(specifying a \214lename containing a)144 216 Q F3(/)2.5 E F1
(as an ar)2.5 E(gument to the)-.18 E F3(.)2.5 E F1 -.2(bu)5 G
(iltin command).2 E<83>108 232.8 Q
(specifying a \214lename containing a slash as an ar)144 232.8 Q
(gument to the)-.18 E F2(history)2.5 E F0 -.2(bu)2.5 G(iltin command).2
(gument to the)-.18 E F3(history)2.5 E F1 -.2(bu)2.5 G(iltin command).2
E<83>108 249.6 Q .45
(specifying a \214lename containing a slash as an ar)144 249.6 R .449
(gument to the)-.18 F F2<ad70>2.949 E F0 .449(option to the)2.949 F F2
(hash)2.949 E F0 -.2(bu)2.949 G .449(iltin com-).2 F(mand)144 261.6 Q
(gument to the)-.18 F F3<ad70>2.949 E F1 .449(option to the)2.949 F F3
(hash)2.949 E F1 -.2(bu)2.949 G .449(iltin com-).2 F(mand)144 261.6 Q
<83>108 278.4 Q(importing function de\214nitions from the shell en)144
278.4 Q(vironment at startup)-.4 E<83>108 295.2 Q(parsing the v)144
295.2 Q(alue of)-.25 E F3(SHELLOPTS)2.5 E F0(from the shell en)2.25 E
295.2 Q(alue of)-.25 E F4(SHELLOPTS)2.5 E F1(from the shell en)2.25 E
(vironment at startup)-.4 E<83>108 312 Q(redirecting output using the >\
, >|, <>, >&, &>, and >> redirection operators)144 312 Q<83>108 328.8 Q
(using the)144 328.8 Q F2(exec)2.5 E F0 -.2(bu)2.5 G
(using the)144 328.8 Q F3(exec)2.5 E F1 -.2(bu)2.5 G
(iltin command to replace the shell with another command).2 E<83>108
345.6 Q(adding or deleting b)144 345.6 Q(uiltin commands with the)-.2 E
F2<ad66>2.5 E F0(and)2.5 E F2<ad64>2.5 E F0(options to the)2.5 E F2
(enable)2.5 E F0 -.2(bu)2.5 G(iltin command).2 E<83>108 362.4 Q
(using the)144 362.4 Q F2(enable)2.5 E F0 -.2(bu)2.5 G
F3<ad66>2.5 E F1(and)2.5 E F3<ad64>2.5 E F1(options to the)2.5 E F3
(enable)2.5 E F1 -.2(bu)2.5 G(iltin command).2 E<83>108 362.4 Q
(using the)144 362.4 Q F3(enable)2.5 E F1 -.2(bu)2.5 G
(iltin command to enable disabled shell b).2 E(uiltins)-.2 E<83>108
379.2 Q(specifying the)144 379.2 Q F2<ad70>2.5 E F0(option to the)2.5 E
F2(command)2.5 E F0 -.2(bu)2.5 G(iltin command).2 E<83>108 396 Q
(turning of)144 396 Q 2.5(fr)-.25 G(estricted mode with)-2.5 E F2
(set +r)2.5 E F0(or)2.5 E F2(shopt -u r)2.5 E(estricted_shell)-.18 E F0
(.)A(These restrictions are enforced after an)108 412.8 Q 2.5(ys)-.15 G
(tartup \214les are read.)-2.5 E .429
379.2 Q(specifying the)144 379.2 Q F3<ad70>2.5 E F1(option to the)2.5 E
F3(command)2.5 E F1 -.2(bu)2.5 G(iltin command).2 E<83>108 396 Q
(turning of)144 396 Q 2.5(fr)-.25 G(estricted mode with)-2.5 E F3
(set +r)2.5 E F1(or)2.5 E F3(shopt \255u r)2.5 E(estricted_shell)-.18 E
F1(.)A(These restrictions are enforced after an)108 412.8 Q 2.5(ys)-.15
G(tartup \214les are read.)-2.5 E .429
(When a command that is found to be a shell script is e)108 429.6 R -.15
(xe)-.15 G(cuted,).15 E F2(rbash)2.929 E F0 .429(turns of)2.929 F 2.929
(xe)-.15 G(cuted,).15 E F3(rbash)2.929 E F1 .429(turns of)2.929 F 2.929
(fa)-.25 G .729 -.15(ny r)-2.929 H .429(estrictions in the shell).15 F
(spa)108 441.6 Q(wned to e)-.15 E -.15(xe)-.15 G(cute the script.).15 E
F1(SEE ALSO)72 458.4 Q F0(bash\(1\))108 470.4 Q 157.215(Bash-5.2 2021)72
F2(SEE ALSO)72 458.4 Q F1(bash\(1\))108 470.4 Q 157.215(Bash-5.2 2021)72
768 R(No)2.5 E -.15(ve)-.15 G(mber 22).15 E(1)190.545 E 0 Cg EP
%%Trailer
end
+3 -3
View File
@@ -2,10 +2,10 @@
Copyright (C) 1988-2024 Free Software Foundation, Inc.
@end ignore
@set LASTCHANGE Mon Mar 25 10:56:49 EDT 2024
@set LASTCHANGE Fri Apr 5 12:10:00 EDT 2024
@set EDITION 5.3
@set VERSION 5.3
@set UPDATED 25 March 2024
@set UPDATED-MONTH March 2024
@set UPDATED 5 April 2024
@set UPDATED-MONTH April 2024
+42 -7
View File
@@ -184,7 +184,7 @@ static char *getinterp (char *, int, int *);
static void initialize_subshell (void);
static int execute_in_subshell (COMMAND *, int, int, int, struct fd_bitmap *);
#if defined (COPROCESS_SUPPORT)
static void coproc_setstatus (struct coproc *, int);
static void coproc_setstatus (struct coproc *, WAIT);
static int execute_coproc (COMMAND *, int, int, struct fd_bitmap *);
#endif
@@ -2185,7 +2185,11 @@ coproc_reap (void)
cp = &sh_coproc; /* XXX - will require changes for multiple coprocs */
if (cp && (cp->c_flags & COPROC_DEAD))
{
INTERNAL_DEBUG (("coproc_reap: deleting %d", cp->c_pid));
coproc_dispose (cp);
}
#endif
}
@@ -2255,13 +2259,27 @@ coproc_fdrestore (struct coproc *cp)
cp->c_wfd = cp->c_wsave;
}
/* Translate an exit status encoded in WAIT into a coproc state */
static inline int
coproc_getstate (WAIT status)
{
if (WIFEXITED (status) || WIFSIGNALED (status))
return COPROC_DEAD;
else if (WIFSTOPPED (status))
return (COPROC_STOPPED|COPROC_RUNNING);
else if (WIFCONTINUED (status))
return COPROC_RUNNING;
else
return COPROC_DEAD; /* defaults to terminated */
}
static void
coproc_setstatus (struct coproc *cp, int status)
coproc_setstatus (struct coproc *cp, WAIT status)
{
cp->c_lock = 4;
cp->c_status = status;
cp->c_flags |= COPROC_DEAD;
cp->c_flags &= ~COPROC_RUNNING;
cp->c_status = process_exit_status (status);
cp->c_flags &= ~(COPROC_DEAD|COPROC_STOPPED|COPROC_FOREGROUND|COPROC_RUNNING);
cp->c_flags |= coproc_getstate (status);
/* Don't dispose the coproc or unset the COPROC_XXX variables because
this is executed in a signal handler context. Wait until coproc_reap
takes care of it. */
@@ -2269,7 +2287,7 @@ coproc_setstatus (struct coproc *cp, int status)
}
void
coproc_pidchk (pid_t pid, int status)
coproc_pidchk (pid_t pid, WAIT status)
{
struct coproc *cp;
@@ -2417,11 +2435,19 @@ execute_coproc (COMMAND *command, int pipe_in, int pipe_out, struct fd_bitmap *f
Coproc *cp;
char *tcmd, *p, *name;
sigset_t set, oset;
#if !MULTIPLE_COPROCS
int oldrfd, oldwfd;
#endif
/* XXX -- can be removed after changes to handle multiple coprocs */
#if !MULTIPLE_COPROCS
oldrfd = oldwfd = -1;
if (sh_coproc.c_pid != NO_PID && (sh_coproc.c_rfd >= 0 || sh_coproc.c_wfd >= 0))
internal_warning (_("execute_coproc: coproc [%d:%s] still exists"), sh_coproc.c_pid, sh_coproc.c_name);
{
internal_warning (_("execute_coproc: coproc [%d:%s] still exists"), sh_coproc.c_pid, sh_coproc.c_name);
oldrfd = sh_coproc.c_rfd;
oldwfd = sh_coproc.c_wfd;
}
coproc_init (&sh_coproc);
#endif
@@ -2457,6 +2483,15 @@ execute_coproc (COMMAND *command, int pipe_in, int pipe_out, struct fd_bitmap *f
close (rpipe[0]);
close (wpipe[1]);
#if !MULTIPLE_COPROCS
/* Do this here instead of letting execute_in_subshell call
coproc_closeall since we've already overwritten sh_coproc */
if (oldrfd != -1)
close (oldrfd);
if (oldwfd != -1)
close (oldwfd);
#endif
#if defined (JOB_CONTROL)
FREE (p);
#endif
+4 -1
View File
@@ -105,7 +105,10 @@ extern void coproc_fdclose (struct coproc *, int);
extern void coproc_checkfd (struct coproc *, int);
extern void coproc_fdchk (int);
extern void coproc_pidchk (pid_t, int);
#if defined _POSIXWAIT_H_
extern void coproc_pidchk (pid_t, WAIT);
extern void coproc_setstate (pid_t, WAIT);
#endif
extern void coproc_fdsave (struct coproc *);
extern void coproc_fdrestore (struct coproc *);
+3 -4
View File
@@ -261,7 +261,6 @@ static int job_last_running (int);
static int most_recent_job_in_state (int, JOB_STATE);
static int find_job (pid_t, int, PROCESS **);
static int print_job (JOB *, int, int, int);
static int process_exit_status (WAIT);
static int process_exit_signal (WAIT);
static int set_job_status_and_cleanup (int);
@@ -2775,7 +2774,7 @@ process_exit_signal (WAIT status)
return (WIFSIGNALED (status) ? WTERMSIG (status) : 0);
}
static int
int
process_exit_status (WAIT status)
{
if (WIFSIGNALED (status))
@@ -2821,7 +2820,7 @@ raw_job_exit_status (int job)
do
{
if (WSTATUS (p->status) != EXECUTION_SUCCESS)
fail = WSTATUS(p->status);
fail = WSTATUS (p->status);
p = p->next;
}
while (p != jobs[job]->pipe);
@@ -3889,7 +3888,7 @@ itrace("waitchld: waitpid returns %d block = %d children_exited = %d", pid, bloc
child = find_process (pid, 1, &job); /* want living procs only */
#if defined (COPROCESS_SUPPORT)
coproc_pidchk (pid, WSTATUS(status));
coproc_pidchk (pid, status);
#endif
#if defined (PROCESS_SUBSTITUTION)
+2
View File
@@ -281,6 +281,8 @@ extern int set_tty_state (void);
extern int job_exit_status (int);
extern int job_exit_signal (int);
extern int process_exit_status (WAIT);
extern int wait_for_single_pid (pid_t, int);
extern int wait_for_background_pids (struct procstat *);
extern int wait_for (pid_t, int);
+2 -3
View File
@@ -3,7 +3,7 @@
/* This file works under BSD, System V, minix, and Posix systems. It does
not implement job control. */
/* Copyright (C) 1987-2023 Free Software Foundation, Inc.
/* Copyright (C) 1987-2024 Free Software Foundation, Inc.
This file is part of GNU Bash, the Bourne Again SHell.
@@ -123,7 +123,6 @@ static void alloc_pid_list (void);
static int find_proc_slot (pid_t);
static int find_index_by_pid (pid_t);
static int find_status_by_pid (pid_t);
static int process_exit_status (WAIT);
static int find_termsig_by_pid (pid_t);
static int get_termsig (WAIT);
static void set_pid_status (pid_t, WAIT);
@@ -210,7 +209,7 @@ find_status_by_pid (pid_t pid)
return (pid_list[i].status);
}
static int
int
process_exit_status (WAIT status)
{
if (WIFSIGNALED (status))
+1 -1
View File
@@ -73,7 +73,7 @@ test.c
trap.c
variables.c
version.c
version2.c
#version2.c
xmalloc.c
# Apparently gettext's defaults cannot handle files that exist outside of the
BIN
View File
Binary file not shown.
+684 -581
View File
File diff suppressed because it is too large Load Diff
+4273
View File
File diff suppressed because it is too large Load Diff
+681 -579
View File
File diff suppressed because it is too large Load Diff
BIN
View File
Binary file not shown.
+1667 -1023
View File
File diff suppressed because it is too large Load Diff
BIN
View File
Binary file not shown.
+1204 -793
View File
File diff suppressed because it is too large Load Diff
BIN
View File
Binary file not shown.
+1477 -926
View File
File diff suppressed because it is too large Load Diff
BIN
View File
Binary file not shown.
+734 -590
View File
File diff suppressed because it is too large Load Diff
BIN
View File
Binary file not shown.
+1172 -772
View File
File diff suppressed because it is too large Load Diff
BIN
View File
Binary file not shown.
+702 -585
View File
File diff suppressed because it is too large Load Diff
Binary file not shown.
+813 -673
View File
File diff suppressed because it is too large Load Diff
BIN
View File
Binary file not shown.
+808 -669
View File
File diff suppressed because it is too large Load Diff
BIN
View File
Binary file not shown.
+741 -586
View File
File diff suppressed because it is too large Load Diff
BIN
View File
Binary file not shown.
+1235 -801
View File
File diff suppressed because it is too large Load Diff
BIN
View File
Binary file not shown.
+693 -583
View File
File diff suppressed because it is too large Load Diff
BIN
View File
Binary file not shown.
+731 -586
View File
File diff suppressed because it is too large Load Diff
BIN
View File
Binary file not shown.
+2272 -1305
View File
File diff suppressed because it is too large Load Diff
BIN
View File
Binary file not shown.
+734 -583
View File
File diff suppressed because it is too large Load Diff
BIN
View File
Binary file not shown.
+726 -584
View File
File diff suppressed because it is too large Load Diff
BIN
View File
Binary file not shown.
+1236 -811
View File
File diff suppressed because it is too large Load Diff
BIN
View File
Binary file not shown.
+735 -583
View File
File diff suppressed because it is too large Load Diff
BIN
View File
Binary file not shown.
+733 -585
View File
File diff suppressed because it is too large Load Diff
BIN
View File
Binary file not shown.
+743 -596
View File
File diff suppressed because it is too large Load Diff
BIN
View File
Binary file not shown.
+1273 -830
View File
File diff suppressed because it is too large Load Diff
BIN
View File
Binary file not shown.
+938 -686
View File
File diff suppressed because it is too large Load Diff
BIN
View File
Binary file not shown.
+1099 -743
View File
File diff suppressed because it is too large Load Diff
BIN
View File
Binary file not shown.
+717 -584
View File
File diff suppressed because it is too large Load Diff
BIN
View File
Binary file not shown.
+1319 -848
View File
File diff suppressed because it is too large Load Diff
BIN
View File
Binary file not shown.
+1409 -897
View File
File diff suppressed because it is too large Load Diff
BIN
View File
Binary file not shown.
+1329 -849
View File
File diff suppressed because it is too large Load Diff
BIN
View File
Binary file not shown.
+745 -590
View File
File diff suppressed because it is too large Load Diff
BIN
View File
Binary file not shown.
+1927 -1137
View File
File diff suppressed because it is too large Load Diff
BIN
View File
Binary file not shown.
+1690 -1020
View File
File diff suppressed because it is too large Load Diff
BIN
View File
Binary file not shown.
+1996 -2092
View File
File diff suppressed because it is too large Load Diff
BIN
View File
Binary file not shown.

Some files were not shown because too many files have changed in this diff Show More