aboutsummaryrefslogtreecommitdiffstats
path: root/doc/builtins.0
diff options
context:
space:
mode:
Diffstat (limited to 'doc/builtins.0')
-rw-r--r--doc/builtins.0704
1 files changed, 376 insertions, 328 deletions
diff --git a/doc/builtins.0 b/doc/builtins.0
index a721e38..5361dd7 100644
--- a/doc/builtins.0
+++ b/doc/builtins.0
@@ -129,7 +129,7 @@ BBAASSHH BBUUIILLTTIINN CCOOMMMMAANNDDSS
ccaalllleerr [_e_x_p_r]
Returns the context of any active subroutine call (a shell func-
- tion or a script executed with the .. or ssoouurrccee builtins. With-
+ tion or a script executed with the .. or ssoouurrccee builtins). With-
out _e_x_p_r, ccaalllleerr displays the line number and source filename of
the current subroutine call. If a non-negative integer is sup-
plied as _e_x_p_r, ccaalllleerr displays the line number, subroutine name,
@@ -140,7 +140,7 @@ BBAASSHH BBUUIILLTTIINN CCOOMMMMAANNDDSS
routine call or _e_x_p_r does not correspond to a valid position in
the call stack.
- ccdd [--LL||--PP] [_d_i_r]
+ ccdd [--LL|[--PP [--ee]]] [_d_i_r]
Change the current directory to _d_i_r. The variable HHOOMMEE is the
default _d_i_r. The variable CCDDPPAATTHH defines the search path for
the directory containing _d_i_r. Alternative directory names in
@@ -150,104 +150,107 @@ BBAASSHH BBUUIILLTTIINN CCOOMMMMAANNDDSS
option says to use the physical directory structure instead of
following symbolic links (see also the --PP option to the sseett
builtin command); the --LL option forces symbolic links to be fol-
- lowed. An argument of -- is equivalent to $$OOLLDDPPWWDD. If a non-
- empty directory name from CCDDPPAATTHH is used, or if -- is the first
- argument, and the directory change is successful, the absolute
- pathname of the new working directory is written to the standard
- output. The return value is true if the directory was success-
+ lowed. If the --ee option is supplied with --PP, and the current
+ working directory cannot be successfully determined after a suc-
+ cessful directory change, ccdd will return an unsuccessful status.
+ An argument of -- is equivalent to $$OOLLDDPPWWDD. If a non-empty
+ directory name from CCDDPPAATTHH is used, or if -- is the first argu-
+ ment, and the directory change is successful, the absolute path-
+ name of the new working directory is written to the standard
+ output. The return value is true if the directory was success-
fully changed; false otherwise.
ccoommmmaanndd [--ppVVvv] _c_o_m_m_a_n_d [_a_r_g ...]
- Run _c_o_m_m_a_n_d with _a_r_g_s suppressing the normal shell function
- lookup. Only builtin commands or commands found in the PPAATTHH are
- executed. If the --pp option is given, the search for _c_o_m_m_a_n_d is
- performed using a default value for PPAATTHH that is guaranteed to
- find all of the standard utilities. If either the --VV or --vv
+ Run _c_o_m_m_a_n_d with _a_r_g_s suppressing the normal shell function
+ lookup. Only builtin commands or commands found in the PPAATTHH are
+ executed. If the --pp option is given, the search for _c_o_m_m_a_n_d is
+ performed using a default value for PPAATTHH that is guaranteed to
+ find all of the standard utilities. If either the --VV or --vv
option is supplied, a description of _c_o_m_m_a_n_d is printed. The --vv
- option causes a single word indicating the command or file name
+ option causes a single word indicating the command or file name
used to invoke _c_o_m_m_a_n_d to be displayed; the --VV option produces a
- more verbose description. If the --VV or --vv option is supplied,
- the exit status is 0 if _c_o_m_m_a_n_d was found, and 1 if not. If
+ more verbose description. If the --VV or --vv option is supplied,
+ the exit status is 0 if _c_o_m_m_a_n_d was found, and 1 if not. If
neither option is supplied and an error occurred or _c_o_m_m_a_n_d can-
- not be found, the exit status is 127. Otherwise, the exit sta-
+ not be found, the exit status is 127. Otherwise, the exit sta-
tus of the ccoommmmaanndd builtin is the exit status of _c_o_m_m_a_n_d.
ccoommppggeenn [_o_p_t_i_o_n] [_w_o_r_d]
- Generate possible completion matches for _w_o_r_d according to the
- _o_p_t_i_o_ns, which may be any option accepted by the ccoommpplleettee
- builtin with the exception of --pp and --rr, and write the matches
- to the standard output. When using the --FF or --CC options, the
- various shell variables set by the programmable completion
+ Generate possible completion matches for _w_o_r_d according to the
+ _o_p_t_i_o_ns, which may be any option accepted by the ccoommpplleettee
+ builtin with the exception of --pp and --rr, and write the matches
+ to the standard output. When using the --FF or --CC options, the
+ various shell variables set by the programmable completion
facilities, while available, will not have useful values.
- The matches will be generated in the same way as if the pro-
- grammable completion code had generated them directly from a
+ The matches will be generated in the same way as if the pro-
+ grammable completion code had generated them directly from a
completion specification with the same flags. If _w_o_r_d is speci-
fied, only those completions matching _w_o_r_d will be displayed.
- The return value is true unless an invalid option is supplied,
+ 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] [--DDEE] [--AA _a_c_t_i_o_n] [--GG _g_l_o_b_-
+ 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 [--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
+ 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-
+ ification for each _n_a_m_e, or, if no _n_a_m_es are supplied, all com-
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
+ 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--
+ The process of applying these completion specifications when
+ word completion is attempted is described above under PPrroo--
ggrraammmmaabbllee CCoommpplleettiioonn.
- Other options, if specified, have the following meanings. The
- arguments to the --GG, --WW, and --XX options (and, if necessary, the
- --PP and --SS options) should be quoted to protect them from expan-
+ Other options, if specified, have the following meanings. The
+ arguments to the --GG, --WW, and --XX options (and, if necessary, the
+ --PP and --SS options) should be quoted to protect them from expan-
sion before the ccoommpplleettee builtin is invoked.
--oo _c_o_m_p_-_o_p_t_i_o_n
- The _c_o_m_p_-_o_p_t_i_o_n controls several aspects of the comp-
- spec's behavior beyond the simple generation of comple-
+ The _c_o_m_p_-_o_p_t_i_o_n controls several aspects of the comp-
+ spec's behavior beyond the simple generation of comple-
tions. _c_o_m_p_-_o_p_t_i_o_n may be one of:
bbaasshhddeeffaauulltt
Perform the rest of the default bbaasshh completions
if the compspec generates no matches.
- ddeeffaauulltt Use readline's default filename completion if
+ ddeeffaauulltt Use readline's default filename completion if
the compspec generates no matches.
ddiirrnnaammeess
- Perform directory name completion if the comp-
+ Perform directory name completion if the comp-
spec generates no matches.
ffiilleennaammeess
- Tell readline that the compspec generates file-
- names, so it can perform any filename-specific
- processing (like adding a slash to directory
- names, quoting special characters, or suppress-
- ing trailing spaces). Intended to be used with
+ Tell readline that the compspec generates file-
+ names, so it can perform any filename-specific
+ processing (like adding a slash to directory
+ names, quoting special characters, or suppress-
+ ing trailing spaces). Intended to be used with
shell functions.
- nnoossppaaccee Tell readline not to append a space (the
- default) to words completed at the end of the
+ nnoossppaaccee Tell readline not to append a space (the
+ default) to words completed at the end of the
line.
pplluussddiirrss
- After any matches defined by the compspec are
- generated, directory name completion is
- attempted and any matches are added to the
+ After any matches defined by the compspec are
+ generated, directory name completion is
+ attempted and any matches are added to the
results of the other actions.
--AA _a_c_t_i_o_n
- The _a_c_t_i_o_n may be one of the following to generate a
+ The _a_c_t_i_o_n may be one of the following to generate a
list of possible completions:
aalliiaass Alias names. May also be specified as --aa.
aarrrraayyvvaarr
Array variable names.
bbiinnddiinngg RReeaaddlliinnee key binding names.
- bbuuiillttiinn Names of shell builtin commands. May also be
+ bbuuiillttiinn Names of shell builtin commands. May also be
specified as --bb.
ccoommmmaanndd Command names. May also be specified as --cc.
ddiirreeccttoorryy
@@ -255,7 +258,7 @@ BBAASSHH BBUUIILLTTIINN CCOOMMMMAANNDDSS
ddiissaabblleedd
Names of disabled shell builtins.
eennaabblleedd Names of enabled shell builtins.
- eexxppoorrtt Names of exported shell variables. May also be
+ eexxppoorrtt Names of exported shell variables. May also be
specified as --ee.
ffiillee File names. May also be specified as --ff.
ffuunnccttiioonn
@@ -264,17 +267,17 @@ BBAASSHH BBUUIILLTTIINN CCOOMMMMAANNDDSS
hheellppttooppiicc
Help topics as accepted by the hheellpp builtin.
hhoossttnnaammee
- Hostnames, as taken from the file specified by
+ Hostnames, as taken from the file specified by
the HHOOSSTTFFIILLEE shell variable.
- jjoobb Job names, if job control is active. May also
+ jjoobb Job names, if job control is active. May also
be specified as --jj.
- kkeeyywwoorrdd Shell reserved words. May also be specified as
+ kkeeyywwoorrdd Shell reserved words. May also be specified as
--kk.
rruunnnniinngg Names of running jobs, if job control is active.
sseerrvviiccee Service names. May also be specified as --ss.
- sseettoopptt Valid arguments for the --oo option to the sseett
+ sseettoopptt Valid arguments for the --oo option to the sseett
builtin.
- sshhoopptt Shell option names as accepted by the sshhoopptt
+ sshhoopptt Shell option names as accepted by the sshhoopptt
builtin.
ssiiggnnaall Signal names.
ssttooppppeedd Names of stopped jobs, if job control is active.
@@ -282,15 +285,6 @@ BBAASSHH BBUUIILLTTIINN CCOOMMMMAANNDDSS
vvaarriiaabbllee
Names of all shell variables. May also be spec-
ified as --vv.
- --GG _g_l_o_b_p_a_t
- 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
- special variable as delimiters, and each resultant word
- is expanded. The possible completions are the members
- of the resultant list which match the word being com-
- pleted.
--CC _c_o_m_m_a_n_d
_c_o_m_m_a_n_d is executed in a subshell environment, and its
output is used as the possible completions.
@@ -299,69 +293,81 @@ BBAASSHH BBUUIILLTTIINN CCOOMMMMAANNDDSS
shell environment. When it finishes, the possible com-
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 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.
- A leading !! in _f_i_l_t_e_r_p_a_t negates the pattern; in this
- case, any completion not matching _f_i_l_t_e_r_p_a_t is removed.
+ --GG _g_l_o_b_p_a_t
+ The pathname expansion pattern _g_l_o_b_p_a_t is expanded to
+ generate the possible completions.
--PP _p_r_e_f_i_x
- _p_r_e_f_i_x is added at the beginning of each possible com-
+ _p_r_e_f_i_x is added at the beginning of each possible com-
pletion after all other options have been applied.
--SS _s_u_f_f_i_x
_s_u_f_f_i_x is appended to each possible completion after all
other options have been applied.
-
- The return value is true unless an invalid option is supplied,
- an option other than --pp or --rr is supplied without a _n_a_m_e argu-
- ment, an attempt is made to remove a completion specification
+ --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
+ special variable as delimiters, and each resultant word
+ is expanded. The possible completions are the members
+ of the resultant list which match the word being com-
+ pleted.
+ --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 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.
+ A leading !! in _f_i_l_t_e_r_p_a_t negates the pattern; in this
+ case, any completion not matching _f_i_l_t_e_r_p_a_t is removed.
+
+ The return value is true unless an invalid option is supplied,
+ an option other than --pp or --rr is supplied without a _n_a_m_e argu-
+ ment, an attempt is made to remove a completion specification
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] [--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 --DD option indicates that the remaining
+ _o_p_t_i_o_ns, or for the currently-executing 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 --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;
+ 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.
+ 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
+ completion 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
+ ddeeccllaarree [--aaAAffFFggiillrrttuuxx] [--pp] [_n_a_m_e[=_v_a_l_u_e] ...]
+ ttyyppeesseett [--aaAAffFFggiillrrttuuxx] [--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
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
- specified attribute or to give variables attributes:
+ played as well. The --FF option implies --ff. The --gg option forces
+ variables to be created or modified at the global scope, even
+ when ddeeccllaarree is executed in a shell function. It is ignored in
+ all other cases. 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
above).
--AA Each _n_a_m_e is an associative array variable (see AArrrraayyss
@@ -388,20 +394,20 @@ BBAASSHH BBUUIILLTTIINN CCOOMMMMAANNDDSS
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 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
- 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
- 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-
- tent function with --ff.
-
- ddiirrss [[++_n]] [[--_n]] [[--ccppllvv]]
+ in a function, makes each _n_a_m_e local, as with the llooccaall command,
+ unless the --ggPP ooppttiioonn iiss ssuupppplliieedd,, IIff aa vvaarriiaabbllee nnaammee iiss ffooll--
+ lloowweedd bbyy ==_v_a_l_u_e,, tthhee vvaalluuee ooff tthhee vvaarriiaabbllee iiss sseett ttoo _v_a_l_u_e.. TThhee
+ rreettuurrnn vvaalluuee iiss 00 uunnlleessss aann iinnvvaalliidd ooppttiioonn iiss eennccoouunntteerreedd,, aann
+ aatttteemmpptt iiss mmaaddee ttoo ddeeffiinnee aa ffuunnccttiioonn uussiinngg ````--ff ffoooo==bbaarr'''',, aann
+ aatttteemmpptt iiss mmaaddee ttoo aassssiiggnn aa vvaalluuee ttoo aa rreeaaddoonnllyy vvaarriiaabbllee,, aann
+ aatttteemmpptt iiss mmaaddee ttoo aassssiiggnn aa vvaalluuee ttoo aann aarrrraayy vvaarriiaabbllee wwiitthhoouutt
+ uussiinngg tthhee ccoommppoouunndd aassssiiggnnmmeenntt ssyynnttaaxx ((sseeee 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 readonly variable, an attempt
+ is made to turn off array status for an array variable, or an
+ attempt is made to display a non-existent function with --ff.
+
+ ddiirrss [[++_n]] [[--_n]] [[--ccllppvv]]
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
@@ -451,7 +457,8 @@ BBAASSHH BBUUIILLTTIINN CCOOMMMMAANNDDSS
\\aa alert (bell)
\\bb backspace
\\cc suppress further output
- \\ee an escape character
+ \\ee
+ \\EE an escape character
\\ff form feed
\\nn new line
\\rr carriage return
@@ -462,6 +469,11 @@ BBAASSHH BBUUIILLTTIINN CCOOMMMMAANNDDSS
_n_n_n (zero to three octal digits)
\\xx_H_H the eight-bit character whose value is the hexadecimal
value _H_H (one or two hex digits)
+ \\uu_H_H_H_H the Unicode (ISO/IEC 10646) character whose value is the
+ hexadecimal value _H_H_H_H (one to four hex digits)
+ \\UU_H_H_H_H_H_H_H_H
+ the Unicode (ISO/IEC 10646) character whose value is the
+ hexadecimal value _H_H_H_H_H_H_H_H (one to eight 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
@@ -589,7 +601,7 @@ BBAASSHH BBUUIILLTTIINN CCOOMMMMAANNDDSS
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 ?.
+ the first non-option argument, and _n_a_m_e is set to ?.
ggeettooppttss normally parses the positional parameters, but if more
arguments are given in _a_r_g_s, ggeettooppttss parses those instead.
@@ -617,25 +629,26 @@ BBAASSHH BBUUIILLTTIINN CCOOMMMMAANNDDSS
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
- 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
- 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
- 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
- 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
- or an invalid option is supplied.
+ Each time hhaasshh is invoked, the full pathname of the command _n_a_m_e
+ is determined by searching the directories in $$PPAATTHH and remem-
+ bered. Any previously-remembered pathname is discarded. 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 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 argu-
+ ments are supplied with --tt, the _n_a_m_e is printed before the
+ hashed full pathname. The --ll option causes output to be dis-
+ played in a format that may be reused as input. If no arguments
+ are given, or if only --ll is supplied, information about remem-
+ bered commands is 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
@@ -651,44 +664,44 @@ 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 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
+ 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-
+ 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.
@@ -697,127 +710,141 @@ BBAASSHH BBUUIILLTTIINN CCOOMMMMAANNDDSS
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
- leader.
--nn Display information only about jobs that have changed
status since the user was last notified of their status.
+ --pp List only the process ID of the job's process group
+ leader.
--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 above). If the last _a_r_g evaluates to 0, lleett
+ 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 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
+ 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
+ --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 newline from each line read.
- --uu Read lines from file descriptor _f_d instead of the stan-
+ --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
- element is assigned.
+ array element to be assigned and the line to be assigned to that
+ element as additional arguments. _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, _a_r_r_a_y is invalid or unassignable, or if
+ 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,
- removes the top directory from the stack, and performs a ccdd to
+ Removes entries from the directory stack. With no arguments,
+ removes the top directory from the stack, and performs a ccdd to
the new top directory. Arguments, if supplied, have the follow-
ing meanings:
- --nn Suppresses the normal change of directory when removing
- directories from the stack, so that only the stack is
+ --nn Suppresses the normal change of directory when removing
+ directories from the stack, so that only the stack is
manipulated.
- ++_n Removes the _nth entry counting from the left of the list
- shown by ddiirrss, starting with zero. For example: ``popd
+ ++_n Removes the _nth entry counting from the left of the list
+ shown by ddiirrss, starting with zero. For example: ``popd
+0'' removes the first directory, ``popd +1'' the second.
--_n Removes the _nth entry counting from the right of the list
- shown by ddiirrss, starting with zero. For example: ``popd
- -0'' removes the last directory, ``popd -1'' the next to
+ shown by ddiirrss, starting with zero. For example: ``popd
+ -0'' removes the last directory, ``popd -1'' the next to
last.
- If the ppooppdd command is successful, a ddiirrss is performed as well,
- and the return status is 0. ppooppdd returns false if an invalid
+ If the ppooppdd command is successful, a ddiirrss is performed as well,
+ and the return status is 0. ppooppdd returns false if an invalid
option is encountered, the directory stack is empty, a non-exis-
tent directory stack entry is specified, or the directory change
fails.
pprriinnttff [--vv _v_a_r] _f_o_r_m_a_t [_a_r_g_u_m_e_n_t_s]
- Write the formatted _a_r_g_u_m_e_n_t_s to the standard output under the
- control of the _f_o_r_m_a_t. The _f_o_r_m_a_t is a character string which
- contains three types of objects: plain characters, which are
- simply copied to standard output, character escape sequences,
- which are converted and copied to the standard output, and for-
- mat specifications, each of which causes printing of the next
- successive _a_r_g_u_m_e_n_t. In addition to the standard _p_r_i_n_t_f(1) for-
- mats, %%bb causes pprriinnttff to expand backslash escape sequences in
- the corresponding _a_r_g_u_m_e_n_t (except that \\cc terminates output,
- backslashes in \\'', \\"", and \\?? are not removed, and octal escapes
- beginning with \\00 may contain up to four digits), and %%qq causes
- pprriinnttff to output the corresponding _a_r_g_u_m_e_n_t in a format that can
- be reused as shell input.
-
- The --vv option causes the output to be assigned to the variable
- _v_a_r rather than being printed to the standard output.
+ Write the formatted _a_r_g_u_m_e_n_t_s to the standard output under the
+ control of the _f_o_r_m_a_t. The --vv option causes the output to be
+ assigned to the variable _v_a_r rather than being printed to the
+ standard output.
+
+ The _f_o_r_m_a_t is a character string which contains three types of
+ objects: plain characters, which are simply copied to standard
+ output, character escape sequences, which are converted and
+ copied to the standard output, and format specifications, each
+ of which causes printing of the next successive _a_r_g_u_m_e_n_t. In
+ addition to the standard _p_r_i_n_t_f(1) format specifications, pprriinnttff
+ interprets the following extensions:
+ %%bb causes pprriinnttff to expand backslash escape sequences in the
+ corresponding _a_r_g_u_m_e_n_t (except that \\cc terminates output,
+ backslashes in \\'', \\"", and \\?? are not removed, and octal
+ escapes beginning with \\00 may contain up to four digits).
+ %%qq causes pprriinnttff to output the corresponding _a_r_g_u_m_e_n_t in a
+ format that can be reused as shell input.
+ %%((_d_a_t_e_f_m_t))TT
+ causes pprriinnttff to output the date-time string resulting
+ from using _d_a_t_e_f_m_t as a format string for _s_t_r_f_t_i_m_e(3).
+ The corresponding _a_r_g_u_m_e_n_t is an integer representing the
+ number of seconds since the epoch. Two special argument
+ values may be used: -1 represents the current time, and
+ -2 represents the time the shell was invoked.
+
+ Arguments to non-string format specifiers are treated as C con-
+ stants, except that a leading plus or minus sign is allowed, and
+ if the leading character is a single or double quote, the value
+ is the ASCII value of the following character.
The _f_o_r_m_a_t is reused as necessary to consume all of the _a_r_g_u_-
_m_e_n_t_s. If the _f_o_r_m_a_t requires more _a_r_g_u_m_e_n_t_s than are supplied,
@@ -956,8 +983,8 @@ BBAASSHH BBUUIILLTTIINN CCOOMMMMAANNDDSS
status is false. Any command associated with the RREETTUURRNN trap is
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 ...]
+ sseett [----aabbeeffhhkkmmnnppttuuvvxxBBCCEEHHPPTT] [--oo _o_p_t_i_o_n_-_n_a_m_e] [_a_r_g ...]
+ sseett [++aabbeeffhhkkmmnnppttuuvvxxBBCCEEHHPPTT] [++oo _o_p_t_i_o_n_-_n_a_m_e] [_a_r_g ...]
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-
@@ -1200,17 +1227,29 @@ BBAASSHH BBUUIILLTTIINN CCOOMMMMAANNDDSS
easy re-editing of multi-line commands.
ccoommppaatt3311
If set, bbaasshh changes its behavior to that of version 3.1
- with respect to quoted arguments to the conditional com-
- mand's =~ operator.
+ with respect to quoted arguments to the [[[[ conditional
+ command'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.
+ using the [[[[ conditional command's << and >> operators.
+ Bash versions prior to bash-4.1 use ASCII collation 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).
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.
+ with respect to locale-specific string comparison when
+ using the [[[[ conditional command's << and >> operators
+ (see previous item) and the effect of interrupting a
+ command list.
+ ccoommppaatt4411
+ @item compat41 If set, bbaasshh, when in posix mode, treats
+ a single quote in a double-quoted parameter expansion as
+ a special character. The single quotes must match (an
+ even number) and the characters between the single
+ quotes are considered quoted. This is the behavior of
+ posix mode through version 4.1. The default bash behav-
+ ior remains as in previous versions.
ddiirrssppeellll
If set, bbaasshh attempts spelling correction on directory
names during word completion if the directory name ini-
@@ -1247,7 +1286,7 @@ BBAASSHH BBUUIILLTTIINN CCOOMMMMAANNDDSS
(( _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 ((
- _c_o_m_m_a_n_d )) inherit the EERRRROORR trap.
+ _c_o_m_m_a_n_d )) inherit the EERRRR trap.
eexxttgglloobb If set, the extended pattern matching features described
above under PPaatthhnnaammee EExxppaannssiioonn are enabled.
eexxttqquuoottee
@@ -1298,6 +1337,10 @@ BBAASSHH BBUUIILLTTIINN CCOOMMMMAANNDDSS
and all remaining characters on that line to be ignored
in an interactive shell (see CCOOMMMMEENNTTSS above). This
option is enabled by default.
+ llaassttppiippee
+ If set, and job control is not active, the shell runs
+ the last command of a pipeline not executed in the back-
+ ground in the current shell environment.
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.
@@ -1369,10 +1412,11 @@ BBAASSHH BBUUIILLTTIINN CCOOMMMMAANNDDSS
Expressions may be combined using the following operators,
listed in decreasing order of precedence. The evaluation
- depends on the number of arguments; see below.
+ depends on the number of arguments; see below. Operator prece-
+ dence is used when there are five or more arguments.
!! _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.
@@ -1389,13 +1433,14 @@ 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
+ The following conditions are applied in the order listed.
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
@@ -1417,31 +1462,34 @@ BBAASSHH BBUUIILLTTIINN CCOOMMMMAANNDDSS
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
+ When used with tteesstt or [[, the << and >> operators sort lexico-
+ graphically using ASCII ordering.
+
+ 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 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
+ 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 SSIIGG 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-
@@ -1449,53 +1497,53 @@ BBAASSHH BBUUIILLTTIINN CCOOMMMMAANNDDSS
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
+ 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
+ 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
+ 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
- returned. If the --pp option is used, ttyyppee either returns the
+ 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
+ returned. 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 speci-
fied as a command name, or nothing if ``type -t name'' would not
- return _f_i_l_e. The --PP option forces a PPAATTHH search for each _n_a_m_e,
+ return _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, not necessarily the
+ hashed, --pp and --PP print the hashed value, not necessarily 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 func-
- tion lookup, as with the ccoommmmaanndd builtin. ttyyppee returns true if
+ 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 func-
+ tion lookup, as with the ccoommmmaanndd builtin. ttyyppee returns true if
all of the arguments are found, false if any are not found.
uulliimmiitt [--HHSSTTaabbccddeeffiillmmnnppqqrrssttuuvvxx [_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,
- respectively. 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
+ current hard limit, the current soft limit, and no limit,
+ respectively. 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 are printed before the value. Other options are inter-
preted as follows:
@@ -1504,11 +1552,11 @@ BBAASSHH BBUUIILLTTIINN CCOOMMMMAANNDDSS
--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
--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)
@@ -1517,58 +1565,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
- shell
+ --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
--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 CCOOMMPP__WWOORRDDBBRREEAAKKSS, RRAANNDDOOMM, SSEECCOONNDDSS,
- LLIINNEENNOO, HHIISSTTCCMMDD, FFUUNNCCNNAAMMEE, GGRROOUUPPSS, or DDIIRRSSTTAACCKK are unset, they
- lose their special properties, even if they are subsequently
+ 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