fix for programmable completion functions setting traps on signals that readline handles

This commit is contained in:
Chet Ramey
2022-12-06 10:41:41 -05:00
parent 198210c58f
commit 237c32ba16
28 changed files with 3223 additions and 3018 deletions
+41
View File
@@ -4613,3 +4613,44 @@ lib/glob/sm_loop.c
lib/glob/{glob,gmisc}.c
- PATSCAN: change all callers to add extra flags arg of 0
doc/{bash.1,bashref.texi}
- trap description: replace ARG with ACTION
- clarify the language describing what trap without arguments and
trap -p without arguments display
- clarify that trap in non-interactive shells does not allow signals
that were ignored at shell start to be trapped; interactive shells
allow this
- trap: add missing command types to the description of when the
DEBUG trap is executed
builtins/trap.def
- LONG_DOC: replace ARG with ACTION
- make it clear that trap and trap -p without arguments display a
information about specified signals, but in a form that may be
reused as shell input
12/5
----
pcomplete.c
- compgen_compspec: new flag saying whether or not we're running via
the compgen builtin or via programmable completion: set to 0
every time gen_progcomp_completions runs, set to 1 in
gen_compspec_completions if this_shell_builtin == compgen_builtin
- gen_shell_function_completions: call rl_clear_signals and
rl_set_signals so the shell's signal handlers are active when
running shell functions to generate completions. We try to do it
only when programmable completion, not the compgen builtin, is active.
Idea from Koichi Murase <myoga.murase@gmail.com>, fixes bug
reported in 9/22
sig.c
- sigint_sighandler, termsig_sighandler: since these can now be called
during programmable completion, we need to set the readline signal
event hook if the readline state includes RL_STATE_DISPATCHING or
RL_STATE_COMPLETING, since we can't rely on RL_STATE_SIGHANDLER
being set and we want to call throw_to_top_level here
- throw_to_top_level: if the shell is interactive, before calling
bashline_reset (which zeroes rl_signal_event_hook), call
rl_cleanup_after_signal if we think readline hasn't called it
already
+3 -2
View File
@@ -169,8 +169,9 @@ The following list is what's changed when 'POSIX mode' is in effect:
handler for a given signal to the original disposition, they should
use '-' as the first argument.
42. 'trap -p' displays signals whose dispositions are set to SIG_DFL
and those that were ignored when the shell started.
42. '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.
43. The '.' and 'source' builtins do not search the current directory
for the filename argument if it is not found by searching 'PATH'.
+16 -12
View File
@@ -22,31 +22,35 @@ $PRODUCES trap.c
$BUILTIN trap
$FUNCTION trap_builtin
$SHORT_DOC trap [-lp] [[arg] signal_spec ...]
$SHORT_DOC trap [-lp] [[action] signal_spec ...]
Trap signals and other events.
Defines and activates handlers to be run when the shell receives signals
or other conditions.
ARG is a command to be read and executed when the shell receives the
signal(s) SIGNAL_SPEC. If ARG is absent (and a single SIGNAL_SPEC
ACTION is a command to be read and executed when the shell receives the
signal(s) SIGNAL_SPEC. If ACTION is absent (and a single SIGNAL_SPEC
is supplied) or `-', each specified signal is reset to its original
value. If ARG is the null string each SIGNAL_SPEC is ignored by the
value. If ACTION is the null string each SIGNAL_SPEC is ignored by the
shell and by the commands it invokes.
If a SIGNAL_SPEC is EXIT (0) ARG is executed on exit from the shell. If
a SIGNAL_SPEC is DEBUG, ARG is executed before every simple command. If
a SIGNAL_SPEC is RETURN, ARG is executed each time a shell function or a
script run by the . or source builtins finishes executing. A SIGNAL_SPEC
of ERR means to execute ARG each time a command's failure would cause the
shell to exit when the -e option is enabled.
If a SIGNAL_SPEC is EXIT (0) ACTION is executed on exit from the shell.
If a SIGNAL_SPEC is DEBUG, ACTION is executed before every simple command
and selected other commands. If a SIGNAL_SPEC is RETURN, ACTION is
executed each time a shell function or a script run by the . or source
builtins finishes executing. A SIGNAL_SPEC of ERR means to execute ACTION
each time a command's failure would cause the shell to exit when the -e
option is enabled.
If no arguments are supplied, trap prints the list of commands associated
with each signal.
with each trapped signal in a form that may be reused as shell input to
restore the same signal dispositions.
Options:
-l print a list of signal names and their corresponding numbers
-p display the trap commands associated with each SIGNAL_SPEC
-p display the trap commands associated with each SIGNAL_SPEC in a
form that may be reused as shell input; or for all trapped
signals if no arguments are supplied
Each SIGNAL_SPEC is either a signal name in <signal.h> or a signal number.
Signal names are case insensitive and the SIG prefix is optional. A
+212 -203
View File
@@ -683,7 +683,7 @@ QQUUOOTTIINNGG
fault, whether or not it is translated and replaced. If the nnooeexx--
ppaanndd__ttrraannssllaattiioonn option is enabled using the sshhoopptt builtin, translated
strings are single-quoted instead of double-quoted. See the descrip-
tion of sshhoopptt below under SSHHEELLLLBUILTINCCOOMMMMAANNDDSS.
tion of sshhoopptt below under SSHHEELLLL BBUUIILLTTIINN CCOOMMMMAANNDDSS.
PPAARRAAMMEETTEERRSS
A _p_a_r_a_m_e_t_e_r is an entity that stores values. It can be a _n_a_m_e, a num-
@@ -2154,7 +2154,7 @@ EEXXPPAANNSSIIOONN
!!((_p_a_t_t_e_r_n_-_l_i_s_t))
Matches anything except one of the given patterns
Theeexxttgglloobb option changes the behavior of the parser, since the paren-
The eexxttgglloobb option changes the behavior of the parser, since the paren-
theses are normally treated as operators with syntactic meaning. To
ensure that extended matching patterns are parsed correctly, make sure
that eexxttgglloobb is enabled before parsing constructs containing the pat-
@@ -6204,34 +6204,42 @@ SSHHEELLLL BBUUIILLTTIINN CCOOMMMMAANNDDSS
ttiimmeess Print the accumulated user and system times for the shell and
for processes run from the shell. The return status is 0.
ttrraapp [--llpp] [[_a_r_g] _s_i_g_s_p_e_c ...]
The command _a_r_g is to be read and executed when the shell re-
ceives signal(s) _s_i_g_s_p_e_c. If _a_r_g is absent (and there is a sin-
gle _s_i_g_s_p_e_c) or --, each specified signal is reset to its origi-
nal disposition (the value it had upon entrance to the shell).
If _a_r_g is the null string the signal specified by each _s_i_g_s_p_e_c
is ignored by the shell and by the commands it invokes. If _a_r_g
is not present and --pp has been supplied, then the trap commands
associated with each _s_i_g_s_p_e_c are displayed. If no arguments are
supplied or if only --pp is given, ttrraapp prints the list of com-
mands associated with each signal. The --ll option causes the
shell to print a list of signal names and their corresponding
numbers. Each _s_i_g_s_p_e_c is either a signal name defined in <_s_i_g_-
_n_a_l_._h>, or a signal number. Signal names are case insensitive
and the SSIIGG prefix is optional.
ttrraapp [--llpp] [[_a_c_t_i_o_n] _s_i_g_s_p_e_c ...]
The _a_c_t_i_o_n is a command that is read and executed when the shell
receives signal(s) _s_i_g_s_p_e_c. If _a_c_t_i_o_n is absent (and there is a
single _s_i_g_s_p_e_c) or --, each specified signal is reset to its
original disposition (the value it had upon entrance to the
shell). If _a_c_t_i_o_n is the null string the signal specified by
each _s_i_g_s_p_e_c is ignored by the shell and by the commands it in-
vokes.
If a _s_i_g_s_p_e_c is EEXXIITT (0) the command _a_r_g is executed on exit
from the shell. If a _s_i_g_s_p_e_c is DDEEBBUUGG, the command _a_r_g is exe-
cuted before every _s_i_m_p_l_e _c_o_m_m_a_n_d, _f_o_r command, _c_a_s_e command,
_s_e_l_e_c_t command, every arithmetic _f_o_r command, and before the
first command executes in a shell function (see SSHHEELLLL GGRRAAMMMMAARR
above). Refer to the description of the eexxttddeebbuugg option to the
sshhoopptt builtin for details of its effect on the DDEEBBUUGG trap. If a
_s_i_g_s_p_e_c is RREETTUURRNN, the command _a_r_g is executed each time a shell
function or a script executed with the .. or ssoouurrccee builtins fin-
ishes executing.
If no arguments are supplied, ttrraapp displays the actions associ-
ated with each trapped signal as a set of ttrraapp commands that can
be reused as shell input to restore the current signal disposi-
tions. If --pp is given, and _a_c_t_i_o_n is not present, then ttrraapp
displays the actions associated with each _s_i_g_s_p_e_c or, if none
are supplied, for all trapped signals, as a set of ttrraapp commands
that can be reused as shell input to restore the current signal
dispositions.
If a _s_i_g_s_p_e_c is EERRRR, the command _a_r_g is executed whenever a
The --ll option causes ttrraapp to print a list of signal names and
their corresponding numbers. Each _s_i_g_s_p_e_c is either a signal
name defined in <_s_i_g_n_a_l_._h>, or a signal number. Signal names
are case insensitive and the SSIIGG prefix is optional.
If a _s_i_g_s_p_e_c is EEXXIITT (0) the command _a_c_t_i_o_n is executed on exit
from the shell. If a _s_i_g_s_p_e_c is DDEEBBUUGG, the command _a_c_t_i_o_n is
executed before every _s_i_m_p_l_e _c_o_m_m_a_n_d, _f_o_r command, _c_a_s_e command,
_s_e_l_e_c_t command, (( arithmetic command, [[ conditional command,
arithmetic _f_o_r command, and before the first command executes in
a shell function (see SSHHEELLLL GGRRAAMMMMAARR above). Refer to the de-
scription of the eexxttddeebbuugg option to the sshhoopptt builtin for de-
tails of its effect on the DDEEBBUUGG trap. If a _s_i_g_s_p_e_c is RREETTUURRNN,
the command _a_c_t_i_o_n is executed each time a shell function or a
script executed with the .. or ssoouurrccee builtins finishes execut-
ing.
If a _s_i_g_s_p_e_c is EERRRR, the command _a_c_t_i_o_n is executed whenever a
pipeline (which may consist of a single simple command), a list,
or a compound command returns a non-zero exit status, subject to
the following conditions. The EERRRR trap is not executed if the
@@ -6243,61 +6251,62 @@ SSHHEELLLL BBUUIILLTTIINN CCOOMMMMAANNDDSS
!!. These are the same conditions obeyed by the eerrrreexxiitt (--ee) op-
tion.
Signals ignored upon entry to the shell cannot be trapped or re-
set. Trapped signals that are not being ignored are reset to
their original values in a subshell or subshell environment when
one is created. The return status is false if any _s_i_g_s_p_e_c is
invalid; otherwise ttrraapp returns true.
When the shell is not interactive, signals ignored upon entry to
the shell cannot be trapped or reset. Interactive shells permit
trapping signals ignored on entry. Trapped signals that are not
being ignored are reset to their original values in a subshell
or subshell environment when one is created. The return status
is false if any _s_i_g_s_p_e_c is invalid; otherwise ttrraapp returns true.
ttyyppee [--aaffttppPP] _n_a_m_e [_n_a_m_e ...]
With no options, indicate how each _n_a_m_e would be interpreted if
With no options, indicate how each _n_a_m_e would be interpreted if
used as a command name. If the --tt option is used, ttyyppee prints a
string which is one of _a_l_i_a_s, _k_e_y_w_o_r_d, _f_u_n_c_t_i_o_n, _b_u_i_l_t_i_n, or
_f_i_l_e if _n_a_m_e is an alias, shell reserved word, function,
builtin, or disk file, respectively. If the _n_a_m_e is not found,
then nothing is printed, and an exit status of false is re-
turned. If the --pp option is used, ttyyppee either returns the name
of the disk file that would be executed if _n_a_m_e were specified
as a command name, or nothing if ``type -t name'' would not re-
turn _f_i_l_e. The --PP option forces a PPAATTHH search for each _n_a_m_e,
string which is one of _a_l_i_a_s, _k_e_y_w_o_r_d, _f_u_n_c_t_i_o_n, _b_u_i_l_t_i_n, or
_f_i_l_e if _n_a_m_e is an alias, shell reserved word, function,
builtin, or disk file, respectively. If the _n_a_m_e is not found,
then nothing is printed, and an exit status of false is re-
turned. If the --pp option is used, ttyyppee either returns the name
of the disk file that would be executed if _n_a_m_e were specified
as a command name, or nothing if ``type -t name'' would not re-
turn _f_i_l_e. The --PP option forces a PPAATTHH search for each _n_a_m_e,
even if ``type -t name'' would not return _f_i_l_e. If a command is
hashed, --pp and --PP print the hashed value, which is not necessar-
ily the file that appears first in PPAATTHH. If the --aa option is
used, ttyyppee prints all of the places that contain an executable
ily the file that appears first in PPAATTHH. If the --aa option is
used, ttyyppee prints all of the places that contain an executable
named _n_a_m_e. This includes aliases and functions, if and only if
the --pp option is not also used. The table of hashed commands is
not consulted when using --aa. The --ff option suppresses shell
not consulted when using --aa. The --ff option suppresses shell
function lookup, as with the ccoommmmaanndd builtin. ttyyppee returns true
if all of the arguments are found, false if any are not found.
uulliimmiitt [--HHSS] --aa
uulliimmiitt [--HHSS] [--bbccddeeffiikkllmmnnppqqrrssttuuvvxxPPRRTT [_l_i_m_i_t]]
Provides control over the resources available to the shell and
to processes started by it, on systems that allow such control.
Provides control over the resources available to the shell and
to processes started by it, on systems that allow such control.
The --HH and --SS options specify that the hard or soft limit is set
for the given resource. A hard limit cannot be increased by a
non-root user once it is set; a soft limit may be increased up
to the value of the hard limit. If neither --HH nor --SS is speci-
for the given resource. A hard limit cannot be increased by a
non-root user once it is set; a soft limit may be increased up
to the value of the hard limit. If neither --HH nor --SS is speci-
fied, both the soft and hard limits are set. The value of _l_i_m_i_t
can be a number in the unit specified for the resource or one of
the special values hhaarrdd, ssoofftt, or uunnlliimmiitteedd, which stand for the
current hard limit, the current soft limit, and no limit, re-
spectively. If _l_i_m_i_t is omitted, the current value of the soft
current hard limit, the current soft limit, and no limit, re-
spectively. If _l_i_m_i_t is omitted, the current value of the soft
limit of the resource is printed, unless the --HH option is given.
When more than one resource is specified, the limit name and
unit, if appropriate, are printed before the value. Other op-
When more than one resource is specified, the limit name and
unit, if appropriate, are printed before the value. Other op-
tions are interpreted as follows:
--aa All current limits are reported; no limits are set
--bb The maximum socket buffer size
--cc The maximum size of core files created
--dd The maximum size of a process's data segment
--ee The maximum scheduling priority ("nice")
--ff The maximum size of files written by the shell and its
--ff The maximum size of files written by the shell and its
children
--ii The maximum number of pending signals
--kk The maximum number of kqueues that may be allocated
--ll The maximum size that may be locked into memory
--mm The maximum resident set size (many systems do not honor
--mm The maximum resident set size (many systems do not honor
this limit)
--nn The maximum number of open file descriptors (most systems
do not allow this value to be set)
@@ -6306,134 +6315,134 @@ SSHHEELLLL BBUUIILLTTIINN CCOOMMMMAANNDDSS
--rr The maximum real-time scheduling priority
--ss The maximum stack size
--tt The maximum amount of cpu time in seconds
--uu The maximum number of processes available to a single
--uu The maximum number of processes available to a single
user
--vv The maximum amount of virtual memory available to the
--vv The maximum amount of virtual memory available to the
shell and, on some systems, to its children
--xx The maximum number of file locks
--PP The maximum number of pseudoterminals
--RR The maximum time a real-time process can run before
--RR The maximum time a real-time process can run before
blocking, in microseconds
--TT The maximum number of threads
If _l_i_m_i_t is given, and the --aa option is not used, _l_i_m_i_t is the
new value of the specified resource. If no option is given,
then --ff is assumed. Values are in 1024-byte increments, except
for --tt, which is in seconds; --RR, which is in microseconds; --pp,
which is in units of 512-byte blocks; --PP, --TT, --bb, --kk, --nn, and
--uu, which are unscaled values; and, when in posix mode, --cc and
--ff, which are in 512-byte increments. The return status is 0
unless an invalid option or argument is supplied, or an error
If _l_i_m_i_t is given, and the --aa option is not used, _l_i_m_i_t is the
new value of the specified resource. If no option is given,
then --ff is assumed. Values are in 1024-byte increments, except
for --tt, which is in seconds; --RR, which is in microseconds; --pp,
which is in units of 512-byte blocks; --PP, --TT, --bb, --kk, --nn, and
--uu, which are unscaled values; and, when in posix mode, --cc and
--ff, which are in 512-byte increments. The return status is 0
unless an invalid option or argument is supplied, or an error
occurs while setting a new limit.
uummaasskk [--pp] [--SS] [_m_o_d_e]
The user file-creation mask is set to _m_o_d_e. If _m_o_d_e begins with
a digit, it is interpreted as an octal number; otherwise it is
interpreted as a symbolic mode mask similar to that accepted by
_c_h_m_o_d(1). If _m_o_d_e is omitted, the current value of the mask is
printed. The --SS option causes the mask to be printed in sym-
bolic form; the default output is an octal number. If the --pp
a digit, it is interpreted as an octal number; otherwise it is
interpreted as a symbolic mode mask similar to that accepted by
_c_h_m_o_d(1). If _m_o_d_e is omitted, the current value of the mask is
printed. The --SS option causes the mask to be printed in sym-
bolic form; the default output is an octal number. If the --pp
option is supplied, and _m_o_d_e is omitted, the output is in a form
that may be reused as input. The return status is 0 if the mode
was successfully changed or if no _m_o_d_e argument was supplied,
was successfully changed or if no _m_o_d_e argument was supplied,
and false otherwise.
uunnaalliiaass [-aa] [_n_a_m_e ...]
Remove each _n_a_m_e from the list of defined aliases. If --aa is
supplied, all alias definitions are removed. The return value
Remove each _n_a_m_e from the list of defined aliases. If --aa is
supplied, all alias definitions are removed. The return value
is true unless a supplied _n_a_m_e is not a defined alias.
uunnsseett [-ffvv] [-nn] [_n_a_m_e ...]
For each _n_a_m_e, remove the corresponding variable or function.
For each _n_a_m_e, remove the corresponding variable or function.
If the --vv option is given, each _n_a_m_e refers to a shell variable,
and that variable is removed. Read-only variables may not be
unset. If --ff is specified, each _n_a_m_e refers to a shell func-
tion, and the function definition is removed. If the --nn option
is supplied, and _n_a_m_e is a variable with the _n_a_m_e_r_e_f attribute,
_n_a_m_e will be unset rather than the variable it references. --nn
has no effect if the --ff option is supplied. If no options are
supplied, each _n_a_m_e refers to a variable; if there is no vari-
able by that name, a function with that name, if any, is unset.
Each unset variable or function is removed from the environment
passed to subsequent commands. If any of BBAASSHH__AALLIIAASSEESS,
and that variable is removed. Read-only variables may not be
unset. If --ff is specified, each _n_a_m_e refers to a shell func-
tion, and the function definition is removed. If the --nn option
is supplied, and _n_a_m_e is a variable with the _n_a_m_e_r_e_f attribute,
_n_a_m_e will be unset rather than the variable it references. --nn
has no effect if the --ff option is supplied. If no options are
supplied, each _n_a_m_e refers to a variable; if there is no vari-
able by that name, a function with that name, if any, is unset.
Each unset variable or function is removed from the environment
passed to subsequent commands. If any of BBAASSHH__AALLIIAASSEESS,
BBAASSHH__AARRGGVV00, BBAASSHH__CCMMDDSS, BBAASSHH__CCOOMMMMAANNDD, BBAASSHH__SSUUBBSSHHEELLLL, BBAASSHHPPIIDD,
CCOOMMPP__WWOORRDDBBRREEAAKKSS, DDIIRRSSTTAACCKK, EEPPOOCCHHRREEAALLTTIIMMEE, EEPPOOCCHHSSEECCOONNDDSS, FFUUNNCC--
NNAAMMEE, GGRROOUUPPSS, HHIISSTTCCMMDD, LLIINNEENNOO, RRAANNDDOOMM, SSEECCOONNDDSS, or SSRRAANNDDOOMM are
CCOOMMPP__WWOORRDDBBRREEAAKKSS, DDIIRRSSTTAACCKK, EEPPOOCCHHRREEAALLTTIIMMEE, EEPPOOCCHHSSEECCOONNDDSS, FFUUNNCC--
NNAAMMEE, GGRROOUUPPSS, HHIISSTTCCMMDD, LLIINNEENNOO, RRAANNDDOOMM, SSEECCOONNDDSS, or SSRRAANNDDOOMM are
unset, they lose their special properties, even if they are sub-
sequently reset. The exit status is true unless a _n_a_m_e is read-
only or may not be unset.
wwaaiitt [--ffnn] [--pp _v_a_r_n_a_m_e] [_i_d _._._.]
Wait for each specified child process and return its termination
status. Each _i_d may be a process ID or a job specification; if
a job spec is given, all processes in that job's pipeline are
waited for. If _i_d is not given, wwaaiitt waits for all running
background jobs and the last-executed process substitution, if
status. Each _i_d may be a process ID or a job specification; if
a job spec is given, all processes in that job's pipeline are
waited for. If _i_d is not given, wwaaiitt waits for all running
background jobs and the last-executed process substitution, if
its process id is the same as $$!!, and the return status is zero.
If the --nn option is supplied, wwaaiitt waits for a single job from
If the --nn option is supplied, wwaaiitt waits for a single job from
the list of _i_ds or, if no _i_ds are supplied, any job, to complete
and returns its exit status. If none of the supplied arguments
and returns its exit status. If none of the supplied arguments
is a child of the shell, or if no arguments are supplied and the
shell has no unwaited-for children, the exit status is 127. If
the --pp option is supplied, the process or job identifier of the
job for which the exit status is returned is assigned to the
variable _v_a_r_n_a_m_e named by the option argument. The variable
will be unset initially, before any assignment. This is useful
only when the --nn option is supplied. Supplying the --ff option,
when job control is enabled, forces wwaaiitt to wait for _i_d to ter-
shell has no unwaited-for children, the exit status is 127. If
the --pp option is supplied, the process or job identifier of the
job for which the exit status is returned is assigned to the
variable _v_a_r_n_a_m_e named by the option argument. The variable
will be unset initially, before any assignment. This is useful
only when the --nn option is supplied. Supplying the --ff option,
when job control is enabled, forces wwaaiitt to wait for _i_d to ter-
minate before returning its status, instead of returning when it
changes status. If _i_d specifies a non-existent process or job,
the return status is 127. If wwaaiitt is interrupted by a signal,
the return status will be greater than 128, as described under
SSIIGGNNAALLSS above. Otherwise, the return status is the exit status
changes status. If _i_d specifies a non-existent process or job,
the return status is 127. If wwaaiitt is interrupted by a signal,
the return status will be greater than 128, as described under
SSIIGGNNAALLSS above. Otherwise, the return status is the exit status
of the last process or job waited for.
SSHHEELLLL CCOOMMPPAATTIIBBIILLIITTYY MMOODDEE
Bash-4.0 introduced the concept of a _s_h_e_l_l _c_o_m_p_a_t_i_b_i_l_i_t_y _l_e_v_e_l, speci-
fied as a set of options to the shopt builtin ( ccoommppaatt3311, ccoommppaatt3322,
ccoommppaatt4400, ccoommppaatt4411, and so on). There is only one current compatibil-
ity level -- each option is mutually exclusive. The compatibility
level is intended to allow users to select behavior from previous ver-
sions that is incompatible with newer versions while they migrate
scripts to use current features and behavior. It's intended to be a
Bash-4.0 introduced the concept of a _s_h_e_l_l _c_o_m_p_a_t_i_b_i_l_i_t_y _l_e_v_e_l, speci-
fied as a set of options to the shopt builtin ( ccoommppaatt3311, ccoommppaatt3322,
ccoommppaatt4400, ccoommppaatt4411, and so on). There is only one current compatibil-
ity level -- each option is mutually exclusive. The compatibility
level is intended to allow users to select behavior from previous ver-
sions that is incompatible with newer versions while they migrate
scripts to use current features and behavior. It's intended to be a
temporary solution.
This section does not mention behavior that is standard for a particu-
lar version (e.g., setting ccoommppaatt3322 means that quoting the rhs of the
regexp matching operator quotes special regexp characters in the word,
This section does not mention behavior that is standard for a particu-
lar version (e.g., setting ccoommppaatt3322 means that quoting the rhs of the
regexp matching operator quotes special regexp characters in the word,
which is default behavior in bash-3.2 and subsequent versions).
If a user enables, say, ccoommppaatt3322, it may affect the behavior of other
compatibility levels up to and including the current compatibility
level. The idea is that each compatibility level controls behavior
that changed in that version of bbaasshh, but that behavior may have been
present in earlier versions. For instance, the change to use locale-
based comparisons with the [[[[ command came in bash-4.1, and earlier
If a user enables, say, ccoommppaatt3322, it may affect the behavior of other
compatibility levels up to and including the current compatibility
level. The idea is that each compatibility level controls behavior
that changed in that version of bbaasshh, but that behavior may have been
present in earlier versions. For instance, the change to use locale-
based comparisons with the [[[[ command came in bash-4.1, and earlier
versions used ASCII-based comparisons, so enabling ccoommppaatt3322 will enable
ASCII-based comparisons as well. That granularity may not be suffi-
cient for all uses, and as a result users should employ compatibility
levels carefully. Read the documentation for a particular feature to
ASCII-based comparisons as well. That granularity may not be suffi-
cient for all uses, and as a result users should employ compatibility
levels carefully. Read the documentation for a particular feature to
find out the current behavior.
Bash-4.3 introduced a new shell variable: BBAASSHH__CCOOMMPPAATT. The value as-
Bash-4.3 introduced a new shell variable: BBAASSHH__CCOOMMPPAATT. The value as-
signed to this variable (a decimal version number like 4.2, or an inte-
ger corresponding to the ccoommppaatt_N_N option, like 42) determines the com-
ger corresponding to the ccoommppaatt_N_N option, like 42) determines the com-
patibility level.
Starting with bash-4.4, Bash has begun deprecating older compatibility
levels. Eventually, the options will be removed in favor of BBAASSHH__CCOOMM--
Starting with bash-4.4, Bash has begun deprecating older compatibility
levels. Eventually, the options will be removed in favor of BBAASSHH__CCOOMM--
PPAATT.
Bash-5.0 is the final version for which there will be an individual
shopt option for the previous version. Users should use BBAASSHH__CCOOMMPPAATT on
Bash-5.0 is the final version for which there will be an individual
shopt option for the previous version. Users should use BBAASSHH__CCOOMMPPAATT on
bash-5.0 and later versions.
The following table describes the behavior changes controlled by each
The following table describes the behavior changes controlled by each
compatibility level setting. The ccoommppaatt_N_N tag is used as shorthand for
setting the compatibility level to _N_N using one of the following mecha-
nisms. For versions prior to bash-5.0, the compatibility level may be
set using the corresponding ccoommppaatt_N_N shopt option. For bash-4.3 and
later versions, the BBAASSHH__CCOOMMPPAATT variable is preferred, and it is re-
nisms. For versions prior to bash-5.0, the compatibility level may be
set using the corresponding ccoommppaatt_N_N shopt option. For bash-4.3 and
later versions, the BBAASSHH__CCOOMMPPAATT variable is preferred, and it is re-
quired for bash-5.1 and later versions.
ccoommppaatt3311
@@ -6441,114 +6450,114 @@ SSHHEELLLL CCOOMMPPAATTIIBBIILLIITTYY MMOODDEE
ator (=~) has no special effect
ccoommppaatt3322
+o interrupting a command list such as "a ; b ; c" causes
the execution of the next command in the list (in
bash-4.0 and later versions, the shell acts as if it re-
ceived the interrupt, so interrupting one command in a
+o interrupting a command list such as "a ; b ; c" causes
the execution of the next command in the list (in
bash-4.0 and later versions, the shell acts as if it re-
ceived the interrupt, so interrupting one command in a
list aborts the execution of the entire list)
ccoommppaatt4400
+o the << and >> operators to the [[[[ command do not consider
+o the << and >> operators to the [[[[ command do not consider
the current locale when comparing strings; they use ASCII
ordering. Bash versions prior to bash-4.1 use ASCII col-
lation and _s_t_r_c_m_p(3); bash-4.1 and later use the current
lation and _s_t_r_c_m_p(3); bash-4.1 and later use the current
locale's collation sequence and _s_t_r_c_o_l_l(3).
ccoommppaatt4411
+o in _p_o_s_i_x mode, ttiimmee may be followed by options and still
+o in _p_o_s_i_x mode, ttiimmee may be followed by options and still
be recognized as a reserved word (this is POSIX interpre-
tation 267)
+o in _p_o_s_i_x mode, the parser requires that an even number of
single quotes occur in the _w_o_r_d portion of a double-
quoted parameter expansion and treats them specially, so
that characters within the single quotes are considered
single quotes occur in the _w_o_r_d portion of a double-
quoted parameter expansion and treats them specially, so
that characters within the single quotes are considered
quoted (this is POSIX interpretation 221)
ccoommppaatt4422
+o the replacement string in double-quoted pattern substitu-
tion does not undergo quote removal, as it does in ver-
tion does not undergo quote removal, as it does in ver-
sions after bash-4.2
+o in posix mode, single quotes are considered special when
expanding the _w_o_r_d portion of a double-quoted parameter
expansion and can be used to quote a closing brace or
other special character (this is part of POSIX interpre-
tation 221); in later versions, single quotes are not
+o in posix mode, single quotes are considered special when
expanding the _w_o_r_d portion of a double-quoted parameter
expansion and can be used to quote a closing brace or
other special character (this is part of POSIX interpre-
tation 221); in later versions, single quotes are not
special within double-quoted word expansions
ccoommppaatt4433
+o the shell does not print a warning message if an attempt
is made to use a quoted compound assignment as an argu-
ment to declare (e.g., declare -a foo='(1 2)'). Later
+o the shell does not print a warning message if an attempt
is made to use a quoted compound assignment as an argu-
ment to declare (e.g., declare -a foo='(1 2)'). Later
versions warn that this usage is deprecated
+o word expansion errors are considered non-fatal errors
that cause the current command to fail, even in posix
mode (the default behavior is to make them fatal errors
+o word expansion errors are considered non-fatal errors
that cause the current command to fail, even in posix
mode (the default behavior is to make them fatal errors
that cause the shell to exit)
+o when executing a shell function, the loop state
+o when executing a shell function, the loop state
(while/until/etc.) is not reset, so bbrreeaakk or ccoonnttiinnuuee in
that function will break or continue loops in the calling
context. Bash-4.4 and later reset the loop state to pre-
context. Bash-4.4 and later reset the loop state to pre-
vent this
ccoommppaatt4444
+o the shell sets up the values used by BBAASSHH__AARRGGVV and
BBAASSHH__AARRGGCC so they can expand to the shell's positional
+o the shell sets up the values used by BBAASSHH__AARRGGVV and
BBAASSHH__AARRGGCC so they can expand to the shell's positional
parameters even if extended debugging mode is not enabled
+o a subshell inherits loops from its parent context, so
bbrreeaakk or ccoonnttiinnuuee will cause the subshell to exit.
Bash-5.0 and later reset the loop state to prevent the
+o a subshell inherits loops from its parent context, so
bbrreeaakk or ccoonnttiinnuuee will cause the subshell to exit.
Bash-5.0 and later reset the loop state to prevent the
exit
+o variable assignments preceding builtins like eexxppoorrtt and
+o variable assignments preceding builtins like eexxppoorrtt and
rreeaaddoonnllyy that set attributes continue to affect variables
with the same name in the calling environment even if the
shell is not in posix mode
ccoommppaatt5500
+o Bash-5.1 changed the way $$RRAANNDDOOMM is generated to intro-
+o Bash-5.1 changed the way $$RRAANNDDOOMM is generated to intro-
duce slightly more randomness. If the shell compatibility
level is set to 50 or lower, it reverts to the method
from bash-5.0 and previous versions, so seeding the ran-
dom number generator by assigning a value to RRAANNDDOOMM will
level is set to 50 or lower, it reverts to the method
from bash-5.0 and previous versions, so seeding the ran-
dom number generator by assigning a value to RRAANNDDOOMM will
produce the same sequence as in bash-5.0
+o If the command hash table is empty, bash versions prior
to bash-5.1 printed an informational message to that ef-
fect, even when producing output that can be reused as
input. Bash-5.1 suppresses that message when the --ll op-
+o If the command hash table is empty, bash versions prior
to bash-5.1 printed an informational message to that ef-
fect, even when producing output that can be reused as
input. Bash-5.1 suppresses that message when the --ll op-
tion is supplied.
ccoommppaatt5511
+o The uunnsseett builtin treats attempts to unset array sub-
scripts @@ and ** differently depending on whether the ar-
ray is indexed or associative, and differently than in
+o The uunnsseett builtin treats attempts to unset array sub-
scripts @@ and ** differently depending on whether the ar-
ray is indexed or associative, and differently than in
previous versions.
RREESSTTRRIICCTTEEDD SSHHEELLLL
If bbaasshh is started with the name rrbbaasshh, or the --rr 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. It
behaves identically to bbaasshh with the exception that the following are
invocation, the shell becomes restricted. A restricted shell is used
to set up an environment more controlled than the standard shell. It
behaves identically to bbaasshh with the exception that the following are
disallowed or not performed:
+o changing directories with ccdd
+o setting or unsetting the values of SSHHEELLLL, PPAATTHH, HHIISSTTFFIILLEE, EENNVV,
+o setting or unsetting the values of SSHHEELLLL, PPAATTHH, HHIISSTTFFIILLEE, EENNVV,
or BBAASSHH__EENNVV
+o specifying command names containing //
+o specifying a filename containing a // as an argument to the ..
+o specifying a filename containing a // as an argument to the ..
builtin command
+o specifying a filename containing a slash as an argument to the
+o specifying a filename containing a slash as an argument to the
hhiissttoorryy builtin command
+o specifying a filename containing a slash as an argument to the
+o specifying a filename containing a slash as an argument to the
--pp option to the hhaasshh builtin command
+o importing function definitions from the shell environment at
+o importing function definitions from the shell environment at
startup
+o parsing the value of SSHHEELLLLOOPPTTSS from the shell environment at
+o parsing the value of SSHHEELLLLOOPPTTSS from the shell environment at
startup
+o redirecting output using the >, >|, <>, >&, &>, and >> redirect-
@@ -6557,28 +6566,28 @@ RREESSTTRRIICCTTEEDD SSHHEELLLL
+o using the eexxeecc builtin command to replace the shell with another
command
+o adding or deleting builtin commands with the --ff and --dd options
+o adding or deleting builtin commands with the --ff and --dd options
to the eennaabbllee builtin command
+o using the eennaabbllee builtin command to enable disabled shell
+o using the eennaabbllee builtin command to enable disabled shell
builtins
+o specifying the --pp option to the ccoommmmaanndd builtin command
+o turning off restricted mode with sseett ++rr or sshhoopptt --uu rree--
+o turning off restricted mode with sseett ++rr or sshhoopptt --uu rree--
ssttrriicctteedd__sshheellll.
These restrictions are enforced after any startup files are read.
When a command that is found to be a shell script is executed (see CCOOMM--
MMAANNDD EEXXEECCUUTTIIOONN above), rrbbaasshh turns off any restrictions in the shell
MMAANNDD EEXXEECCUUTTIIOONN above), rrbbaasshh turns off any restrictions in the shell
spawned to execute the script.
SSEEEE AALLSSOO
_B_a_s_h _R_e_f_e_r_e_n_c_e _M_a_n_u_a_l, Brian Fox and Chet Ramey
_T_h_e _G_n_u _R_e_a_d_l_i_n_e _L_i_b_r_a_r_y, Brian Fox and Chet Ramey
_T_h_e _G_n_u _H_i_s_t_o_r_y _L_i_b_r_a_r_y, Brian Fox and Chet Ramey
_P_o_r_t_a_b_l_e _O_p_e_r_a_t_i_n_g _S_y_s_t_e_m _I_n_t_e_r_f_a_c_e _(_P_O_S_I_X_) _P_a_r_t _2_: _S_h_e_l_l _a_n_d _U_t_i_l_i_-
_P_o_r_t_a_b_l_e _O_p_e_r_a_t_i_n_g _S_y_s_t_e_m _I_n_t_e_r_f_a_c_e _(_P_O_S_I_X_) _P_a_r_t _2_: _S_h_e_l_l _a_n_d _U_t_i_l_i_-
_t_i_e_s, IEEE --
http://pubs.opengroup.org/onlinepubs/9699919799/
http://tiswww.case.edu/~chet/bash/POSIX -- a description of posix mode
@@ -6596,10 +6605,10 @@ FFIILLEESS
_~_/_._b_a_s_h_r_c
The individual per-interactive-shell startup file
_~_/_._b_a_s_h___l_o_g_o_u_t
The individual login shell cleanup file, executed when a login
The individual login shell cleanup file, executed when a login
shell exits
_~_/_._b_a_s_h___h_i_s_t_o_r_y
The default value of HHIISSTTFFIILLEE, the file in which bash saves the
The default value of HHIISSTTFFIILLEE, the file in which bash saves the
command history
_~_/_._i_n_p_u_t_r_c
Individual _r_e_a_d_l_i_n_e initialization file
@@ -6613,15 +6622,15 @@ AAUUTTHHOORRSS
BBUUGG RREEPPOORRTTSS
If you find a bug in bbaasshh,, you should report it. But first, you should
make sure that it really is a bug, and that it appears in the latest
version of bbaasshh. The latest version is always available from
make sure that it really is a bug, and that it appears in the latest
version of bbaasshh. The latest version is always available from
_f_t_p_:_/_/_f_t_p_._g_n_u_._o_r_g_/_p_u_b_/_g_n_u_/_b_a_s_h_/ and _h_t_t_p_:_/_/_g_i_t_._s_a_v_a_n_-
_n_a_h_._g_n_u_._o_r_g_/_c_g_i_t_/_b_a_s_h_._g_i_t_/_s_n_a_p_s_h_o_t_/_b_a_s_h_-_m_a_s_t_e_r_._t_a_r_._g_z.
Once you have determined that a bug actually exists, use the _b_a_s_h_b_u_g
command to submit a bug report. If you have a fix, you are encouraged
to mail that as well! Suggestions and `philosophical' bug reports may
be mailed to _b_u_g_-_b_a_s_h_@_g_n_u_._o_r_g or posted to the Usenet newsgroup
Once you have determined that a bug actually exists, use the _b_a_s_h_b_u_g
command to submit a bug report. If you have a fix, you are encouraged
to mail that as well! Suggestions and `philosophical' bug reports may
be mailed to _b_u_g_-_b_a_s_h_@_g_n_u_._o_r_g or posted to the Usenet newsgroup
ggnnuu..bbaasshh..bbuugg.
ALL bug reports should include:
@@ -6632,7 +6641,7 @@ BBUUGG RREEPPOORRTTSS
A description of the bug behaviour
A short script or `recipe' which exercises the bug
_b_a_s_h_b_u_g inserts the first three items automatically into the template
_b_a_s_h_b_u_g inserts the first three items automatically into the template
it provides for filing a bug report.
Comments and bug reports concerning this manual page should be directed
@@ -6649,10 +6658,10 @@ BBUUGGSS
Shell builtin commands and functions are not stoppable/restartable.
Compound commands and command sequences of the form `a ; b ; c' are not
handled gracefully when process suspension is attempted. When a
process is stopped, the shell immediately executes the next command in
the sequence. It suffices to place the sequence of commands between
parentheses to force it into a subshell, which may be stopped as a
handled gracefully when process suspension is attempted. When a
process is stopped, the shell immediately executes the next command in
the sequence. It suffices to place the sequence of commands between
parentheses to force it into a subshell, which may be stopped as a
unit.
Array variables may not (yet) be exported.
@@ -6661,4 +6670,4 @@ BBUUGGSS
GNU Bash 5.2 2022 September 19 BASH(1)
GNU Bash 5.2 2022 December 2 BASH(1)
+39 -25
View File
@@ -5,12 +5,12 @@
.\" Case Western Reserve University
.\" chet.ramey@case.edu
.\"
.\" Last Change: Mon Sep 19 11:13:21 EDT 2022
.\" Last Change: Fri Dec 2 15:53:52 EST 2022
.\"
.\" bash_builtins, strip all but Built-Ins section
.if \n(zZ=1 .ig zZ
.if \n(zY=1 .ig zY
.TH BASH 1 "2022 September 19" "GNU Bash 5.2"
.TH BASH 1 "2022 December 2" "GNU Bash 5.2"
.\"
.\" There's some problem with having a `@'
.\" in a tagged paragraph with the BSD man macros.
@@ -10858,39 +10858,49 @@ sort lexicographically using ASCII ordering.
Print the accumulated user and system times for the shell and
for processes run from the shell. The return status is 0.
.TP
\fBtrap\fP [\fB\-lp\fP] [[\fIarg\fP] \fIsigspec\fP ...]
The command
.I arg
is to be read and executed when the shell receives
\fBtrap\fP [\fB\-lp\fP] [[\fIaction\fP] \fIsigspec\fP ...]
The
.I action
is a command that is read and executed when the shell receives
signal(s)
.IR sigspec .
If
.I arg
.I action
is absent (and there is a single \fIsigspec\fP) or
.BR \- ,
each specified signal is
reset to its original disposition (the value it had
upon entrance to the shell).
If
.I arg
.I action
is the null string the signal specified by each
.I sigspec
is ignored by the shell and by the commands it invokes.
.if t .sp 0.5
.if n .sp 1
If no arguments are supplied,
.B trap
displays the actions associated with each trapped signal
as a set of \fBtrap\fP commands
that can be reused as shell input to
restore the current signal dispositions.
If
.I arg
is not present and
.B \-p
has been supplied, then the trap commands associated with each
.I sigspec
are displayed.
If no arguments are supplied or if only
.B \-p
is given,
.B trap
prints the list of commands associated with each signal.
and
.I action
is not present,
then \fBtrap\fP displays the actions associated with each
.I sigspec
or, if none are supplied, for all trapped signals,
as a set of \fBtrap\fP commands
that can be reused as shell input to
restore the current signal dispositions.
.if t .sp 0.5
.if n .sp 1
The
.B \-l
option causes the shell to print a list of signal names and
option causes \fBtrap\fP to print a list of signal names and
their corresponding numbers.
Each
.I sigspec
@@ -10908,7 +10918,7 @@ is
.SM
.B EXIT
(0) the command
.I arg
.I action
is executed on exit from the shell.
If a
.I sigspec
@@ -10916,10 +10926,12 @@ is
.SM
.BR DEBUG ,
the command
.I arg
.I action
is executed before every \fIsimple command\fP, \fIfor\fP command,
\fIcase\fP command, \fIselect\fP command, every arithmetic \fIfor\fP
command, and before the first command executes in a shell function (see
\fIcase\fP command, \fIselect\fP command, (( arithmetic command,
[[ conditional command,
arithmetic \fIfor\fP command, and before the first command executes
in a shell function (see
.SM
.B SHELL GRAMMAR
.ie \n(zZ=1 in \fIbash(1)\fP).
@@ -10932,7 +10944,7 @@ is
.SM
.BR RETURN ,
the command
.I arg
.I action
is executed each time a shell function or a script executed with
the \fB.\fP or \fBsource\fP builtins finishes executing.
.if t .sp 0.5
@@ -10943,7 +10955,7 @@ is
.SM
.BR ERR ,
the command
.I arg
.I action
is executed whenever
a pipeline (which may consist of a single simple
command), a list, or a compound command returns a
@@ -10972,7 +10984,9 @@ being inverted using
These are the same conditions obeyed by the \fBerrexit\fP (\fB\-e\fP) option.
.if t .sp 0.5
.if n .sp 1
Signals ignored upon entry to the shell cannot be trapped or reset.
When the shell is not interactive,
signals ignored upon entry to the shell cannot be trapped or reset.
Interactive shells permit trapping signals ignored on entry.
Trapped signals that are not being ignored are reset to their original
values in a subshell or subshell environment when one is created.
The return status is false if any
+47 -32
View File
@@ -3,7 +3,7 @@
</HEAD>
<BODY><TABLE WIDTH=100%>
<TR>
<TH ALIGN=LEFT width=33%>BASH(1)<TH ALIGN=CENTER width=33%>2022 September 19<TH ALIGN=RIGHT width=33%>BASH(1)
<TH ALIGN=LEFT width=33%>BASH(1)<TH ALIGN=CENTER width=33%>2022 December 2<TH ALIGN=RIGHT width=33%>BASH(1)
</TR>
</TABLE>
<BR><A HREF="#index">Index</A>
@@ -1586,7 +1586,7 @@ See the description of
<B>shopt</B>
below under
<FONT SIZE=-1><B>SHELL</B>BUILTIN<B>COMMANDS</B>.
<FONT SIZE=-1><B>SHELL BUILTIN COMMANDS</B>.
</FONT>
<A NAME="lbAT">&nbsp;</A>
@@ -4994,7 +4994,7 @@ Matches anything except one of the given patterns
<P>
The<B>extglob</B> option changes the behavior of the parser, since the
The <B>extglob</B> option changes the behavior of the parser, since the
parentheses are normally treated as operators with syntactic meaning.
To ensure that extended matching patterns are parsed correctly, make sure
that <B>extglob</B> is enabled before parsing constructs containing the
@@ -13632,16 +13632,16 @@ sort lexicographically using ASCII ordering.
<DD>
Print the accumulated user and system times for the shell and
for processes run from the shell. The return status is 0.
<DT><B>trap</B> [<B>-lp</B>] [[<I>arg</I>] <I>sigspec</I> ...]<DD>
The command
<I>arg</I>
<DT><B>trap</B> [<B>-lp</B>] [[<I>action</I>] <I>sigspec</I> ...]<DD>
The
<I>action</I>
is to be read and executed when the shell receives
is a command that is read and executed when the shell receives
signal(s)
<I>sigspec</I>.
If
<I>arg</I>
<I>action</I>
is absent (and there is a single <I>sigspec</I>) or
<B>-</B>,
@@ -13650,33 +13650,44 @@ each specified signal is
reset to its original disposition (the value it had
upon entrance to the shell).
If
<I>arg</I>
<I>action</I>
is the null string the signal specified by each
<I>sigspec</I>
is ignored by the shell and by the commands it invokes.
<P>
If no arguments are supplied,
<B>trap</B>
displays the actions associated with each trapped signal
as a set of <B>trap</B> commands
that can be reused as shell input to
restore the current signal dispositions.
If
<I>arg</I>
is not present and
<B>-p</B>
has been supplied, then the trap commands associated with each
<I>sigspec</I>
are displayed.
If no arguments are supplied or if only
<B>-p</B>
is given,
<B>trap</B>
and
<I>action</I>
is not present,
then <B>trap</B> displays the actions associated with each
<I>sigspec</I>
or, if none are supplied, for all trapped signals,
as a set of <B>trap</B> commands
that can be reused as shell input to
restore the current signal dispositions.
<P>
prints the list of commands associated with each signal.
The
<B>-l</B>
option causes the shell to print a list of signal names and
option causes <B>trap</B> to print a list of signal names and
their corresponding numbers.
Each
<I>sigspec</I>
@@ -13699,7 +13710,7 @@ is
</FONT>
(0) the command
<I>arg</I>
<I>action</I>
is executed on exit from the shell.
If a
@@ -13710,11 +13721,13 @@ is
</FONT>
the command
<I>arg</I>
<I>action</I>
is executed before every <I>simple command</I>, <I>for</I> command,
<I>case</I> command, <I>select</I> command, every arithmetic <I>for</I>
command, and before the first command executes in a shell function (see
<I>case</I> command, <I>select</I> command, (( arithmetic command,
[[ conditional command,
arithmetic <I>for</I> command, and before the first command executes
in a shell function (see
<FONT SIZE=-1><B>SHELL GRAMMAR</B>
</FONT>
@@ -13730,7 +13743,7 @@ is
</FONT>
the command
<I>arg</I>
<I>action</I>
is executed each time a shell function or a script executed with
the <B>.</B> or <B>source</B> builtins finishes executing.
@@ -13745,7 +13758,7 @@ is
</FONT>
the command
<I>arg</I>
<I>action</I>
is executed whenever
a pipeline (which may consist of a single simple
@@ -13783,7 +13796,9 @@ These are the same conditions obeyed by the <B>errexit</B> (<B>-e</B>) option.
<P>
Signals ignored upon entry to the shell cannot be trapped or reset.
When the shell is not interactive,
signals ignored upon entry to the shell cannot be trapped or reset.
Interactive shells permit trapping signals ignored on entry.
Trapped signals that are not being ignored are reset to their original
values in a subshell or subshell environment when one is created.
The return status is false if any
@@ -14787,7 +14802,7 @@ There may be only one active coprocess at a time.
<HR>
<TABLE WIDTH=100%>
<TR>
<TH ALIGN=LEFT width=33%>GNU Bash 5.2<TH ALIGN=CENTER width=33%>2022 September 19<TH ALIGN=RIGHT width=33%>BASH(1)
<TH ALIGN=LEFT width=33%>GNU Bash 5.2<TH ALIGN=CENTER width=33%>2022 December 2<TH ALIGN=RIGHT width=33%>BASH(1)
</TR>
</TABLE>
<HR>
@@ -14893,7 +14908,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-20220907/doc/bash.1.<BR>
Time: 19 September 2022 12:02:51 EDT
This document was created by man2html from /usr/local/src/bash/bash-20221202/doc/bash.1.<BR>
Time: 02 December 2022 17:01:20 EST
</BODY>
</HTML>
+186 -177
View File
@@ -1,9 +1,9 @@
This is bash.info, produced by makeinfo version 6.8 from bashref.texi.
This text is a brief description of the features that are present in the
Bash shell (version 5.2, 19 September 2022).
Bash shell (version 5.2, 2 December 2022).
This is Edition 5.2, last updated 19 September 2022, of 'The GNU Bash
This is Edition 5.2, last updated 2 December 2022, of 'The GNU Bash
Reference Manual', for 'Bash', Version 5.2.
Copyright (C) 1988-2022 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.2, 19 September 2022). The Bash home page is
Bash shell (version 5.2, 2 December 2022). The Bash home page is
<http://www.gnu.org/software/bash/>.
This is Edition 5.2, last updated 19 September 2022, of 'The GNU Bash
This is Edition 5.2, last updated 2 December 2022, of 'The GNU Bash
Reference Manual', for 'Bash', Version 5.2.
Bash contains features that appear in other popular shells, and some
@@ -1832,7 +1832,7 @@ immediately follow the left brace in order to introduce indirection.
In each of the cases below, WORD is subject to tilde expansion,
parameter expansion, command substitution, and arithmetic expansion.
When not performing substring expansion, using the form described
When not performing substring expansion, using the forms described
below (e.g., ':-'), Bash tests for a parameter that is unset or null.
Omitting the colon results in a test only for a parameter that is unset.
Put another way, if the colon is included, the operator tests for both
@@ -3563,37 +3563,43 @@ standard.
children. The return status is zero.
'trap'
trap [-lp] [ARG] [SIGSPEC ...]
trap [-lp] [ACTION] [SIGSPEC ...]
The commands in ARG are to be read and executed when the shell
receives signal SIGSPEC. If ARG is absent (and there is a single
SIGSPEC) or equal to '-', each specified signal's disposition is
reset to the value it had when the shell was started. If ARG is
the null string, then the signal specified by each SIGSPEC is
ignored by the shell and commands it invokes. If ARG is not
present and '-p' has been supplied, the shell displays the trap
commands associated with each SIGSPEC. If no arguments are
supplied, or only '-p' is given, 'trap' prints the list of commands
associated with each signal number in a form that may be reused as
shell input. The '-l' option causes the shell to print a list of
signal names and their corresponding numbers. Each SIGSPEC is
either a signal name or a signal number. Signal names are case
insensitive and the 'SIG' prefix is optional.
The ACTION is a command that is read and executed when the shell
receives signal SIGSPEC. If ACTION is absent (and there is a
single SIGSPEC) or equal to '-', each specified signal's
disposition is reset to the value it had when the shell was
started. If ACTION is the null string, then the signal specified
by each SIGSPEC is ignored by the shell and commands it invokes.
If a SIGSPEC is '0' or 'EXIT', ARG is executed when the shell
exits. If a SIGSPEC is 'DEBUG', the command ARG is executed before
every simple command, 'for' command, 'case' command, 'select'
command, every arithmetic 'for' command, and before the first
command executes in a shell function. Refer to the description of
the 'extdebug' option to the 'shopt' builtin (*note The Shopt
Builtin::) for details of its effect on the 'DEBUG' trap. If a
SIGSPEC is 'RETURN', the command ARG is executed each time a shell
function or a script executed with the '.' or 'source' builtins
finishes executing.
If no arguments are supplied, 'trap' prints the actions associated
with each trapped signal as a set of 'trap' commands that can be
reused as shell input to restore the current signal dispositions.
If ACTION is not present and '-p' has been supplied, 'trap'
displays the trap commands associated with each SIGSPEC, or, if no
SIGSPECs are supplied, for all trapped signals, as a set of 'trap'
commands that can be reused as shell input to restore the current
signal dispositions.
If a SIGSPEC is 'ERR', the command ARG is executed whenever a
pipeline (which may consist of a single simple command), a list, or
a compound command returns a non-zero exit status, subject to the
The '-l' option causes 'trap' to print a list of signal names and
their corresponding numbers. Each SIGSPEC is either a signal name
or a signal number. Signal names are case insensitive and the
'SIG' prefix is optional.
If a SIGSPEC is '0' or 'EXIT', ACTION is executed when the shell
exits. If a SIGSPEC is 'DEBUG', ACTION is executed before every
simple command, 'for' command, 'case' command, 'select' command, ((
arithmetic command, [[ conditional command, arithmetic 'for'
command, and before the first command executes in a shell function.
Refer to the description of the 'extdebug' option to the 'shopt'
builtin (*note The Shopt Builtin::) for details of its effect on
the 'DEBUG' trap. If a SIGSPEC is 'RETURN', ACTION is executed
each time a shell function or a script executed with the '.' or
'source' builtins finishes executing.
If a SIGSPEC is 'ERR', ACTION is executed whenever a pipeline
(which may consist of a single simple command), a list, or a
compound command returns a non-zero exit status, subject to the
following conditions. The 'ERR' trap is not executed if the failed
command is part of the command list immediately following an
'until' or 'while' keyword, part of the test following the 'if' or
@@ -3603,10 +3609,11 @@ standard.
status is being inverted using '!'. These are the same conditions
obeyed by the 'errexit' ('-e') option.
Signals ignored upon entry to the shell cannot be trapped or reset.
Trapped signals that are not being ignored are reset to their
original values in a subshell or subshell environment when one is
created.
Signals ignored upon entry to a non-interactive shell cannot be
trapped or reset. Interactive shells permit trapping signals
ignored on entry. Trapped signals that are not being ignored are
reset to their original values in a subshell or subshell
environment when one is created.
The return status is zero unless a SIGSPEC does not specify a valid
signal.
@@ -7190,8 +7197,9 @@ startup files.
handler for a given signal to the original disposition, they should
use '-' as the first argument.
42. 'trap -p' displays signals whose dispositions are set to SIG_DFL
and those that were ignored when the shell started.
42. '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.
43. The '.' and 'source' builtins do not search the current directory
for the filename argument if it is not found by searching 'PATH'.
@@ -10887,10 +10895,11 @@ of Bash. The latest version of Bash is always available for FTP from
<http://git.savannah.gnu.org/cgit/bash.git/snapshot/bash-master.tar.gz>.
Once you have determined that a bug actually exists, use the
'bashbug' command to submit a bug report. If you have a fix, you are
encouraged to mail that as well! Suggestions and 'philosophical' bug
reports may be mailed to <bug-bash@gnu.org> or posted to the Usenet
newsgroup 'gnu.bash.bug'.
'bashbug' command to submit a bug report or use the form at the <a
href="https://savannah.gnu.org/projects/bash/">Bash project page</a>.
If you have a fix, you are encouraged to submit that as well!
Suggestions and 'philosophical' bug reports may be mailed to
<bug-bash@gnu.org> or <help-bash@gnu.org>.
All bug reports should include:
* The version number of Bash.
@@ -11867,10 +11876,10 @@ D.1 Index of Shell Builtin Commands
* typeset: Bash Builtins. (line 631)
* ulimit: Bash Builtins. (line 637)
* umask: Bourne Shell Builtins.
(line 415)
(line 422)
* unalias: Bash Builtins. (line 743)
* unset: Bourne Shell Builtins.
(line 433)
(line 440)
* wait: Job Control Builtins.
(line 76)
@@ -12534,138 +12543,138 @@ D.5 Concept Index

Tag Table:
Node: Top896
Node: Introduction2815
Node: What is Bash?3028
Node: What is a shell?4139
Node: Definitions6674
Node: Basic Shell Features9622
Node: Shell Syntax10838
Node: Shell Operation11861
Node: Quoting13151
Node: Escape Character14452
Node: Single Quotes14934
Node: Double Quotes15279
Node: ANSI-C Quoting16554
Node: Locale Translation17861
Node: Creating Internationalized Scripts19169
Node: Comments23283
Node: Shell Commands23898
Node: Reserved Words24833
Node: Simple Commands25586
Node: Pipelines26237
Node: Lists29233
Node: Compound Commands31025
Node: Looping Constructs32034
Node: Conditional Constructs34526
Node: Command Grouping49011
Node: Coprocesses50486
Node: GNU Parallel53146
Node: Shell Functions54060
Node: Shell Parameters61942
Node: Positional Parameters66327
Node: Special Parameters67226
Node: Shell Expansions70437
Node: Brace Expansion72561
Node: Tilde Expansion75292
Node: Shell Parameter Expansion77910
Node: Command Substitution96258
Node: Arithmetic Expansion97610
Node: Process Substitution98575
Node: Word Splitting99692
Node: Filename Expansion101633
Node: Pattern Matching104379
Node: Quote Removal109378
Node: Redirections109670
Node: Executing Commands119327
Node: Simple Command Expansion119994
Node: Command Search and Execution122101
Node: Command Execution Environment124476
Node: Environment127508
Node: Exit Status129168
Node: Signals130949
Node: Shell Scripts134395
Node: Shell Builtin Commands137419
Node: Bourne Shell Builtins139454
Node: Bash Builtins160917
Node: Modifying Shell Behavior191770
Node: The Set Builtin192112
Node: The Shopt Builtin202710
Node: Special Builtins218619
Node: Shell Variables219595
Node: Bourne Shell Variables220029
Node: Bash Variables222130
Node: Bash Features254942
Node: Invoking Bash255952
Node: Bash Startup Files261962
Node: Interactive Shells267090
Node: What is an Interactive Shell?267498
Node: Is this Shell Interactive?268144
Node: Interactive Shell Behavior268956
Node: Bash Conditional Expressions272582
Node: Shell Arithmetic277221
Node: Aliases280162
Node: Arrays282772
Node: The Directory Stack289160
Node: Directory Stack Builtins289941
Node: Controlling the Prompt294198
Node: The Restricted Shell297160
Node: Bash POSIX Mode299767
Node: Shell Compatibility Mode311682
Node: Job Control320246
Node: Job Control Basics320703
Node: Job Control Builtins325702
Node: Job Control Variables331494
Node: Command Line Editing332647
Node: Introduction and Notation334315
Node: Readline Interaction335935
Node: Readline Bare Essentials337123
Node: Readline Movement Commands338909
Node: Readline Killing Commands339866
Node: Readline Arguments341784
Node: Searching342825
Node: Readline Init File345008
Node: Readline Init File Syntax346266
Node: Conditional Init Constructs369849
Node: Sample Init File374042
Node: Bindable Readline Commands377163
Node: Commands For Moving378364
Node: Commands For History380412
Node: Commands For Text385403
Node: Commands For Killing389049
Node: Numeric Arguments392079
Node: Commands For Completion393215
Node: Keyboard Macros397403
Node: Miscellaneous Commands398088
Node: Readline vi Mode404030
Node: Programmable Completion404934
Node: Programmable Completion Builtins412711
Node: A Programmable Completion Example423460
Node: Using History Interactively428705
Node: Bash History Facilities429386
Node: Bash History Builtins432388
Node: History Interaction437409
Node: Event Designators441026
Node: Word Designators442377
Node: Modifiers444134
Node: Installing Bash445939
Node: Basic Installation447073
Node: Compilers and Options450792
Node: Compiling For Multiple Architectures451530
Node: Installation Names453219
Node: Specifying the System Type455325
Node: Sharing Defaults456039
Node: Operation Controls456709
Node: Optional Features457664
Node: Reporting Bugs468880
Node: Major Differences From The Bourne Shell470152
Node: GNU Free Documentation License486998
Node: Indexes512172
Node: Builtin Index512623
Node: Reserved Word Index519447
Node: Variable Index521892
Node: Function Index538663
Node: Concept Index552444
Node: Top892
Node: Introduction2807
Node: What is Bash?3020
Node: What is a shell?4131
Node: Definitions6666
Node: Basic Shell Features9614
Node: Shell Syntax10830
Node: Shell Operation11853
Node: Quoting13143
Node: Escape Character14444
Node: Single Quotes14926
Node: Double Quotes15271
Node: ANSI-C Quoting16546
Node: Locale Translation17853
Node: Creating Internationalized Scripts19161
Node: Comments23275
Node: Shell Commands23890
Node: Reserved Words24825
Node: Simple Commands25578
Node: Pipelines26229
Node: Lists29225
Node: Compound Commands31017
Node: Looping Constructs32026
Node: Conditional Constructs34518
Node: Command Grouping49003
Node: Coprocesses50478
Node: GNU Parallel53138
Node: Shell Functions54052
Node: Shell Parameters61934
Node: Positional Parameters66319
Node: Special Parameters67218
Node: Shell Expansions70429
Node: Brace Expansion72553
Node: Tilde Expansion75284
Node: Shell Parameter Expansion77902
Node: Command Substitution96251
Node: Arithmetic Expansion97603
Node: Process Substitution98568
Node: Word Splitting99685
Node: Filename Expansion101626
Node: Pattern Matching104372
Node: Quote Removal109371
Node: Redirections109663
Node: Executing Commands119320
Node: Simple Command Expansion119987
Node: Command Search and Execution122094
Node: Command Execution Environment124469
Node: Environment127501
Node: Exit Status129161
Node: Signals130942
Node: Shell Scripts134388
Node: Shell Builtin Commands137412
Node: Bourne Shell Builtins139447
Node: Bash Builtins161229
Node: Modifying Shell Behavior192082
Node: The Set Builtin192424
Node: The Shopt Builtin203022
Node: Special Builtins218931
Node: Shell Variables219907
Node: Bourne Shell Variables220341
Node: Bash Variables222442
Node: Bash Features255254
Node: Invoking Bash256264
Node: Bash Startup Files262274
Node: Interactive Shells267402
Node: What is an Interactive Shell?267810
Node: Is this Shell Interactive?268456
Node: Interactive Shell Behavior269268
Node: Bash Conditional Expressions272894
Node: Shell Arithmetic277533
Node: Aliases280474
Node: Arrays283084
Node: The Directory Stack289472
Node: Directory Stack Builtins290253
Node: Controlling the Prompt294510
Node: The Restricted Shell297472
Node: Bash POSIX Mode300079
Node: Shell Compatibility Mode312043
Node: Job Control320607
Node: Job Control Basics321064
Node: Job Control Builtins326063
Node: Job Control Variables331855
Node: Command Line Editing333008
Node: Introduction and Notation334676
Node: Readline Interaction336296
Node: Readline Bare Essentials337484
Node: Readline Movement Commands339270
Node: Readline Killing Commands340227
Node: Readline Arguments342145
Node: Searching343186
Node: Readline Init File345369
Node: Readline Init File Syntax346627
Node: Conditional Init Constructs370210
Node: Sample Init File374403
Node: Bindable Readline Commands377524
Node: Commands For Moving378725
Node: Commands For History380773
Node: Commands For Text385764
Node: Commands For Killing389410
Node: Numeric Arguments392440
Node: Commands For Completion393576
Node: Keyboard Macros397764
Node: Miscellaneous Commands398449
Node: Readline vi Mode404391
Node: Programmable Completion405295
Node: Programmable Completion Builtins413072
Node: A Programmable Completion Example423821
Node: Using History Interactively429066
Node: Bash History Facilities429747
Node: Bash History Builtins432749
Node: History Interaction437770
Node: Event Designators441387
Node: Word Designators442738
Node: Modifiers444495
Node: Installing Bash446300
Node: Basic Installation447434
Node: Compilers and Options451153
Node: Compiling For Multiple Architectures451891
Node: Installation Names453580
Node: Specifying the System Type455686
Node: Sharing Defaults456400
Node: Operation Controls457070
Node: Optional Features458025
Node: Reporting Bugs469241
Node: Major Differences From The Bourne Shell470582
Node: GNU Free Documentation License487428
Node: Indexes512602
Node: Builtin Index513053
Node: Reserved Word Index519877
Node: Variable Index522322
Node: Function Index539093
Node: Concept Index552874

End Tag Table
BIN
View File
Binary file not shown.
+557 -553
View File
File diff suppressed because it is too large Load Diff
+4 -4
View File
@@ -19,7 +19,7 @@
\entry{trap}{54}{\code {trap}}
\entry{umask}{55}{\code {umask}}
\entry{unset}{55}{\code {unset}}
\entry{alias}{55}{\code {alias}}
\entry{alias}{56}{\code {alias}}
\entry{bind}{56}{\code {bind}}
\entry{builtin}{57}{\code {builtin}}
\entry{caller}{57}{\code {caller}}
@@ -35,11 +35,11 @@
\entry{printf}{62}{\code {printf}}
\entry{read}{63}{\code {read}}
\entry{readarray}{64}{\code {readarray}}
\entry{source}{64}{\code {source}}
\entry{type}{64}{\code {type}}
\entry{source}{65}{\code {source}}
\entry{type}{65}{\code {type}}
\entry{typeset}{65}{\code {typeset}}
\entry{ulimit}{65}{\code {ulimit}}
\entry{unalias}{66}{\code {unalias}}
\entry{unalias}{67}{\code {unalias}}
\entry{set}{67}{\code {set}}
\entry{shopt}{71}{\code {shopt}}
\entry{dirs}{102}{\code {dirs}}
+4 -4
View File
@@ -5,7 +5,7 @@
\initial {[}
\entry{\code {[}}{52}
\initial {A}
\entry{\code {alias}}{55}
\entry{\code {alias}}{56}
\initial {B}
\entry{\code {bg}}{114}
\entry{\code {bind}}{56}
@@ -63,18 +63,18 @@
\entry{\code {set}}{67}
\entry{\code {shift}}{52}
\entry{\code {shopt}}{71}
\entry{\code {source}}{64}
\entry{\code {source}}{65}
\entry{\code {suspend}}{116}
\initial {T}
\entry{\code {test}}{52}
\entry{\code {times}}{54}
\entry{\code {trap}}{54}
\entry{\code {type}}{64}
\entry{\code {type}}{65}
\entry{\code {typeset}}{65}
\initial {U}
\entry{\code {ulimit}}{65}
\entry{\code {umask}}{55}
\entry{\code {unalias}}{66}
\entry{\code {unalias}}{67}
\entry{\code {unset}}{55}
\initial {W}
\entry{\code {wait}}{115}
BIN
View File
Binary file not shown.
+38 -29
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.2, 19 September 2022).
the Bash shell (version 5.2, 2 December 2022).
This is Edition 5.2, last updated 19 September 2022,
This is Edition 5.2, last updated 2 December 2022,
of The GNU Bash Reference Manual,
for Bash, Version 5.2.
@@ -77,10 +77,10 @@ Next: <a href="#Introduction" accesskey="n" rel="next">Introduction</a>, Previou
<span id="Bash-Features-1"></span><h1 class="top">Bash Features</h1>
<p>This text is a brief description of the features that are present in
the Bash shell (version 5.2, 19 September 2022).
the Bash shell (version 5.2, 2 December 2022).
The Bash home page is <a href="http://www.gnu.org/software/bash/">http://www.gnu.org/software/bash/</a>.
</p>
<p>This is Edition 5.2, last updated 19 September 2022,
<p>This is Edition 5.2, last updated 2 December 2022,
of <cite>The GNU Bash Reference Manual</cite>,
for <code>Bash</code>, Version 5.2.
</p>
@@ -2561,7 +2561,7 @@ introduce indirection.
<p>In each of the cases below, <var>word</var> is subject to tilde expansion,
parameter expansion, command substitution, and arithmetic expansion.
</p>
<p>When not performing substring expansion, using the form described
<p>When not performing substring expansion, using the forms described
below (e.g., &lsquo;<samp>:-</samp>&rsquo;), Bash tests for a parameter that is unset or null.
Omitting the colon results in a test only for a parameter that is unset.
Put another way, if the colon is included,
@@ -4740,41 +4740,47 @@ The return status is zero.
</dd>
<dt id='index-trap'><span><code>trap</code><a href='#index-trap' class='copiable-anchor'> &para;</a></span></dt>
<dd><div class="example">
<pre class="example">trap [-lp] [<var>arg</var>] [<var>sigspec</var> &hellip;]
<pre class="example">trap [-lp] [<var>action</var>] [<var>sigspec</var> &hellip;]
</pre></div>
<p>The commands in <var>arg</var> are to be read and executed when the
shell receives signal <var>sigspec</var>. If <var>arg</var> is absent (and
<p>The <var>action</var> is a command that is read and executed when the
shell receives signal <var>sigspec</var>. If <var>action</var> is absent (and
there is a single <var>sigspec</var>) or
equal to &lsquo;<samp>-</samp>&rsquo;, each specified signal&rsquo;s disposition is reset
to the value it had when the shell was started.
If <var>arg</var> is the null string, then the signal specified by
If <var>action</var> is the null string, then the signal specified by
each <var>sigspec</var> is ignored by the shell and commands it invokes.
If <var>arg</var> is not present and <samp>-p</samp> has been supplied,
the shell displays the trap commands associated with each <var>sigspec</var>.
If no arguments are supplied, or
only <samp>-p</samp> is given, <code>trap</code> prints the list of commands
associated with each signal number in a form that may be reused as
shell input.
The <samp>-l</samp> option causes the shell to print a list of signal names
</p>
<p>If no arguments are supplied, <code>trap</code> prints the actions
associated with each trapped signal
as a set of <code>trap</code> commands that can be reused as shell input to
restore the current signal dispositions.
If <var>action</var> is not present and <samp>-p</samp> has been supplied,
<code>trap</code> displays the trap commands associated with each <var>sigspec</var>,
or, if no <var>sigspec</var>s are supplied, for all trapped signals,
as a set of <code>trap</code> commands that can be reused as shell input to
restore the current signal dispositions.
</p>
<p>The <samp>-l</samp> option causes <code>trap</code> to print a list of signal names
and their corresponding numbers.
Each <var>sigspec</var> is either a signal name or a signal number.
Signal names are case insensitive and the <code>SIG</code> prefix is optional.
</p>
<p>If a <var>sigspec</var>
is <code>0</code> or <code>EXIT</code>, <var>arg</var> is executed when the shell exits.
If a <var>sigspec</var> is <code>DEBUG</code>, the command <var>arg</var> is executed
is <code>0</code> or <code>EXIT</code>, <var>action</var> is executed when the shell exits.
If a <var>sigspec</var> is <code>DEBUG</code>, <var>action</var> is executed
before every simple command, <code>for</code> command, <code>case</code> command,
<code>select</code> command, every arithmetic <code>for</code> command, and before
the first command executes in a shell function.
<code>select</code> command, (( arithmetic command, [[ conditional command,
arithmetic <code>for</code> command,
and before the first command executes in a shell function.
Refer to the description of the <code>extdebug</code> option to the
<code>shopt</code> builtin (see <a href="#The-Shopt-Builtin">The Shopt Builtin</a>) for details of its
effect on the <code>DEBUG</code> trap.
If a <var>sigspec</var> is <code>RETURN</code>, the command <var>arg</var> is executed
If a <var>sigspec</var> is <code>RETURN</code>, <var>action</var> is executed
each time a shell function or a script executed with the <code>.</code> or
<code>source</code> builtins finishes executing.
</p>
<p>If a <var>sigspec</var> is <code>ERR</code>, the command <var>arg</var>
<p>If a <var>sigspec</var> is <code>ERR</code>, <var>action</var>
is executed whenever
a pipeline (which may consist of a single simple
command), a list, or a compound command returns a
@@ -4791,7 +4797,9 @@ status is being inverted using <code>!</code>.
These are the same conditions obeyed by the <code>errexit</code> (<samp>-e</samp>)
option.
</p>
<p>Signals ignored upon entry to the shell cannot be trapped or reset.
<p>Signals ignored upon entry to a non-interactive shell cannot be trapped or
reset.
Interactive shells permit trapping signals ignored on entry.
Trapped signals that are not being ignored are reset to their original
values in a subshell or subshell environment when one is created.
</p>
@@ -9291,8 +9299,9 @@ is a valid signal number. If users want to reset the handler for a given
signal to the original disposition, they should use &lsquo;<samp>-</samp>&rsquo; as the
first argument.
</li><li> <code>trap -p</code> displays signals whose dispositions are set to SIG_DFL and
those that were ignored when the shell started.
</li><li> <code>trap -p</code> without arguments displays signals whose dispositions are
set to SIG_DFL and those that were ignored when the shell started, not
just trapped signals.
</li><li> The <code>.</code> and <code>source</code> builtins do not search the current directory
for the filename argument if it is not found by searching <code>PATH</code>.
@@ -13913,11 +13922,11 @@ The latest version of Bash is always available for FTP from
<a href="http://git.savannah.gnu.org/cgit/bash.git/snapshot/bash-master.tar.gz">http://git.savannah.gnu.org/cgit/bash.git/snapshot/bash-master.tar.gz</a>.
</p>
<p>Once you have determined that a bug actually exists, use the
<code>bashbug</code> command to submit a bug report.
If you have a fix, you are encouraged to mail that as well!
<code>bashbug</code> command to submit a bug report or use the form at the
&lt;a href=&quot;https://savannah.gnu.org/projects/bash/&quot;&gt;Bash project page&lt;/a&gt;.
If you have a fix, you are encouraged to submit that as well!
Suggestions and &lsquo;philosophical&rsquo; bug reports may be mailed
to <a href="mailto:bug-bash@gnu.org">bug-bash@gnu.org</a> or posted to the Usenet
newsgroup <code>gnu.bash.bug</code>.
to <a href="mailto:bug-bash@gnu.org">bug-bash@gnu.org</a> or <a href="mailto:help-bash@gnu.org">help-bash@gnu.org</a>.
</p>
<p>All bug reports should include:
</p><ul>
+186 -177
View File
@@ -2,9 +2,9 @@ This is bashref.info, produced by makeinfo version 6.8 from
bashref.texi.
This text is a brief description of the features that are present in the
Bash shell (version 5.2, 19 September 2022).
Bash shell (version 5.2, 2 December 2022).
This is Edition 5.2, last updated 19 September 2022, of 'The GNU Bash
This is Edition 5.2, last updated 2 December 2022, of 'The GNU Bash
Reference Manual', for 'Bash', Version 5.2.
Copyright (C) 1988-2022 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.2, 19 September 2022). The Bash home page is
Bash shell (version 5.2, 2 December 2022). The Bash home page is
<http://www.gnu.org/software/bash/>.
This is Edition 5.2, last updated 19 September 2022, of 'The GNU Bash
This is Edition 5.2, last updated 2 December 2022, of 'The GNU Bash
Reference Manual', for 'Bash', Version 5.2.
Bash contains features that appear in other popular shells, and some
@@ -1833,7 +1833,7 @@ immediately follow the left brace in order to introduce indirection.
In each of the cases below, WORD is subject to tilde expansion,
parameter expansion, command substitution, and arithmetic expansion.
When not performing substring expansion, using the form described
When not performing substring expansion, using the forms described
below (e.g., ':-'), Bash tests for a parameter that is unset or null.
Omitting the colon results in a test only for a parameter that is unset.
Put another way, if the colon is included, the operator tests for both
@@ -3564,37 +3564,43 @@ standard.
children. The return status is zero.
'trap'
trap [-lp] [ARG] [SIGSPEC ...]
trap [-lp] [ACTION] [SIGSPEC ...]
The commands in ARG are to be read and executed when the shell
receives signal SIGSPEC. If ARG is absent (and there is a single
SIGSPEC) or equal to '-', each specified signal's disposition is
reset to the value it had when the shell was started. If ARG is
the null string, then the signal specified by each SIGSPEC is
ignored by the shell and commands it invokes. If ARG is not
present and '-p' has been supplied, the shell displays the trap
commands associated with each SIGSPEC. If no arguments are
supplied, or only '-p' is given, 'trap' prints the list of commands
associated with each signal number in a form that may be reused as
shell input. The '-l' option causes the shell to print a list of
signal names and their corresponding numbers. Each SIGSPEC is
either a signal name or a signal number. Signal names are case
insensitive and the 'SIG' prefix is optional.
The ACTION is a command that is read and executed when the shell
receives signal SIGSPEC. If ACTION is absent (and there is a
single SIGSPEC) or equal to '-', each specified signal's
disposition is reset to the value it had when the shell was
started. If ACTION is the null string, then the signal specified
by each SIGSPEC is ignored by the shell and commands it invokes.
If a SIGSPEC is '0' or 'EXIT', ARG is executed when the shell
exits. If a SIGSPEC is 'DEBUG', the command ARG is executed before
every simple command, 'for' command, 'case' command, 'select'
command, every arithmetic 'for' command, and before the first
command executes in a shell function. Refer to the description of
the 'extdebug' option to the 'shopt' builtin (*note The Shopt
Builtin::) for details of its effect on the 'DEBUG' trap. If a
SIGSPEC is 'RETURN', the command ARG is executed each time a shell
function or a script executed with the '.' or 'source' builtins
finishes executing.
If no arguments are supplied, 'trap' prints the actions associated
with each trapped signal as a set of 'trap' commands that can be
reused as shell input to restore the current signal dispositions.
If ACTION is not present and '-p' has been supplied, 'trap'
displays the trap commands associated with each SIGSPEC, or, if no
SIGSPECs are supplied, for all trapped signals, as a set of 'trap'
commands that can be reused as shell input to restore the current
signal dispositions.
If a SIGSPEC is 'ERR', the command ARG is executed whenever a
pipeline (which may consist of a single simple command), a list, or
a compound command returns a non-zero exit status, subject to the
The '-l' option causes 'trap' to print a list of signal names and
their corresponding numbers. Each SIGSPEC is either a signal name
or a signal number. Signal names are case insensitive and the
'SIG' prefix is optional.
If a SIGSPEC is '0' or 'EXIT', ACTION is executed when the shell
exits. If a SIGSPEC is 'DEBUG', ACTION is executed before every
simple command, 'for' command, 'case' command, 'select' command, ((
arithmetic command, [[ conditional command, arithmetic 'for'
command, and before the first command executes in a shell function.
Refer to the description of the 'extdebug' option to the 'shopt'
builtin (*note The Shopt Builtin::) for details of its effect on
the 'DEBUG' trap. If a SIGSPEC is 'RETURN', ACTION is executed
each time a shell function or a script executed with the '.' or
'source' builtins finishes executing.
If a SIGSPEC is 'ERR', ACTION is executed whenever a pipeline
(which may consist of a single simple command), a list, or a
compound command returns a non-zero exit status, subject to the
following conditions. The 'ERR' trap is not executed if the failed
command is part of the command list immediately following an
'until' or 'while' keyword, part of the test following the 'if' or
@@ -3604,10 +3610,11 @@ standard.
status is being inverted using '!'. These are the same conditions
obeyed by the 'errexit' ('-e') option.
Signals ignored upon entry to the shell cannot be trapped or reset.
Trapped signals that are not being ignored are reset to their
original values in a subshell or subshell environment when one is
created.
Signals ignored upon entry to a non-interactive shell cannot be
trapped or reset. Interactive shells permit trapping signals
ignored on entry. Trapped signals that are not being ignored are
reset to their original values in a subshell or subshell
environment when one is created.
The return status is zero unless a SIGSPEC does not specify a valid
signal.
@@ -7191,8 +7198,9 @@ startup files.
handler for a given signal to the original disposition, they should
use '-' as the first argument.
42. 'trap -p' displays signals whose dispositions are set to SIG_DFL
and those that were ignored when the shell started.
42. '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.
43. The '.' and 'source' builtins do not search the current directory
for the filename argument if it is not found by searching 'PATH'.
@@ -10888,10 +10896,11 @@ of Bash. The latest version of Bash is always available for FTP from
<http://git.savannah.gnu.org/cgit/bash.git/snapshot/bash-master.tar.gz>.
Once you have determined that a bug actually exists, use the
'bashbug' command to submit a bug report. If you have a fix, you are
encouraged to mail that as well! Suggestions and 'philosophical' bug
reports may be mailed to <bug-bash@gnu.org> or posted to the Usenet
newsgroup 'gnu.bash.bug'.
'bashbug' command to submit a bug report or use the form at the <a
href="https://savannah.gnu.org/projects/bash/">Bash project page</a>.
If you have a fix, you are encouraged to submit that as well!
Suggestions and 'philosophical' bug reports may be mailed to
<bug-bash@gnu.org> or <help-bash@gnu.org>.
All bug reports should include:
* The version number of Bash.
@@ -11868,10 +11877,10 @@ D.1 Index of Shell Builtin Commands
* typeset: Bash Builtins. (line 631)
* ulimit: Bash Builtins. (line 637)
* umask: Bourne Shell Builtins.
(line 415)
(line 422)
* unalias: Bash Builtins. (line 743)
* unset: Bourne Shell Builtins.
(line 433)
(line 440)
* wait: Job Control Builtins.
(line 76)
@@ -12535,138 +12544,138 @@ D.5 Concept Index

Tag Table:
Node: Top899
Node: Introduction2821
Node: What is Bash?3037
Node: What is a shell?4151
Node: Definitions6689
Node: Basic Shell Features9640
Node: Shell Syntax10859
Node: Shell Operation11885
Node: Quoting13178
Node: Escape Character14482
Node: Single Quotes14967
Node: Double Quotes15315
Node: ANSI-C Quoting16593
Node: Locale Translation17903
Node: Creating Internationalized Scripts19214
Node: Comments23331
Node: Shell Commands23949
Node: Reserved Words24887
Node: Simple Commands25643
Node: Pipelines26297
Node: Lists29296
Node: Compound Commands31091
Node: Looping Constructs32103
Node: Conditional Constructs34598
Node: Command Grouping49086
Node: Coprocesses50564
Node: GNU Parallel53227
Node: Shell Functions54144
Node: Shell Parameters62029
Node: Positional Parameters66417
Node: Special Parameters67319
Node: Shell Expansions70533
Node: Brace Expansion72660
Node: Tilde Expansion75394
Node: Shell Parameter Expansion78015
Node: Command Substitution96366
Node: Arithmetic Expansion97721
Node: Process Substitution98689
Node: Word Splitting99809
Node: Filename Expansion101753
Node: Pattern Matching104502
Node: Quote Removal109504
Node: Redirections109799
Node: Executing Commands119459
Node: Simple Command Expansion120129
Node: Command Search and Execution122239
Node: Command Execution Environment124617
Node: Environment127652
Node: Exit Status129315
Node: Signals131099
Node: Shell Scripts134548
Node: Shell Builtin Commands137575
Node: Bourne Shell Builtins139613
Node: Bash Builtins161079
Node: Modifying Shell Behavior191935
Node: The Set Builtin192280
Node: The Shopt Builtin202881
Node: Special Builtins218793
Node: Shell Variables219772
Node: Bourne Shell Variables220209
Node: Bash Variables222313
Node: Bash Features255128
Node: Invoking Bash256141
Node: Bash Startup Files262154
Node: Interactive Shells267285
Node: What is an Interactive Shell?267696
Node: Is this Shell Interactive?268345
Node: Interactive Shell Behavior269160
Node: Bash Conditional Expressions272789
Node: Shell Arithmetic277431
Node: Aliases280375
Node: Arrays282988
Node: The Directory Stack289379
Node: Directory Stack Builtins290163
Node: Controlling the Prompt294423
Node: The Restricted Shell297388
Node: Bash POSIX Mode299998
Node: Shell Compatibility Mode311916
Node: Job Control320483
Node: Job Control Basics320943
Node: Job Control Builtins325945
Node: Job Control Variables331740
Node: Command Line Editing332896
Node: Introduction and Notation334567
Node: Readline Interaction336190
Node: Readline Bare Essentials337381
Node: Readline Movement Commands339170
Node: Readline Killing Commands340130
Node: Readline Arguments342051
Node: Searching343095
Node: Readline Init File345281
Node: Readline Init File Syntax346542
Node: Conditional Init Constructs370128
Node: Sample Init File374324
Node: Bindable Readline Commands377448
Node: Commands For Moving378652
Node: Commands For History380703
Node: Commands For Text385697
Node: Commands For Killing389346
Node: Numeric Arguments392379
Node: Commands For Completion393518
Node: Keyboard Macros397709
Node: Miscellaneous Commands398397
Node: Readline vi Mode404342
Node: Programmable Completion405249
Node: Programmable Completion Builtins413029
Node: A Programmable Completion Example423781
Node: Using History Interactively429029
Node: Bash History Facilities429713
Node: Bash History Builtins432718
Node: History Interaction437742
Node: Event Designators441362
Node: Word Designators442716
Node: Modifiers444476
Node: Installing Bash446284
Node: Basic Installation447421
Node: Compilers and Options451143
Node: Compiling For Multiple Architectures451884
Node: Installation Names453576
Node: Specifying the System Type455685
Node: Sharing Defaults456402
Node: Operation Controls457075
Node: Optional Features458033
Node: Reporting Bugs469252
Node: Major Differences From The Bourne Shell470527
Node: GNU Free Documentation License487376
Node: Indexes512553
Node: Builtin Index513007
Node: Reserved Word Index519834
Node: Variable Index522282
Node: Function Index539056
Node: Concept Index552840
Node: Top895
Node: Introduction2813
Node: What is Bash?3029
Node: What is a shell?4143
Node: Definitions6681
Node: Basic Shell Features9632
Node: Shell Syntax10851
Node: Shell Operation11877
Node: Quoting13170
Node: Escape Character14474
Node: Single Quotes14959
Node: Double Quotes15307
Node: ANSI-C Quoting16585
Node: Locale Translation17895
Node: Creating Internationalized Scripts19206
Node: Comments23323
Node: Shell Commands23941
Node: Reserved Words24879
Node: Simple Commands25635
Node: Pipelines26289
Node: Lists29288
Node: Compound Commands31083
Node: Looping Constructs32095
Node: Conditional Constructs34590
Node: Command Grouping49078
Node: Coprocesses50556
Node: GNU Parallel53219
Node: Shell Functions54136
Node: Shell Parameters62021
Node: Positional Parameters66409
Node: Special Parameters67311
Node: Shell Expansions70525
Node: Brace Expansion72652
Node: Tilde Expansion75386
Node: Shell Parameter Expansion78007
Node: Command Substitution96359
Node: Arithmetic Expansion97714
Node: Process Substitution98682
Node: Word Splitting99802
Node: Filename Expansion101746
Node: Pattern Matching104495
Node: Quote Removal109497
Node: Redirections109792
Node: Executing Commands119452
Node: Simple Command Expansion120122
Node: Command Search and Execution122232
Node: Command Execution Environment124610
Node: Environment127645
Node: Exit Status129308
Node: Signals131092
Node: Shell Scripts134541
Node: Shell Builtin Commands137568
Node: Bourne Shell Builtins139606
Node: Bash Builtins161391
Node: Modifying Shell Behavior192247
Node: The Set Builtin192592
Node: The Shopt Builtin203193
Node: Special Builtins219105
Node: Shell Variables220084
Node: Bourne Shell Variables220521
Node: Bash Variables222625
Node: Bash Features255440
Node: Invoking Bash256453
Node: Bash Startup Files262466
Node: Interactive Shells267597
Node: What is an Interactive Shell?268008
Node: Is this Shell Interactive?268657
Node: Interactive Shell Behavior269472
Node: Bash Conditional Expressions273101
Node: Shell Arithmetic277743
Node: Aliases280687
Node: Arrays283300
Node: The Directory Stack289691
Node: Directory Stack Builtins290475
Node: Controlling the Prompt294735
Node: The Restricted Shell297700
Node: Bash POSIX Mode300310
Node: Shell Compatibility Mode312277
Node: Job Control320844
Node: Job Control Basics321304
Node: Job Control Builtins326306
Node: Job Control Variables332101
Node: Command Line Editing333257
Node: Introduction and Notation334928
Node: Readline Interaction336551
Node: Readline Bare Essentials337742
Node: Readline Movement Commands339531
Node: Readline Killing Commands340491
Node: Readline Arguments342412
Node: Searching343456
Node: Readline Init File345642
Node: Readline Init File Syntax346903
Node: Conditional Init Constructs370489
Node: Sample Init File374685
Node: Bindable Readline Commands377809
Node: Commands For Moving379013
Node: Commands For History381064
Node: Commands For Text386058
Node: Commands For Killing389707
Node: Numeric Arguments392740
Node: Commands For Completion393879
Node: Keyboard Macros398070
Node: Miscellaneous Commands398758
Node: Readline vi Mode404703
Node: Programmable Completion405610
Node: Programmable Completion Builtins413390
Node: A Programmable Completion Example424142
Node: Using History Interactively429390
Node: Bash History Facilities430074
Node: Bash History Builtins433079
Node: History Interaction438103
Node: Event Designators441723
Node: Word Designators443077
Node: Modifiers444837
Node: Installing Bash446645
Node: Basic Installation447782
Node: Compilers and Options451504
Node: Compiling For Multiple Architectures452245
Node: Installation Names453937
Node: Specifying the System Type456046
Node: Sharing Defaults456763
Node: Operation Controls457436
Node: Optional Features458394
Node: Reporting Bugs469613
Node: Major Differences From The Bourne Shell470957
Node: GNU Free Documentation License487806
Node: Indexes512983
Node: Builtin Index513437
Node: Reserved Word Index520264
Node: Variable Index522712
Node: Function Index539486
Node: Concept Index553270

End Tag Table
+52 -39
View File
@@ -1,11 +1,11 @@
This is pdfTeX, Version 3.141592653-2.6-1.40.22 (TeX Live 2021/MacPorts 2021.58693_0) (preloaded format=pdfetex 2021.8.30) 19 SEP 2022 12:02
This is pdfTeX, Version 3.141592653-2.6-1.40.22 (TeX Live 2021/MacPorts 2021.58693_0) (preloaded format=pdfetex 2021.8.30) 2 DEC 2022 17:01
entering extended mode
restricted \write18 enabled.
file:line:error style messages enabled.
%&-line parsing enabled.
**\input /usr/local/src/bash/bash-20220907/doc/bashref.texi
(/usr/local/src/bash/bash-20220907/doc/bashref.texi
(/usr/local/src/bash/bash-20220907/doc/texinfo.tex
**\input /usr/local/src/bash/bash-20221202/doc/bashref.texi
(/usr/local/src/bash/bash-20221202/doc/bashref.texi
(/usr/local/src/bash/bash-20221202/doc/texinfo.tex
Loading texinfo [version 2015-11-22.14]:
\outerhsize=\dimen16
\outervsize=\dimen17
@@ -161,15 +161,15 @@ This is `epsf.tex' v2.7.4 <14 February 2011>
texinfo.tex: doing @include of version.texi
(/usr/local/src/bash/bash-20220907/doc/version.texi) [1{/opt/local/var/db/texmf
(/usr/local/src/bash/bash-20221202/doc/version.texi) [1{/opt/local/var/db/texmf
/fonts/map/pdftex/updmap/pdftex.map}] [2]
(/usr/local/build/bash/bash-20220907/doc/bashref.toc [-1] [-2] [-3]) [-4]
(/usr/local/build/bash/bash-20220907/doc/bashref.toc)
(/usr/local/build/bash/bash-20220907/doc/bashref.toc) Chapter 1
(/usr/local/build/bash/bash-20221202/doc/bashref.toc [-1] [-2] [-3]) [-4]
(/usr/local/build/bash/bash-20221202/doc/bashref.toc)
(/usr/local/build/bash/bash-20221202/doc/bashref.toc) Chapter 1
\openout0 = `bashref.toc'.
(/usr/local/build/bash/bash-20220907/doc/bashref.aux)
(/usr/local/build/bash/bash-20221202/doc/bashref.aux)
\openout1 = `bashref.aux'.
Chapter 2 [1] [2]
@@ -228,7 +228,7 @@ Overfull \hbox (5.95723pt too wide) in paragraph at lines 724--725
[48] [49] [50] [51]
[52] [53] [54] [55] [56] [57] [58] [59] [60] [61] [62] [63] [64] [65] [66]
Overfull \hbox (38.26585pt too wide) in paragraph at lines 5230--5230
Overfull \hbox (38.26585pt too wide) in paragraph at lines 5238--5238
[]@texttt set [-abefhkmnptuvxBCEHPT] [-o @textttsl option-name@texttt ] [--] [
-] [@textttsl ar-gu-ment []@texttt ][]
@@ -241,7 +241,7 @@ Overfull \hbox (38.26585pt too wide) in paragraph at lines 5230--5230
.etc.
Overfull \hbox (38.26585pt too wide) in paragraph at lines 5231--5231
Overfull \hbox (38.26585pt too wide) in paragraph at lines 5239--5239
[]@texttt set [+abefhkmnptuvxBCEHPT] [+o @textttsl option-name@texttt ] [--] [
-] [@textttsl ar-gu-ment []@texttt ][]
@@ -260,7 +260,7 @@ Overfull \hbox (38.26585pt too wide) in paragraph at lines 5231--5231
texinfo.tex: doing @include of rluser.texi
(/usr/local/src/bash/bash-20220907/lib/readline/doc/rluser.texi Chapter 8
(/usr/local/src/bash/bash-20221202/lib/readline/doc/rluser.texi Chapter 8
[116] [117] [118] [119] [120] [121] [122] [123] [124] [125] [126] [127]
Underfull \hbox (badness 7540) in paragraph at lines 868--874
[]@textrm In the ex-am-ple above, @textttsl C-u[] @textrm is bound to the func
@@ -322,10 +322,10 @@ Overfull \hbox (15.27109pt too wide) in paragraph at lines 2127--2127
texinfo.tex: doing @include of hsuser.texi
(/usr/local/src/bash/bash-20220907/lib/readline/doc/hsuser.texi Chapter 9
(/usr/local/src/bash/bash-20221202/lib/readline/doc/hsuser.texi Chapter 9
[151] [152] [153] [154] [155] [156]) Chapter 10 [157] [158] [159] [160]
[161]
Underfull \hbox (badness 10000) in paragraph at lines 9386--9395
Underfull \hbox (badness 10000) in paragraph at lines 9395--9404
[]@textrm All of the fol-low-ing op-tions ex-cept for `@texttt alt-array-implem
entation[]@textrm '[],
@@ -338,7 +338,7 @@ entation[]@textrm '[],
.etc.
Underfull \hbox (badness 10000) in paragraph at lines 9386--9395
Underfull \hbox (badness 10000) in paragraph at lines 9395--9404
@textrm `@texttt disabled-builtins[]@textrm '[], `@texttt direxpand-default[]@t
extrm '[], `@texttt strict-posix-default[]@textrm '[], and
@@ -350,39 +350,52 @@ extrm '[], `@texttt strict-posix-default[]@textrm '[], and
.@texttt a
.etc.
[162] [163] [164] [165] Appendix A [166] Appendix B [167] [168] [169] [170]
[171] [172] Appendix C [173]
[162] [163] [164] [165] Appendix A [166]
Overfull \hbox (26.5845pt too wide) in paragraph at lines 9603--9609
@textrm mit a bug re-port or use the form at the @texttt <@textrm a href=@textt
t "@textrm https://savannah.gnu.org/projects/bash/@texttt ">@textrm Bash
@hbox(8.2125+2.73749)x433.62, glue set - 1.0
.@textrm m
.@textrm i
.@textrm t
.@glue 3.65 plus 1.825 minus 1.21666
.@textrm a
.etc.
Appendix B [167] [168] [169] [170] [171] [172] Appendix C [173]
texinfo.tex: doing @include of fdl.texi
(/usr/local/src/bash/bash-20220907/doc/fdl.texi
[174] [175] [176] [177] [178] [179] [180]) Appendix D [181] [182] [183]
[184] [185] [186] [187] [188] [189] [190] )
(/usr/local/src/bash/bash-20221202/doc/fdl.texi [174] [175] [176] [177]
[178] [179] [180]) Appendix D [181] [182] [183] [184] [185] [186] [187]
[188] [189] [190] )
Here is how much of TeX's memory you used:
4095 strings out of 497086
47569 string characters out of 6206517
141570 words of memory out of 5000000
141518 words of memory out of 5000000
4867 multiletter control sequences out of 15000+600000
34315 words of font info for 116 fonts, out of 8000000 for 9000
51 hyphenation exceptions out of 8191
16i,6n,16p,331b,978s stack positions out of 5000i,500n,10000p,200000b,80000s
{/opt/local/share/texmf-texlive/font
s/enc/dvips/cm-super/cm-super-t1.enc}</opt/local/share/texmf-texlive/fonts/type
1/public/amsfonts/cm/cmbx12.pfb></opt/local/share/texmf-texlive/fonts/type1/pub
lic/amsfonts/cm/cmcsc10.pfb></opt/local/share/texmf-texlive/fonts/type1/public/
amsfonts/cm/cmmi10.pfb></opt/local/share/texmf-texlive/fonts/type1/public/amsfo
nts/cm/cmmi12.pfb></opt/local/share/texmf-texlive/fonts/type1/public/amsfonts/c
m/cmmi9.pfb></opt/local/share/texmf-texlive/fonts/type1/public/amsfonts/cm/cmr1
0.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></opt/loc
al/share/texmf-texlive/fonts/type1/public/amsfonts/cm/cmsy10.pfb></opt/local/sh
are/texmf-texlive/fonts/type1/public/amsfonts/cm/cmti10.pfb></opt/local/share/t
exmf-texlive/fonts/type1/public/amsfonts/cm/cmtt10.pfb></opt/local/share/texmf-
texlive/fonts/type1/public/amsfonts/cm/cmtt12.pfb></opt/local/share/texmf-texli
ve/fonts/type1/public/amsfonts/cm/cmtt9.pfb></opt/local/share/texmf-texlive/fon
ts/type1/public/cm-super/sfrm1095.pfb></opt/local/share/texmf-texlive/fonts/typ
e1/public/cm-super/sfrm1440.pfb>
Output written on bashref.pdf (196 pages, 795771 bytes).
{/opt/local/share/texmf-texlive/fonts/enc/dvips/cm-super/cm-
super-t1.enc}</opt/local/share/texmf-texlive/fonts/type1/public/amsfonts/cm/cmb
x12.pfb></opt/local/share/texmf-texlive/fonts/type1/public/amsfonts/cm/cmcsc10.
pfb></opt/local/share/texmf-texlive/fonts/type1/public/amsfonts/cm/cmmi10.pfb><
/opt/local/share/texmf-texlive/fonts/type1/public/amsfonts/cm/cmmi12.pfb></opt/
local/share/texmf-texlive/fonts/type1/public/amsfonts/cm/cmmi9.pfb></opt/local/
share/texmf-texlive/fonts/type1/public/amsfonts/cm/cmr10.pfb></opt/local/share/
texmf-texlive/fonts/type1/public/amsfonts/cm/cmr9.pfb></opt/local/share/texmf-t
exlive/fonts/type1/public/amsfonts/cm/cmsl10.pfb></opt/local/share/texmf-texliv
e/fonts/type1/public/amsfonts/cm/cmsltt10.pfb></opt/local/share/texmf-texlive/f
onts/type1/public/amsfonts/cm/cmsy10.pfb></opt/local/share/texmf-texlive/fonts/
type1/public/amsfonts/cm/cmti10.pfb></opt/local/share/texmf-texlive/fonts/type1
/public/amsfonts/cm/cmtt10.pfb></opt/local/share/texmf-texlive/fonts/type1/publ
ic/amsfonts/cm/cmtt12.pfb></opt/local/share/texmf-texlive/fonts/type1/public/am
sfonts/cm/cmtt9.pfb></opt/local/share/texmf-texlive/fonts/type1/public/cm-super
/sfrm1095.pfb></opt/local/share/texmf-texlive/fonts/type1/public/cm-super/sfrm1
440.pfb>
Output written on bashref.pdf (196 pages, 796156 bytes).
PDF statistics:
2756 PDF objects out of 2984 (max. 8388607)
2513 compressed objects within 26 object streams
BIN
View File
Binary file not shown.
+1222 -1211
View File
File diff suppressed because it is too large Load Diff
+30 -21
View File
@@ -4224,41 +4224,47 @@ The return status is zero.
@item trap
@btindex trap
@example
trap [-lp] [@var{arg}] [@var{sigspec} @dots{}]
trap [-lp] [@var{action}] [@var{sigspec} @dots{}]
@end example
The commands in @var{arg} are to be read and executed when the
shell receives signal @var{sigspec}. If @var{arg} is absent (and
The @var{action} is a command that is read and executed when the
shell receives signal @var{sigspec}. If @var{action} is absent (and
there is a single @var{sigspec}) or
equal to @samp{-}, each specified signal's disposition is reset
to the value it had when the shell was started.
If @var{arg} is the null string, then the signal specified by
If @var{action} is the null string, then the signal specified by
each @var{sigspec} is ignored by the shell and commands it invokes.
If @var{arg} is not present and @option{-p} has been supplied,
the shell displays the trap commands associated with each @var{sigspec}.
If no arguments are supplied, or
only @option{-p} is given, @code{trap} prints the list of commands
associated with each signal number in a form that may be reused as
shell input.
The @option{-l} option causes the shell to print a list of signal names
If no arguments are supplied, @code{trap} prints the actions
associated with each trapped signal
as a set of @code{trap} commands that can be reused as shell input to
restore the current signal dispositions.
If @var{action} is not present and @option{-p} has been supplied,
@code{trap} displays the trap commands associated with each @var{sigspec},
or, if no @var{sigspec}s are supplied, for all trapped signals,
as a set of @code{trap} commands that can be reused as shell input to
restore the current signal dispositions.
The @option{-l} option causes @code{trap} to print a list of signal names
and their corresponding numbers.
Each @var{sigspec} is either a signal name or a signal number.
Signal names are case insensitive and the @code{SIG} prefix is optional.
If a @var{sigspec}
is @code{0} or @code{EXIT}, @var{arg} is executed when the shell exits.
If a @var{sigspec} is @code{DEBUG}, the command @var{arg} is executed
is @code{0} or @code{EXIT}, @var{action} is executed when the shell exits.
If a @var{sigspec} is @code{DEBUG}, @var{action} is executed
before every simple command, @code{for} command, @code{case} command,
@code{select} command, every arithmetic @code{for} command, and before
the first command executes in a shell function.
@code{select} command, (( arithmetic command, [[ conditional command,
arithmetic @code{for} command,
and before the first command executes in a shell function.
Refer to the description of the @code{extdebug} option to the
@code{shopt} builtin (@pxref{The Shopt Builtin}) for details of its
effect on the @code{DEBUG} trap.
If a @var{sigspec} is @code{RETURN}, the command @var{arg} is executed
If a @var{sigspec} is @code{RETURN}, @var{action} is executed
each time a shell function or a script executed with the @code{.} or
@code{source} builtins finishes executing.
If a @var{sigspec} is @code{ERR}, the command @var{arg}
If a @var{sigspec} is @code{ERR}, @var{action}
is executed whenever
a pipeline (which may consist of a single simple
command), a list, or a compound command returns a
@@ -4275,7 +4281,9 @@ status is being inverted using @code{!}.
These are the same conditions obeyed by the @code{errexit} (@option{-e})
option.
Signals ignored upon entry to the shell cannot be trapped or reset.
Signals ignored upon entry to a non-interactive shell cannot be trapped or
reset.
Interactive shells permit trapping signals ignored on entry.
Trapped signals that are not being ignored are reset to their original
values in a subshell or subshell environment when one is created.
@@ -8325,8 +8333,9 @@ signal to the original disposition, they should use @samp{-} as the
first argument.
@item
@code{trap -p} displays signals whose dispositions are set to SIG_DFL and
those that were ignored when the shell started.
@code{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.
@item
The @code{.} and @code{source} builtins do not search the current directory
@@ -9596,7 +9605,7 @@ Once you have determined that a bug actually exists, use the
<a href="https://savannah.gnu.org/projects/bash/">Bash project page</a>.
If you have a fix, you are encouraged to submit that as well!
Suggestions and `philosophical' bug reports may be mailed
to @email{bug-bash@@gnu.org} or @email{help-bash@gnu.org}.
to @email{bug-bash@@gnu.org} or @email{help-bash@@gnu.org}.
All bug reports should include:
@itemize @bullet
+182 -173
View File
@@ -1757,34 +1757,42 @@ BBAASSHH BBUUIILLTTIINN CCOOMMMMAANNDDSS
ttiimmeess Print the accumulated user and system times for the shell and
for processes run from the shell. The return status is 0.
ttrraapp [--llpp] [[_a_r_g] _s_i_g_s_p_e_c ...]
The command _a_r_g is to be read and executed when the shell re-
ceives signal(s) _s_i_g_s_p_e_c. If _a_r_g is absent (and there is a sin-
gle _s_i_g_s_p_e_c) or --, each specified signal is reset to its origi-
nal disposition (the value it had upon entrance to the shell).
If _a_r_g is the null string the signal specified by each _s_i_g_s_p_e_c
is ignored by the shell and by the commands it invokes. If _a_r_g
is not present and --pp has been supplied, then the trap commands
associated with each _s_i_g_s_p_e_c are displayed. If no arguments are
supplied or if only --pp is given, ttrraapp prints the list of com-
mands associated with each signal. The --ll option causes the
shell to print a list of signal names and their corresponding
numbers. Each _s_i_g_s_p_e_c is either a signal name defined in <_s_i_g_-
_n_a_l_._h>, or a signal number. Signal names are case insensitive
and the SSIIGG prefix is optional.
ttrraapp [--llpp] [[_a_c_t_i_o_n] _s_i_g_s_p_e_c ...]
The _a_c_t_i_o_n is a command that is read and executed when the shell
receives signal(s) _s_i_g_s_p_e_c. If _a_c_t_i_o_n is absent (and there is a
single _s_i_g_s_p_e_c) or --, each specified signal is reset to its
original disposition (the value it had upon entrance to the
shell). If _a_c_t_i_o_n is the null string the signal specified by
each _s_i_g_s_p_e_c is ignored by the shell and by the commands it in-
vokes.
If a _s_i_g_s_p_e_c is EEXXIITT (0) the command _a_r_g is executed on exit
from the shell. If a _s_i_g_s_p_e_c is DDEEBBUUGG, the command _a_r_g is exe-
cuted before every _s_i_m_p_l_e _c_o_m_m_a_n_d, _f_o_r command, _c_a_s_e command,
_s_e_l_e_c_t command, every arithmetic _f_o_r command, and before the
first command executes in a shell function (see SSHHEELLLL GGRRAAMMMMAARR in
_b_a_s_h_(_1_)). Refer to the description of the eexxttddeebbuugg option to
the sshhoopptt builtin for details of its effect on the DDEEBBUUGG trap.
If a _s_i_g_s_p_e_c is RREETTUURRNN, the command _a_r_g is executed each time a
shell function or a script executed with the .. or ssoouurrccee
builtins finishes executing.
If no arguments are supplied, ttrraapp displays the actions associ-
ated with each trapped signal as a set of ttrraapp commands that can
be reused as shell input to restore the current signal disposi-
tions. If --pp is given, and _a_c_t_i_o_n is not present, then ttrraapp
displays the actions associated with each _s_i_g_s_p_e_c or, if none
are supplied, for all trapped signals, as a set of ttrraapp commands
that can be reused as shell input to restore the current signal
dispositions.
If a _s_i_g_s_p_e_c is EERRRR, the command _a_r_g is executed whenever a
The --ll option causes ttrraapp to print a list of signal names and
their corresponding numbers. Each _s_i_g_s_p_e_c is either a signal
name defined in <_s_i_g_n_a_l_._h>, or a signal number. Signal names
are case insensitive and the SSIIGG prefix is optional.
If a _s_i_g_s_p_e_c is EEXXIITT (0) the command _a_c_t_i_o_n is executed on exit
from the shell. If a _s_i_g_s_p_e_c is DDEEBBUUGG, the command _a_c_t_i_o_n is
executed before every _s_i_m_p_l_e _c_o_m_m_a_n_d, _f_o_r command, _c_a_s_e command,
_s_e_l_e_c_t command, (( arithmetic command, [[ conditional command,
arithmetic _f_o_r command, and before the first command executes in
a shell function (see SSHHEELLLL GGRRAAMMMMAARR in _b_a_s_h_(_1_)). Refer to the
description of the eexxttddeebbuugg option to the sshhoopptt builtin for de-
tails of its effect on the DDEEBBUUGG trap. If a _s_i_g_s_p_e_c is RREETTUURRNN,
the command _a_c_t_i_o_n is executed each time a shell function or a
script executed with the .. or ssoouurrccee builtins finishes execut-
ing.
If a _s_i_g_s_p_e_c is EERRRR, the command _a_c_t_i_o_n is executed whenever a
pipeline (which may consist of a single simple command), a list,
or a compound command returns a non-zero exit status, subject to
the following conditions. The EERRRR trap is not executed if the
@@ -1796,61 +1804,62 @@ BBAASSHH BBUUIILLTTIINN CCOOMMMMAANNDDSS
!!. These are the same conditions obeyed by the eerrrreexxiitt (--ee) op-
tion.
Signals ignored upon entry to the shell cannot be trapped or re-
set. Trapped signals that are not being ignored are reset to
their original values in a subshell or subshell environment when
one is created. The return status is false if any _s_i_g_s_p_e_c is
invalid; otherwise ttrraapp returns true.
When the shell is not interactive, signals ignored upon entry to
the shell cannot be trapped or reset. Interactive shells permit
trapping signals ignored on entry. Trapped signals that are not
being ignored are reset to their original values in a subshell
or subshell environment when one is created. The return status
is false if any _s_i_g_s_p_e_c is invalid; otherwise ttrraapp returns true.
ttyyppee [--aaffttppPP] _n_a_m_e [_n_a_m_e ...]
With no options, indicate how each _n_a_m_e would be interpreted if
With no options, indicate how each _n_a_m_e would be interpreted if
used as a command name. If the --tt option is used, ttyyppee prints a
string which is one of _a_l_i_a_s, _k_e_y_w_o_r_d, _f_u_n_c_t_i_o_n, _b_u_i_l_t_i_n, or
_f_i_l_e if _n_a_m_e is an alias, shell reserved word, function,
builtin, or disk file, respectively. If the _n_a_m_e is not found,
then nothing is printed, and an exit status of false is re-
turned. If the --pp option is used, ttyyppee either returns the name
of the disk file that would be executed if _n_a_m_e were specified
as a command name, or nothing if ``type -t name'' would not re-
turn _f_i_l_e. The --PP option forces a PPAATTHH search for each _n_a_m_e,
string which is one of _a_l_i_a_s, _k_e_y_w_o_r_d, _f_u_n_c_t_i_o_n, _b_u_i_l_t_i_n, or
_f_i_l_e if _n_a_m_e is an alias, shell reserved word, function,
builtin, or disk file, respectively. If the _n_a_m_e is not found,
then nothing is printed, and an exit status of false is re-
turned. If the --pp option is used, ttyyppee either returns the name
of the disk file that would be executed if _n_a_m_e were specified
as a command name, or nothing if ``type -t name'' would not re-
turn _f_i_l_e. The --PP option forces a PPAATTHH search for each _n_a_m_e,
even if ``type -t name'' would not return _f_i_l_e. If a command is
hashed, --pp and --PP print the hashed value, which is not necessar-
ily the file that appears first in PPAATTHH. If the --aa option is
used, ttyyppee prints all of the places that contain an executable
ily the file that appears first in PPAATTHH. If the --aa option is
used, ttyyppee prints all of the places that contain an executable
named _n_a_m_e. This includes aliases and functions, if and only if
the --pp option is not also used. The table of hashed commands is
not consulted when using --aa. The --ff option suppresses shell
not consulted when using --aa. The --ff option suppresses shell
function lookup, as with the ccoommmmaanndd builtin. ttyyppee returns true
if all of the arguments are found, false if any are not found.
uulliimmiitt [--HHSS] --aa
uulliimmiitt [--HHSS] [--bbccddeeffiikkllmmnnppqqrrssttuuvvxxPPRRTT [_l_i_m_i_t]]
Provides control over the resources available to the shell and
to processes started by it, on systems that allow such control.
Provides control over the resources available to the shell and
to processes started by it, on systems that allow such control.
The --HH and --SS options specify that the hard or soft limit is set
for the given resource. A hard limit cannot be increased by a
non-root user once it is set; a soft limit may be increased up
to the value of the hard limit. If neither --HH nor --SS is speci-
for the given resource. A hard limit cannot be increased by a
non-root user once it is set; a soft limit may be increased up
to the value of the hard limit. If neither --HH nor --SS is speci-
fied, both the soft and hard limits are set. The value of _l_i_m_i_t
can be a number in the unit specified for the resource or one of
the special values hhaarrdd, ssoofftt, or uunnlliimmiitteedd, which stand for the
current hard limit, the current soft limit, and no limit, re-
spectively. If _l_i_m_i_t is omitted, the current value of the soft
current hard limit, the current soft limit, and no limit, re-
spectively. If _l_i_m_i_t is omitted, the current value of the soft
limit of the resource is printed, unless the --HH option is given.
When more than one resource is specified, the limit name and
unit, if appropriate, are printed before the value. Other op-
When more than one resource is specified, the limit name and
unit, if appropriate, are printed before the value. Other op-
tions are interpreted as follows:
--aa All current limits are reported; no limits are set
--bb The maximum socket buffer size
--cc The maximum size of core files created
--dd The maximum size of a process's data segment
--ee The maximum scheduling priority ("nice")
--ff The maximum size of files written by the shell and its
--ff The maximum size of files written by the shell and its
children
--ii The maximum number of pending signals
--kk The maximum number of kqueues that may be allocated
--ll The maximum size that may be locked into memory
--mm The maximum resident set size (many systems do not honor
--mm The maximum resident set size (many systems do not honor
this limit)
--nn The maximum number of open file descriptors (most systems
do not allow this value to be set)
@@ -1859,134 +1868,134 @@ BBAASSHH BBUUIILLTTIINN CCOOMMMMAANNDDSS
--rr The maximum real-time scheduling priority
--ss The maximum stack size
--tt The maximum amount of cpu time in seconds
--uu The maximum number of processes available to a single
--uu The maximum number of processes available to a single
user
--vv The maximum amount of virtual memory available to the
--vv The maximum amount of virtual memory available to the
shell and, on some systems, to its children
--xx The maximum number of file locks
--PP The maximum number of pseudoterminals
--RR The maximum time a real-time process can run before
--RR The maximum time a real-time process can run before
blocking, in microseconds
--TT The maximum number of threads
If _l_i_m_i_t is given, and the --aa option is not used, _l_i_m_i_t is the
new value of the specified resource. If no option is given,
then --ff is assumed. Values are in 1024-byte increments, except
for --tt, which is in seconds; --RR, which is in microseconds; --pp,
which is in units of 512-byte blocks; --PP, --TT, --bb, --kk, --nn, and
--uu, which are unscaled values; and, when in posix mode, --cc and
--ff, which are in 512-byte increments. The return status is 0
unless an invalid option or argument is supplied, or an error
If _l_i_m_i_t is given, and the --aa option is not used, _l_i_m_i_t is the
new value of the specified resource. If no option is given,
then --ff is assumed. Values are in 1024-byte increments, except
for --tt, which is in seconds; --RR, which is in microseconds; --pp,
which is in units of 512-byte blocks; --PP, --TT, --bb, --kk, --nn, and
--uu, which are unscaled values; and, when in posix mode, --cc and
--ff, which are in 512-byte increments. The return status is 0
unless an invalid option or argument is supplied, or an error
occurs while setting a new limit.
uummaasskk [--pp] [--SS] [_m_o_d_e]
The user file-creation mask is set to _m_o_d_e. If _m_o_d_e begins with
a digit, it is interpreted as an octal number; otherwise it is
interpreted as a symbolic mode mask similar to that accepted by
_c_h_m_o_d(1). If _m_o_d_e is omitted, the current value of the mask is
printed. The --SS option causes the mask to be printed in sym-
bolic form; the default output is an octal number. If the --pp
a digit, it is interpreted as an octal number; otherwise it is
interpreted as a symbolic mode mask similar to that accepted by
_c_h_m_o_d(1). If _m_o_d_e is omitted, the current value of the mask is
printed. The --SS option causes the mask to be printed in sym-
bolic form; the default output is an octal number. If the --pp
option is supplied, and _m_o_d_e is omitted, the output is in a form
that may be reused as input. The return status is 0 if the mode
was successfully changed or if no _m_o_d_e argument was supplied,
was successfully changed or if no _m_o_d_e argument was supplied,
and false otherwise.
uunnaalliiaass [-aa] [_n_a_m_e ...]
Remove each _n_a_m_e from the list of defined aliases. If --aa is
supplied, all alias definitions are removed. The return value
Remove each _n_a_m_e from the list of defined aliases. If --aa is
supplied, all alias definitions are removed. The return value
is true unless a supplied _n_a_m_e is not a defined alias.
uunnsseett [-ffvv] [-nn] [_n_a_m_e ...]
For each _n_a_m_e, remove the corresponding variable or function.
For each _n_a_m_e, remove the corresponding variable or function.
If the --vv option is given, each _n_a_m_e refers to a shell variable,
and that variable is removed. Read-only variables may not be
unset. If --ff is specified, each _n_a_m_e refers to a shell func-
tion, and the function definition is removed. If the --nn option
is supplied, and _n_a_m_e is a variable with the _n_a_m_e_r_e_f attribute,
_n_a_m_e will be unset rather than the variable it references. --nn
has no effect if the --ff option is supplied. If no options are
supplied, each _n_a_m_e refers to a variable; if there is no vari-
able by that name, a function with that name, if any, is unset.
Each unset variable or function is removed from the environment
passed to subsequent commands. If any of BBAASSHH__AALLIIAASSEESS,
and that variable is removed. Read-only variables may not be
unset. If --ff is specified, each _n_a_m_e refers to a shell func-
tion, and the function definition is removed. If the --nn option
is supplied, and _n_a_m_e is a variable with the _n_a_m_e_r_e_f attribute,
_n_a_m_e will be unset rather than the variable it references. --nn
has no effect if the --ff option is supplied. If no options are
supplied, each _n_a_m_e refers to a variable; if there is no vari-
able by that name, a function with that name, if any, is unset.
Each unset variable or function is removed from the environment
passed to subsequent commands. If any of BBAASSHH__AALLIIAASSEESS,
BBAASSHH__AARRGGVV00, BBAASSHH__CCMMDDSS, BBAASSHH__CCOOMMMMAANNDD, BBAASSHH__SSUUBBSSHHEELLLL, BBAASSHHPPIIDD,
CCOOMMPP__WWOORRDDBBRREEAAKKSS, DDIIRRSSTTAACCKK, EEPPOOCCHHRREEAALLTTIIMMEE, EEPPOOCCHHSSEECCOONNDDSS, FFUUNNCC--
NNAAMMEE, GGRROOUUPPSS, HHIISSTTCCMMDD, LLIINNEENNOO, RRAANNDDOOMM, SSEECCOONNDDSS, or SSRRAANNDDOOMM are
CCOOMMPP__WWOORRDDBBRREEAAKKSS, DDIIRRSSTTAACCKK, EEPPOOCCHHRREEAALLTTIIMMEE, EEPPOOCCHHSSEECCOONNDDSS, FFUUNNCC--
NNAAMMEE, GGRROOUUPPSS, HHIISSTTCCMMDD, LLIINNEENNOO, RRAANNDDOOMM, SSEECCOONNDDSS, or SSRRAANNDDOOMM are
unset, they lose their special properties, even if they are sub-
sequently reset. The exit status is true unless a _n_a_m_e is read-
only or may not be unset.
wwaaiitt [--ffnn] [--pp _v_a_r_n_a_m_e] [_i_d _._._.]
Wait for each specified child process and return its termination
status. Each _i_d may be a process ID or a job specification; if
a job spec is given, all processes in that job's pipeline are
waited for. If _i_d is not given, wwaaiitt waits for all running
background jobs and the last-executed process substitution, if
status. Each _i_d may be a process ID or a job specification; if
a job spec is given, all processes in that job's pipeline are
waited for. If _i_d is not given, wwaaiitt waits for all running
background jobs and the last-executed process substitution, if
its process id is the same as $$!!, and the return status is zero.
If the --nn option is supplied, wwaaiitt waits for a single job from
If the --nn option is supplied, wwaaiitt waits for a single job from
the list of _i_ds or, if no _i_ds are supplied, any job, to complete
and returns its exit status. If none of the supplied arguments
and returns its exit status. If none of the supplied arguments
is a child of the shell, or if no arguments are supplied and the
shell has no unwaited-for children, the exit status is 127. If
the --pp option is supplied, the process or job identifier of the
job for which the exit status is returned is assigned to the
variable _v_a_r_n_a_m_e named by the option argument. The variable
will be unset initially, before any assignment. This is useful
only when the --nn option is supplied. Supplying the --ff option,
when job control is enabled, forces wwaaiitt to wait for _i_d to ter-
shell has no unwaited-for children, the exit status is 127. If
the --pp option is supplied, the process or job identifier of the
job for which the exit status is returned is assigned to the
variable _v_a_r_n_a_m_e named by the option argument. The variable
will be unset initially, before any assignment. This is useful
only when the --nn option is supplied. Supplying the --ff option,
when job control is enabled, forces wwaaiitt to wait for _i_d to ter-
minate before returning its status, instead of returning when it
changes status. If _i_d specifies a non-existent process or job,
the return status is 127. If wwaaiitt is interrupted by a signal,
the return status will be greater than 128, as described under
SSIIGGNNAALLSS in _b_a_s_h_(_1_). Otherwise, the return status is the exit
changes status. If _i_d specifies a non-existent process or job,
the return status is 127. If wwaaiitt is interrupted by a signal,
the return status will be greater than 128, as described under
SSIIGGNNAALLSS in _b_a_s_h_(_1_). Otherwise, the return status is the exit
status of the last process or job waited for.
SSHHEELLLL CCOOMMPPAATTIIBBIILLIITTYY MMOODDEE
Bash-4.0 introduced the concept of a _s_h_e_l_l _c_o_m_p_a_t_i_b_i_l_i_t_y _l_e_v_e_l, speci-
fied as a set of options to the shopt builtin ( ccoommppaatt3311, ccoommppaatt3322,
ccoommppaatt4400, ccoommppaatt4411, and so on). There is only one current compatibil-
ity level -- each option is mutually exclusive. The compatibility
level is intended to allow users to select behavior from previous ver-
sions that is incompatible with newer versions while they migrate
scripts to use current features and behavior. It's intended to be a
Bash-4.0 introduced the concept of a _s_h_e_l_l _c_o_m_p_a_t_i_b_i_l_i_t_y _l_e_v_e_l, speci-
fied as a set of options to the shopt builtin ( ccoommppaatt3311, ccoommppaatt3322,
ccoommppaatt4400, ccoommppaatt4411, and so on). There is only one current compatibil-
ity level -- each option is mutually exclusive. The compatibility
level is intended to allow users to select behavior from previous ver-
sions that is incompatible with newer versions while they migrate
scripts to use current features and behavior. It's intended to be a
temporary solution.
This section does not mention behavior that is standard for a particu-
lar version (e.g., setting ccoommppaatt3322 means that quoting the rhs of the
regexp matching operator quotes special regexp characters in the word,
This section does not mention behavior that is standard for a particu-
lar version (e.g., setting ccoommppaatt3322 means that quoting the rhs of the
regexp matching operator quotes special regexp characters in the word,
which is default behavior in bash-3.2 and subsequent versions).
If a user enables, say, ccoommppaatt3322, it may affect the behavior of other
compatibility levels up to and including the current compatibility
level. The idea is that each compatibility level controls behavior
that changed in that version of bbaasshh, but that behavior may have been
present in earlier versions. For instance, the change to use locale-
based comparisons with the [[[[ command came in bash-4.1, and earlier
If a user enables, say, ccoommppaatt3322, it may affect the behavior of other
compatibility levels up to and including the current compatibility
level. The idea is that each compatibility level controls behavior
that changed in that version of bbaasshh, but that behavior may have been
present in earlier versions. For instance, the change to use locale-
based comparisons with the [[[[ command came in bash-4.1, and earlier
versions used ASCII-based comparisons, so enabling ccoommppaatt3322 will enable
ASCII-based comparisons as well. That granularity may not be suffi-
cient for all uses, and as a result users should employ compatibility
levels carefully. Read the documentation for a particular feature to
ASCII-based comparisons as well. That granularity may not be suffi-
cient for all uses, and as a result users should employ compatibility
levels carefully. Read the documentation for a particular feature to
find out the current behavior.
Bash-4.3 introduced a new shell variable: BBAASSHH__CCOOMMPPAATT. The value as-
Bash-4.3 introduced a new shell variable: BBAASSHH__CCOOMMPPAATT. The value as-
signed to this variable (a decimal version number like 4.2, or an inte-
ger corresponding to the ccoommppaatt_N_N option, like 42) determines the com-
ger corresponding to the ccoommppaatt_N_N option, like 42) determines the com-
patibility level.
Starting with bash-4.4, Bash has begun deprecating older compatibility
levels. Eventually, the options will be removed in favor of BBAASSHH__CCOOMM--
Starting with bash-4.4, Bash has begun deprecating older compatibility
levels. Eventually, the options will be removed in favor of BBAASSHH__CCOOMM--
PPAATT.
Bash-5.0 is the final version for which there will be an individual
shopt option for the previous version. Users should use BBAASSHH__CCOOMMPPAATT on
Bash-5.0 is the final version for which there will be an individual
shopt option for the previous version. Users should use BBAASSHH__CCOOMMPPAATT on
bash-5.0 and later versions.
The following table describes the behavior changes controlled by each
The following table describes the behavior changes controlled by each
compatibility level setting. The ccoommppaatt_N_N tag is used as shorthand for
setting the compatibility level to _N_N using one of the following mecha-
nisms. For versions prior to bash-5.0, the compatibility level may be
set using the corresponding ccoommppaatt_N_N shopt option. For bash-4.3 and
later versions, the BBAASSHH__CCOOMMPPAATT variable is preferred, and it is re-
nisms. For versions prior to bash-5.0, the compatibility level may be
set using the corresponding ccoommppaatt_N_N shopt option. For bash-4.3 and
later versions, the BBAASSHH__CCOOMMPPAATT variable is preferred, and it is re-
quired for bash-5.1 and later versions.
ccoommppaatt3311
@@ -1994,85 +2003,85 @@ SSHHEELLLL CCOOMMPPAATTIIBBIILLIITTYY MMOODDEE
ator (=~) has no special effect
ccoommppaatt3322
+o interrupting a command list such as "a ; b ; c" causes
the execution of the next command in the list (in
bash-4.0 and later versions, the shell acts as if it re-
ceived the interrupt, so interrupting one command in a
+o interrupting a command list such as "a ; b ; c" causes
the execution of the next command in the list (in
bash-4.0 and later versions, the shell acts as if it re-
ceived the interrupt, so interrupting one command in a
list aborts the execution of the entire list)
ccoommppaatt4400
+o the << and >> operators to the [[[[ command do not consider
+o the << and >> operators to the [[[[ command do not consider
the current locale when comparing strings; they use ASCII
ordering. Bash versions prior to bash-4.1 use ASCII col-
lation and _s_t_r_c_m_p(3); bash-4.1 and later use the current
lation and _s_t_r_c_m_p(3); bash-4.1 and later use the current
locale's collation sequence and _s_t_r_c_o_l_l(3).
ccoommppaatt4411
+o in _p_o_s_i_x mode, ttiimmee may be followed by options and still
+o in _p_o_s_i_x mode, ttiimmee may be followed by options and still
be recognized as a reserved word (this is POSIX interpre-
tation 267)
+o in _p_o_s_i_x mode, the parser requires that an even number of
single quotes occur in the _w_o_r_d portion of a double-
quoted parameter expansion and treats them specially, so
that characters within the single quotes are considered
single quotes occur in the _w_o_r_d portion of a double-
quoted parameter expansion and treats them specially, so
that characters within the single quotes are considered
quoted (this is POSIX interpretation 221)
ccoommppaatt4422
+o the replacement string in double-quoted pattern substitu-
tion does not undergo quote removal, as it does in ver-
tion does not undergo quote removal, as it does in ver-
sions after bash-4.2
+o in posix mode, single quotes are considered special when
expanding the _w_o_r_d portion of a double-quoted parameter
expansion and can be used to quote a closing brace or
other special character (this is part of POSIX interpre-
tation 221); in later versions, single quotes are not
+o in posix mode, single quotes are considered special when
expanding the _w_o_r_d portion of a double-quoted parameter
expansion and can be used to quote a closing brace or
other special character (this is part of POSIX interpre-
tation 221); in later versions, single quotes are not
special within double-quoted word expansions
ccoommppaatt4433
+o the shell does not print a warning message if an attempt
is made to use a quoted compound assignment as an argu-
ment to declare (e.g., declare -a foo='(1 2)'). Later
+o the shell does not print a warning message if an attempt
is made to use a quoted compound assignment as an argu-
ment to declare (e.g., declare -a foo='(1 2)'). Later
versions warn that this usage is deprecated
+o word expansion errors are considered non-fatal errors
that cause the current command to fail, even in posix
mode (the default behavior is to make them fatal errors
+o word expansion errors are considered non-fatal errors
that cause the current command to fail, even in posix
mode (the default behavior is to make them fatal errors
that cause the shell to exit)
+o when executing a shell function, the loop state
+o when executing a shell function, the loop state
(while/until/etc.) is not reset, so bbrreeaakk or ccoonnttiinnuuee in
that function will break or continue loops in the calling
context. Bash-4.4 and later reset the loop state to pre-
context. Bash-4.4 and later reset the loop state to pre-
vent this
ccoommppaatt4444
+o the shell sets up the values used by BBAASSHH__AARRGGVV and
BBAASSHH__AARRGGCC so they can expand to the shell's positional
+o the shell sets up the values used by BBAASSHH__AARRGGVV and
BBAASSHH__AARRGGCC so they can expand to the shell's positional
parameters even if extended debugging mode is not enabled
+o a subshell inherits loops from its parent context, so
bbrreeaakk or ccoonnttiinnuuee will cause the subshell to exit.
Bash-5.0 and later reset the loop state to prevent the
+o a subshell inherits loops from its parent context, so
bbrreeaakk or ccoonnttiinnuuee will cause the subshell to exit.
Bash-5.0 and later reset the loop state to prevent the
exit
+o variable assignments preceding builtins like eexxppoorrtt and
+o variable assignments preceding builtins like eexxppoorrtt and
rreeaaddoonnllyy that set attributes continue to affect variables
with the same name in the calling environment even if the
shell is not in posix mode
ccoommppaatt5500
+o Bash-5.1 changed the way $$RRAANNDDOOMM is generated to intro-
+o Bash-5.1 changed the way $$RRAANNDDOOMM is generated to intro-
duce slightly more randomness. If the shell compatibility
level is set to 50 or lower, it reverts to the method
from bash-5.0 and previous versions, so seeding the ran-
dom number generator by assigning a value to RRAANNDDOOMM will
level is set to 50 or lower, it reverts to the method
from bash-5.0 and previous versions, so seeding the ran-
dom number generator by assigning a value to RRAANNDDOOMM will
produce the same sequence as in bash-5.0
+o If the command hash table is empty, bash versions prior
to bash-5.1 printed an informational message to that ef-
fect, even when producing output that can be reused as
input. Bash-5.1 suppresses that message when the --ll op-
+o If the command hash table is empty, bash versions prior
to bash-5.1 printed an informational message to that ef-
fect, even when producing output that can be reused as
input. Bash-5.1 suppresses that message when the --ll op-
tion is supplied.
ccoommppaatt5511
+o The uunnsseett builtin treats attempts to unset array sub-
scripts @@ and ** differently depending on whether the ar-
ray is indexed or associative, and differently than in
+o The uunnsseett builtin treats attempts to unset array sub-
scripts @@ and ** differently depending on whether the ar-
ray is indexed or associative, and differently than in
previous versions.
SSEEEE AALLSSOO
+338 -332
View File
@@ -1,6 +1,6 @@
%!PS-Adobe-3.0
%%Creator: groff version 1.22.4
%%CreationDate: Mon Sep 19 12:02:42 2022
%%CreationDate: Fri Dec 2 17:01:16 2022
%%DocumentNeededResources: font Times-Roman
%%+ font Times-Bold
%%+ font Times-Italic
@@ -2897,216 +2897,211 @@ E F0(operators sort le)2.5 E(xicographically using ASCII ordering.)-.15
E F4(times)108 334.8 Q F0 1.229(Print the accumulated user and system t\
imes for the shell and for processes run from the shell.)144 334.8 R
(The return status is 0.)144 346.8 Q F4(trap)108 363.6 Q F0([)2.5 E F4
(\255lp)A F0 2.5(][)C([)-2.5 E F1(ar)A(g)-.37 E F0(])A F1(sigspec)2.5 E
F0(...])2.5 E .682(The command)144 375.6 R F1(ar)3.512 E(g)-.37 E F0
.682(is to be read and e)3.402 F -.15(xe)-.15 G .682
(cuted when the shell recei).15 F -.15(ve)-.25 G 3.183(ss).15 G
(ignal\(s\))-3.183 E F1(sigspec)3.523 E F0 5.683(.I).31 G(f)-5.683 E F1
(ar)3.513 E(g)-.37 E F0(is)3.403 E .609(absent \(and there is a single)
144 387.6 R F1(sigspec)3.108 E F0 3.108(\)o)C(r)-3.108 E F4<ad>3.108 E
F0 3.108(,e)C .608
(ach speci\214ed signal is reset to its original disposition)-3.108 F
.658(\(the v)144 399.6 R .658(alue it had upon entrance to the shell\).)
-.25 F(If)5.658 E F1(ar)3.488 E(g)-.37 E F0 .659
(is the null string the signal speci\214ed by each)3.378 F F1(sigspec)
144.34 411.6 Q F0 .581
(is ignored by the shell and by the commands it in)3.391 F -.2(vo)-.4 G
-.1(ke).2 G 3.08(s. If).1 F F1(ar)3.41 E(g)-.37 E F0 .58
(is not present and)3.3 F F4<ad70>3.08 E F0(has)3.08 E 1.214
(been supplied, then the trap commands associated with each)144 423.6 R
F1(sigspec)4.054 E F0 1.215(are displayed.)4.024 F 1.215(If no ar)6.215
F(gu-)-.18 E .86(ments are supplied or if only)144 435.6 R F4<ad70>3.36
E F0 .86(is gi)3.36 F -.15(ve)-.25 G(n,).15 E F4(trap)3.36 E F0 .86
(prints the list of commands associated with each)3.36 F 2.83
(signal. The)144 447.6 R F4<ad6c>2.83 E F0 .33(option causes the shell \
to print a list of signal names and their corresponding num-)2.83 F
4.311(bers. Each)144 459.6 R F1(sigspec)4.651 E F0 1.811
(is either a signal name de\214ned in <)4.621 F F1(signal.h)A F0 1.81
(>, or a signal number)B 6.81(.S)-.55 G(ignal)-6.81 E
(names are case insensiti)144 471.6 Q .3 -.15(ve a)-.25 H(nd the).15 E
F2(SIG)2.5 E F0(pre\214x is optional.)2.25 E .666(If a)144 489.6 R F1
(sigspec)3.506 E F0(is)3.476 E F2(EXIT)3.166 E F0 .666
(\(0\) the command)2.916 F F1(ar)3.496 E(g)-.37 E F0 .666(is e)3.386 F
-.15(xe)-.15 G .666(cuted on e).15 F .667(xit from the shell.)-.15 F
.667(If a)5.667 F F1(sigspec)3.507 E F0(is)3.477 E F2(DE-)3.167 E -.09
(BU)144 501.6 S(G).09 E F3(,)A F0 .484(the command)2.734 F F1(ar)3.314 E
(g)-.37 E F0 .484(is e)3.204 F -.15(xe)-.15 G .484(cuted before e).15 F
-.15(ve)-.25 G(ry).15 E F1 .483(simple command)2.984 F F0(,)A F1(for)
2.983 E F0(command,)2.983 E F1(case)2.983 E F0(command,)2.983 E F1
(select)144 513.6 Q F0 .562(command, e)3.062 F -.15(ve)-.25 G .563
(ry arithmetic).15 F F1(for)3.063 E F0 .563
(command, and before the \214rst command e)3.063 F -.15(xe)-.15 G .563
(cutes in a shell).15 F .442(function \(see)144 525.6 R F2 .442
(SHELL GRAMMAR)2.942 F F0(in)2.692 E F1(bash\(1\))2.942 E F0 2.941
(\). Refer)B .441(to the description of the)2.941 F F4(extdeb)2.941 E
(ug)-.2 E F0 .441(option to)2.941 F(the)144 537.6 Q F4(shopt)3.2 E F0
-.2(bu)3.2 G .7(iltin for details of its ef).2 F .7(fect on the)-.25 F
F4(DEB)3.2 E(UG)-.1 E F0 3.2(trap. If)3.2 F(a)3.2 E F1(sigspec)3.54 E F0
(is)3.51 E F2(RETURN)3.2 E F3(,)A F0 .701(the com-)2.951 F(mand)144
549.6 Q F1(ar)3.474 E(g)-.37 E F0 .644(is e)3.364 F -.15(xe)-.15 G .643
(cuted each time a shell function or a script e).15 F -.15(xe)-.15 G
.643(cuted with the).15 F F4(.)3.143 E F0(or)3.143 E F4(sour)3.143 E(ce)
-.18 E F0 -.2(bu)3.143 G(iltins).2 E(\214nishes e)144 561.6 Q -.15(xe)
-.15 G(cuting.).15 E .96(If a)144 579.6 R F1(sigspec)3.8 E F0(is)3.77 E
F2(ERR)3.46 E F3(,)A F0 .96(the command)3.21 F F1(ar)3.791 E(g)-.37 E F0
.961(is e)3.681 F -.15(xe)-.15 G .961(cuted whene).15 F -.15(ve)-.25 G
3.461(rap).15 G .961(ipeline \(which may consist of a)-3.461 F .185(sin\
gle simple command\), a list, or a compound command returns a non\255ze\
ro e)144 591.6 R .184(xit status, subject to)-.15 F .451(the follo)144
603.6 R .451(wing conditions.)-.25 F(The)5.451 E F2(ERR)2.951 E F0 .451
(trap is not e)2.701 F -.15(xe)-.15 G .451(cuted if the f).15 F .452
(ailed command is part of the com-)-.1 F .388
(mand list immediately follo)144 615.6 R .388(wing a)-.25 F F4(while)
2.888 E F0(or)2.888 E F4(until)2.888 E F0 -.1(ke)2.888 G(yw)-.05 E .388
(ord, part of the test in an)-.1 F F1(if)2.897 E F0 .387
(statement, part)4.847 F .777(of a command e)144 627.6 R -.15(xe)-.15 G
(\255lp)A F0 2.5(][)C([)-2.5 E F1(action)A F0(])A F1(sigspec)2.5 E F0
(...])2.5 E(The)144 375.6 Q F1(action)3.733 E F0 .903
(is a command that is read and e)3.643 F -.15(xe)-.15 G .903
(cuted when the shell recei).15 F -.15(ve)-.25 G 3.403(ss).15 G
(ignal\(s\))-3.403 E F1(sigspec)3.744 E F0 5.904(.I).31 G(f)-5.904 E F1
(action)144.33 387.6 Q F0 .106(is absent \(and there is a single)2.846 F
F1(sigspec)2.605 E F0 2.605(\)o)C(r)-2.605 E F4<ad>2.605 E F0 2.605(,e)C
.105(ach speci\214ed signal is reset to its original dis-)-2.605 F .626
(position \(the v)144 399.6 R .626
(alue it had upon entrance to the shell\).)-.25 F(If)5.626 E F1(action)
3.456 E F0 .626(is the null string the signal speci-)3.366 F
(\214ed by each)144 411.6 Q F1(sigspec)2.84 E F0
(is ignored by the shell and by the commands it in)2.81 E -.2(vo)-.4 G
-.1(ke).2 G(s.).1 E .165(If no ar)144 429.6 R .165
(guments are supplied,)-.18 F F4(trap)2.665 E F0 .165
(displays the actions associated with each trapped signal as a set)2.665
F(of)144 441.6 Q F4(trap)2.569 E F0 .069(commands that can be reused as\
shell input to restore the current signal dispositions.)2.569 F(If)5.07
E F4<ad70>2.57 E F0 .474(is gi)144 453.6 R -.15(ve)-.25 G .474(n, and)
.15 F F1(action)3.303 E F0 .473(is not present, then)3.213 F F4(trap)
2.973 E F0 .473(displays the actions associated with each)2.973 F F1
(sigspec)3.313 E F0(or)3.283 E(,)-.4 E .363
(if none are supplied, for all trapped signals, as a set of)144 465.6 R
F4(trap)2.864 E F0 .364(commands that can be reused as shell)2.864 F
(input to restore the current signal dispositions.)144 477.6 Q(The)144
495.6 Q F4<ad6c>3.217 E F0 .717(option causes)3.217 F F4(trap)3.217 E F0
.716(to print a list of signal names and their corresponding numbers.)
3.216 F(Each)5.716 E F1(sigspec)144.34 507.6 Q F0 .709
(is either a signal name de\214ned in <)3.518 F F1(signal.h)A F0 .709
(>, or a signal number)B 5.709(.S)-.55 G .709(ignal names are case)
-5.709 F(insensiti)144 519.6 Q .3 -.15(ve a)-.25 H(nd the).15 E F2(SIG)
2.5 E F0(pre\214x is optional.)2.25 E .092(If a)144 537.6 R F1(sigspec)
2.932 E F0(is)2.902 E F2(EXIT)2.592 E F0 .092(\(0\) the command)2.342 F
F1(action)2.921 E F0 .091(is e)2.831 F -.15(xe)-.15 G .091(cuted on e)
.15 F .091(xit from the shell.)-.15 F .091(If a)5.091 F F1(sigspec)2.931
E F0(is)2.901 E F2(DE-)2.591 E -.09(BU)144 549.6 S(G).09 E F3(,)A F0
1.244(the command)3.494 F F1(action)4.074 E F0 1.244(is e)3.984 F -.15
(xe)-.15 G 1.244(cuted before e).15 F -.15(ve)-.25 G(ry).15 E F1 1.245
(simple command)3.744 F F0(,)A F1(for)3.745 E F0(command,)3.745 E F1
(case)3.745 E F0(com-)3.745 E(mand,)144 561.6 Q F1(select)2.697 E F0
.196
(command, \(\( arithmetic command, [[ conditional command, arithmetic)
2.697 F F1(for)2.696 E F0(command,)2.696 E 1.105
(and before the \214rst command e)144 573.6 R -.15(xe)-.15 G 1.105
(cutes in a shell function \(see).15 F F2 1.105(SHELL GRAMMAR)3.605 F F0
(in)3.355 E F1(bash\(1\))3.605 E F0(\).)A .556
(Refer to the description of the)144 585.6 R F4(extdeb)3.056 E(ug)-.2 E
F0 .556(option to the)3.056 F F4(shopt)3.056 E F0 -.2(bu)3.056 G .556
(iltin for details of its ef).2 F .556(fect on the)-.25 F F4(DEB)144
597.6 Q(UG)-.1 E F0 2.514(trap. If)2.514 F(a)2.514 E F1(sigspec)2.854 E
F0(is)2.824 E F2(RETURN)2.514 E F3(,)A F0 .014(the command)2.264 F F1
(action)2.845 E F0 .015(is e)2.755 F -.15(xe)-.15 G .015
(cuted each time a shell function).15 F(or a script e)144 609.6 Q -.15
(xe)-.15 G(cuted with the).15 E F4(.)2.5 E F0(or)2.5 E F4(sour)2.5 E(ce)
-.18 E F0 -.2(bu)2.5 G(iltins \214nishes e).2 E -.15(xe)-.15 G(cuting.)
.15 E .285(If a)144 627.6 R F1(sigspec)3.125 E F0(is)3.095 E F2(ERR)
2.784 E F3(,)A F0 .284(the command)2.534 F F1(action)3.114 E F0 .284
(is e)3.024 F -.15(xe)-.15 G .284(cuted whene).15 F -.15(ve)-.25 G 2.784
(rap).15 G .284(ipeline \(which may consist of a)-2.784 F .185(single s\
imple command\), a list, or a compound command returns a non\255zero e)
144 639.6 R .185(xit status, subject to)-.15 F .452(the follo)144 651.6
R .452(wing conditions.)-.25 F(The)5.452 E F2(ERR)2.952 E F0 .451
(trap is not e)2.701 F -.15(xe)-.15 G .451(cuted if the f).15 F .451
(ailed command is part of the com-)-.1 F .387
(mand list immediately follo)144 663.6 R .387(wing a)-.25 F F4(while)
2.887 E F0(or)2.887 E F4(until)2.888 E F0 -.1(ke)2.888 G(yw)-.05 E .388
(ord, part of the test in an)-.1 F F1(if)2.898 E F0 .388
(statement, part)4.848 F .778(of a command e)144 675.6 R -.15(xe)-.15 G
.778(cuted in a).15 F F4(&&)3.278 E F0(or)3.278 E F4(||)3.278 E F0 .778
(list e)3.278 F .778(xcept the command follo)-.15 F .778
(wing the \214nal)-.25 F F4(&&)3.278 E F0(or)3.278 E F4(||)3.278 E F0
3.278(,a)C -.15(ny)-3.278 G 1.28(command in a pipeline b)144 639.6 R
(wing the \214nal)-.25 F F4(&&)3.278 E F0(or)3.278 E F4(||)3.277 E F0
3.277(,a)C -.15(ny)-3.277 G 1.28(command in a pipeline b)144 687.6 R
1.28(ut the last, or if the command')-.2 F 3.78(sr)-.55 G 1.28(eturn v)
-3.78 F 1.28(alue is being in)-.25 F -.15(ve)-.4 G 1.28(rted using).15 F
F4(!)3.78 E F0(.)A(These are the same conditions obe)144 651.6 Q
F4(!)3.78 E F0(.)A(These are the same conditions obe)144 699.6 Q
(yed by the)-.15 E F4(err)2.5 E(exit)-.18 E F0(\()2.5 E F4<ad65>A F0 2.5
(\)o)C(ption.)-2.5 E .132
(Signals ignored upon entry to the shell cannot be trapped or reset.)144
669.6 R -.35(Tr)5.133 G .133(apped signals that are not be-).35 F .117
(ing ignored are reset to their original v)144 681.6 R .117
(alues in a subshell or subshell en)-.25 F .117
(vironment when one is cre-)-.4 F 2.5(ated. The)144 693.6 R
(return status is f)2.5 E(alse if an)-.1 E(y)-.15 E F1(sigspec)2.84 E F0
(is in)2.81 E -.25(va)-.4 G(lid; otherwise).25 E F4(trap)2.5 E F0
(returns true.)2.5 E(GNU Bash 5.2)72 768 Q(2021 No)136.385 E -.15(ve)
-.15 G(mber 22).15 E(23)185.545 E 0 Cg EP
(\)o)C(ption.)-2.5 E .07(When the shell is not interacti)144 717.6 R
-.15(ve)-.25 G 2.57(,s).15 G .069
(ignals ignored upon entry to the shell cannot be trapped or reset.)
-2.57 F(Interacti)144 729.6 Q 2.048 -.15(ve s)-.25 H 1.748
(hells permit trapping signals ignored on entry).15 F 6.749(.T)-.65 G
1.749(rapped signals that are not being)-7.099 F(GNU Bash 5.2)72 768 Q
(2021 No)136.385 E -.15(ve)-.15 G(mber 22).15 E(23)185.545 E 0 Cg EP
%%Page: 24 24
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@0 SF -.35(BA)72 48 S(SH_B).35 E(UIL)-.1 E 87.61
(TINS\(1\) General)-.92 F(Commands Manual)2.5 E -.35(BA)90.11 G(SH_B).35
E(UIL)-.1 E(TINS\(1\))-.92 E/F1 10/Times-Bold@0 SF(type)108 84 Q F0([)
2.5 E F1(\255aftpP)A F0(])A/F2 10/Times-Italic@0 SF(name)2.5 E F0([)2.5
E F2(name)A F0(...])2.5 E -.4(Wi)144 96 S .173
(th no options, indicate ho).4 F 2.673(we)-.25 G(ach)-2.673 E F2(name)
3.033 E F0 -.1(wo)2.853 G .174
E(UIL)-.1 E(TINS\(1\))-.92 E .09(ignored are reset to their original v)
144 84 R .09(alues in a subshell or subshell en)-.25 F .09
(vironment when one is created.)-.4 F(The return status is f)144 96 Q
(alse if an)-.1 E(y)-.15 E/F1 10/Times-Italic@0 SF(sigspec)2.84 E F0
(is in)2.81 E -.25(va)-.4 G(lid; otherwise).25 E/F2 10/Times-Bold@0 SF
(trap)2.5 E F0(returns true.)2.5 E F2(type)108 112.8 Q F0([)2.5 E F2
(\255aftpP)A F0(])A F1(name)2.5 E F0([)2.5 E F1(name)A F0(...])2.5 E -.4
(Wi)144 124.8 S .173(th no options, indicate ho).4 F 2.673(we)-.25 G
(ach)-2.673 E F1(name)3.033 E F0 -.1(wo)2.853 G .174
(uld be interpreted if used as a command name.).1 F .174(If the)5.174 F
F1<ad74>144 108 Q F0 .715(option is used,)3.215 F F1(type)3.215 E F0
.715(prints a string which is one of)3.215 F F2(alias)3.545 E F0(,).27 E
F2 -.1(ke)3.215 G(ywor)-.2 E(d)-.37 E F0(,).77 E F2(function)5.185 E F0
(,).24 E F2 -.2(bu)3.215 G(iltin).2 E F0 3.215(,o).24 G(r)-3.215 E F2
(\214le)5.125 E F0(if)3.395 E F2(name)144.36 120 Q F0 .086
F2<ad74>144 136.8 Q F0 .715(option is used,)3.215 F F2(type)3.215 E F0
.715(prints a string which is one of)3.215 F F1(alias)3.545 E F0(,).27 E
F1 -.1(ke)3.215 G(ywor)-.2 E(d)-.37 E F0(,).77 E F1(function)5.185 E F0
(,).24 E F1 -.2(bu)3.215 G(iltin).2 E F0 3.215(,o).24 G(r)-3.215 E F1
(\214le)5.125 E F0(if)3.395 E F1(name)144.36 148.8 Q F0 .086
(is an alias, shell reserv)2.766 F .086(ed w)-.15 F .086
(ord, function, b)-.1 F .087(uiltin, or disk \214le, respecti)-.2 F -.15
(ve)-.25 G(ly).15 E 5.087(.I)-.65 G 2.587(ft)-5.087 G(he)-2.587 E F2
(ve)-.25 G(ly).15 E 5.087(.I)-.65 G 2.587(ft)-5.087 G(he)-2.587 E F1
(name)2.947 E F0 .087(is not)2.767 F .119
(found, then nothing is printed, and an e)144 132 R .118
(found, then nothing is printed, and an e)144 160.8 R .118
(xit status of f)-.15 F .118(alse is returned.)-.1 F .118(If the)5.118 F
F1<ad70>2.618 E F0 .118(option is used,)2.618 F F1(type)2.618 E F0 .855
(either returns the name of the disk \214le that w)144 144 R .855
(ould be e)-.1 F -.15(xe)-.15 G .855(cuted if).15 F F2(name)3.715 E F0
F2<ad70>2.618 E F0 .118(option is used,)2.618 F F2(type)2.618 E F0 .855
(either returns the name of the disk \214le that w)144 172.8 R .855
(ould be e)-.1 F -.15(xe)-.15 G .855(cuted if).15 F F1(name)3.715 E F0
.855(were speci\214ed as a com-)3.535 F .529(mand name, or nothing if)
144 156 R/F3 10/Courier@0 SF .528(type -t name)3.028 F F0 -.1(wo)3.028 G
.528(uld not return).1 F F2(\214le)4.938 E F0 5.528(.T).18 G(he)-5.528 E
F1<ad50>3.028 E F0 .528(option forces a)3.028 F/F4 9/Times-Bold@0 SF
-.666(PA)3.028 G(TH)-.189 E F0 .006(search for each)144 168 R F2(name)
144 184.8 R/F3 10/Courier@0 SF .528(type -t name)3.028 F F0 -.1(wo)3.028
G .528(uld not return).1 F F1(\214le)4.938 E F0 5.528(.T).18 G(he)-5.528
E F2<ad50>3.028 E F0 .528(option forces a)3.028 F/F4 9/Times-Bold@0 SF
-.666(PA)3.028 G(TH)-.189 E F0 .006(search for each)144 196.8 R F1(name)
2.506 E F0 2.506(,e)C -.15(ve)-2.756 G 2.506(ni).15 G(f)-2.506 E F3 .007
(type -t name)2.506 F F0 -.1(wo)2.507 G .007(uld not return).1 F F2
(type -t name)2.506 F F0 -.1(wo)2.507 G .007(uld not return).1 F F1
(\214le)4.417 E F0 5.007(.I).18 G 2.507(fac)-5.007 G .007
(ommand is hashed,)-2.507 F F1<ad70>2.507 E F0(and)144 180 Q F1<ad50>
(ommand is hashed,)-2.507 F F2<ad70>2.507 E F0(and)144 208.8 Q F2<ad50>
3.231 E F0 .731(print the hashed v)3.231 F .73
(alue, which is not necessarily the \214le that appears \214rst in)-.25
F F4 -.666(PA)3.23 G(TH)-.189 E/F5 9/Times-Roman@0 SF(.)A F0 .73(If the)
5.23 F F1<ad61>144 192 Q F0 .823(option is used,)3.323 F F1(type)3.323 E
F0 .824(prints all of the places that contain an e)3.323 F -.15(xe)-.15
G .824(cutable named).15 F F2(name)3.684 E F0 5.824(.T).18 G .824
5.23 F F2<ad61>144 220.8 Q F0 .823(option is used,)3.323 F F2(type)3.323
E F0 .824(prints all of the places that contain an e)3.323 F -.15(xe)
-.15 G .824(cutable named).15 F F1(name)3.684 E F0 5.824(.T).18 G .824
(his in-)-5.824 F 1.176
(cludes aliases and functions, if and only if the)144 204 R F1<ad70>
(cludes aliases and functions, if and only if the)144 232.8 R F2<ad70>
3.676 E F0 1.176(option is not also used.)3.676 F 1.176
(The table of hashed)6.176 F 1.223(commands is not consulted when using)
144 216 R F1<ad61>3.723 E F0 6.223(.T)C(he)-6.223 E F1<ad66>3.723 E F0
144 244.8 R F2<ad61>3.723 E F0 6.223(.T)C(he)-6.223 E F2<ad66>3.723 E F0
1.223(option suppresses shell function lookup, as)3.723 F .326(with the)
144 228 R F1(command)2.826 E F0 -.2(bu)2.826 G(iltin.).2 E F1(type)5.326
E F0 .326(returns true if all of the ar)2.826 F .325
144 256.8 R F2(command)2.826 E F0 -.2(bu)2.826 G(iltin.).2 E F2(type)
5.326 E F0 .326(returns true if all of the ar)2.826 F .325
(guments are found, f)-.18 F .325(alse if an)-.1 F 2.825(ya)-.15 G .325
(re not)-2.825 F(found.)144 240 Q F1(ulimit)108 256.8 Q F0([)2.5 E F1
(\255HS)A F0(])A F1<ad61>2.5 E(ulimit)108 268.8 Q F0([)2.5 E F1(\255HS)A
F0 2.5(][)C F1(\255bcde\214klmnpqrstuvxPR)-2.5 E(T)-.4 E F0([)2.5 E F2
(limit)A F0(]])A(Pro)144 280.8 Q .243(vides control o)-.15 F -.15(ve)
(re not)-2.825 F(found.)144 268.8 Q F2(ulimit)108 285.6 Q F0([)2.5 E F2
(\255HS)A F0(])A F2<ad61>2.5 E(ulimit)108 297.6 Q F0([)2.5 E F2(\255HS)A
F0 2.5(][)C F2(\255bcde\214klmnpqrstuvxPR)-2.5 E(T)-.4 E F0([)2.5 E F1
(limit)A F0(]])A(Pro)144 309.6 Q .243(vides control o)-.15 F -.15(ve)
-.15 G 2.743(rt).15 G .243(he resources a)-2.743 F -.25(va)-.2 G .244
(ilable to the shell and to processes started by it, on systems).25 F
.944(that allo)144 292.8 R 3.444(ws)-.25 G .944(uch control.)-3.444 F
(The)5.944 E F1<ad48>3.444 E F0(and)3.444 E F1<ad53>3.444 E F0 .943
.944(that allo)144 321.6 R 3.444(ws)-.25 G .944(uch control.)-3.444 F
(The)5.944 E F2<ad48>3.444 E F0(and)3.444 E F2<ad53>3.444 E F0 .943
(options specify that the hard or soft limit is set for the)3.444 F(gi)
144 304.8 Q -.15(ve)-.25 G 2.708(nr).15 G 2.708(esource. A)-2.708 F .208
144 333.6 Q -.15(ve)-.25 G 2.708(nr).15 G 2.708(esource. A)-2.708 F .208
(hard limit cannot be increased by a non-root user once it is set; a so\
ft limit may)2.708 F .426(be increased up to the v)144 316.8 R .426
(alue of the hard limit.)-.25 F .425(If neither)5.426 F F1<ad48>2.925 E
F0(nor)2.925 E F1<ad53>2.925 E F0 .425
ft limit may)2.708 F .426(be increased up to the v)144 345.6 R .426
(alue of the hard limit.)-.25 F .425(If neither)5.426 F F2<ad48>2.925 E
F0(nor)2.925 E F2<ad53>2.925 E F0 .425
(is speci\214ed, both the soft and)2.925 F .139(hard limits are set.)144
328.8 R .139(The v)5.139 F .139(alue of)-.25 F F2(limit)2.729 E F0 .139
357.6 R .139(The v)5.139 F .139(alue of)-.25 F F1(limit)2.729 E F0 .139
(can be a number in the unit speci\214ed for the resource or one)3.319 F
.742(of the special v)144 340.8 R(alues)-.25 E F1(hard)3.242 E F0(,)A F1
(soft)3.241 E F0 3.241(,o)C(r)-3.241 E F1(unlimited)3.241 E F0 3.241(,w)
.742(of the special v)144 369.6 R(alues)-.25 E F2(hard)3.242 E F0(,)A F2
(soft)3.241 E F0 3.241(,o)C(r)-3.241 E F2(unlimited)3.241 E F0 3.241(,w)
C .741(hich stand for the current hard limit, the current)-3.241 F .023
(soft limit, and no limit, respecti)144 352.8 R -.15(ve)-.25 G(ly).15 E
5.023(.I)-.65 G(f)-5.023 E F2(limit)2.613 E F0 .023
(soft limit, and no limit, respecti)144 381.6 R -.15(ve)-.25 G(ly).15 E
5.023(.I)-.65 G(f)-5.023 E F1(limit)2.613 E F0 .023
(is omitted, the current v)3.203 F .023
(alue of the soft limit of the re-)-.25 F .985
(source is printed, unless the)144 364.8 R F1<ad48>3.485 E F0 .984
(source is printed, unless the)144 393.6 R F2<ad48>3.485 E F0 .984
(option is gi)3.485 F -.15(ve)-.25 G 3.484(n. When).15 F .984
(more than one resource is speci\214ed, the)3.484 F .7
(limit name and unit, if appropriate, are printed before the v)144 376.8
(limit name and unit, if appropriate, are printed before the v)144 405.6
R 3.2(alue. Other)-.25 F .7(options are interpreted as)3.2 F(follo)144
388.8 Q(ws:)-.25 E F1<ad61>144 400.8 Q F0
(All current limits are reported; no limits are set)180 400.8 Q F1<ad62>
144 412.8 Q F0(The maximum sock)180 412.8 Q(et b)-.1 E(uf)-.2 E
(fer size)-.25 E F1<ad63>144 424.8 Q F0
(The maximum size of core \214les created)180 424.8 Q F1<ad64>144 436.8
Q F0(The maximum size of a process')180 436.8 Q 2.5(sd)-.55 G(ata se)
-2.5 E(gment)-.15 E F1<ad65>144 448.8 Q F0
(The maximum scheduling priority \("nice"\))180 448.8 Q F1<ad66>144
460.8 Q F0
417.6 Q(ws:)-.25 E F2<ad61>144 429.6 Q F0
(All current limits are reported; no limits are set)180 429.6 Q F2<ad62>
144 441.6 Q F0(The maximum sock)180 441.6 Q(et b)-.1 E(uf)-.2 E
(fer size)-.25 E F2<ad63>144 453.6 Q F0
(The maximum size of core \214les created)180 453.6 Q F2<ad64>144 465.6
Q F0(The maximum size of a process')180 465.6 Q 2.5(sd)-.55 G(ata se)
-2.5 E(gment)-.15 E F2<ad65>144 477.6 Q F0
(The maximum scheduling priority \("nice"\))180 477.6 Q F2<ad66>144
489.6 Q F0
(The maximum size of \214les written by the shell and its children)180
460.8 Q F1<ad69>144 472.8 Q F0(The maximum number of pending signals)180
472.8 Q F1<ad6b>144 484.8 Q F0
(The maximum number of kqueues that may be allocated)180 484.8 Q F1
<ad6c>144 496.8 Q F0(The maximum size that may be lock)180 496.8 Q
(ed into memory)-.1 E F1<ad6d>144 508.8 Q F0
(The maximum resident set size \(man)180 508.8 Q 2.5(ys)-.15 G
(ystems do not honor this limit\))-2.5 E F1<ad6e>144 520.8 Q F0 .791(Th\
489.6 Q F2<ad69>144 501.6 Q F0(The maximum number of pending signals)180
501.6 Q F2<ad6b>144 513.6 Q F0
(The maximum number of kqueues that may be allocated)180 513.6 Q F2
<ad6c>144 525.6 Q F0(The maximum size that may be lock)180 525.6 Q
(ed into memory)-.1 E F2<ad6d>144 537.6 Q F0
(The maximum resident set size \(man)180 537.6 Q 2.5(ys)-.15 G
(ystems do not honor this limit\))-2.5 E F2<ad6e>144 549.6 Q F0 .791(Th\
e maximum number of open \214le descriptors \(most systems do not allo)
180 520.8 R 3.29(wt)-.25 G .79(his v)-3.29 F .79(alue to)-.25 F
(be set\))180 532.8 Q F1<ad70>144 544.8 Q F0
(The pipe size in 512-byte blocks \(this may not be set\))180 544.8 Q F1
<ad71>144 556.8 Q F0
(The maximum number of bytes in POSIX message queues)180 556.8 Q F1
<ad72>144 568.8 Q F0(The maximum real-time scheduling priority)180 568.8
Q F1<ad73>144 580.8 Q F0(The maximum stack size)180 580.8 Q F1<ad74>144
592.8 Q F0(The maximum amount of cpu time in seconds)180 592.8 Q F1
<ad75>144 604.8 Q F0(The maximum number of processes a)180 604.8 Q -.25
(va)-.2 G(ilable to a single user).25 E F1<ad76>144 616.8 Q F0 .47
(The maximum amount of virtual memory a)180 616.8 R -.25(va)-.2 G .47
180 549.6 R 3.29(wt)-.25 G .79(his v)-3.29 F .79(alue to)-.25 F
(be set\))180 561.6 Q F2<ad70>144 573.6 Q F0
(The pipe size in 512-byte blocks \(this may not be set\))180 573.6 Q F2
<ad71>144 585.6 Q F0
(The maximum number of bytes in POSIX message queues)180 585.6 Q F2
<ad72>144 597.6 Q F0(The maximum real-time scheduling priority)180 597.6
Q F2<ad73>144 609.6 Q F0(The maximum stack size)180 609.6 Q F2<ad74>144
621.6 Q F0(The maximum amount of cpu time in seconds)180 621.6 Q F2
<ad75>144 633.6 Q F0(The maximum number of processes a)180 633.6 Q -.25
(va)-.2 G(ilable to a single user).25 E F2<ad76>144 645.6 Q F0 .47
(The maximum amount of virtual memory a)180 645.6 R -.25(va)-.2 G .47
(ilable to the shell and, on some systems, to).25 F(its children)180
628.8 Q F1<ad78>144 640.8 Q F0(The maximum number of \214le locks)180
640.8 Q F1<ad50>144 652.8 Q F0(The maximum number of pseudoterminals)180
652.8 Q F1<ad52>144 664.8 Q F0(The maximum time a real-time process can\
run before blocking, in microseconds)180 664.8 Q F1<ad54>144 676.8 Q F0
(The maximum number of threads)180 676.8 Q(If)144 693.6 Q F2(limit)3.058
E F0 .468(is gi)3.648 F -.15(ve)-.25 G .468(n, and the).15 F F1<ad61>
2.968 E F0 .468(option is not used,)2.968 F F2(limit)2.968 E F0 .468
657.6 Q F2<ad78>144 669.6 Q F0(The maximum number of \214le locks)180
669.6 Q F2<ad50>144 681.6 Q F0(The maximum number of pseudoterminals)180
681.6 Q F2<ad52>144 693.6 Q F0(The maximum time a real-time process can\
run before blocking, in microseconds)180 693.6 Q F2<ad54>144 705.6 Q F0
(The maximum number of threads)180 705.6 Q(If)144 722.4 Q F1(limit)3.058
E F0 .468(is gi)3.648 F -.15(ve)-.25 G .468(n, and the).15 F F2<ad61>
2.968 E F0 .468(option is not used,)2.968 F F1(limit)2.968 E F0 .468
(is the ne)2.968 F 2.968(wv)-.25 G .468
(alue of the speci\214ed resource.)-3.218 F(If)5.468 E .044
(no option is gi)144 705.6 R -.15(ve)-.25 G .044(n, then).15 F F1<ad66>
2.544 E F0 .045(is assumed.)2.545 F -1.11(Va)5.045 G .045
(lues are in 1024-byte increments, e)1.11 F .045(xcept for)-.15 F F1
<ad74>2.545 E F0 2.545(,w)C .045(hich is)-2.545 F .67(in seconds;)144
717.6 R F1<ad52>3.17 E F0 3.17(,w)C .67(hich is in microseconds;)-3.17 F
F1<ad70>3.17 E F0 3.17(,w)C .67(hich is in units of 512-byte blocks;)
-3.17 F F1<ad50>3.17 E F0(,)A F1<ad54>3.17 E F0(,)A F1<ad62>3.17 E F0(,)
A F1<ad6b>144 729.6 Q F0(,)A F1<ad6e>3.736 E F0 3.736(,a)C(nd)-3.736 E
F1<ad75>3.736 E F0 3.736(,w)C 1.236(hich are unscaled v)-3.736 F 1.236
(alues; and, when in posix mode,)-.25 F F1<ad63>3.736 E F0(and)3.736 E
F1<ad66>3.736 E F0 3.736(,w)C 1.237(hich are in)-3.736 F(GNU Bash 5.2)72
(alue of the speci\214ed resource.)-3.218 F(If)5.468 E(GNU Bash 5.2)72
768 Q(2021 No)136.385 E -.15(ve)-.15 G(mber 22).15 E(24)185.545 E 0 Cg
EP
%%Page: 25 25
@@ -3115,319 +3110,330 @@ BP
%%EndPageSetup
/F0 10/Times-Roman@0 SF -.35(BA)72 48 S(SH_B).35 E(UIL)-.1 E 87.61
(TINS\(1\) General)-.92 F(Commands Manual)2.5 E -.35(BA)90.11 G(SH_B).35
E(UIL)-.1 E(TINS\(1\))-.92 E .239(512-byte increments.)144 84 R .238
E(UIL)-.1 E(TINS\(1\))-.92 E .044(no option is gi)144 84 R -.15(ve)-.25
G .044(n, then).15 F/F1 10/Times-Bold@0 SF<ad66>2.544 E F0 .045
(is assumed.)2.545 F -1.11(Va)5.045 G .045
(lues are in 1024-byte increments, e)1.11 F .045(xcept for)-.15 F F1
<ad74>2.545 E F0 2.545(,w)C .045(hich is)-2.545 F .67(in seconds;)144 96
R F1<ad52>3.17 E F0 3.17(,w)C .67(hich is in microseconds;)-3.17 F F1
<ad70>3.17 E F0 3.17(,w)C .67(hich is in units of 512-byte blocks;)-3.17
F F1<ad50>3.17 E F0(,)A F1<ad54>3.17 E F0(,)A F1<ad62>3.17 E F0(,)A F1
<ad6b>144 108 Q F0(,)A F1<ad6e>3.736 E F0 3.736(,a)C(nd)-3.736 E F1
<ad75>3.736 E F0 3.736(,w)C 1.236(hich are unscaled v)-3.736 F 1.236
(alues; and, when in posix mode,)-.25 F F1<ad63>3.736 E F0(and)3.736 E
F1<ad66>3.736 E F0 3.736(,w)C 1.237(hich are in)-3.736 F .239
(512-byte increments.)144 120 R .238
(The return status is 0 unless an in)5.239 F -.25(va)-.4 G .238
(lid option or ar).25 F .238(gument is supplied, or an)-.18 F
(error occurs while setting a ne)144 96 Q 2.5(wl)-.25 G(imit.)-2.5 E/F1
10/Times-Bold@0 SF(umask)108 112.8 Q F0([)2.5 E F1<ad70>A F0 2.5(][)C F1
<ad53>-2.5 E F0 2.5(][)C/F2 10/Times-Italic@0 SF(mode)-2.5 E F0(])A .18
(The user \214le-creation mask is set to)144 124.8 R F2(mode)3.06 E F0
(error occurs while setting a ne)144 132 Q 2.5(wl)-.25 G(imit.)-2.5 E F1
(umask)108 148.8 Q F0([)2.5 E F1<ad70>A F0 2.5(][)C F1<ad53>-2.5 E F0
2.5(][)C/F2 10/Times-Italic@0 SF(mode)-2.5 E F0(])A .18
(The user \214le-creation mask is set to)144 160.8 R F2(mode)3.06 E F0
5.18(.I).18 G(f)-5.18 E F2(mode)3.06 E F0(be)2.86 E .18
(gins with a digit, it is interpreted as an octal)-.15 F .066(number; o\
therwise it is interpreted as a symbolic mode mask similar to that acce\
pted by)144 136.8 R F2 -.15(ch)2.566 G(mod).15 E F0(\(1\).).77 E(If)144
148.8 Q F2(mode)3.262 E F0 .382(is omitted, the current v)3.062 F .382
pted by)144 172.8 R F2 -.15(ch)2.566 G(mod).15 E F0(\(1\).).77 E(If)144
184.8 Q F2(mode)3.262 E F0 .382(is omitted, the current v)3.062 F .382
(alue of the mask is printed.)-.25 F(The)5.382 E F1<ad53>2.882 E F0 .382
(option causes the mask to be)2.882 F .547
(printed in symbolic form; the def)144 160.8 R .547
(printed in symbolic form; the def)144 196.8 R .547
(ault output is an octal number)-.1 F 5.547(.I)-.55 G 3.047(ft)-5.547 G
(he)-3.047 E F1<ad70>3.047 E F0 .547(option is supplied, and)3.047 F F2
(mode)144.38 172.8 Q F0 .551
(mode)144.38 208.8 Q F0 .551
(is omitted, the output is in a form that may be reused as input.)3.231
F .552(The return status is 0 if the)5.552 F(mode w)144 184.8 Q
F .552(The return status is 0 if the)5.552 F(mode w)144 220.8 Q
(as successfully changed or if no)-.1 E F2(mode)2.5 E F0(ar)2.5 E
(gument w)-.18 E(as supplied, and f)-.1 E(alse otherwise.)-.1 E F1
(unalias)108 201.6 Q F0<5bad>2.5 E F1(a)A F0 2.5(][)C F2(name)-2.5 E F0
(...])2.5 E(Remo)144 213.6 Q 1.058 -.15(ve e)-.15 H(ach).15 E F2(name)
(unalias)108 237.6 Q F0<5bad>2.5 E F1(a)A F0 2.5(][)C F2(name)-2.5 E F0
(...])2.5 E(Remo)144 249.6 Q 1.058 -.15(ve e)-.15 H(ach).15 E F2(name)
3.258 E F0 .758(from the list of de\214ned aliases.)3.258 F(If)5.758 E
F1<ad61>3.258 E F0 .757(is supplied, all alias de\214nitions are re-)
3.258 F(mo)144 225.6 Q -.15(ve)-.15 G 2.5(d. The).15 F(return v)2.5 E
3.258 F(mo)144 261.6 Q -.15(ve)-.15 G 2.5(d. The).15 F(return v)2.5 E
(alue is true unless a supplied)-.25 E F2(name)2.86 E F0
(is not a de\214ned alias.)2.68 E F1(unset)108 242.4 Q F0<5bad>2.5 E F1
(is not a de\214ned alias.)2.68 E F1(unset)108 278.4 Q F0<5bad>2.5 E F1
(fv)A F0 2.5(][)C<ad>-2.5 E F1(n)A F0 2.5(][)C F2(name)-2.5 E F0(...])
2.5 E -.15(Fo)144 254.4 S 3.803(re).15 G(ach)-3.803 E F2(name)4.163 E F0
2.5 E -.15(Fo)144 290.4 S 3.803(re).15 G(ach)-3.803 E F2(name)4.163 E F0
3.803(,r).18 G(emo)-3.803 E 1.603 -.15(ve t)-.15 H 1.303
(he corresponding v).15 F 1.303(ariable or function.)-.25 F 1.303
(If the)6.303 F F1<ad76>3.804 E F0 1.304(option is gi)3.804 F -.15(ve)
-.25 G 1.304(n, each).15 F F2(name)144.36 266.4 Q F0 .465
-.25 G 1.304(n, each).15 F F2(name)144.36 302.4 Q F0 .465
(refers to a shell v)3.145 F .464(ariable, and that v)-.25 F .464
(ariable is remo)-.25 F -.15(ve)-.15 G 2.964(d. Read-only).15 F -.25(va)
2.964 G .464(riables may not be un-).25 F 2.768(set. If)144 278.4 R F1
2.964 G .464(riables may not be un-).25 F 2.768(set. If)144 314.4 R F1
<ad66>2.768 E F0 .269(is speci\214ed, each)2.768 F F2(name)3.129 E F0
.269(refers to a shell function, and the function de\214nition is remo)
2.949 F -.15(ve)-.15 G(d.).15 E .404(If the)144 290.4 R F1<ad6e>2.904 E
2.949 F -.15(ve)-.15 G(d.).15 E .404(If the)144 326.4 R F1<ad6e>2.904 E
F0 .404(option is supplied, and)2.904 F F2(name)2.904 E F0 .404(is a v)
2.904 F .404(ariable with the)-.25 F F2(namer)2.904 E(ef)-.37 E F0
(attrib)2.904 E(ute,)-.2 E F2(name)2.904 E F0 .403(will be unset)2.904 F
.719(rather than the v)144 302.4 R .719(ariable it references.)-.25 F F1
.719(rather than the v)144 338.4 R .719(ariable it references.)-.25 F F1
<ad6e>5.719 E F0 .719(has no ef)3.219 F .719(fect if the)-.25 F F1<ad66>
3.22 E F0 .72(option is supplied.)3.22 F .72(If no options)5.72 F .737
(are supplied, each)144 314.4 R F2(name)3.237 E F0 .737(refers to a v)
(are supplied, each)144 350.4 R F2(name)3.237 E F0 .737(refers to a v)
3.237 F .737(ariable; if there is no v)-.25 F .736
(ariable by that name, a function with)-.25 F 1.761(that name, if an)144
326.4 R 3.061 -.65(y, i)-.15 H 4.261(su).65 G 4.261(nset. Each)-4.261 F
362.4 R 3.061 -.65(y, i)-.15 H 4.261(su).65 G 4.261(nset. Each)-4.261 F
1.761(unset v)4.261 F 1.761(ariable or function is remo)-.25 F -.15(ve)
-.15 G 4.262(df).15 G 1.762(rom the en)-4.262 F(vironment)-.4 E 3.172
(passed to subsequent commands.)144 338.4 R 3.172(If an)8.172 F 5.672
(passed to subsequent commands.)144 374.4 R 3.172(If an)8.172 F 5.672
(yo)-.15 G(f)-5.672 E/F3 9/Times-Bold@0 SF -.27(BA)5.672 G(SH_ALIASES)
.27 E/F4 9/Times-Roman@0 SF(,)A F3 -.27(BA)5.421 G(SH_ARGV0).27 E F4(,)A
F3 -.27(BA)5.421 G(SH_CMDS).27 E F4(,)A F3 -.27(BA)144 350.4 S
F3 -.27(BA)5.421 G(SH_CMDS).27 E F4(,)A F3 -.27(BA)144 386.4 S
(SH_COMMAND).27 E F4(,)A F3 -.27(BA)11.481 G(SH_SUBSHELL).27 E F4(,)A F3
-.27(BA)11.482 G(SHPID).27 E F4(,)A F3(COMP_W)11.482 E(ORDBREAKS)-.09 E
F4(,)A F3(DIRST)11.482 E -.495(AC)-.81 G(K).495 E F4(,)A F3(EPOCHREAL)
144 362.4 Q(TIME)-.828 E F4(,)A F3(EPOCHSECONDS)2.67 E F4(,)A F3(FUNCN)
144 398.4 Q(TIME)-.828 E F4(,)A F3(EPOCHSECONDS)2.67 E F4(,)A F3(FUNCN)
2.67 E(AME)-.18 E F4(,)A F3(GR)2.67 E(OUPS)-.27 E F4(,)A F3(HISTCMD)2.67
E F4(,)A F3(LINENO)2.67 E F4(,)A F3(RANDOM)2.67 E F4(,)A F3(SECONDS)144
374.4 Q F4(,)A F0(or)4.029 E F3(SRANDOM)4.279 E F0 1.779(are unset, the)
410.4 Q F4(,)A F0(or)4.029 E F3(SRANDOM)4.279 E F0 1.779(are unset, the)
4.029 F 4.279(yl)-.15 G 1.779(ose their special properties, e)-4.279 F
-.15(ve)-.25 G 4.279(ni).15 G 4.28(ft)-4.279 G(he)-4.28 E 4.28(ya)-.15 G
1.78(re subse-)-4.28 F(quently reset.)144 386.4 Q(The e)5 E
1.78(re subse-)-4.28 F(quently reset.)144 422.4 Q(The e)5 E
(xit status is true unless a)-.15 E F2(name)2.86 E F0
(is readonly or may not be unset.)2.68 E F1(wait)108 403.2 Q F0([)2.5 E
(is readonly or may not be unset.)2.68 E F1(wait)108 439.2 Q F0([)2.5 E
F1(\255fn)A F0 2.5(][)C F1<ad70>-2.5 E F2(varname)2.5 E F0 2.5(][)C F2
(id ...)-2.5 E F0(])A -.8(Wa)144 415.2 S .659(it for each speci\214ed c\
(id ...)-2.5 E F0(])A -.8(Wa)144 451.2 S .659(it for each speci\214ed c\
hild process and return its termination status.).8 F(Each)5.659 E F2(id)
3.169 E F0 .658(may be a process)3.928 F .008
(ID or a job speci\214cation; if a job spec is gi)144 427.2 R -.15(ve)
(ID or a job speci\214cation; if a job spec is gi)144 463.2 R -.15(ve)
-.25 G .009(n, all processes in that job').15 F 2.509(sp)-.55 G .009
(ipeline are w)-2.509 F .009(aited for)-.1 F 5.009(.I)-.55 G(f)-5.009 E
F2(id)144.01 439.2 Q F0 .442(is not gi)3.712 F -.15(ve)-.25 G(n,).15 E
F2(id)144.01 475.2 Q F0 .442(is not gi)3.712 F -.15(ve)-.25 G(n,).15 E
F1(wait)2.942 E F0 -.1(wa)2.942 G .441
(its for all running background jobs and the last-e).1 F -.15(xe)-.15 G
.441(cuted process substitu-).15 F .597
(tion, if its process id is the same as)144 451.2 R F1($!)3.098 E F0
(tion, if its process id is the same as)144 487.2 R F1($!)3.098 E F0
3.098(,a)C .598(nd the return status is zero.)-3.098 F .598(If the)5.598
F F1<ad6e>3.098 E F0 .598(option is supplied,)3.098 F F1(wait)144 463.2
F F1<ad6e>3.098 E F0 .598(option is supplied,)3.098 F F1(wait)144 499.2
Q F0 -.1(wa)3.083 G .583(its for a single job from the list of).1 F F2
(id)3.083 E F0 3.083(so)C 1.383 -.4(r, i)-3.083 H 3.083(fn).4 G(o)-3.083
E F2(id)3.083 E F0 3.083(sa)C .583(re supplied, an)-3.083 F 3.083(yj)
-.15 G .582(ob, to complete and)-3.083 F .403(returns its e)144 475.2 R
-.15 G .582(ob, to complete and)-3.083 F .403(returns its e)144 511.2 R
.403(xit status.)-.15 F .403(If none of the supplied ar)5.403 F .403
(guments is a child of the shell, or if no ar)-.18 F(guments)-.18 E .573
(are supplied and the shell has no unw)144 487.2 R .573
(are supplied and the shell has no unw)144 523.2 R .573
(aited-for children, the e)-.1 F .573(xit status is 127.)-.15 F .572
(If the)5.573 F F1<ad70>3.072 E F0 .572(option is)3.072 F .39
(supplied, the process or job identi\214er of the job for which the e)
144 499.2 R .39(xit status is returned is assigned to)-.15 F .905(the v)
144 511.2 R(ariable)-.25 E F2(varname)3.405 E F0 .905
144 535.2 R .39(xit status is returned is assigned to)-.15 F .905(the v)
144 547.2 R(ariable)-.25 E F2(varname)3.405 E F0 .905
(named by the option ar)3.405 F 3.405(gument. The)-.18 F -.25(va)3.405 G
.905(riable will be unset initially).25 F 3.405(,b)-.65 G(efore)-3.405 E
(an)144 523.2 Q 3.89(ya)-.15 G 3.89(ssignment. This)-3.89 F 1.39
(an)144 559.2 Q 3.89(ya)-.15 G 3.89(ssignment. This)-3.89 F 1.39
(is useful only when the)3.89 F F1<ad6e>3.89 E F0 1.39
(option is supplied.)3.89 F 1.39(Supplying the)6.39 F F1<ad66>3.89 E F0
(option,)3.89 E .575(when job control is enabled, forces)144 535.2 R F1
(option,)3.89 E .575(when job control is enabled, forces)144 571.2 R F1
(wait)3.075 E F0 .575(to w)3.075 F .575(ait for)-.1 F F2(id)3.075 E F0
.574(to terminate before returning its status, in-)3.075 F .635
(stead of returning when it changes status.)144 547.2 R(If)5.635 E F2
(stead of returning when it changes status.)144 583.2 R(If)5.635 E F2
(id)3.145 E F0 .635(speci\214es a non-e)3.905 F .635
(xistent process or job, the return)-.15 F .802(status is 127.)144 559.2
(xistent process or job, the return)-.15 F .802(status is 127.)144 595.2
R(If)5.801 E F1(wait)3.301 E F0 .801(is interrupted by a signal, the re\
turn status will be greater than 128, as de-)3.301 F 1.758
(scribed under)144 571.2 R F1(SIGN)4.258 E(ALS)-.2 E F0(in)4.258 E F2
(scribed under)144 607.2 R F1(SIGN)4.258 E(ALS)-.2 E F0(in)4.258 E F2
(bash\(1\))4.258 E F0 6.758(.O)C 1.759
(therwise, the return status is the e)-6.758 F 1.759
(xit status of the last)-.15 F(process or job w)144 583.2 Q(aited for)
-.1 E(.)-.55 E/F5 10.95/Times-Bold@0 SF(SHELL COMP)72 600 Q -1.04(AT)
(xit status of the last)-.15 F(process or job w)144 619.2 Q(aited for)
-.1 E(.)-.55 E/F5 10.95/Times-Bold@0 SF(SHELL COMP)72 636 Q -1.04(AT)
-.81 G(IBILITY MODE)1.04 E F0 1.355
(Bash-4.0 introduced the concept of a)108 612 R F2 1.355
(Bash-4.0 introduced the concept of a)108 648 R F2 1.355
(shell compatibility le)3.855 F(vel)-.15 E F0 3.855(,s)C 1.354
(peci\214ed as a set of options to the shopt)-3.855 F -.2(bu)108 624 S
(peci\214ed as a set of options to the shopt)-3.855 F -.2(bu)108 660 S
.398(iltin \().2 F F1(compat31)2.898 E F0(,)A F1(compat32)2.898 E F0(,)A
F1(compat40)2.898 E F0(,)A F1(compat41)2.898 E F0 2.898(,a)C .399
(nd so on\).)-2.898 F .399(There is only one current compatibility)5.399
F(le)108 636 Q -.15(ve)-.25 G 3.254(l-).15 G 3.254(-e)-3.254 G .754
F(le)108 672 Q -.15(ve)-.25 G 3.254(l-).15 G 3.254(-e)-3.254 G .754
(ach option is mutually e)-3.254 F(xclusi)-.15 E -.15(ve)-.25 G 5.754
(.T).15 G .754(he compatibility le)-5.754 F -.15(ve)-.25 G 3.253(li).15
G 3.253(si)-3.253 G .753(ntended to allo)-3.253 F 3.253(wu)-.25 G .753
(sers to select be-)-3.253 F(ha)108 648 Q 1.083(vior from pre)-.2 F
(sers to select be-)-3.253 F(ha)108 684 Q 1.083(vior from pre)-.2 F
1.083(vious v)-.25 F 1.083(ersions that is incompatible with ne)-.15 F
1.083(wer v)-.25 F 1.083(ersions while the)-.15 F 3.584(ym)-.15 G 1.084
(igrate scripts to use)-3.584 F(current features and beha)108 660 Q
(igrate scripts to use)-3.584 F(current features and beha)108 696 Q
(vior)-.2 E 2.5(.I)-.55 G(t')-2.5 E 2.5(si)-.55 G
(ntended to be a temporary solution.)-2.5 E 1.457
(This section does not mention beha)108 676.8 R 1.457
(This section does not mention beha)108 712.8 R 1.457
(vior that is standard for a particular v)-.2 F 1.456
(ersion \(e.g., setting)-.15 F F1(compat32)3.956 E F0 .886
(means that quoting the rhs of the re)108 688.8 R(ge)-.15 E .886
(means that quoting the rhs of the re)108 724.8 R(ge)-.15 E .886
(xp matching operator quotes special re)-.15 F(ge)-.15 E .887
(xp characters in the w)-.15 F(ord,)-.1 E(which is def)108 700.8 Q
(ault beha)-.1 E(vior in bash-3.2 and subsequent v)-.2 E(ersions\).)-.15
E .523(If a user enables, say)108 717.6 R(,)-.65 E F1(compat32)3.023 E
F0 3.023(,i)C 3.023(tm)-3.023 G .523(ay af)-3.023 F .523(fect the beha)
-.25 F .523(vior of other compatibility le)-.2 F -.15(ve)-.25 G .522
(ls up to and includ-).15 F .259(ing the current compatibility le)108
729.6 R -.15(ve)-.25 G 2.759(l. The).15 F .259
(idea is that each compatibility le)2.759 F -.15(ve)-.25 G 2.76(lc).15 G
.26(ontrols beha)-2.76 F .26(vior that changed)-.2 F(GNU Bash 5.2)72 768
Q(2021 No)136.385 E -.15(ve)-.15 G(mber 22).15 E(25)185.545 E 0 Cg EP
(xp characters in the w)-.15 F(ord,)-.1 E(GNU Bash 5.2)72 768 Q(2021 No)
136.385 E -.15(ve)-.15 G(mber 22).15 E(25)185.545 E 0 Cg EP
%%Page: 26 26
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@0 SF -.35(BA)72 48 S(SH_B).35 E(UIL)-.1 E 87.61
(TINS\(1\) General)-.92 F(Commands Manual)2.5 E -.35(BA)90.11 G(SH_B).35
E(UIL)-.1 E(TINS\(1\))-.92 E 1.646(in that v)108 84 R 1.646(ersion of)
-.15 F/F1 10/Times-Bold@0 SF(bash)4.146 E F0 4.146(,b)C 1.646
(ut that beha)-4.346 F 1.646(vior may ha)-.2 F 1.946 -.15(ve b)-.2 H
1.646(een present in earlier v).15 F 4.146(ersions. F)-.15 F 1.645
(or instance, the)-.15 F .76
(change to use locale-based comparisons with the)108 96 R F1([[)3.261 E
F0 .761(command came in bash-4.1, and earlier v)3.261 F .761
(ersions used)-.15 F 1.905(ASCII-based comparisons, so enabling)108 108
R F1(compat32)4.405 E F0 1.904
E(UIL)-.1 E(TINS\(1\))-.92 E(which is def)108 84 Q(ault beha)-.1 E
(vior in bash-3.2 and subsequent v)-.2 E(ersions\).)-.15 E .523
(If a user enables, say)108 100.8 R(,)-.65 E/F1 10/Times-Bold@0 SF
(compat32)3.023 E F0 3.023(,i)C 3.023(tm)-3.023 G .523(ay af)-3.023 F
.523(fect the beha)-.25 F .523(vior of other compatibility le)-.2 F -.15
(ve)-.25 G .522(ls up to and includ-).15 F .259
(ing the current compatibility le)108 112.8 R -.15(ve)-.25 G 2.759
(l. The).15 F .259(idea is that each compatibility le)2.759 F -.15(ve)
-.25 G 2.76(lc).15 G .26(ontrols beha)-2.76 F .26(vior that changed)-.2
F 1.646(in that v)108 124.8 R 1.646(ersion of)-.15 F F1(bash)4.146 E F0
4.146(,b)C 1.646(ut that beha)-4.346 F 1.646(vior may ha)-.2 F 1.946
-.15(ve b)-.2 H 1.646(een present in earlier v).15 F 4.146(ersions. F)
-.15 F 1.645(or instance, the)-.15 F .76
(change to use locale-based comparisons with the)108 136.8 R F1([[)3.261
E F0 .761(command came in bash-4.1, and earlier v)3.261 F .761
(ersions used)-.15 F 1.905(ASCII-based comparisons, so enabling)108
148.8 R F1(compat32)4.405 E F0 1.904
(will enable ASCII-based comparisons as well.)4.405 F(That)6.904 E .295
(granularity may not be suf)108 120 R .296
(granularity may not be suf)108 160.8 R .296
(\214cient for all uses, and as a result users should emplo)-.25 F 2.796
(yc)-.1 G .296(ompatibility le)-2.796 F -.15(ve)-.25 G .296(ls care-).15
F(fully)108 132 Q 5(.R)-.65 G(ead the documentation for a particular fe\
ature to \214nd out the current beha)-5 E(vior)-.2 E(.)-.55 E .532
(Bash-4.3 introduced a ne)108 148.8 R 3.032(ws)-.25 G .531(hell v)-3.032
F(fully)108 172.8 Q 5(.R)-.65 G(ead the documentation for a particular \
feature to \214nd out the current beha)-5 E(vior)-.2 E(.)-.55 E .532
(Bash-4.3 introduced a ne)108 189.6 R 3.032(ws)-.25 G .531(hell v)-3.032
F(ariable:)-.25 E/F2 9/Times-Bold@0 SF -.27(BA)3.031 G(SH_COMP).27 E
-.855(AT)-.666 G/F3 9/Times-Roman@0 SF(.).855 E F0 .531(The v)5.031 F
.531(alue assigned to this v)-.25 F .531(ariable \(a decimal)-.25 F -.15
(ve)108 160.8 S .107(rsion number lik).15 F 2.607(e4)-.1 G .107
(ve)108 201.6 S .107(rsion number lik).15 F 2.607(e4)-.1 G .107
(.2, or an inte)-2.607 F .107(ger corresponding to the)-.15 F F1(compat)
2.608 E/F4 10/Times-Italic@0 SF(NN)A F0 .108(option, lik)2.608 F 2.608
(e4)-.1 G .108(2\) determines the com-)-2.608 F(patibility le)108 172.8
(e4)-.1 G .108(2\) determines the com-)-2.608 F(patibility le)108 213.6
Q -.15(ve)-.25 G(l.).15 E .388(Starting with bash-4.4, Bash has be)108
189.6 R .388(gun deprecating older compatibility le)-.15 F -.15(ve)-.25
230.4 R .388(gun deprecating older compatibility le)-.15 F -.15(ve)-.25
G 2.887(ls. Ev).15 F(entually)-.15 E 2.887(,t)-.65 G .387
(he options will)-2.887 F(be remo)108 201.6 Q -.15(ve)-.15 G 2.5(di).15
(he options will)-2.887 F(be remo)108 242.4 Q -.15(ve)-.15 G 2.5(di).15
G 2.5(nf)-2.5 G -.2(avo)-2.6 G 2.5(ro).2 G(f)-2.5 E F2 -.27(BA)2.5 G
(SH_COMP).27 E -.855(AT)-.666 G F3(.).855 E F0 1.163
(Bash-5.0 is the \214nal v)108 218.4 R 1.163
(Bash-5.0 is the \214nal v)108 259.2 R 1.163
(ersion for which there will be an indi)-.15 F 1.164
(vidual shopt option for the pre)-.25 F 1.164(vious v)-.25 F(ersion.)
-.15 E(Users should use)108 230.4 Q F2 -.27(BA)2.5 G(SH_COMP).27 E -.855
-.15 E(Users should use)108 271.2 Q F2 -.27(BA)2.5 G(SH_COMP).27 E -.855
(AT)-.666 G F0(on bash-5.0 and later v)3.105 E(ersions.)-.15 E 1.614
(The follo)108 247.2 R 1.613(wing table describes the beha)-.25 F 1.613
(The follo)108 288 R 1.613(wing table describes the beha)-.25 F 1.613
(vior changes controlled by each compatibility le)-.2 F -.15(ve)-.25 G
4.113(ls).15 G 4.113(etting. The)-4.113 F F1(compat)108 259.2 Q F4(NN)A
F0 1.186(tag is used as shorthand for setting the compatibility le)3.685
F -.15(ve)-.25 G 3.686(lt).15 G(o)-3.686 E F4(NN)3.686 E F0 1.186
(using one of the follo)3.686 F(wing)-.25 E 3.807(mechanisms. F)108
271.2 R 1.307(or v)-.15 F 1.307
4.113(ls).15 G 4.113(etting. The)-4.113 F F1(compat)108 300 Q F4(NN)A F0
1.186(tag is used as shorthand for setting the compatibility le)3.685 F
-.15(ve)-.25 G 3.686(lt).15 G(o)-3.686 E F4(NN)3.686 E F0 1.186
(using one of the follo)3.686 F(wing)-.25 E 3.807(mechanisms. F)108 312
R 1.307(or v)-.15 F 1.307
(ersions prior to bash-5.0, the compatibility le)-.15 F -.15(ve)-.25 G
3.806(lm).15 G 1.306(ay be set using the corresponding)-3.806 F F1
(compat)108 283.2 Q F4(NN)A F0 .502(shopt option.)3.002 F -.15(Fo)5.502
G 3.002(rb).15 G .502(ash-4.3 and later v)-3.002 F .502(ersions, the)
-.15 F F2 -.27(BA)3.002 G(SH_COMP).27 E -.855(AT)-.666 G F0 -.25(va)
3.607 G .502(riable is preferred, and it).25 F
(is required for bash-5.1 and later v)108 295.2 Q(ersions.)-.15 E F1
(compat31)108 312 Q F0<83>144 324 Q(quoting the rhs of the)180 324 Q F1
([[)2.5 E F0(command')2.5 E 2.5(sr)-.55 G -.15(eg)-2.5 G -.15(ex).15 G
2.5(pm).15 G(atching operator \(=~\) has no special ef)-2.5 E(fect)-.25
E F1(compat32)108 340.8 Q F0<83>144 352.8 Q .35
(interrupting a command list such as "a ; b ; c" causes the e)180 352.8
(compat)108 324 Q F4(NN)A F0 .502(shopt option.)3.002 F -.15(Fo)5.502 G
3.002(rb).15 G .502(ash-4.3 and later v)-3.002 F .502(ersions, the)-.15
F F2 -.27(BA)3.002 G(SH_COMP).27 E -.855(AT)-.666 G F0 -.25(va)3.607 G
.502(riable is preferred, and it).25 F
(is required for bash-5.1 and later v)108 336 Q(ersions.)-.15 E F1
(compat31)108 352.8 Q F0<83>144 364.8 Q(quoting the rhs of the)180 364.8
Q F1([[)2.5 E F0(command')2.5 E 2.5(sr)-.55 G -.15(eg)-2.5 G -.15(ex).15
G 2.5(pm).15 G(atching operator \(=~\) has no special ef)-2.5 E(fect)
-.25 E F1(compat32)108 381.6 Q F0<83>144 393.6 Q .35
(interrupting a command list such as "a ; b ; c" causes the e)180 393.6
R -.15(xe)-.15 G .35(cution of the ne).15 F .35(xt command)-.15 F .017
(in the list \(in bash-4.0 and later v)180 364.8 R .018
(in the list \(in bash-4.0 and later v)180 405.6 R .018
(ersions, the shell acts as if it recei)-.15 F -.15(ve)-.25 G 2.518(dt)
.15 G .018(he interrupt, so in-)-2.518 F
(terrupting one command in a list aborts the e)180 376.8 Q -.15(xe)-.15
G(cution of the entire list\)).15 E F1(compat40)108 393.6 Q F0<83>144
405.6 Q(the)180 405.6 Q F1(<)2.674 E F0(and)2.674 E F1(>)2.673 E F0 .173
(terrupting one command in a list aborts the e)180 417.6 Q -.15(xe)-.15
G(cution of the entire list\)).15 E F1(compat40)108 434.4 Q F0<83>144
446.4 Q(the)180 446.4 Q F1(<)2.674 E F0(and)2.674 E F1(>)2.673 E F0 .173
(operators to the)2.673 F F1([[)2.673 E F0 .173
(command do not consider the current locale when compar)2.673 F(-)-.2 E
.067(ing strings; the)180 417.6 R 2.567(yu)-.15 G .067
.067(ing strings; the)180 458.4 R 2.567(yu)-.15 G .067
(se ASCII ordering.)-2.567 F .068(Bash v)5.068 F .068
(ersions prior to bash-4.1 use ASCII collation)-.15 F(and)180 429.6 Q F4
(ersions prior to bash-4.1 use ASCII collation)-.15 F(and)180 470.4 Q F4
(str)4.743 E(cmp)-.37 E F0 1.903
(\(3\); bash-4.1 and later use the current locale').19 F 4.402(sc)-.55 G
1.902(ollation sequence and)-4.402 F F4(str)4.742 E(-)-.2 E(coll)180
441.6 Q F0(\(3\).).51 E F1(compat41)108 458.4 Q F0<83>144 470.4 Q(in)180
470.4 Q F4(posix)3.79 E F0(mode,)3.79 E F1(time)3.79 E F0 1.29
482.4 Q F0(\(3\).).51 E F1(compat41)108 499.2 Q F0<83>144 511.2 Q(in)180
511.2 Q F4(posix)3.79 E F0(mode,)3.79 E F1(time)3.79 E F0 1.29
(may be follo)3.79 F 1.29
(wed by options and still be recognized as a reserv)-.25 F(ed)-.15 E -.1
(wo)180 482.4 S(rd \(this is POSIX interpretation 267\)).1 E<83>144
494.4 Q(in)180 494.4 Q F4(posix)2.709 E F0 .208
(wo)180 523.2 S(rd \(this is POSIX interpretation 267\)).1 E<83>144
535.2 Q(in)180 535.2 Q F4(posix)2.709 E F0 .208
(mode, the parser requires that an e)2.709 F -.15(ve)-.25 G 2.708(nn).15
G .208(umber of single quotes occur in the)-2.708 F F4(wor)2.708 E(d)
-.37 E F0 .281(portion of a double-quoted parameter e)180 506.4 R .282
-.37 E F0 .281(portion of a double-quoted parameter e)180 547.2 R .282
(xpansion and treats them specially)-.15 F 2.782(,s)-.65 G 2.782(ot)
-2.782 G .282(hat charac-)-2.782 F(ters within the single quotes are co\
nsidered quoted \(this is POSIX interpretation 221\))180 518.4 Q F1
(compat42)108 535.2 Q F0<83>144 547.2 Q 1.056(the replacement string in\
double-quoted pattern substitution does not under)180 547.2 R 1.055
(go quote re-)-.18 F(mo)180 559.2 Q -.25(va)-.15 G(l, as it does in v)
.25 E(ersions after bash-4.2)-.15 E<83>144 571.2 Q .021
(in posix mode, single quotes are considered special when e)180 571.2 R
nsidered quoted \(this is POSIX interpretation 221\))180 559.2 Q F1
(compat42)108 576 Q F0<83>144 588 Q 1.056(the replacement string in dou\
ble-quoted pattern substitution does not under)180 588 R 1.055
(go quote re-)-.18 F(mo)180 600 Q -.25(va)-.15 G(l, as it does in v).25
E(ersions after bash-4.2)-.15 E<83>144 612 Q .021
(in posix mode, single quotes are considered special when e)180 612 R
.021(xpanding the)-.15 F F4(wor)2.521 E(d)-.37 E F0 .021(portion of a)
2.521 F .018(double-quoted parameter e)180 583.2 R .017
2.521 F .018(double-quoted parameter e)180 624 R .017
(xpansion and can be used to quote a closing brace or other spe-)-.15 F
.998(cial character \(this is part of POSIX interpretation 221\); in la\
ter v)180 595.2 R .999(ersions, single quotes)-.15 F
(are not special within double-quoted w)180 607.2 Q(ord e)-.1 E
(xpansions)-.15 E F1(compat43)108 624 Q F0<83>144 636 Q 1.071
(the shell does not print a w)180 636 R 1.07
ter v)180 636 R .999(ersions, single quotes)-.15 F
(are not special within double-quoted w)180 648 Q(ord e)-.1 E(xpansions)
-.15 E F1(compat43)108 664.8 Q F0<83>144 676.8 Q 1.071
(the shell does not print a w)180 676.8 R 1.07
(arning message if an attempt is made to use a quoted com-)-.1 F .71
(pound assignment as an ar)180 648 R .711
(pound assignment as an ar)180 688.8 R .711
(gument to declare \(e.g., declare -a foo=\010\(1 2\)\010\). Later v)
-.18 F(ersions)-.15 E -.1(wa)180 660 S(rn that this usage is deprecated)
.1 E<83>144 672 Q -.1(wo)180 672 S .501(rd e).1 F .501
(xpansion errors are considered non-f)-.15 F .501
(atal errors that cause the current command to)-.1 F -.1(fa)180 684 S
-.18 F(ersions)-.15 E -.1(wa)180 700.8 S
(rn that this usage is deprecated).1 E<83>144 712.8 Q -.1(wo)180 712.8 S
.501(rd e).1 F .501(xpansion errors are considered non-f)-.15 F .501
(atal errors that cause the current command to)-.1 F -.1(fa)180 724.8 S
.605(il, e).1 F -.15(ve)-.25 G 3.105(ni).15 G 3.105(np)-3.105 G .605
(osix mode \(the def)-3.105 F .605(ault beha)-.1 F .605(vior is to mak)
-.2 F 3.105(et)-.1 G .605(hem f)-3.105 F .605
(atal errors that cause the)-.1 F(shell to e)180 696 Q(xit\))-.15 E<83>
144 708 Q .355(when e)180 708 R -.15(xe)-.15 G .354
(cuting a shell function, the loop state \(while/until/etc.\)).15 F .354
(is not reset, so)5.354 F F1(br)2.854 E(eak)-.18 E F0(or)2.854 E F1
(continue)180 720 Q F0 .052
(in that function will break or continue loops in the calling conte)
2.552 F .053(xt. Bash-4.4 and)-.15 F(GNU Bash 5.2)72 768 Q(2021 No)
136.385 E -.15(ve)-.15 G(mber 22).15 E(26)185.545 E 0 Cg EP
(atal errors that cause the)-.1 F(GNU Bash 5.2)72 768 Q(2021 No)136.385
E -.15(ve)-.15 G(mber 22).15 E(26)185.545 E 0 Cg EP
%%Page: 27 27
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@0 SF -.35(BA)72 48 S(SH_B).35 E(UIL)-.1 E 87.61
(TINS\(1\) General)-.92 F(Commands Manual)2.5 E -.35(BA)90.11 G(SH_B).35
E(UIL)-.1 E(TINS\(1\))-.92 E(later reset the loop state to pre)180 84 Q
-.15(ve)-.25 G(nt this).15 E/F1 10/Times-Bold@0 SF(compat44)108 100.8 Q
F0<83>144 112.8 Q .719(the shell sets up the v)180 112.8 R .719
(alues used by)-.25 F/F2 9/Times-Bold@0 SF -.27(BA)3.219 G(SH_ARGV).27 E
F0(and)2.969 E F2 -.27(BA)3.219 G(SH_ARGC).27 E F0 .719(so the)2.969 F
3.218(yc)-.15 G .718(an e)-3.218 F(xpand)-.15 E(to the shell')180 124.8
Q 2.5(sp)-.55 G(ositional parameters e)-2.5 E -.15(ve)-.25 G 2.5(ni).15
G 2.5(fe)-2.5 G(xtended deb)-2.65 E(ugging mode is not enabled)-.2 E<83>
144 136.8 Q 2.634(as)180 136.8 S .134
(ubshell inherits loops from its parent conte)-2.634 F .135(xt, so)-.15
F F1(br)2.635 E(eak)-.18 E F0(or)2.635 E F1(continue)2.635 E F0 .135
(will cause the sub-)2.635 F(shell to e)180 148.8 Q 2.5(xit. Bash-5.0)
-.15 F(and later reset the loop state to pre)2.5 E -.15(ve)-.25 G
(nt the e).15 E(xit)-.15 E<83>144 160.8 Q -.25(va)180 160.8 S .619
(riable assignments preceding b).25 F .618(uiltins lik)-.2 F(e)-.1 E F1
(export)3.118 E F0(and)3.118 E F1 -.18(re)3.118 G(adonly).18 E F0 .618
(that set attrib)3.118 F .618(utes con-)-.2 F .119(tinue to af)180 172.8
R .119(fect v)-.25 F .119(ariables with the same name in the calling en)
-.25 F .12(vironment e)-.4 F -.15(ve)-.25 G 2.62(ni).15 G 2.62(ft)-2.62
G .12(he shell is)-2.62 F(not in posix mode)180 184.8 Q F1(compat50)108
201.6 Q F0<83>144 213.6 Q 1.209(Bash-5.1 changed the w)180 213.6 R(ay)
-.1 E F2($RANDOM)3.709 E F0 1.209
(is generated to introduce slightly more random-)3.459 F 1.018
(ness. If the shell compatibility le)180 225.6 R -.15(ve)-.25 G 3.518
E(UIL)-.1 E(TINS\(1\))-.92 E(shell to e)180 84 Q(xit\))-.15 E<83>144 96
Q .355(when e)180 96 R -.15(xe)-.15 G .354
(cuting a shell function, the loop state \(while/until/etc.\)).15 F .354
(is not reset, so)5.354 F/F1 10/Times-Bold@0 SF(br)2.854 E(eak)-.18 E F0
(or)2.854 E F1(continue)180 108 Q F0 .052
(in that function will break or continue loops in the calling conte)
2.552 F .053(xt. Bash-4.4 and)-.15 F(later reset the loop state to pre)
180 120 Q -.15(ve)-.25 G(nt this).15 E F1(compat44)108 136.8 Q F0<83>144
148.8 Q .719(the shell sets up the v)180 148.8 R .719(alues used by)-.25
F/F2 9/Times-Bold@0 SF -.27(BA)3.219 G(SH_ARGV).27 E F0(and)2.969 E F2
-.27(BA)3.219 G(SH_ARGC).27 E F0 .719(so the)2.969 F 3.218(yc)-.15 G
.718(an e)-3.218 F(xpand)-.15 E(to the shell')180 160.8 Q 2.5(sp)-.55 G
(ositional parameters e)-2.5 E -.15(ve)-.25 G 2.5(ni).15 G 2.5(fe)-2.5 G
(xtended deb)-2.65 E(ugging mode is not enabled)-.2 E<83>144 172.8 Q
2.634(as)180 172.8 S .134(ubshell inherits loops from its parent conte)
-2.634 F .135(xt, so)-.15 F F1(br)2.635 E(eak)-.18 E F0(or)2.635 E F1
(continue)2.635 E F0 .135(will cause the sub-)2.635 F(shell to e)180
184.8 Q 2.5(xit. Bash-5.0)-.15 F(and later reset the loop state to pre)
2.5 E -.15(ve)-.25 G(nt the e).15 E(xit)-.15 E<83>144 196.8 Q -.25(va)
180 196.8 S .619(riable assignments preceding b).25 F .618(uiltins lik)
-.2 F(e)-.1 E F1(export)3.118 E F0(and)3.118 E F1 -.18(re)3.118 G
(adonly).18 E F0 .618(that set attrib)3.118 F .618(utes con-)-.2 F .119
(tinue to af)180 208.8 R .119(fect v)-.25 F .119
(ariables with the same name in the calling en)-.25 F .12(vironment e)
-.4 F -.15(ve)-.25 G 2.62(ni).15 G 2.62(ft)-2.62 G .12(he shell is)-2.62
F(not in posix mode)180 220.8 Q F1(compat50)108 237.6 Q F0<83>144 249.6
Q 1.209(Bash-5.1 changed the w)180 249.6 R(ay)-.1 E F2($RANDOM)3.709 E
F0 1.209(is generated to introduce slightly more random-)3.459 F 1.018
(ness. If the shell compatibility le)180 261.6 R -.15(ve)-.25 G 3.518
(li).15 G 3.518(ss)-3.518 G 1.018(et to 50 or lo)-3.518 F(wer)-.25 E
3.518(,i)-.4 G 3.518(tr)-3.518 G -2.15 -.25(ev e)-3.518 H 1.019
(rts to the method from).25 F .733(bash-5.0 and pre)180 237.6 R .733
(rts to the method from).25 F .733(bash-5.0 and pre)180 273.6 R .733
(vious v)-.25 F .732
(ersions, so seeding the random number generator by assigning a)-.15 F
-.25(va)180 249.6 S(lue to).25 E F2(RANDOM)2.5 E F0
(will produce the same sequence as in bash-5.0)2.25 E<83>144 261.6 Q
.695(If the command hash table is empty)180 261.6 R 3.196(,b)-.65 G .696
-.25(va)180 285.6 S(lue to).25 E F2(RANDOM)2.5 E F0
(will produce the same sequence as in bash-5.0)2.25 E<83>144 297.6 Q
.695(If the command hash table is empty)180 297.6 R 3.196(,b)-.65 G .696
(ash v)-3.196 F .696(ersions prior to bash-5.1 printed an informa-)-.15
F 1.321(tional message to that ef)180 273.6 R 1.321(fect, e)-.25 F -.15
F 1.321(tional message to that ef)180 309.6 R 1.321(fect, e)-.25 F -.15
(ve)-.25 G 3.821(nw).15 G 1.321
(hen producing output that can be reused as input.)-3.821 F
(Bash-5.1 suppresses that message when the)180 285.6 Q F1<ad6c>2.5 E F0
(option is supplied.)2.5 E F1(compat51)108 302.4 Q F0<83>144 314.4 Q
(The)180 314.4 Q F1(unset)2.954 E F0 -.2(bu)2.954 G .454
(Bash-5.1 suppresses that message when the)180 321.6 Q F1<ad6c>2.5 E F0
(option is supplied.)2.5 E F1(compat51)108 338.4 Q F0<83>144 350.4 Q
(The)180 350.4 Q F1(unset)2.954 E F0 -.2(bu)2.954 G .454
(iltin treats attempts to unset array subscripts).2 F F1(@)2.955 E F0
(and)2.955 E F1(*)2.955 E F0(dif)2.955 E .455(ferently depending)-.25 F
(on whether the array is inde)180 326.4 Q -.15(xe)-.15 G 2.5(do).15 G
(on whether the array is inde)180 362.4 Q -.15(xe)-.15 G 2.5(do).15 G
2.5(ra)-2.5 G(ssociati)-2.5 E -.15(ve)-.25 G 2.5(,a).15 G(nd dif)-2.5 E
(ferently than in pre)-.25 E(vious v)-.25 E(ersions.)-.15 E/F3 10.95
/Times-Bold@0 SF(SEE ALSO)72 343.2 Q F0(bash\(1\), sh\(1\))108 355.2 Q
/Times-Bold@0 SF(SEE ALSO)72 379.2 Q F0(bash\(1\), sh\(1\))108 391.2 Q
(GNU Bash 5.2)72 768 Q(2021 No)136.385 E -.15(ve)-.15 G(mber 22).15 E
(27)185.545 E 0 Cg EP
%%Trailer
+1 -1
View File
@@ -1,6 +1,6 @@
%!PS-Adobe-3.0
%%Creator: groff version 1.22.4
%%CreationDate: Mon Sep 19 12:02:42 2022
%%CreationDate: Fri Dec 2 17:01:16 2022
%%DocumentNeededResources: font Times-Roman
%%+ font Times-Bold
%%DocumentSuppliedResources: procset grops 1.22 4
+3 -3
View File
@@ -2,10 +2,10 @@
Copyright (C) 1988-2022 Free Software Foundation, Inc.
@end ignore
@set LASTCHANGE Fri Nov 18 11:09:41 EST 2022
@set LASTCHANGE Fri Dec 2 16:14:27 EST 2022
@set EDITION 5.2
@set VERSION 5.2
@set UPDATED 18 November 2022
@set UPDATED-MONTH November 2022
@set UPDATED 2 December 2022
@set UPDATED-MONTH December 2022
+17 -1
View File
@@ -145,6 +145,8 @@ static void unbind_compfunc_variables PARAMS((int));
static WORD_LIST *build_arg_list PARAMS((char *, const char *, const char *, WORD_LIST *, int));
static WORD_LIST *command_line_to_word_list PARAMS((char *, int, int, int *, int *));
static int compgen_compspec = 0; /* are we generating completions for compgen? */
#ifdef DEBUG
static int progcomp_debug = 0;
#endif
@@ -1117,13 +1119,14 @@ gen_shell_function_matches (cs, cmd, text, line, ind, lwords, nw, cw, foundp)
STRINGLIST *sl;
SHELL_VAR *f, *v;
WORD_LIST *cmdlist;
int fval, found;
int fval, found, local_compgen;
sh_parser_state_t ps;
sh_parser_state_t * restrict pps;
#if defined (ARRAY_VARS)
ARRAY *a;
#endif
local_compgen = compgen_compspec;
found = 0;
if (foundp)
*foundp = found;
@@ -1154,11 +1157,21 @@ gen_shell_function_matches (cs, cmd, text, line, ind, lwords, nw, cw, foundp)
add_unwind_protect (restore_parser_state, (char *)pps);
add_unwind_protect (dispose_words, (char *)cmdlist);
add_unwind_protect (unbind_compfunc_variables, (char *)0);
if (local_compgen == 0)
{
add_unwind_protect (rl_set_signals, (char *)NULL);
rl_clear_signals ();
}
fval = execute_shell_function (f, cmdlist);
discard_unwind_frame ("gen-shell-function-matches");
restore_parser_state (pps);
if (local_compgen == 0)
{
QUIT;
rl_set_signals ();
}
found = fval != EX_NOTFOUND;
if (fval == EX_RETRYFAIL)
@@ -1328,6 +1341,7 @@ gen_compspec_completions (cs, cmd, word, start, end, foundp)
COMPSPEC *tcs;
found = 1;
compgen_compspec = this_shell_builtin == compgen_builtin;
#ifdef DEBUG
debug_printf ("gen_compspec_completions (%s, %s, %d, %d)", cmd, word, start, end);
@@ -1568,6 +1582,8 @@ gen_progcomp_completions (ocmd, cmd, word, start, end, foundp, retryp, lastcs)
const char *oldcmd, *oldtxt;
STRINGLIST *ret;
compgen_compspec = 0;
cs = progcomp_search (ocmd);
if (cs == 0 || cs == *lastcs)
+10 -1
View File
@@ -446,7 +446,12 @@ throw_to_top_level ()
#if defined (READLINE)
if (interactive)
bashline_reset ();
{
if (RL_ISSTATE (RL_STATE_SIGHANDLER) == 0)
rl_cleanup_after_signal ();
bashline_reset ();
}
#endif /* READLINE */
#if defined (PROCESS_SUBSTITUTION)
@@ -568,6 +573,8 @@ termsig_sighandler (sig)
RL_STATE_TERMPREPPED is possibly redundant. */
if (RL_ISSTATE (RL_STATE_SIGHANDLER) || RL_ISSTATE (RL_STATE_TERMPREPPED))
bashline_set_event_hook ();
else if (RL_ISSTATE (RL_STATE_COMPLETING|RL_STATE_DISPATCHING))
bashline_set_event_hook ();
#endif
SIGRETURN (0);
@@ -716,6 +723,8 @@ sigint_sighandler (sig)
quick response. */
else if (RL_ISSTATE (RL_STATE_SIGHANDLER))
bashline_set_event_hook ();
else if (RL_ISSTATE (RL_STATE_COMPLETING|RL_STATE_DISPATCHING))
bashline_set_event_hook ();
#endif
SIGRETURN (0);
+1 -1
View File
@@ -87,7 +87,7 @@ command: usage: command [-pVv] command [arg ...]
./errors.tests: line 231: /bin/sh + 0: arithmetic syntax error: operand expected (error token is "/bin/sh + 0")
./errors.tests: line 234: trap: NOSIG: invalid signal specification
./errors.tests: line 237: trap: -s: invalid option
trap: usage: trap [-lp] [[arg] signal_spec ...]
trap: usage: trap [-lp] [[action] signal_spec ...]
./errors.tests: line 243: return: can only `return' from a function or sourced script
./errors.tests: line 247: break: 0: loop count out of range
./errors.tests: line 251: continue: 0: loop count out of range
+1 -1
View File
@@ -17,7 +17,7 @@
#16: pat=*[ba]/*/efg yes/yes
#17: pat=*[!a]/*/efg yes/yes
#18: pat=*[a-c]/*/efg yes/yes
#19: pat=ab@(/)cd/efg no/no
#19: pat=ab@(/)cd/efg yes/yes
#20: pat=*@(/)cd/efg no/no
#21: pat=*/cd/efg yes/yes
+32 -15
View File
@@ -13,6 +13,8 @@
#
# tests of various aspects of pathname expansion, mostly dealing with bracket
# expressions
#
# Derived from tests contributed by Koichi Murase <myoga.murase@gmail.com>
LC_COLLATE=C
@@ -25,15 +27,25 @@ trap 'rm -rf $TESTDIR $WORK_DIR' EXIT
WORK_DIR=${TMPDIR}/globtest-$$
mkdir $WORK_DIR || {
echo "cannot create directory $WORK_DIR" >&2
echo "glob-bracket: cannot create directory $WORK_DIR" >&2
exit 1
}
cd $WORK_DIR || {
echo "cannot cd to directory $WORK_DIR" >&2
echo "glob-bracket: cannot cd to directory $WORK_DIR" >&2
exit 1
}
gcc -O2 -xc -o ./fnmatch - <<-EOF
eval $(grep -E '^(CC |SHOBJ_).*=' $BUILD_DIR/examples/loadables/Makefile | sed -e 's/[ ]*=[ ]*/="/' -e 's/\$@/strmatch/' -e 's/$/"/' )
if [ "$SHOBJ_STATUS" != "supported" ]; then
echo "glob-bracket: shared objects not supported, cannot continue" >&2
exit 2
fi
# we assume gcc as a default here
: ${CC:=gcc}
cat > fnmatch.c <<-EOF
#include <fnmatch.h>
#include <stdlib.h>
#include <stdio.h>
@@ -54,15 +66,15 @@ gcc -O2 -xc -o ./fnmatch - <<-EOF
return 1;
}
EOF
$CC -O2 -o fnmatch fnmatch.c
rm -f fnmatch.c
eval $(grep -E '^(CC |SHOBJ_).*=' $BUILD_DIR/examples/loadables/Makefile | sed -e 's/[ ]*=[ ]*/="/' -e 's/$/"/' )
if [ "$SHOBJ_STATUS" != "supported" ]; then
echo "glob-bracket: shared objects not supported, cannot continue" >&2
if [ ! -f fnmatch ] ; then
echo "glob-bracket: cannot create fnmatch executable" >&2
exit 2
fi
cat > ./strmatch.c <<-EOF
cat > strmatch.c <<-EOF
#define BUILTIN_ENABLED 0x01
struct word_desc { char* word; int flags; };
struct word_list { struct word_list* next; struct word_desc* word; };
@@ -120,7 +132,7 @@ enable -f ./strmatch.so strmatch || {
check_count=1
if [ -z "$BASH_TSTOUT" ]; then
yes=$(printf '\033[32myes\033[m') no=$(printf '\033[31mno\033[m')
yes=$'\033[32myes\033[m' no=$'\033[31mno\033[m'
else
yes=yes no=no
fi
@@ -157,10 +169,13 @@ function pcheck {
fi
# Linux fnmatch
if $WORK_DIR/fnmatch ab/cd/efg "$1"; then
local fnmatch=$yes
else
local fnmatch=$no
local fnmatch=${2-}
if [[ ! $fnmatch ]]; then
if $WORK_DIR/fnmatch ab/cd/efg "$1"; then
fnmatch=$yes
else
fnmatch=$no
fi
fi
printf '#%d: pat=%-16s %s/%s\n' "$((check_count++))" "$1" "$strmatch" "$fnmatch"
@@ -192,9 +207,11 @@ pcheck '*[ba]/*/efg'
pcheck '*[!a]/*/efg'
pcheck '*[a-c]/*/efg'
pcheck 'ab@(/)cd/efg'
pcheck '*@(/)cd/efg'
shopt -s extglob
pcheck 'ab@(/)cd/efg' "$yes"
pcheck '*@(/)cd/efg' "$no"
pcheck '*/cd/efg'
shopt -u extglob
cd "$WORK_DIR"
fi
+1 -1
View File
@@ -1,5 +1,5 @@
PATH=$PATH:`pwd`
export PATH
${THIS_SH} ./glob-bracket.tests > ${BASH_TSTOUT} 2>&1
${THIS_SH} ./glob-bracket.tests > ${BASH_TSTOUT}
diff ${BASH_TSTOUT} glob-bracket.right && rm -f ${BASH_TSTOUT}