aboutsummaryrefslogtreecommitdiffstats
path: root/doc/builtins.0
diff options
context:
space:
mode:
Diffstat (limited to 'doc/builtins.0')
-rw-r--r--doc/builtins.0945
1 files changed, 495 insertions, 450 deletions
diff --git a/doc/builtins.0 b/doc/builtins.0
index faf90a0..a721e38 100644
--- a/doc/builtins.0
+++ b/doc/builtins.0
@@ -14,8 +14,12 @@ NNAAMMEE
BBAASSHH BBUUIILLTTIINN CCOOMMMMAANNDDSS
Unless otherwise noted, each builtin command documented in this section
as accepting options preceded by -- accepts ---- to signify the end of the
- options. For example, the ::, ttrruuee, ffaallssee, and tteesstt builtins do not
- accept options.
+ options. The ::, ttrruuee, ffaallssee, and tteesstt builtins do not accept options
+ and do not treat ---- specially. The eexxiitt, llooggoouutt, bbrreeaakk, ccoonnttiinnuuee, lleett,
+ and sshhiifftt builtins accept and process arguments beginning with -- with-
+ out requiring ----. Other builtins that accept arguments but are not
+ specified as accepting options interpret arguments beginning with -- as
+ invalid options and require ---- to prevent this interpretation.
:: [_a_r_g_u_m_e_n_t_s]
No effect; the command does nothing beyond expanding _a_r_g_u_m_e_n_t_s
and performing any specified redirections. A zero exit code is
@@ -184,18 +188,22 @@ BBAASSHH BBUUIILLTTIINN CCOOMMMMAANNDDSS
The return value is true unless an invalid option is supplied,
or no matches were generated.
- ccoommpplleettee [--aabbccddeeffggjjkkssuuvv] [--oo _c_o_m_p_-_o_p_t_i_o_n] [--EE] [--AA _a_c_t_i_o_n] [--GG _g_l_o_b_p_a_t]
- [--WW _w_o_r_d_l_i_s_t] [--FF _f_u_n_c_t_i_o_n] [--CC _c_o_m_m_a_n_d]
+ ccoommpplleettee [--aabbccddeeffggjjkkssuuvv] [--oo _c_o_m_p_-_o_p_t_i_o_n] [--DDEE] [--AA _a_c_t_i_o_n] [--GG _g_l_o_b_-
+ _p_a_t] [--WW _w_o_r_d_l_i_s_t] [--FF _f_u_n_c_t_i_o_n] [--CC _c_o_m_m_a_n_d]
[--XX _f_i_l_t_e_r_p_a_t] [--PP _p_r_e_f_i_x] [--SS _s_u_f_f_i_x] _n_a_m_e [_n_a_m_e _._._.]
- ccoommpplleettee --pprr [--EE] [_n_a_m_e ...]
+ ccoommpplleettee --pprr [--DDEE] [_n_a_m_e ...]
Specify how arguments to each _n_a_m_e should be completed. If the
--pp option is supplied, or if no options are supplied, existing
completion specifications are printed in a way that allows them
to be reused as input. The --rr option removes a completion spec-
ification for each _n_a_m_e, or, if no _n_a_m_es are supplied, all com-
- pletion specifications. The --EE option indicates that the
- remaining options and actions should apply to ``empty'' command
- completion; that is, completion attempted on a blank line.
+ pletion specifications. The --DD option indicates that the
+ remaining options and actions should apply to the ``default''
+ command completion; that is, completion attempted on a command
+ for which no completion has previously been defined. The --EE
+ option indicates that the remaining options and actions should
+ apply to ``empty'' command completion; that is, completion
+ attempted on a blank line.
The process of applying these completion specifications when
word completion is attempted is described above under PPrroo--
@@ -275,7 +283,7 @@ BBAASSHH BBUUIILLTTIINN CCOOMMMMAANNDDSS
Names of all shell variables. May also be spec-
ified as --vv.
--GG _g_l_o_b_p_a_t
- The filename expansion pattern _g_l_o_b_p_a_t is expanded to
+ The pathname expansion pattern _g_l_o_b_p_a_t is expanded to
generate the possible completions.
--WW _w_o_r_d_l_i_s_t
The _w_o_r_d_l_i_s_t is split using the characters in the IIFFSS
@@ -292,7 +300,7 @@ BBAASSHH BBUUIILLTTIINN CCOOMMMMAANNDDSS
pletions are retrieved from the value of the CCOOMMPPRREEPPLLYY
array variable.
--XX _f_i_l_t_e_r_p_a_t
- _f_i_l_t_e_r_p_a_t is a pattern as used for filename expansion.
+ _f_i_l_t_e_r_p_a_t is a pattern as used for pathname expansion.
It is applied to the list of possible completions gener-
ated by the preceding options and arguments, and each
completion matching _f_i_l_t_e_r_p_a_t is removed from the list.
@@ -311,129 +319,134 @@ BBAASSHH BBUUIILLTTIINN CCOOMMMMAANNDDSS
for a _n_a_m_e for which no specification exists, or an error occurs
adding a completion specification.
- ccoommppoopptt [--oo _o_p_t_i_o_n] [++oo _o_p_t_i_o_n] [_n_a_m_e]
+ ccoommppoopptt [--oo _o_p_t_i_o_n] [--DDEE] [++oo _o_p_t_i_o_n] [_n_a_m_e]
Modify completion options for each _n_a_m_e according to the
_o_p_t_i_o_ns, or for the currently-execution completion if no _n_a_m_es
are supplied. If no _o_p_t_i_o_ns are given, display the completion
options for each _n_a_m_e or the current completion. The possible
values of _o_p_t_i_o_n are those valid for the ccoommpplleettee builtin
- described above.
-
- The return value is true unless an invalid option is supplied, an
- attempt is made to modify the options for a _n_a_m_e for which no comple-
+ described above. The --DD option indicates that the remaining
+ options should apply to the ``default'' command completion; that
+ is, completion attempted on a command for which no completion
+ has previously been defined. The --EE option indicates that the
+ remaining options should apply to ``empty'' command completion;
+ that is, completion attempted on a blank line.
+
+ The return value is true unless an invalid option is supplied, an
+ attempt is made to modify the options for a _n_a_m_e for which no comple-
tion specification exists, or an output error occurs.
ccoonnttiinnuuee [_n]
Resume the next iteration of the enclosing ffoorr, wwhhiillee, uunnttiill, or
- sseelleecctt loop. If _n is specified, resume at the _nth enclosing
- loop. _n must be >= 1. If _n is greater than the number of
- enclosing loops, the last enclosing loop (the ``top-level''
+ sseelleecctt loop. If _n is specified, resume at the _nth enclosing
+ loop. _n must be >= 1. If _n is greater than the number of
+ enclosing loops, the last enclosing loop (the ``top-level''
loop) is resumed. The return value is 0 unless _n is not greater
than or equal to 1.
ddeeccllaarree [--aaAAffFFiillrrttuuxx] [--pp] [_n_a_m_e[=_v_a_l_u_e] ...]
ttyyppeesseett [--aaAAffFFiillrrttuuxx] [--pp] [_n_a_m_e[=_v_a_l_u_e] ...]
- Declare variables and/or give them attributes. If no _n_a_m_es are
- given then display the values of variables. The --pp option will
+ Declare variables and/or give them attributes. If no _n_a_m_es are
+ given then display the values of variables. The --pp option will
display the attributes and values of each _n_a_m_e. When --pp is used
with _n_a_m_e arguments, additional options are ignored. When --pp is
- supplied without _n_a_m_e arguments, it will display the attributes
- and values of all variables having the attributes specified by
- the additional options. If no other options are supplied with
- --pp, ddeeccllaarree will display the attributes and values of all shell
- variables. The --ff option will restrict the display to shell
+ supplied without _n_a_m_e arguments, it will display the attributes
+ and values of all variables having the attributes specified by
+ the additional options. If no other options are supplied with
+ --pp, ddeeccllaarree will display the attributes and values of all shell
+ variables. The --ff option will restrict the display to shell
functions. The --FF option inhibits the display of function defi-
- nitions; only the function name and attributes are printed. If
- the eexxttddeebbuugg shell option is enabled using sshhoopptt, the source
+ nitions; only the function name and attributes are printed. If
+ the eexxttddeebbuugg shell option is enabled using sshhoopptt, the source
file name and line number where the function is defined are dis-
- played as well. The --FF option implies --ff. The following
- options can be used to restrict output to variables with the
+ played as well. The --FF option implies --ff. The following
+ options can be used to restrict output to variables with the
specified attribute or to give variables attributes:
- --aa Each _n_a_m_e is an indexed array variable (see AArrrraayyss
+ --aa Each _n_a_m_e is an indexed array variable (see AArrrraayyss
above).
- --AA Each _n_a_m_e is an associative array variable (see AArrrraayyss
+ --AA Each _n_a_m_e is an associative array variable (see AArrrraayyss
above).
--ff Use function names only.
--ii The variable is treated as an integer; arithmetic evalua-
- tion (see AARRIITTHHMMEETTIICC EEVVAALLUUAATTIIOONN )) is performed when the
- variable is assigned a value.
- --ll When the variable is assigned a value, all upper-case
- characters are converted to lower-case. The upper-case
+ tion (see AARRIITTHHMMEETTIICC EEVVAALLUUAATTIIOONN above) is performed when
+ the variable is assigned a value.
+ --ll When the variable is assigned a value, all upper-case
+ characters are converted to lower-case. The upper-case
attribute is disabled.
--rr Make _n_a_m_es readonly. These names cannot then be assigned
values by subsequent assignment statements or unset.
- --tt Give each _n_a_m_e the _t_r_a_c_e attribute. Traced functions
- inherit the DDEEBBUUGG and RREETTUURRNN traps from the calling
- shell. The trace attribute has no special meaning for
+ --tt Give each _n_a_m_e the _t_r_a_c_e attribute. Traced functions
+ inherit the DDEEBBUUGG and RREETTUURRNN traps from the calling
+ shell. The trace attribute has no special meaning for
variables.
- --uu When the variable is assigned a value, all lower-case
- characters are converted to upper-case. The lower-case
+ --uu When the variable is assigned a value, all lower-case
+ characters are converted to upper-case. The lower-case
attribute is disabled.
- --xx Mark _n_a_m_es for export to subsequent commands via the
+ --xx Mark _n_a_m_es for export to subsequent commands via the
environment.
- Using `+' instead of `-' turns off the attribute instead, with
+ Using `+' instead of `-' turns off the attribute instead, with
the exceptions that ++aa may not be used to destroy an array vari-
- able and ++rr wwiillll nnoott rreemmoovvee tthhee rreeaaddoonnllyy aattttrriibbuuttee.. WWhheenn uusseedd
- iinn aa ffuunnccttiioonn,, mmaakkeess eeaacchh _n_a_m_e llooccaall,, aass wwiitthh tthhee llooccaall command.
+ able and ++rr will not remove the readonly attribute. When used
+ in a function, makes each _n_a_m_e local, as with the llooccaall command.
If a variable name is followed by =_v_a_l_u_e, the value of the vari-
- able is set to _v_a_l_u_e. The return value is 0 unless an invalid
- option is encountered, an attempt is made to define a function
- using ``-f foo=bar'', an attempt is made to assign a value to a
- readonly variable, an attempt is made to assign a value to an
+ able is set to _v_a_l_u_e. The return value is 0 unless an invalid
+ option is encountered, an attempt is made to define a function
+ using ``-f foo=bar'', an attempt is made to assign a value to a
+ readonly variable, an attempt is made to assign a value to an
array variable without using the compound assignment syntax (see
- AArrrraayyss above), one of the _n_a_m_e_s is not a valid shell variable
+ AArrrraayyss above), one of the _n_a_m_e_s is not a valid shell variable
name, an attempt is made to turn off readonly status for a read-
- only variable, an attempt is made to turn off array status for
- an array variable, or an attempt is made to display a non-exis-
+ only variable, an attempt is made to turn off array status for
+ an array variable, or an attempt is made to display a non-exis-
tent function with --ff.
ddiirrss [[++_n]] [[--_n]] [[--ccppllvv]]
- Without options, displays the list of currently remembered
- directories. The default display is on a single line with
- directory names separated by spaces. Directories are added to
- the list with the ppuusshhdd command; the ppooppdd command removes
+ Without options, displays the list of currently remembered
+ directories. The default display is on a single line with
+ directory names separated by spaces. Directories are added to
+ the list with the ppuusshhdd command; the ppooppdd command removes
entries from the list.
++_n Displays the _nth entry counting from the left of the list
shown by ddiirrss when invoked without options, starting with
zero.
- --_n Displays the _nth entry counting from the right of the
+ --_n Displays the _nth entry counting from the right of the
list shown by ddiirrss when invoked without options, starting
with zero.
--cc Clears the directory stack by deleting all of the
entries.
- --ll Produces a longer listing; the default listing format
+ --ll Produces a longer listing; the default listing format
uses a tilde to denote the home directory.
--pp Print the directory stack with one entry per line.
- --vv Print the directory stack with one entry per line, pre-
+ --vv Print the directory stack with one entry per line, pre-
fixing each entry with its index in the stack.
- The return value is 0 unless an invalid option is supplied or _n
+ The return value is 0 unless an invalid option is supplied or _n
indexes beyond the end of the directory stack.
ddiissoowwnn [--aarr] [--hh] [_j_o_b_s_p_e_c ...]
- Without options, each _j_o_b_s_p_e_c is removed from the table of
- active jobs. If _j_o_b_s_p_e_c is not present, and neither --aa nnoorr --rr
- iiss ssuupppplliieedd,, tthhee sshheellll''ss nnoottiioonn ooff tthhee _c_u_r_r_e_n_t _j_o_b iiss uusseedd.. IIff
- tthhee --hh ooppttiioonn iiss ggiivveenn,, eeaacchh _j_o_b_s_p_e_c is not removed from the ta-
- ble, but is marked so that SSIIGGHHUUPP is not sent to the job if the
- shell receives a SSIIGGHHUUPP. If no _j_o_b_s_p_e_c is present, and neither
- the --aa nor the --rr option is supplied, the _c_u_r_r_e_n_t _j_o_b is used.
+ Without options, each _j_o_b_s_p_e_c is removed from the table of
+ active jobs. If _j_o_b_s_p_e_c is not present, and neither --aa nor --rr
+ is supplied, the shell's notion of the _c_u_r_r_e_n_t _j_o_b is used. If
+ the --hh option is given, each _j_o_b_s_p_e_c is not removed from the ta-
+ ble, but is marked so that SSIIGGHHUUPP is not sent to the job if the
+ shell receives a SSIIGGHHUUPP. If no _j_o_b_s_p_e_c is present, and neither
+ the --aa nor the --rr option is supplied, the _c_u_r_r_e_n_t _j_o_b is used.
If no _j_o_b_s_p_e_c is supplied, the --aa option means to remove or mark
- all jobs; the --rr option without a _j_o_b_s_p_e_c argument restricts
- operation to running jobs. The return value is 0 unless a _j_o_b_-
+ all jobs; the --rr option without a _j_o_b_s_p_e_c argument restricts
+ operation to running jobs. The return value is 0 unless a _j_o_b_-
_s_p_e_c does not specify a valid job.
eecchhoo [--nneeEE] [_a_r_g ...]
- Output the _a_r_gs, separated by spaces, followed by a newline.
+ Output the _a_r_gs, separated by spaces, followed by a newline.
The return status is always 0. If --nn is specified, the trailing
- newline is suppressed. If the --ee option is given, interpreta-
- tion of the following backslash-escaped characters is enabled.
- The --EE option disables the interpretation of these escape char-
- acters, even on systems where they are interpreted by default.
- The xxppgg__eecchhoo shell option may be used to dynamically determine
- whether or not eecchhoo expands these escape characters by default.
- eecchhoo does not interpret ---- to mean the end of options. eecchhoo
+ newline is suppressed. If the --ee option is given, interpreta-
+ tion of the following backslash-escaped characters is enabled.
+ The --EE option disables the interpretation of these escape char-
+ acters, even on systems where they are interpreted by default.
+ The xxppgg__eecchhoo shell option may be used to dynamically determine
+ whether or not eecchhoo expands these escape characters by default.
+ eecchhoo does not interpret ---- to mean the end of options. eecchhoo
interprets the following escape sequences:
\\aa alert (bell)
\\bb backspace
@@ -445,187 +458,187 @@ BBAASSHH BBUUIILLTTIINN CCOOMMMMAANNDDSS
\\tt horizontal tab
\\vv vertical tab
\\\\ backslash
- \\00_n_n_n the eight-bit character whose value is the octal value
+ \\00_n_n_n the eight-bit character whose value is the octal value
_n_n_n (zero to three octal digits)
- \\xx_H_H the eight-bit character whose value is the hexadecimal
+ \\xx_H_H the eight-bit character whose value is the hexadecimal
value _H_H (one or two hex digits)
eennaabbllee [--aa] [--ddnnppss] [--ff _f_i_l_e_n_a_m_e] [_n_a_m_e ...]
- Enable and disable builtin shell commands. Disabling a builtin
+ Enable and disable builtin shell commands. Disabling a builtin
allows a disk command which has the same name as a shell builtin
- to be executed without specifying a full pathname, even though
- the shell normally searches for builtins before disk commands.
- If --nn is used, each _n_a_m_e is disabled; otherwise, _n_a_m_e_s are
+ to be executed without specifying a full pathname, even though
+ the shell normally searches for builtins before disk commands.
+ If --nn is used, each _n_a_m_e is disabled; otherwise, _n_a_m_e_s are
enabled. For example, to use the tteesstt binary found via the PPAATTHH
- instead of the shell builtin version, run ``enable -n test''.
- The --ff option means to load the new builtin command _n_a_m_e from
+ instead of the shell builtin version, run ``enable -n test''.
+ The --ff option means to load the new builtin command _n_a_m_e from
shared object _f_i_l_e_n_a_m_e, on systems that support dynamic loading.
- The --dd option will delete a builtin previously loaded with --ff.
+ The --dd option will delete a builtin previously loaded with --ff.
If no _n_a_m_e arguments are given, or if the --pp option is supplied,
a list of shell builtins is printed. With no other option argu-
- ments, the list consists of all enabled shell builtins. If --nn
- is supplied, only disabled builtins are printed. If --aa is sup-
- plied, the list printed includes all builtins, with an indica-
- tion of whether or not each is enabled. If --ss is supplied, the
- output is restricted to the POSIX _s_p_e_c_i_a_l builtins. The return
- value is 0 unless a _n_a_m_e is not a shell builtin or there is an
+ ments, the list consists of all enabled shell builtins. If --nn
+ is supplied, only disabled builtins are printed. If --aa is sup-
+ plied, the list printed includes all builtins, with an indica-
+ tion of whether or not each is enabled. If --ss is supplied, the
+ output is restricted to the POSIX _s_p_e_c_i_a_l builtins. The return
+ value is 0 unless a _n_a_m_e is not a shell builtin or there is an
error loading a new builtin from a shared object.
eevvaall [_a_r_g ...]
- The _a_r_gs are read and concatenated together into a single com-
- mand. This command is then read and executed by the shell, and
- its exit status is returned as the value of eevvaall. If there are
+ The _a_r_gs are read and concatenated together into a single com-
+ mand. This command is then read and executed by the shell, and
+ its exit status is returned as the value of eevvaall. If there are
no _a_r_g_s, or only null arguments, eevvaall returns 0.
eexxeecc [--ccll] [--aa _n_a_m_e] [_c_o_m_m_a_n_d [_a_r_g_u_m_e_n_t_s]]
- If _c_o_m_m_a_n_d is specified, it replaces the shell. No new process
- is created. The _a_r_g_u_m_e_n_t_s become the arguments to _c_o_m_m_a_n_d. If
+ If _c_o_m_m_a_n_d is specified, it replaces the shell. No new process
+ is created. The _a_r_g_u_m_e_n_t_s become the arguments to _c_o_m_m_a_n_d. If
the --ll option is supplied, the shell places a dash at the begin-
- ning of the zeroth argument passed to _c_o_m_m_a_n_d. This is what
+ ning of the zeroth argument passed to _c_o_m_m_a_n_d. This is what
_l_o_g_i_n(1) does. The --cc option causes _c_o_m_m_a_n_d to be executed with
- an empty environment. If --aa is supplied, the shell passes _n_a_m_e
+ an empty environment. If --aa is supplied, the shell passes _n_a_m_e
as the zeroth argument to the executed command. If _c_o_m_m_a_n_d can-
- not be executed for some reason, a non-interactive shell exits,
- unless the shell option eexxeeccffaaiill is enabled, in which case it
- returns failure. An interactive shell returns failure if the
+ not be executed for some reason, a non-interactive shell exits,
+ unless the shell option eexxeeccffaaiill is enabled, in which case it
+ returns failure. An interactive shell returns failure if the
file cannot be executed. If _c_o_m_m_a_n_d is not specified, any redi-
rections take effect in the current shell, and the return status
- is 0. If there is a redirection error, the return status is 1.
+ is 0. If there is a redirection error, the return status is 1.
eexxiitt [_n]
- Cause the shell to exit with a status of _n. If _n is omitted,
+ Cause the shell to exit with a status of _n. If _n is omitted,
the exit status is that of the last command executed. A trap on
EEXXIITT is executed before the shell terminates.
eexxppoorrtt [--ffnn] [_n_a_m_e[=_w_o_r_d]] ...
eexxppoorrtt --pp
- The supplied _n_a_m_e_s are marked for automatic export to the envi-
- ronment of subsequently executed commands. If the --ff option is
- given, the _n_a_m_e_s refer to functions. If no _n_a_m_e_s are given, or
- if the --pp option is supplied, a list of all names that are
- exported in this shell is printed. The --nn option causes the
- export property to be removed from each _n_a_m_e. If a variable
- name is followed by =_w_o_r_d, the value of the variable is set to
- _w_o_r_d. eexxppoorrtt returns an exit status of 0 unless an invalid
- option is encountered, one of the _n_a_m_e_s is not a valid shell
+ The supplied _n_a_m_e_s are marked for automatic export to the envi-
+ ronment of subsequently executed commands. If the --ff option is
+ given, the _n_a_m_e_s refer to functions. If no _n_a_m_e_s are given, or
+ if the --pp option is supplied, a list of all names that are
+ exported in this shell is printed. The --nn option causes the
+ export property to be removed from each _n_a_m_e. If a variable
+ name is followed by =_w_o_r_d, the value of the variable is set to
+ _w_o_r_d. eexxppoorrtt returns an exit status of 0 unless an invalid
+ option is encountered, one of the _n_a_m_e_s is not a valid shell
variable name, or --ff is supplied with a _n_a_m_e that is not a func-
tion.
ffcc [--ee _e_n_a_m_e] [--llnnrr] [_f_i_r_s_t] [_l_a_s_t]
ffcc --ss [_p_a_t=_r_e_p] [_c_m_d]
- Fix Command. In the first form, a range of commands from _f_i_r_s_t
- to _l_a_s_t is selected from the history list. _F_i_r_s_t and _l_a_s_t may
- be specified as a string (to locate the last command beginning
- with that string) or as a number (an index into the history
+ Fix Command. In the first form, a range of commands from _f_i_r_s_t
+ to _l_a_s_t is selected from the history list. _F_i_r_s_t and _l_a_s_t may
+ be specified as a string (to locate the last command beginning
+ with that string) or as a number (an index into the history
list, where a negative number is used as an offset from the cur-
rent command number). If _l_a_s_t is not specified it is set to the
- current command for listing (so that ``fc -l -10'' prints the
+ current command for listing (so that ``fc -l -10'' prints the
last 10 commands) and to _f_i_r_s_t otherwise. If _f_i_r_s_t is not spec-
- ified it is set to the previous command for editing and -16 for
+ ified it is set to the previous command for editing and -16 for
listing.
- The --nn option suppresses the command numbers when listing. The
- --rr option reverses the order of the commands. If the --ll option
- is given, the commands are listed on standard output. Other-
- wise, the editor given by _e_n_a_m_e is invoked on a file containing
- those commands. If _e_n_a_m_e is not given, the value of the FFCCEEDDIITT
- variable is used, and the value of EEDDIITTOORR if FFCCEEDDIITT is not set.
- If neither variable is set, is used. When editing is complete,
+ The --nn option suppresses the command numbers when listing. The
+ --rr option reverses the order of the commands. If the --ll option
+ is given, the commands are listed on standard output. Other-
+ wise, the editor given by _e_n_a_m_e is invoked on a file containing
+ those commands. If _e_n_a_m_e is not given, the value of the FFCCEEDDIITT
+ variable is used, and the value of EEDDIITTOORR if FFCCEEDDIITT is not set.
+ If neither variable is set, is used. When editing is complete,
the edited commands are echoed and executed.
- In the second form, _c_o_m_m_a_n_d is re-executed after each instance
- of _p_a_t is replaced by _r_e_p. A useful alias to use with this is
- ``r="fc -s"'', so that typing ``r cc'' runs the last command
+ In the second form, _c_o_m_m_a_n_d is re-executed after each instance
+ of _p_a_t is replaced by _r_e_p. A useful alias to use with this is
+ ``r="fc -s"'', so that typing ``r cc'' runs the last command
beginning with ``cc'' and typing ``r'' re-executes the last com-
mand.
- If the first form is used, the return value is 0 unless an
- invalid option is encountered or _f_i_r_s_t or _l_a_s_t specify history
- lines out of range. If the --ee option is supplied, the return
+ If the first form is used, the return value is 0 unless an
+ invalid option is encountered or _f_i_r_s_t or _l_a_s_t specify history
+ lines out of range. If the --ee option is supplied, the return
value is the value of the last command executed or failure if an
error occurs with the temporary file of commands. If the second
- form is used, the return status is that of the command re-exe-
- cuted, unless _c_m_d does not specify a valid history line, in
+ form is used, the return status is that of the command re-exe-
+ cuted, unless _c_m_d does not specify a valid history line, in
which case ffcc returns failure.
ffgg [_j_o_b_s_p_e_c]
- Resume _j_o_b_s_p_e_c in the foreground, and make it the current job.
+ Resume _j_o_b_s_p_e_c in the foreground, and make it the current job.
If _j_o_b_s_p_e_c is not present, the shell's notion of the _c_u_r_r_e_n_t _j_o_b
- is used. The return value is that of the command placed into
- the foreground, or failure if run when job control is disabled
+ is used. The return value is that of the command placed into
+ the foreground, or failure if run when job control is disabled
or, when run with job control enabled, if _j_o_b_s_p_e_c does not spec-
- ify a valid job or _j_o_b_s_p_e_c specifies a job that was started
+ ify a valid job or _j_o_b_s_p_e_c specifies a job that was started
without job control.
ggeettooppttss _o_p_t_s_t_r_i_n_g _n_a_m_e [_a_r_g_s]
- ggeettooppttss is used by shell procedures to parse positional parame-
- ters. _o_p_t_s_t_r_i_n_g contains the option characters to be recog-
- nized; if a character is followed by a colon, the option is
- expected to have an argument, which should be separated from it
- by white space. The colon and question mark characters may not
- be used as option characters. Each time it is invoked, ggeettooppttss
- places the next option in the shell variable _n_a_m_e, initializing
+ ggeettooppttss is used by shell procedures to parse positional parame-
+ ters. _o_p_t_s_t_r_i_n_g contains the option characters to be recog-
+ nized; if a character is followed by a colon, the option is
+ expected to have an argument, which should be separated from it
+ by white space. The colon and question mark characters may not
+ be used as option characters. Each time it is invoked, ggeettooppttss
+ places the next option in the shell variable _n_a_m_e, initializing
_n_a_m_e if it does not exist, and the index of the next argument to
be processed into the variable OOPPTTIINNDD. OOPPTTIINNDD is initialized to
- 1 each time the shell or a shell script is invoked. When an
- option requires an argument, ggeettooppttss places that argument into
- the variable OOPPTTAARRGG. The shell does not reset OOPPTTIINNDD automati-
- cally; it must be manually reset between multiple calls to
+ 1 each time the shell or a shell script is invoked. When an
+ option requires an argument, ggeettooppttss places that argument into
+ the variable OOPPTTAARRGG. The shell does not reset OOPPTTIINNDD automati-
+ cally; it must be manually reset between multiple calls to
ggeettooppttss within the same shell invocation if a new set of parame-
ters is to be used.
- When the end of options is encountered, ggeettooppttss exits with a
- return value greater than zero. OOPPTTIINNDD is set to the index of
+ When the end of options is encountered, ggeettooppttss exits with a
+ return value greater than zero. OOPPTTIINNDD is set to the index of
the first non-option argument, and nnaammee is set to ?.
- ggeettooppttss normally parses the positional parameters, but if more
+ ggeettooppttss normally parses the positional parameters, but if more
arguments are given in _a_r_g_s, ggeettooppttss parses those instead.
- ggeettooppttss can report errors in two ways. If the first character
- of _o_p_t_s_t_r_i_n_g is a colon, _s_i_l_e_n_t error reporting is used. In
- normal operation diagnostic messages are printed when invalid
- options or missing option arguments are encountered. If the
- variable OOPPTTEERRRR is set to 0, no error messages will be dis-
+ ggeettooppttss can report errors in two ways. If the first character
+ of _o_p_t_s_t_r_i_n_g is a colon, _s_i_l_e_n_t error reporting is used. In
+ normal operation diagnostic messages are printed when invalid
+ options or missing option arguments are encountered. If the
+ variable OOPPTTEERRRR is set to 0, no error messages will be dis-
played, even if the first character of _o_p_t_s_t_r_i_n_g is not a colon.
If an invalid option is seen, ggeettooppttss places ? into _n_a_m_e and, if
- not silent, prints an error message and unsets OOPPTTAARRGG. If
- ggeettooppttss is silent, the option character found is placed in
+ not silent, prints an error message and unsets OOPPTTAARRGG. If
+ ggeettooppttss is silent, the option character found is placed in
OOPPTTAARRGG and no diagnostic message is printed.
- If a required argument is not found, and ggeettooppttss is not silent,
- a question mark (??) is placed in _n_a_m_e, OOPPTTAARRGG is unset, and a
- diagnostic message is printed. If ggeettooppttss is silent, then a
- colon (::) is placed in _n_a_m_e and OOPPTTAARRGG is set to the option
+ If a required argument is not found, and ggeettooppttss is not silent,
+ a question mark (??) is placed in _n_a_m_e, OOPPTTAARRGG is unset, and a
+ diagnostic message is printed. If ggeettooppttss is silent, then a
+ colon (::) is placed in _n_a_m_e and OOPPTTAARRGG is set to the option
character found.
- ggeettooppttss returns true if an option, specified or unspecified, is
+ ggeettooppttss returns true if an option, specified or unspecified, is
found. It returns false if the end of options is encountered or
an error occurs.
hhaasshh [--llrr] [--pp _f_i_l_e_n_a_m_e] [--ddtt] [_n_a_m_e]
- For each _n_a_m_e, the full file name of the command is determined
+ For each _n_a_m_e, the full file name of the command is determined
by searching the directories in $$PPAATTHH and remembered. If the --pp
option is supplied, no path search is performed, and _f_i_l_e_n_a_m_e is
used as the full file name of the command. The --rr option causes
- the shell to forget all remembered locations. The --dd option
+ the shell to forget all remembered locations. The --dd option
causes the shell to forget the remembered location of each _n_a_m_e.
- If the --tt option is supplied, the full pathname to which each
- _n_a_m_e corresponds is printed. If multiple _n_a_m_e arguments are
- supplied with --tt, the _n_a_m_e is printed before the hashed full
+ If the --tt option is supplied, the full pathname to which each
+ _n_a_m_e corresponds is printed. If multiple _n_a_m_e arguments are
+ supplied with --tt, the _n_a_m_e is printed before the hashed full
pathname. The --ll option causes output to be displayed in a for-
- mat that may be reused as input. If no arguments are given, or
+ mat that may be reused as input. If no arguments are given, or
if only --ll is supplied, information about remembered commands is
- printed. The return status is true unless a _n_a_m_e is not found
+ printed. The return status is true unless a _n_a_m_e is not found
or an invalid option is supplied.
hheellpp [--ddmmss] [_p_a_t_t_e_r_n]
- Display helpful information about builtin commands. If _p_a_t_t_e_r_n
- is specified, hheellpp gives detailed help on all commands matching
- _p_a_t_t_e_r_n; otherwise help for all the builtins and shell control
+ Display helpful information about builtin commands. If _p_a_t_t_e_r_n
+ is specified, hheellpp gives detailed help on all commands matching
+ _p_a_t_t_e_r_n; otherwise help for all the builtins and shell control
structures is printed.
--dd Display a short description of each _p_a_t_t_e_r_n
- --mm Display the description of each _p_a_t_t_e_r_n in a manpage-like
+ --mm Display the description of each _p_a_t_t_e_r_n in a manpage-like
format
--ss Display only a short usage synopsis for each _p_a_t_t_e_r_n
The return status is 0 unless no command matches _p_a_t_t_e_r_n.
@@ -638,132 +651,133 @@ BBAASSHH BBUUIILLTTIINN CCOOMMMMAANNDDSS
hhiissttoorryy --ss _a_r_g [_a_r_g _._._.]
With no options, display the command history list with line num-
bers. Lines listed with a ** have been modified. An argument of
- _n lists only the last _n lines. If the shell variable HHIISSTTTTIIMMEE--
- FFOORRMMAATT is set and not null, it is used as a format string for
- _s_t_r_f_t_i_m_e(3) to display the time stamp associated with each dis-
- played history entry. No intervening blank is printed between
- the formatted time stamp and the history line. If _f_i_l_e_n_a_m_e is
- supplied, it is used as the name of the history file; if not,
- the value of HHIISSTTFFIILLEE is used. Options, if supplied, have the
+ _n lists only the last _n lines. If the shell variable HHIISSTTTTIIMMEE--
+ FFOORRMMAATT is set and not null, it is used as a format string for
+ _s_t_r_f_t_i_m_e(3) to display the time stamp associated with each dis-
+ played history entry. No intervening blank is printed between
+ the formatted time stamp and the history line. If _f_i_l_e_n_a_m_e is
+ supplied, it is used as the name of the history file; if not,
+ the value of HHIISSTTFFIILLEE is used. Options, if supplied, have the
following meanings:
--cc Clear the history list by deleting all the entries.
--dd _o_f_f_s_e_t
Delete the history entry at position _o_f_f_s_e_t.
- --aa Append the ``new'' history lines (history lines entered
- since the beginning of the current bbaasshh session) to the
+ --aa Append the ``new'' history lines (history lines entered
+ since the beginning of the current bbaasshh session) to the
history file.
- --nn Read the history lines not already read from the history
- file into the current history list. These are lines
- appended to the history file since the beginning of the
+ --nn Read the history lines not already read from the history
+ file into the current history list. These are lines
+ appended to the history file since the beginning of the
current bbaasshh session.
--rr Read the contents of the history file and use them as the
current history.
- --ww Write the current history to the history file, overwrit-
+ --ww Write the current history to the history file, overwrit-
ing the history file's contents.
- --pp Perform history substitution on the following _a_r_g_s and
- display the result on the standard output. Does not
- store the results in the history list. Each _a_r_g must be
+ --pp Perform history substitution on the following _a_r_g_s and
+ display the result on the standard output. Does not
+ store the results in the history list. Each _a_r_g must be
quoted to disable normal history expansion.
- --ss Store the _a_r_g_s in the history list as a single entry.
- The last command in the history list is removed before
+ --ss Store the _a_r_g_s in the history list as a single entry.
+ The last command in the history list is removed before
the _a_r_g_s are added.
- If the HHIISSTTTTIIMMEEFFOORRMMAATT is set, the time stamp information associ-
- ated with each history entry is written to the history file,
- marked with the history comment character. When the history
- file is read, lines beginning with the history comment character
- followed immediately by a digit are interpreted as timestamps
- for the previous history line. The return value is 0 unless an
- invalid option is encountered, an error occurs while reading or
- writing the history file, an invalid _o_f_f_s_e_t is supplied as an
- argument to --dd, or the history expansion supplied as an argument
- to --pp fails.
+ If the HHIISSTTTTIIMMEEFFOORRMMAATT variable is set, the time stamp informa-
+ tion associated with each history entry is written to the his-
+ tory file, marked with the history comment character. When the
+ history file is read, lines beginning with the history comment
+ character followed immediately by a digit are interpreted as
+ timestamps for the previous history line. The return value is 0
+ unless an invalid option is encountered, an error occurs while
+ reading or writing the history file, an invalid _o_f_f_s_e_t is sup-
+ plied as an argument to --dd, or the history expansion supplied as
+ an argument to --pp fails.
jjoobbss [--llnnpprrss] [ _j_o_b_s_p_e_c ... ]
jjoobbss --xx _c_o_m_m_a_n_d [ _a_r_g_s ... ]
The first form lists the active jobs. The options have the fol-
lowing meanings:
--ll List process IDs in addition to the normal information.
- --pp List only the process ID of the job's process group
+ --pp List only the process ID of the job's process group
leader.
- --nn Display information only about jobs that have changed
- status since the user was last notified of their status.
+ --nn Display information only about jobs that have changed
+ status since the user was last notified of their status.
--rr Restrict output to running jobs.
--ss Restrict output to stopped jobs.
- If _j_o_b_s_p_e_c is given, output is restricted to information about
- that job. The return status is 0 unless an invalid option is
+ If _j_o_b_s_p_e_c is given, output is restricted to information about
+ that job. The return status is 0 unless an invalid option is
encountered or an invalid _j_o_b_s_p_e_c is supplied.
If the --xx option is supplied, jjoobbss replaces any _j_o_b_s_p_e_c found in
- _c_o_m_m_a_n_d or _a_r_g_s with the corresponding process group ID, and
+ _c_o_m_m_a_n_d or _a_r_g_s with the corresponding process group ID, and
executes _c_o_m_m_a_n_d passing it _a_r_g_s, returning its exit status.
kkiillll [--ss _s_i_g_s_p_e_c | --nn _s_i_g_n_u_m | --_s_i_g_s_p_e_c] [_p_i_d | _j_o_b_s_p_e_c] ...
kkiillll --ll [_s_i_g_s_p_e_c | _e_x_i_t___s_t_a_t_u_s]
- Send the signal named by _s_i_g_s_p_e_c or _s_i_g_n_u_m to the processes
- named by _p_i_d or _j_o_b_s_p_e_c. _s_i_g_s_p_e_c is either a case-insensitive
- signal name such as SSIIGGKKIILLLL (with or without the SSIIGG prefix) or
- a signal number; _s_i_g_n_u_m is a signal number. If _s_i_g_s_p_e_c is not
- present, then SSIIGGTTEERRMM is assumed. An argument of --ll lists the
- signal names. If any arguments are supplied when --ll is given,
- the names of the signals corresponding to the arguments are
+ Send the signal named by _s_i_g_s_p_e_c or _s_i_g_n_u_m to the processes
+ named by _p_i_d or _j_o_b_s_p_e_c. _s_i_g_s_p_e_c is either a case-insensitive
+ signal name such as SSIIGGKKIILLLL (with or without the SSIIGG prefix) or
+ a signal number; _s_i_g_n_u_m is a signal number. If _s_i_g_s_p_e_c is not
+ present, then SSIIGGTTEERRMM is assumed. An argument of --ll lists the
+ signal names. If any arguments are supplied when --ll is given,
+ the names of the signals corresponding to the arguments are
listed, and the return status is 0. The _e_x_i_t___s_t_a_t_u_s argument to
- --ll is a number specifying either a signal number or the exit
- status of a process terminated by a signal. kkiillll returns true
- if at least one signal was successfully sent, or false if an
+ --ll is a number specifying either a signal number or the exit
+ status of a process terminated by a signal. kkiillll returns true
+ if at least one signal was successfully sent, or false if an
error occurs or an invalid option is encountered.
lleett _a_r_g [_a_r_g ...]
Each _a_r_g is an arithmetic expression to be evaluated (see AARRIITTHH--
- MMEETTIICC EEVVAALLUUAATTIIOONN). If the last _a_r_g evaluates to 0, lleett returns
- 1; 0 is returned otherwise.
+ MMEETTIICC EEVVAALLUUAATTIIOONN above). If the last _a_r_g evaluates to 0, lleett
+ returns 1; 0 is returned otherwise.
llooccaall [_o_p_t_i_o_n] [_n_a_m_e[=_v_a_l_u_e] ...]
- For each argument, a local variable named _n_a_m_e is created, and
- assigned _v_a_l_u_e. The _o_p_t_i_o_n can be any of the options accepted
+ For each argument, a local variable named _n_a_m_e is created, and
+ assigned _v_a_l_u_e. The _o_p_t_i_o_n can be any of the options accepted
by ddeeccllaarree. When llooccaall is used within a function, it causes the
- variable _n_a_m_e to have a visible scope restricted to that func-
+ variable _n_a_m_e to have a visible scope restricted to that func-
tion and its children. With no operands, llooccaall writes a list of
- local variables to the standard output. It is an error to use
+ local variables to the standard output. It is an error to use
llooccaall when not within a function. The return status is 0 unless
- llooccaall is used outside a function, an invalid _n_a_m_e is supplied,
+ llooccaall is used outside a function, an invalid _n_a_m_e is supplied,
or _n_a_m_e is a readonly variable.
llooggoouutt Exit a login shell.
- mmaappffiillee [--nn _c_o_u_n_t] [--OO _o_r_i_g_i_n] [--ss _c_o_u_n_t] [--tt] [--uu _f_d] [--CC _c_a_l_l_b_a_c_k]
+ mmaappffiillee [--nn _c_o_u_n_t] [--OO _o_r_i_g_i_n] [--ss _c_o_u_n_t] [--tt] [--uu _f_d] [--CC _c_a_l_l_b_a_c_k]
[--cc _q_u_a_n_t_u_m] [_a_r_r_a_y]
- rreeaaddaarrrraayy [--nn _c_o_u_n_t] [--OO _o_r_i_g_i_n] [--ss _c_o_u_n_t] [--tt] [--uu _f_d] [--CC _c_a_l_l_b_a_c_k]
+ rreeaaddaarrrraayy [--nn _c_o_u_n_t] [--OO _o_r_i_g_i_n] [--ss _c_o_u_n_t] [--tt] [--uu _f_d] [--CC _c_a_l_l_b_a_c_k]
[--cc _q_u_a_n_t_u_m] [_a_r_r_a_y]
- Read lines from the standard input into array variable _a_r_r_a_y, or
- from file descriptor _f_d if the --uu option is supplied. The vari-
- able MMAAPPFFIILLEE is the default _a_r_r_a_y. Options, if supplied, have
- the following meanings:
- --nn Copy at most _c_o_u_n_t lines. If _c_o_u_n_t is 0, all lines are
+ Read lines from the standard input into the indexed array vari-
+ able _a_r_r_a_y, or from file descriptor _f_d if the --uu option is sup-
+ plied. The variable MMAAPPFFIILLEE is the default _a_r_r_a_y. Options, if
+ supplied, have the following meanings:
+ --nn Copy at most _c_o_u_n_t lines. If _c_o_u_n_t is 0, all lines are
copied.
- --OO Begin assigning to _a_r_r_a_y at index _o_r_i_g_i_n. The default
+ --OO Begin assigning to _a_r_r_a_y at index _o_r_i_g_i_n. The default
index is 0.
--ss Discard the first _c_o_u_n_t lines read.
- --tt Remove a trailing line from each line read.
- --uu Read lines from file descriptor _f_d instead of the stan-
+ --tt Remove a trailing newline from each line read.
+ --uu Read lines from file descriptor _f_d instead of the stan-
dard input.
- --CC Evaluate _c_a_l_l_b_a_c_k each time _q_u_a_n_t_u_m lines are read. The
+ --CC Evaluate _c_a_l_l_b_a_c_k each time _q_u_a_n_t_u_m lines are read. The
--cc option specifies _q_u_a_n_t_u_m.
- --cc Specify the number of lines read between each call to
+ --cc Specify the number of lines read between each call to
_c_a_l_l_b_a_c_k.
- If --CC is specified without --cc, the default quantum is 5000.
+ If --CC is specified without --cc, the default quantum is 5000.
When _c_a_l_l_b_a_c_k is evaluated, it is supplied the index of the next
- array element to be assigned as an additional argument. _c_a_l_l_-
- _b_a_c_k is evaluated after the line is read but before the array
+ array element to be assigned as an additional argument. _c_a_l_l_-
+ _b_a_c_k is evaluated after the line is read but before the array
element is assigned.
- If not supplied with an explicit origin, mmaappffiillee will clear
+ If not supplied with an explicit origin, mmaappffiillee will clear
_a_r_r_a_y before assigning to it.
- mmaappffiillee returns successfully unless an invalid option or option
- argument is supplied, or _a_r_r_a_y is invalid or unassignable.
+ mmaappffiillee returns successfully unless an invalid option or option
+ argument is supplied, _a_r_r_a_y is invalid or unassignable, or if
+ _a_r_r_a_y is not an indexed array.
ppooppdd [-nn] [+_n] [-_n]
Removes entries from the directory stack. With no arguments,
@@ -846,8 +860,8 @@ BBAASSHH BBUUIILLTTIINN CCOOMMMMAANNDDSS
occurs while reading the name of the current directory or an
invalid option is supplied.
- rreeaadd [--eerrss] [--aa _a_n_a_m_e] [--dd _d_e_l_i_m] [-- _t_e_x_t] [--nn _n_c_h_a_r_s] [--pp _p_r_o_m_p_t] [--tt
- _t_i_m_e_o_u_t] [--uu _f_d] [_n_a_m_e ...]
+ rreeaadd [--eerrss] [--aa _a_n_a_m_e] [--dd _d_e_l_i_m] [--ii _t_e_x_t] [--nn _n_c_h_a_r_s] [--NN _n_c_h_a_r_s] [--pp
+ _p_r_o_m_p_t] [--tt _t_i_m_e_o_u_t] [--uu _f_d] [_n_a_m_e ...]
One line is read from the standard input, or from the file
descriptor _f_d supplied as an argument to the --uu option, and the
first word is assigned to the first _n_a_m_e, the second word to the
@@ -876,93 +890,107 @@ BBAASSHH BBUUIILLTTIINN CCOOMMMMAANNDDSS
placed into the editing buffer before editing begins.
--nn _n_c_h_a_r_s
rreeaadd returns after reading _n_c_h_a_r_s characters rather than
- waiting for a complete line of input.
+ waiting for a complete line of input, but honor a delim-
+ iter if fewer than _n_c_h_a_r_s characters are read before the
+ delimiter.
+ --NN _n_c_h_a_r_s
+ rreeaadd returns after reading exactly _n_c_h_a_r_s characters
+ rather than waiting for a complete line of input, unless
+ EOF is encountered or rreeaadd times out. Delimiter charac-
+ ters encountered in the input are not treated specially
+ and do not cause rreeaadd to return until _n_c_h_a_r_s characters
+ are read.
--pp _p_r_o_m_p_t
Display _p_r_o_m_p_t on standard error, without a trailing new-
line, before attempting to read any input. The prompt is
displayed only if input is coming from a terminal.
--rr Backslash does not act as an escape character. The back-
- slash is considered to be part of the line. In particu-
- lar, a backslash-newline pair may not be used as a line
+ slash is considered to be part of the line. In particu-
+ lar, a backslash-newline pair may not be used as a line
continuation.
--ss Silent mode. If input is coming from a terminal, charac-
ters are not echoed.
--tt _t_i_m_e_o_u_t
- Cause rreeaadd to time out and return failure if a complete
- line of input is not read within _t_i_m_e_o_u_t seconds. _t_i_m_e_-
- _o_u_t may be a decimal number with a fractional portion
- following the decimal point. This option is only effec-
- tive if rreeaadd is reading input from a terminal, pipe, or
- other special file; it has no effect when reading from
- regular files. If _t_i_m_e_o_u_t is 0, rreeaadd returns success if
- input is available on the specified file descriptor,
- failure otherwise. The exit status is greater than 128
+ Cause rreeaadd to time out and return failure if a complete
+ line of input is not read within _t_i_m_e_o_u_t seconds. _t_i_m_e_-
+ _o_u_t may be a decimal number with a fractional portion
+ following the decimal point. This option is only effec-
+ tive if rreeaadd is reading input from a terminal, pipe, or
+ other special file; it has no effect when reading from
+ regular files. If _t_i_m_e_o_u_t is 0, rreeaadd returns success if
+ input is available on the specified file descriptor,
+ failure otherwise. The exit status is greater than 128
if the timeout is exceeded.
--uu _f_d Read input from file descriptor _f_d.
If no _n_a_m_e_s are supplied, the line read is assigned to the vari-
- able RREEPPLLYY. The return code is zero, unless end-of-file is
- encountered, rreeaadd times out (in which case the return code is
- greater than 128), or an invalid file descriptor is supplied as
+ able RREEPPLLYY. The return code is zero, unless end-of-file is
+ encountered, rreeaadd times out (in which case the return code is
+ greater than 128), or an invalid file descriptor is supplied as
the argument to --uu.
rreeaaddoonnllyy [--aaAAppff] [_n_a_m_e[=_w_o_r_d] ...]
- The given _n_a_m_e_s are marked readonly; the values of these _n_a_m_e_s
- may not be changed by subsequent assignment. If the --ff option
- is supplied, the functions corresponding to the _n_a_m_e_s are so
- marked. The --aa option restricts the variables to indexed
- arrays; the --AA option restricts the variables to associative
- arrays. If no _n_a_m_e arguments are given, or if the --pp option is
- supplied, a list of all readonly names is printed. The --pp
- option causes output to be displayed in a format that may be
- reused as input. If a variable name is followed by =_w_o_r_d, the
- value of the variable is set to _w_o_r_d. The return status is 0
+ The given _n_a_m_e_s are marked readonly; the values of these _n_a_m_e_s
+ may not be changed by subsequent assignment. If the --ff option
+ is supplied, the functions corresponding to the _n_a_m_e_s are so
+ marked. The --aa option restricts the variables to indexed
+ arrays; the --AA option restricts the variables to associative
+ arrays. If no _n_a_m_e arguments are given, or if the --pp option is
+ supplied, a list of all readonly names is printed. The --pp
+ option causes output to be displayed in a format that may be
+ reused as input. If a variable name is followed by =_w_o_r_d, the
+ value of the variable is set to _w_o_r_d. The return status is 0
unless an invalid option is encountered, one of the _n_a_m_e_s is not
- a valid shell variable name, or --ff is supplied with a _n_a_m_e that
+ a valid shell variable name, or --ff is supplied with a _n_a_m_e that
is not a function.
rreettuurrnn [_n]
- Causes a function to exit with the return value specified by _n.
- If _n is omitted, the return status is that of the last command
- executed in the function body. If used outside a function, but
- during execution of a script by the .. (ssoouurrccee) command, it
+ Causes a function to exit with the return value specified by _n.
+ If _n is omitted, the return status is that of the last command
+ executed in the function body. If used outside a function, but
+ during execution of a script by the .. (ssoouurrccee) command, it
causes the shell to stop executing that script and return either
- _n or the exit status of the last command executed within the
- script as the exit status of the script. If used outside a
- function and not during execution of a script by .., the return
+ _n or the exit status of the last command executed within the
+ script as the exit status of the script. If used outside a
+ function and not during execution of a script by .., the return
status is false. Any command associated with the RREETTUURRNN trap is
- executed before execution resumes after the function or script.
+ executed before execution resumes after the function or script.
sseett [----aabbeeffhhkkmmnnppttuuvvxxBBCCEEHHPPTT] [--oo _o_p_t_i_o_n] [_a_r_g ...]
sseett [++aabbeeffhhkkmmnnppttuuvvxxBBCCEEHHPPTT] [++oo _o_p_t_i_o_n] [_a_r_g ...]
- Without options, the name and value of each shell variable are
+ Without options, the name and value of each shell variable are
displayed in a format that can be reused as input for setting or
resetting the currently-set variables. Read-only variables can-
- not be reset. In _p_o_s_i_x _m_o_d_e, only shell variables are listed.
- The output is sorted according to the current locale. When
- options are specified, they set or unset shell attributes. Any
- arguments remaining after option processing are treated as val-
+ not be reset. In _p_o_s_i_x _m_o_d_e, only shell variables are listed.
+ The output is sorted according to the current locale. When
+ options are specified, they set or unset shell attributes. Any
+ arguments remaining after option processing are treated as val-
ues for the positional parameters and are assigned, in order, to
- $$11, $$22, ...... $$_n. Options, if specified, have the following
+ $$11, $$22, ...... $$_n. Options, if specified, have the following
meanings:
- --aa Automatically mark variables and functions which are
- modified or created for export to the environment of
+ --aa Automatically mark variables and functions which are
+ modified or created for export to the environment of
subsequent commands.
- --bb Report the status of terminated background jobs immedi-
+ --bb Report the status of terminated background jobs immedi-
ately, rather than before the next primary prompt. This
is effective only when job control is enabled.
- --ee Exit immediately if a _s_i_m_p_l_e _c_o_m_m_a_n_d (see SSHHEELLLL GGRRAAMMMMAARR
+ --ee Exit immediately if a _p_i_p_e_l_i_n_e (which may consist of a
+ single _s_i_m_p_l_e _c_o_m_m_a_n_d), a _s_u_b_s_h_e_l_l command enclosed in
+ parentheses, or one of the commands executed as part of
+ a command list enclosed by braces (see SSHHEELLLL GGRRAAMMMMAARR
above) exits with a non-zero status. The shell does not
exit if the command that fails is part of the command
list immediately following a wwhhiillee or uunnttiill keyword,
- part of the test in an iiff statement, part of a command
- executed in a &&&& or |||| list, any command in a pipeline
- but the last, or if the command's return value is being
- inverted via !!. Failing simple commands that are part
- of shell functions or command lists enclosed in braces
- or parentheses satisfying the above conditions do not
- cause the shell to exit. A trap on EERRRR, if set, is exe-
- cuted before the shell exits.
+ part of the test following the iiff or eelliiff reserved
+ words, part of any command executed in a &&&& or |||| list
+ except the command following the final &&&& or ||||, any
+ command in a pipeline but the last, or if the command's
+ return value is being inverted with !!. A trap on EERRRR,
+ if set, is executed before the shell exits. This option
+ applies to the shell environment and each subshell envi-
+ ronment separately (see CCOOMMMMAANNDD EEXXEECCUUTTIIOONN EENNVVIIRROONNMMEENNTT
+ above), and may cause subshells to exit before executing
+ all the commands in the subshell.
--ff Disable pathname expansion.
--hh Remember the location of commands as they are looked up
for execution. This is enabled by default.
@@ -989,11 +1017,11 @@ BBAASSHH BBUUIILLTTIINN CCOOMMMMAANNDDSS
is interactive, unless the shell is started with
the ----nnooeeddiittiinngg option. This also affects the
editing interface used for rreeaadd --ee.
+ eerrrreexxiitt Same as --ee.
eerrrrttrraaccee
Same as --EE.
ffuunnccttrraaccee
Same as --TT.
- eerrrreexxiitt Same as --ee.
hhaasshhaallll Same as --hh.
hhiisstteexxppaanndd
Same as --HH.
@@ -1040,20 +1068,22 @@ BBAASSHH BBUUIILLTTIINN CCOOMMMMAANNDDSS
--pp Turn on _p_r_i_v_i_l_e_g_e_d mode. In this mode, the $$EENNVV and
$$BBAASSHH__EENNVV files are not processed, shell functions are
not inherited from the environment, and the SSHHEELLLLOOPPTTSS,
- CCDDPPAATTHH, and GGLLOOBBIIGGNNOORREE variables, if they appear in the
- environment, are ignored. If the shell is started with
- the effective user (group) id not equal to the real user
- (group) id, and the --pp option is not supplied, these
- actions are taken and the effective user id is set to
- the real user id. If the --pp option is supplied at
- startup, the effective user id is not reset. Turning
- this option off causes the effective user and group ids
- to be set to the real user and group ids.
+ BBAASSHHOOPPTTSS, CCDDPPAATTHH, and GGLLOOBBIIGGNNOORREE variables, if they
+ appear in the environment, are ignored. If the shell is
+ started with the effective user (group) id not equal to
+ the real user (group) id, and the --pp option is not sup-
+ plied, these actions are taken and the effective user id
+ is set to the real user id. If the --pp option is sup-
+ plied at startup, the effective user id is not reset.
+ Turning this option off causes the effective user and
+ group ids to be set to the real user and group ids.
--tt Exit after reading and executing one command.
- --uu Treat unset variables as an error when performing param-
- eter expansion. If expansion is attempted on an unset
- variable, the shell prints an error message, and, if not
- interactive, exits with a non-zero status.
+ --uu Treat unset variables and parameters other than the spe-
+ cial parameters "@" and "*" as an error when performing
+ parameter expansion. If expansion is attempted on an
+ unset variable or parameter, the shell prints an error
+ message, and, if not interactive, exits with a non-zero
+ status.
--vv Print shell input lines as they are read.
--xx After expanding each _s_i_m_p_l_e _c_o_m_m_a_n_d, ffoorr command, ccaassee
command, sseelleecctt command, or arithmetic ffoorr command, dis-
@@ -1172,61 +1202,70 @@ BBAASSHH BBUUIILLTTIINN CCOOMMMMAANNDDSS
If set, bbaasshh changes its behavior to that of version 3.1
with respect to quoted arguments to the conditional com-
mand's =~ operator.
+ ccoommppaatt3322
+ If set, bbaasshh changes its behavior to that of version 3.2
+ with respect to locale-specific string comparison when
+ using the conditional command's < and > operators.
+ ccoommppaatt4400
+ If set, bbaasshh changes its behavior to that of version 4.0
+ with respect to locale-specific string comparison when
+ using the conditional command's < and > operators and
+ the effect of interrupting a command list.
ddiirrssppeellll
- If set, bbaasshh attempts spelling correction on directory
- names during word completion if the directory name ini-
+ If set, bbaasshh attempts spelling correction on directory
+ names during word completion if the directory name ini-
tially supplied does not exist.
- ddoottgglloobb If set, bbaasshh includes filenames beginning with a `.' in
+ ddoottgglloobb If set, bbaasshh includes filenames beginning with a `.' in
the results of pathname expansion.
eexxeeccffaaiill
If set, a non-interactive shell will not exit if it can-
- not execute the file specified as an argument to the
- eexxeecc builtin command. An interactive shell does not
+ not execute the file specified as an argument to the
+ eexxeecc builtin command. An interactive shell does not
exit if eexxeecc fails.
eexxppaanndd__aalliiaasseess
- If set, aliases are expanded as described above under
+ If set, aliases are expanded as described above under
AALLIIAASSEESS. This option is enabled by default for interac-
tive shells.
eexxttddeebbuugg
- If set, behavior intended for use by debuggers is
+ If set, behavior intended for use by debuggers is
enabled:
11.. The --FF option to the ddeeccllaarree builtin displays the
source file name and line number corresponding to
each function name supplied as an argument.
- 22.. If the command run by the DDEEBBUUGG trap returns a
- non-zero value, the next command is skipped and
+ 22.. If the command run by the DDEEBBUUGG trap returns a
+ non-zero value, the next command is skipped and
not executed.
- 33.. If the command run by the DDEEBBUUGG trap returns a
- value of 2, and the shell is executing in a sub-
- routine (a shell function or a shell script exe-
- cuted by the .. or ssoouurrccee builtins), a call to
+ 33.. If the command run by the DDEEBBUUGG trap returns a
+ value of 2, and the shell is executing in a sub-
+ routine (a shell function or a shell script exe-
+ cuted by the .. or ssoouurrccee builtins), a call to
rreettuurrnn is simulated.
- 44.. BBAASSHH__AARRGGCC and BBAASSHH__AARRGGVV are updated as described
+ 44.. BBAASSHH__AARRGGCC and BBAASSHH__AARRGGVV are updated as described
in their descriptions above.
- 55.. Function tracing is enabled: command substitu-
+ 55.. Function tracing is enabled: command substitu-
tion, shell functions, and subshells invoked with
(( _c_o_m_m_a_n_d )) inherit the DDEEBBUUGG and RREETTUURRNN traps.
- 66.. Error tracing is enabled: command substitution,
- shell functions, and subshells invoked with ((
+ 66.. Error tracing is enabled: command substitution,
+ shell functions, and subshells invoked with ((
_c_o_m_m_a_n_d )) inherit the EERRRROORR trap.
eexxttgglloobb If set, the extended pattern matching features described
above under PPaatthhnnaammee EExxppaannssiioonn are enabled.
eexxttqquuoottee
- If set, $$'_s_t_r_i_n_g' and $$"_s_t_r_i_n_g" quoting is performed
- within $${{_p_a_r_a_m_e_t_e_r}} expansions enclosed in double
+ If set, $$'_s_t_r_i_n_g' and $$"_s_t_r_i_n_g" quoting is performed
+ within $${{_p_a_r_a_m_e_t_e_r}} expansions enclosed in double
quotes. This option is enabled by default.
ffaaiillgglloobb
- If set, patterns which fail to match filenames during
+ If set, patterns which fail to match filenames during
pathname expansion result in an expansion error.
ffoorrccee__ffiiggnnoorree
- If set, the suffixes specified by the FFIIGGNNOORREE shell
- variable cause words to be ignored when performing word
+ If set, the suffixes specified by the FFIIGGNNOORREE shell
+ variable cause words to be ignored when performing word
completion even if the ignored words are the only possi-
ble completions. See SSHHEELLLL VVAARRIIAABBLLEESS above for a
- description of FFIIGGNNOORREE. This option is enabled by
+ description of FFIIGGNNOORREE. This option is enabled by
default.
gglloobbssttaarr
- If set, the pattern **** used in a filename expansion con-
+ If set, the pattern **** used in a pathname expansion con-
text will match a files and zero or more directories and
subdirectories. If the pattern is followed by a //, only
directories and subdirectories match.
@@ -1234,58 +1273,58 @@ BBAASSHH BBUUIILLTTIINN CCOOMMMMAANNDDSS
If set, shell error messages are written in the standard
GNU error message format.
hhiissttaappppeenndd
- If set, the history list is appended to the file named
- by the value of the HHIISSTTFFIILLEE variable when the shell
+ If set, the history list is appended to the file named
+ by the value of the HHIISSTTFFIILLEE variable when the shell
exits, rather than overwriting the file.
hhiissttrreeeeddiitt
- If set, and rreeaaddlliinnee is being used, a user is given the
+ If set, and rreeaaddlliinnee is being used, a user is given the
opportunity to re-edit a failed history substitution.
hhiissttvveerriiffyy
- If set, and rreeaaddlliinnee is being used, the results of his-
- tory substitution are not immediately passed to the
- shell parser. Instead, the resulting line is loaded
+ If set, and rreeaaddlliinnee is being used, the results of his-
+ tory substitution are not immediately passed to the
+ shell parser. Instead, the resulting line is loaded
into the rreeaaddlliinnee editing buffer, allowing further modi-
fication.
hhoossttccoommpplleettee
If set, and rreeaaddlliinnee is being used, bbaasshh will attempt to
- perform hostname completion when a word containing a @@
- is being completed (see CCoommpplleettiinngg under RREEAADDLLIINNEE
+ perform hostname completion when a word containing a @@
+ is being completed (see CCoommpplleettiinngg under RREEAADDLLIINNEE
above). This is enabled by default.
hhuuppoonneexxiitt
If set, bbaasshh will send SSIIGGHHUUPP to all jobs when an inter-
active login shell exits.
iinntteerraaccttiivvee__ccoommmmeennttss
If set, allow a word beginning with ## to cause that word
- and all remaining characters on that line to be ignored
- in an interactive shell (see CCOOMMMMEENNTTSS above). This
+ and all remaining characters on that line to be ignored
+ in an interactive shell (see CCOOMMMMEENNTTSS above). This
option is enabled by default.
- lliitthhiisstt If set, and the ccmmddhhiisstt option is enabled, multi-line
+ lliitthhiisstt If set, and the ccmmddhhiisstt option is enabled, multi-line
commands are saved to the history with embedded newlines
rather than using semicolon separators where possible.
llooggiinn__sshheellll
- The shell sets this option if it is started as a login
- shell (see IINNVVOOCCAATTIIOONN above). The value may not be
+ The shell sets this option if it is started as a login
+ shell (see IINNVVOOCCAATTIIOONN above). The value may not be
changed.
mmaaiillwwaarrnn
- If set, and a file that bbaasshh is checking for mail has
- been accessed since the last time it was checked, the
- message ``The mail in _m_a_i_l_f_i_l_e has been read'' is dis-
+ If set, and a file that bbaasshh is checking for mail has
+ been accessed since the last time it was checked, the
+ message ``The mail in _m_a_i_l_f_i_l_e has been read'' is dis-
played.
nnoo__eemmppttyy__ccmmdd__ccoommpplleettiioonn
- If set, and rreeaaddlliinnee is being used, bbaasshh will not
+ If set, and rreeaaddlliinnee is being used, bbaasshh will not
attempt to search the PPAATTHH for possible completions when
completion is attempted on an empty line.
nnooccaasseegglloobb
- If set, bbaasshh matches filenames in a case-insensitive
+ If set, bbaasshh matches filenames in a case-insensitive
fashion when performing pathname expansion (see PPaatthhnnaammee
EExxppaannssiioonn above).
nnooccaasseemmaattcchh
- If set, bbaasshh matches patterns in a case-insensitive
+ If set, bbaasshh matches patterns in a case-insensitive
fashion when performing matching while executing ccaassee or
[[[[ conditional commands.
nnuullllgglloobb
- If set, bbaasshh allows patterns which match no files (see
- PPaatthhnnaammee EExxppaannssiioonn above) to expand to a null string,
+ If set, bbaasshh allows patterns which match no files (see
+ PPaatthhnnaammee EExxppaannssiioonn above) to expand to a null string,
rather than themselves.
pprrooggccoommpp
If set, the programmable completion facilities (see PPrroo--
@@ -1293,47 +1332,47 @@ BBAASSHH BBUUIILLTTIINN CCOOMMMMAANNDDSS
enabled by default.
pprroommppttvvaarrss
If set, prompt strings undergo parameter expansion, com-
- mand substitution, arithmetic expansion, and quote
- removal after being expanded as described in PPRROOMMPPTTIINNGG
+ mand substitution, arithmetic expansion, and quote
+ removal after being expanded as described in PPRROOMMPPTTIINNGG
above. This option is enabled by default.
rreessttrriicctteedd__sshheellll
- The shell sets this option if it is started in
+ The shell sets this option if it is started in
restricted mode (see RREESSTTRRIICCTTEEDD SSHHEELLLL below). The value
- may not be changed. This is not reset when the startup
- files are executed, allowing the startup files to dis-
+ may not be changed. This is not reset when the startup
+ files are executed, allowing the startup files to dis-
cover whether or not a shell is restricted.
sshhiifftt__vveerrbboossee
- If set, the sshhiifftt builtin prints an error message when
+ If set, the sshhiifftt builtin prints an error message when
the shift count exceeds the number of positional parame-
ters.
ssoouurrcceeppaatthh
If set, the ssoouurrccee (..) builtin uses the value of PPAATTHH to
- find the directory containing the file supplied as an
+ find the directory containing the file supplied as an
argument. This option is enabled by default.
xxppgg__eecchhoo
- If set, the eecchhoo builtin expands backslash-escape
+ If set, the eecchhoo builtin expands backslash-escape
sequences by default.
ssuussppeenndd [--ff]
- Suspend the execution of this shell until it receives a SSIIGGCCOONNTT
+ Suspend the execution of this shell until it receives a SSIIGGCCOONNTT
signal. A login shell cannot be suspended; the --ff option can be
used to override this and force the suspension. The return sta-
- tus is 0 unless the shell is a login shell and --ff is not sup-
+ tus is 0 unless the shell is a login shell and --ff is not sup-
plied, or if job control is not enabled.
tteesstt _e_x_p_r
[[ _e_x_p_r ]]
- Return a status of 0 or 1 depending on the evaluation of the
- conditional expression _e_x_p_r. Each operator and operand must be
- a separate argument. Expressions are composed of the primaries
- described above under CCOONNDDIITTIIOONNAALL EEXXPPRREESSSSIIOONNSS. tteesstt does not
+ Return a status of 0 or 1 depending on the evaluation of the
+ conditional expression _e_x_p_r. Each operator and operand must be
+ a separate argument. Expressions are composed of the primaries
+ described above under CCOONNDDIITTIIOONNAALL EEXXPPRREESSSSIIOONNSS. tteesstt does not
accept any options, nor does it accept and ignore an argument of
---- as signifying the end of options.
- Expressions may be combined using the following operators,
+ Expressions may be combined using the following operators,
listed in decreasing order of precedence. The evaluation
depends on the number of arguments; see below.
!! _e_x_p_r True if _e_x_p_r is false.
(( _e_x_p_r ))
- Returns the value of _e_x_p_r. This may be used to override
+ Returns the value of _e_x_p_r. This may be used to override
the normal precedence of operators.
_e_x_p_r_1 -aa _e_x_p_r_2
True if both _e_x_p_r_1 and _e_x_p_r_2 are true.
@@ -1350,73 +1389,78 @@ BBAASSHH BBUUIILLTTIINN CCOOMMMMAANNDDSS
null.
2 arguments
If the first argument is !!, the expression is true if and
- only if the second argument is null. If the first argu-
- ment is one of the unary conditional operators listed
- above under CCOONNDDIITTIIOONNAALL EEXXPPRREESSSSIIOONNSS, the expression is
+ only if the second argument is null. If the first argu-
+ ment is one of the unary conditional operators listed
+ above under CCOONNDDIITTIIOONNAALL EEXXPPRREESSSSIIOONNSS, the expression is
true if the unary test is true. If the first argument is
not a valid unary conditional operator, the expression is
false.
3 arguments
- If the second argument is one of the binary conditional
+ If the second argument is one of the binary conditional
operators listed above under CCOONNDDIITTIIOONNAALL EEXXPPRREESSSSIIOONNSS, the
result of the expression is the result of the binary test
- using the first and third arguments as operands. The --aa
- and --oo operators are considered binary operators when
- there are three arguments. If the first argument is !!,
- the value is the negation of the two-argument test using
+ using the first and third arguments as operands. The --aa
+ and --oo operators are considered binary operators when
+ there are three arguments. If the first argument is !!,
+ the value is the negation of the two-argument test using
the second and third arguments. If the first argument is
exactly (( and the third argument is exactly )), the result
- is the one-argument test of the second argument. Other-
+ is the one-argument test of the second argument. Other-
wise, the expression is false.
4 arguments
If the first argument is !!, the result is the negation of
- the three-argument expression composed of the remaining
+ the three-argument expression composed of the remaining
arguments. Otherwise, the expression is parsed and eval-
- uated according to precedence using the rules listed
+ uated according to precedence using the rules listed
above.
5 or more arguments
- The expression is parsed and evaluated according to
+ The expression is parsed and evaluated according to
precedence using the rules listed above.
- ttiimmeess Print the accumulated user and system times for the shell and
+ 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
- receives signal(s) _s_i_g_s_p_e_c. If _a_r_g 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_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 commands associated with each signal. The --ll option
- causes the shell to print a list of signal names and their cor-
- responding 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 SIG prefix is optional. 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 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, 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 EERRRR,
- the command _a_r_g is executed whenever a simple command has a
- non-zero exit status, subject to the following conditions. The
- EERRRR trap is not executed if the failed command is part of the
- command list immediately following a wwhhiillee or uunnttiill keyword,
- part of the test in an _i_f statement, part of a command executed
- in a &&&& or |||| list, or if the command's return value is being
- inverted via !!. These are the same conditions obeyed by the
- eerrrreexxiitt option. If a _s_i_g_s_p_e_c is RREETTUURRNN, the command _a_r_g is exe-
- cuted each time a shell function or a script executed with the ..
- or ssoouurrccee builtins finishes executing. 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 child process when it is created. The return status is false
- if any _s_i_g_s_p_e_c is invalid; otherwise ttrraapp returns true.
+ The command _a_r_g is to be read and executed when the shell
+ receives signal(s) _s_i_g_s_p_e_c. If _a_r_g 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_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 commands associated with each signal. The --ll option
+ causes the shell to print a list of signal names and their cor-
+ responding 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 SIG prefix is optional.
+
+ 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 a _s_i_g_s_p_e_c is EERRRR, the command _a_r_g is executed whenever a sim-
+ ple command has a non-zero exit status, subject to the following
+ conditions. The EERRRR trap is not executed if the failed command
+ is part of the command list immediately following a wwhhiillee or
+ uunnttiill keyword, part of the test in an _i_f statement, part of a
+ command executed in a &&&& or |||| list, or if the command's return
+ value is being inverted via !!. These are the same conditions
+ obeyed by the eerrrreexxiitt 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. 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
@@ -1464,7 +1508,8 @@ BBAASSHH BBUUIILLTTIINN CCOOMMMMAANNDDSS
children
--ii The maximum number of pending signals
--ll The maximum size that may be locked into memory
- --mm The maximum resident set size
+ --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)
--pp The pipe size in 512-byte blocks (this may not be set)
@@ -1472,58 +1517,58 @@ 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
--xx The maximum number of file locks
--TT The maximum number of threads
If _l_i_m_i_t is given, it is the new value of the specified resource
(the --aa option is display only). If no option is given, then --ff
- is assumed. Values are in 1024-byte increments, except for --tt,
- which is in seconds, --pp, which is in units of 512-byte blocks,
- and --TT, --bb, --nn, and --uu, which are unscaled values. The return
+ is assumed. Values are in 1024-byte increments, except for --tt,
+ which is in seconds, --pp, which is in units of 512-byte blocks,
+ and --TT, --bb, --nn, and --uu, which are unscaled values. 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] [_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 no options are supplied, or the --vv option is given, each _n_a_m_e
- refers to a shell variable. 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. Each unset vari-
- able or function is removed from the environment passed to sub-
- sequent commands. If any of RRAANNDDOOMM, SSEECCOONNDDSS, LLIINNEENNOO, HHIISSTTCCMMDD,
- FFUUNNCCNNAAMMEE, GGRROOUUPPSS, or DDIIRRSSTTAACCKK are unset, they lose their special
- properties, even if they are subsequently reset. The exit sta-
- tus is true unless a _n_a_m_e is readonly.
+ refers to a shell variable. 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. Each unset vari-
+ able or function is removed from the environment passed to sub-
+ sequent commands. If any of CCOOMMPP__WWOORRDDBBRREEAAKKSS, RRAANNDDOOMM, SSEECCOONNDDSS,
+ LLIINNEENNOO, HHIISSTTCCMMDD, FFUUNNCCNNAAMMEE, GGRROOUUPPSS, or DDIIRRSSTTAACCKK are unset, they
+ lose their special properties, even if they are subsequently
+ reset. The exit status is true unless a _n_a_m_e is readonly.
wwaaiitt [_n _._._.]
- Wait for each specified process and return its termination sta-
- tus. Each _n 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 _n is not given, all currently active child pro-
- cesses are waited for, and the return status is zero. If _n
- specifies a non-existent process or job, the return status is
- 127. Otherwise, the return status is the exit status of the
+ Wait for each specified process and return its termination sta-
+ tus. Each _n 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 _n is not given, all currently active child pro-
+ cesses are waited for, and the return status is zero. If _n
+ specifies a non-existent process or job, the return status is
+ 127. Otherwise, the return status is the exit status of the
last process or job waited for.
SSEEEE AALLSSOO