aboutsummaryrefslogtreecommitdiffstats
path: root/doc/builtins.0
diff options
context:
space:
mode:
Diffstat (limited to 'doc/builtins.0')
-rw-r--r--doc/builtins.01059
1 files changed, 583 insertions, 476 deletions
diff --git a/doc/builtins.0 b/doc/builtins.0
index 5361dd7..dcdc6c5 100644
--- a/doc/builtins.0
+++ b/doc/builtins.0
@@ -29,9 +29,9 @@ BBAASSHH BBUUIILLTTIINN CCOOMMMMAANNDDSS
ssoouurrccee _f_i_l_e_n_a_m_e [_a_r_g_u_m_e_n_t_s]
Read and execute commands from _f_i_l_e_n_a_m_e in the current shell
environment and return the exit status of the last command exe-
- cuted from _f_i_l_e_n_a_m_e. If _f_i_l_e_n_a_m_e does not contain a slash, file
- names in PPAATTHH are used to find the directory containing _f_i_l_e_-
- _n_a_m_e. The file searched for in PPAATTHH need not be executable.
+ cuted from _f_i_l_e_n_a_m_e. If _f_i_l_e_n_a_m_e does not contain a slash,
+ filenames in PPAATTHH are used to find the directory containing
+ _f_i_l_e_n_a_m_e. The file searched for in PPAATTHH need not be executable.
When bbaasshh is not in _p_o_s_i_x _m_o_d_e, the current directory is
searched if no file is found in PPAATTHH. If the ssoouurrcceeppaatthh option
to the sshhoopptt builtin command is turned off, the PPAATTHH is not
@@ -61,7 +61,7 @@ BBAASSHH BBUUIILLTTIINN CCOOMMMMAANNDDSS
enabled, any specified _j_o_b_s_p_e_c was not found or was started
without job control.
- bbiinndd [--mm _k_e_y_m_a_p] [--llppssvvPPSSVV]
+ bbiinndd [--mm _k_e_y_m_a_p] [--llppssvvPPSSVVXX]
bbiinndd [--mm _k_e_y_m_a_p] [--qq _f_u_n_c_t_i_o_n] [--uu _f_u_n_c_t_i_o_n] [--rr _k_e_y_s_e_q]
bbiinndd [--mm _k_e_y_m_a_p] --ff _f_i_l_e_n_a_m_e
bbiinndd [--mm _k_e_y_m_a_p] --xx _k_e_y_s_e_q:_s_h_e_l_l_-_c_o_m_m_a_n_d
@@ -108,6 +108,9 @@ BBAASSHH BBUUIILLTTIINN CCOOMMMMAANNDDSS
command changes the value of RREEAADDLLIINNEE__LLIINNEE or RREEAADD--
LLIINNEE__PPOOIINNTT, those new values will be reflected in the
editing state.
+ --XX List all key sequences bound to shell commands and the
+ associated commands in a format that can be reused as
+ input.
The return value is 0 unless an unrecognized option is given or
an error occurred.
@@ -140,117 +143,129 @@ BBAASSHH BBUUIILLTTIINN CCOOMMMMAANNDDSS
routine call or _e_x_p_r does not correspond to a valid position in
the call stack.
- 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
- CCDDPPAATTHH are separated by a colon (:). A null directory name in
- CCDDPPAATTHH is the same as the current directory, i.e., ``..''. If
- _d_i_r begins with a slash (/), then CCDDPPAATTHH is not used. The --PP
- 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. 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.
+ ccdd [--LL|[--PP [--ee]] [-@]] [_d_i_r]
+ Change the current directory to _d_i_r. if _d_i_r is not supplied,
+ the value of the HHOOMMEE shell variable is the default. Any addi-
+ tional arguments following _d_i_r are ignored. The variable CCDDPPAATTHH
+ defines the search path for the directory containing _d_i_r: each
+ directory name in CCDDPPAATTHH is searched for _d_i_r. Alternative
+ directory names in CCDDPPAATTHH are separated by a colon (:). A null
+ directory name in CCDDPPAATTHH is the same as the current directory,
+ i.e., ``..''. If _d_i_r begins with a slash (/), then CCDDPPAATTHH is not
+ used. The --PP option causes ccdd to use the physical directory
+ structure by resolving symbolic links while traversing _d_i_r and
+ before processing instances of _._. in _d_i_r (see also the --PP option
+ to the sseett builtin command); the --LL option forces symbolic links
+ to be followed by resolving the link after processing instances
+ of _._. in _d_i_r. If _._. appears in _d_i_r, it is processed by removing
+ the immediately previous pathname component from _d_i_r, back to a
+ slash or the beginning of _d_i_r. If the --ee option is supplied
+ with --PP, and the current working directory cannot be success-
+ fully determined after a successful directory change, ccdd will
+ return an unsuccessful status. On systems that support it, the
+ --@@ option presents the extended attributes associated with a
+ file as a directory. An argument of -- is converted to $$OOLLDDPPWWDD
+ before the directory change is attempted. If a non-empty direc-
+ tory 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 successfully
+ 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 filename
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
+ nnooqquuoottee Tell readline not to quote the completed words
+ if they are filenames (quoting filenames is the
+ default).
+ 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
@@ -258,7 +273,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
@@ -267,17 +282,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.
@@ -286,13 +301,18 @@ BBAASSHH BBUUIILLTTIINN CCOOMMMMAANNDDSS
Names of all shell variables. May also be spec-
ified as --vv.
--CC _c_o_m_m_a_n_d
- _c_o_m_m_a_n_d is executed in a subshell environment, and its
+ _c_o_m_m_a_n_d is executed in a subshell environment, and its
output is used as the possible completions.
--FF _f_u_n_c_t_i_o_n
- The shell function _f_u_n_c_t_i_o_n is executed in the current
- shell environment. When it finishes, the possible com-
- pletions are retrieved from the value of the CCOOMMPPRREEPPLLYY
- array variable.
+ The shell function _f_u_n_c_t_i_o_n is executed in the current
+ shell environment. When the function is executed, the
+ first argument ($$11) is the name of the command whose
+ arguments are being completed, the second argument ($$22)
+ is the word being completed, and the third argument ($$33)
+ is the word preceding the word being completed on the
+ current command line. When it finishes, the possible
+ completions are retrieved from the value of the CCOOMMPPRREE--
+ PPLLYY array variable.
--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.
@@ -347,27 +367,27 @@ BBAASSHH BBUUIILLTTIINN CCOOMMMMAANNDDSS
loop) is resumed. The return value is 0 unless _n is not greater
than or equal to 1.
- ddeeccllaarree [--aaAAffFFggiillrrttuuxx] [--pp] [_n_a_m_e[=_v_a_l_u_e] ...]
- ttyyppeesseett [--aaAAffFFggiillrrttuuxx] [--pp] [_n_a_m_e[=_v_a_l_u_e] ...]
+ ddeeccllaarree [--aaAAffFFggiillnnrrttuuxx] [--pp] [_n_a_m_e[=_v_a_l_u_e] ...]
+ ttyyppeesseett [--aaAAffFFggiillnnrrttuuxx] [--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
- 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
- file name and line number where the function is defined are dis-
- 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:
+ with _n_a_m_e arguments, additional options, other than --ff and --FF,
+ 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 functions. The --FF option
+ inhibits the display of function definitions; 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 displayed 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
@@ -379,6 +399,13 @@ BBAASSHH BBUUIILLTTIINN CCOOMMMMAANNDDSS
--ll When the variable is assigned a value, all upper-case
characters are converted to lower-case. The upper-case
attribute is disabled.
+ --nn Give each _n_a_m_e the _n_a_m_e_r_e_f attribute, making it a name
+ reference to another variable. That other variable is
+ defined by the value of _n_a_m_e. All references and assign-
+ ments to _n_a_m_e, except for changing the --nn attribute
+ itself, are performed on the variable referenced by
+ _n_a_m_e's value. The --nn attribute cannot be applied to
+ array variables.
--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
@@ -394,66 +421,68 @@ 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,
- 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
- the list with the ppuusshhdd command; the ppooppdd command removes
+ in a function, ddeeccllaarree and ttyyppeesseett make each _n_a_m_e local, as with
+ the llooccaall command, unless the --gg option is supplied. If a vari-
+ able name is followed by =_v_a_l_u_e, the value of the variable is
+ set to _v_a_l_u_e. When using --aa or --AA and the compound assignment
+ syntax to create array variables, additional attributes do not
+ take effect until subsequent assignments. 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 read-
+ only 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 [[--ccllppvv]] [[++_n]] [[--_n]]
+ 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
- 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
- uses a tilde to denote the home directory.
+ --ll Produces a listing using full pathnames; 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-
fixing each entry with its index in the stack.
+ ++_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
+ list shown by ddiirrss when invoked without options, starting
+ with zero.
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 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_-
- _s_p_e_c does not specify a valid job.
+ Without options, remove each _j_o_b_s_p_e_c from the table of active
+ jobs. If _j_o_b_s_p_e_c is not 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 the --hh option
+ is given, each _j_o_b_s_p_e_c is not removed from the table, 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 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_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.
- 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
- interprets the following escape sequences:
+ The return status is 0 unless a write error occurs. If --nn is
+ specified, the trailing newline is suppressed. If the --ee option
+ is given, interpretation of the following backslash-escaped
+ characters is enabled. The --EE option disables the interpreta-
+ tion of these escape characters, 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
\\cc suppress further output
@@ -465,89 +494,88 @@ 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)
- \\uu_H_H_H_H the Unicode (ISO/IEC 10646) character whose value is the
+ \\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
+ 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
+ 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 eexxeeccffaaiill shell option is enabled. In that 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
- variable name, or --ff is supplied with a _n_a_m_e that is not a func-
- tion.
+ 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 names of all exported
+ variables 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 sup-
+ plied with a _n_a_m_e that is not a function.
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
- 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
- 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
- listing.
+ The first form selects a range of commands from _f_i_r_s_t to _l_a_s_t
+ from the history list and displays or edits and re-executes
+ them. _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 current 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 last 10 commands) and to _f_i_r_s_t other-
+ wise. If _f_i_r_s_t is not specified it is set to the previous com-
+ mand 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
@@ -555,14 +583,14 @@ BBAASSHH BBUUIILLTTIINN CCOOMMMMAANNDDSS
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.
+ If neither variable is set, _v_i is used. When editing is com-
+ plete, 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
- beginning with ``cc'' and typing ``r'' re-executes the last com-
- mand.
+ of _p_a_t is replaced by _r_e_p. _C_o_m_m_a_n_d is intepreted the same as
+ _f_i_r_s_t above. 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 command.
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
@@ -608,7 +636,7 @@ BBAASSHH BBUUIILLTTIINN CCOOMMMMAANNDDSS
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
+ 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.
@@ -633,7 +661,7 @@ BBAASSHH BBUUIILLTTIINN CCOOMMMMAANNDDSS
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
+ is used as the full filename 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
@@ -654,7 +682,8 @@ BBAASSHH BBUUIILLTTIINN CCOOMMMMAANNDDSS
--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.
+
+ The return status is 0 unless no command matches _p_a_t_t_e_r_n.
hhiissttoorryy [[_n]]
hhiissttoorryy --cc
@@ -682,10 +711,10 @@ BBAASSHH BBUUIILLTTIINN CCOOMMMMAANNDDSS
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-
- ing the history file's contents.
+ --rr Read the contents of the history file and append them to
+ the current history list.
+ --ww Write the current history list to the history file, over-
+ writing 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
@@ -714,8 +743,8 @@ BBAASSHH BBUUIILLTTIINN CCOOMMMMAANNDDSS
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.
+ --rr Display only running jobs.
+ --ss Display only 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
@@ -839,37 +868,41 @@ BBAASSHH BBUUIILLTTIINN CCOOMMMMAANNDDSS
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.
+ -2 represents the time the shell was invoked. If no
+ argument is specified, conversion behaves as if -1 had
+ been given. This is an exception to the usual pprriinnttff
+ behavior.
- Arguments to non-string format specifiers are treated as C con-
+ 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
+ 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_-
+ 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,
- the extra format specifications behave as if a zero value or
- null string, as appropriate, had been supplied. The return
+ the extra format specifications behave as if a zero value or
+ null string, as appropriate, had been supplied. The return
value is zero on success, non-zero on failure.
ppuusshhdd [--nn] [+_n] [-_n]
ppuusshhdd [--nn] [_d_i_r]
- Adds a directory to the top of the directory stack, or rotates
- the stack, making the new top of the stack the current working
+ Adds a directory to the top of the directory stack, or rotates
+ the stack, making the new top of the stack the current working
directory. With no arguments, exchanges the top two directories
- and returns 0, unless the directory stack is empty. Arguments,
+ and returns 0, unless the directory stack is empty. Arguments,
if supplied, have the following meanings:
- --nn Suppresses the normal change of directory when adding
- directories to the stack, so that only the stack is
+ --nn Suppresses the normal change of directory when adding
+ directories to the stack, so that only the stack is
manipulated.
- ++_n Rotates the stack so that the _nth directory (counting
- from the left of the list shown by ddiirrss, starting with
+ ++_n Rotates the stack so that the _nth directory (counting
+ from the left of the list shown by ddiirrss, starting with
zero) is at the top.
- --_n Rotates the stack so that the _nth directory (counting
- from the right of the list shown by ddiirrss, starting with
+ --_n Rotates the stack so that the _nth directory (counting
+ from the right of the list shown by ddiirrss, starting with
zero) is at the top.
_d_i_r Adds _d_i_r to the directory stack at the top, making it the
- new current working directory.
+ new current working directory as if it had been supplied
+ as the argument to the ccdd builtin.
If the ppuusshhdd command is successful, a ddiirrss is performed as well.
If the first form is used, ppuusshhdd returns 0 unless the cd to _d_i_r
@@ -896,128 +929,149 @@ BBAASSHH BBUUIILLTTIINN CCOOMMMMAANNDDSS
ing separators assigned to the last _n_a_m_e. If there are fewer
words read from the input stream than names, the remaining names
are assigned empty values. The characters in IIFFSS are used to
- split the line into words. The backslash character (\\) may be
- used to remove any special meaning for the next character read
- and for line continuation. Options, if supplied, have the fol-
- lowing meanings:
+ split the line into words using the same rules the shell uses
+ for expansion (described above under WWoorrdd SSpplliittttiinngg). The back-
+ slash character (\\) may be used to remove any special meaning
+ for the next character read and for line continuation. Options,
+ if supplied, have the following meanings:
--aa _a_n_a_m_e
The words are assigned to sequential indices of the array
variable _a_n_a_m_e, starting at 0. _a_n_a_m_e is unset before any
new values are assigned. Other _n_a_m_e arguments are
ignored.
--dd _d_e_l_i_m
- The first character of _d_e_l_i_m is used to terminate the
+ The first character of _d_e_l_i_m is used to terminate the
input line, rather than newline.
--ee If the standard input is coming from a terminal, rreeaaddlliinnee
- (see RREEAADDLLIINNEE above) is used to obtain the line. Read-
- line uses the current (or default, if line editing was
+ (see RREEAADDLLIINNEE above) is used to obtain the line. Read-
+ line uses the current (or default, if line editing was
not previously active) editing settings.
--ii _t_e_x_t
- If rreeaaddlliinnee is being used to read the line, _t_e_x_t is
+ If rreeaaddlliinnee is being used to read the line, _t_e_x_t is
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, but honor a delim-
- iter if fewer than _n_c_h_a_r_s characters are read before the
+ rreeaadd returns after reading _n_c_h_a_r_s characters rather than
+ 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
+ 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
- if the timeout is exceeded.
+ Cause rreeaadd to time out and return failure if a complete
+ line of input (or a specified number of characters) is
+ not read within _t_i_m_e_o_u_t seconds. _t_i_m_e_o_u_t may be a deci-
+ mal number with a fractional portion following the deci-
+ mal point. This option is only effective if rreeaadd is
+ reading input from a terminal, pipe, or other special
+ file; it has no effect when reading from regular files.
+ If rreeaadd times out, rreeaadd saves any partial input read into
+ the specified variable _n_a_m_e. If _t_i_m_e_o_u_t is 0, rreeaadd
+ returns immediately, without trying to read any data.
+ The exit status is 0 if input is available on the speci-
+ fied file descriptor, non-zero otherwise. The exit sta-
+ tus 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
- 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
- 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 function.
+ greater than 128), a variable assignment error (such as assign-
+ ing to a readonly variable) occurs, or an invalid file descrip-
+ tor is supplied as the argument to --uu.
+
+ rreeaaddoonnllyy [--aaAAff] [--pp] [_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 both options are supplied, --AA takes precedence. 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 other options may be
+ used to restrict the output to a subset of the set of readonly
+ names. 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 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 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
- status is false. Any command associated with the RREETTUURRNN trap is
- executed before execution resumes after the function or script.
+ Causes a function to stop executing and return the value speci-
+ fied by _n to its caller. If _n is omitted, the return status is
+ that of the last command executed in the function body. If
+ rreettuurrnn is 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 _n is supplied, the return value is its least
+ significant 8 bits. The return status is non-zero if rreettuurrnn is
+ supplied a non-numeric argument, or is used outside a function
+ and not during execution of a script by .. or ssoouurrccee. Any com-
+ mand associated with the RREETTUURRNN trap is executed before execu-
+ tion resumes after the function or script.
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
+ 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 mode, 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 _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 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,
+ --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 _l_i_s_t, or a _c_o_m_p_o_u_n_d _c_o_m_m_a_n_d
+ (see SSHHEELLLL GGRRAAMMMMAARR above), exits with a non-zero sta-
+ tus. 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 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
+ !!. If a compound command other than a subshell returns
+ a non-zero status because a command failed while --ee was
+ being ignored, the shell does not exit. 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.
+
+ If a compound command or shell function executes in a
+ context where --ee is being ignored, none of the commands
+ executed within the compound command or function body
+ will be affected by the --ee setting, even if --ee is set
+ and a command returns a failure status. If a compound
+ command or shell function sets --ee while executing in a
+ context where --ee is ignored, that setting will not have
+ any effect until the compound command or the command
+ containing the function call completes.
--ff Disable pathname expansion.
--hh Remember the location of commands as they are looked up
for execution. This is enabled by default.
@@ -1026,10 +1080,10 @@ BBAASSHH BBUUIILLTTIINN CCOOMMMMAANNDDSS
that precede the command name.
--mm Monitor mode. Job control is enabled. This option is
on by default for interactive shells on systems that
- support it (see JJOOBB CCOONNTTRROOLL above). Background pro-
- cesses run in a separate process group and a line con-
- taining their exit status is printed upon their comple-
- tion.
+ support it (see JJOOBB CCOONNTTRROOLL above). All processes run
+ in a separate process group. When a background job com-
+ pletes, the shell prints a line containing its exit sta-
+ tus.
--nn Read commands but do not execute them. This may be used
to check a shell script for syntax errors. This is
ignored by interactive shells.
@@ -1079,7 +1133,9 @@ BBAASSHH BBUUIILLTTIINN CCOOMMMMAANNDDSS
is disabled by default.
ppoossiixx Change the behavior of bbaasshh where the default
operation differs from the POSIX standard to
- match the standard (_p_o_s_i_x _m_o_d_e).
+ match the standard (_p_o_s_i_x _m_o_d_e). See SSEEEE AALLSSOO
+ below for a reference to a document that details
+ how posix mode affects bash's behavior.
pprriivviilleeggeedd
Same as --pp.
vveerrbboossee Same as --vv.
@@ -1128,7 +1184,7 @@ BBAASSHH BBUUIILLTTIINN CCOOMMMMAANNDDSS
ited in such cases.
--HH Enable !! style history substitution. This option is on
by default when the shell is interactive.
- --PP If set, the shell does not follow symbolic links when
+ --PP If set, the shell does not resolve symbolic links when
executing commands such as ccdd that change the current
working directory. It uses the physical directory
structure instead. By default, bbaasshh follows the logical
@@ -1164,12 +1220,14 @@ BBAASSHH BBUUIILLTTIINN CCOOMMMMAANNDDSS
zero if _n is greater than $$## or less than zero; otherwise 0.
sshhoopptt [--ppqqssuu] [--oo] [_o_p_t_n_a_m_e ...]
- Toggle the values of variables controlling optional shell behav-
- ior. With no options, or with the --pp option, a list of all set-
- table options is displayed, with an indication of whether or not
- each is set. The --pp option causes output to be displayed in a
- form that may be reused as input. Other options have the fol-
- lowing meanings:
+ Toggle the values of settings controlling optional shell behav-
+ ior. The settings can be either those listed below, or, if the
+ --oo option is used, those available with the --oo option to the sseett
+ builtin command. With no options, or with the --pp option, a list
+ of all settable options is displayed, with an indication of
+ whether or not each is set. The --pp option causes output to be
+ displayed in a form that may be reused as input. Other options
+ have the following meanings:
--ss Enable (set) each _o_p_t_n_a_m_e.
--uu Disable (unset) each _o_p_t_n_a_m_e.
--qq Suppresses normal output (quiet mode); the return status
@@ -1180,10 +1238,10 @@ BBAASSHH BBUUIILLTTIINN CCOOMMMMAANNDDSS
--oo Restricts the values of _o_p_t_n_a_m_e to be those defined for
the --oo option to the sseett builtin.
- If either --ss or --uu is used with no _o_p_t_n_a_m_e arguments, the dis-
- play is limited to those options which are set or unset, respec-
- tively. Unless otherwise noted, the sshhoopptt options are disabled
- (unset) by default.
+ If either --ss or --uu is used with no _o_p_t_n_a_m_e arguments, sshhoopptt
+ shows only those options which are set or unset, respectively.
+ Unless otherwise noted, the sshhoopptt options are disabled (unset)
+ by default.
The return status when listing options is zero if all _o_p_t_n_a_m_e_s
are enabled, non-zero otherwise. When setting or unsetting
@@ -1203,7 +1261,7 @@ BBAASSHH BBUUIILLTTIINN CCOOMMMMAANNDDSS
ponent in a ccdd command will be corrected. The errors
checked for are transposed characters, a missing charac-
ter, and one character too many. If a correction is
- found, the corrected file name is printed, and the com-
+ found, the corrected filename is printed, and the com-
mand proceeds. This option is only used by interactive
shells.
cchheecckkhhaasshh
@@ -1228,146 +1286,183 @@ BBAASSHH BBUUIILLTTIINN CCOOMMMMAANNDDSS
ccoommppaatt3311
If set, bbaasshh changes its behavior to that of version 3.1
with respect to quoted arguments to the [[[[ conditional
- command's ==~~ operator.
+ command's ==~~ operator and locale-specific string compar-
+ ison when 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 cur-
+ rent locale's collation sequence and _s_t_r_c_o_l_l(3).
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.
- 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).
+ using the [[[[ conditional command's << and >> operators
+ (see previous item).
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
- (see previous item) and the effect of interrupting a
- command list.
+ (see description of ccoommppaatt3311) and the effect of inter-
+ rupting a command list. Bash versions 4.0 and later
+ interrupt the list as if the shell received the inter-
+ rupt; previous versions continue with the next command
+ in the 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.
+ If set, bbaasshh, when in _p_o_s_i_x mode, treats a single quote
+ in a double-quoted parameter expansion as a special
+ character. The single quotes must match (an even num-
+ ber) and the characters between the single quotes are
+ considered quoted. This is the behavior of posix mode
+ through version 4.1. The default bash behavior remains
+ as in previous versions.
+ ccoommppaatt4422
+ If set, bbaasshh does not process the replacement string in
+ the pattern substitution word expansion using quote
+ removal.
+ ccoommpplleettee__ffuullllqquuoottee
+ If set, bbaasshh quotes all shell metacharacters in file-
+ names and directory names when performing completion.
+ If not set, bbaasshh removes metacharacters such as the dol-
+ lar sign from the set of characters that will be quoted
+ in completed filenames when these metacharacters appear
+ in shell variable references in words to be completed.
+ This means that dollar signs in variable names that
+ expand to directories will not be quoted; however, any
+ dollar signs appearing in filenames will not be quoted,
+ either. This is active only when bash is using back-
+ slashes to quote completed filenames. This variable is
+ set by default, which is the default bash behavior in
+ versions through 4.2.
+ ddiirreexxppaanndd
+ If set, bbaasshh replaces directory names with the results
+ of word expansion when performing filename completion.
+ This changes the contents of the readline editing
+ buffer. If not set, bbaasshh attempts to preserve what the
+ user typed.
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 EERRRR 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.
+ gglloobbaasscciiiirraannggeess
+ If set, range expressions used in pattern matching
+ bracket expressions (see PPaatttteerrnn MMaattcchhiinngg above) behave
+ as if in the traditional C locale when performing com-
+ parisons. That is, the current locale's collating
+ sequence is not taken into account, so bb will not col-
+ late between AA and BB, and upper-case and lower-case
+ ASCII characters will collate together.
gglloobbssttaarr
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.
+ text will match all files and zero or more directories
+ and subdirectories. If the pattern is followed by a //,
+ only directories and subdirectories match.
ggnnuu__eerrrrffmmtt
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.
llaassttppiippee
- If set, and job control is not active, the shell runs
+ 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
+ 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--
@@ -1375,48 +1470,50 @@ 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
- 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,
+ Return a status of 0 (true) or 1 (false) depending on the evalu-
+ ation of the conditional expression _e_x_p_r. Each operator and op-
+ erand 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,
listed in decreasing order of precedence. The evaluation
- depends on the number of arguments; see below. Operator prece-
+ 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.
@@ -1433,76 +1530,79 @@ 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
+ 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.
- When used with tteesstt or [[, the << and >> operators sort lexico-
+ 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
+ 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
+ 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
+ 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.
+ If a _s_i_g_s_p_e_c is EERRRR, the command _a_r_g is executed whenever a a
+ pipeline (which may consist of a single simple command), a list,
+ or a compound command returns a non-zero exit status, subject to
+ the following conditions. The EERRRR trap is not executed if the
+ 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 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 using
+ !!. These are the same conditions obeyed by the eerrrreexxiitt (--ee)
+ option.
Signals ignored upon entry to the shell cannot be trapped or
reset. Trapped signals that are not being ignored are reset to
@@ -1522,14 +1622,14 @@ BBAASSHH BBUUIILLTTIINN CCOOMMMMAANNDDSS
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,
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
- 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
- all of the arguments are found, false if any are not found.
+ hashed, --pp and --PP print the hashed value, which is not necessar-
+ ily the file that appears first in PPAATTHH. If the --aa option is
+ used, ttyyppee prints all of the places that contain an executable
+ 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
+ function 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
@@ -1572,13 +1672,13 @@ BBAASSHH BBUUIILLTTIINN CCOOMMMMAANNDDSS
--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
- status is 0 unless an invalid option or argument is supplied, or
- an error occurs while setting a new limit.
+ If _l_i_m_i_t is given, and the --aa option is not used, _l_i_m_i_t is the
+ new value of the specified resource. If no option is given,
+ then --ff is assumed. Values are in 1024-byte increments, except
+ for --tt, which is in seconds; --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 sup-
+ plied, 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
@@ -1597,31 +1697,38 @@ BBAASSHH BBUUIILLTTIINN CCOOMMMMAANNDDSS
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 ...]
+ uunnsseett [-ffvv] [-nn] [_n_a_m_e ...]
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
+ If the --vv option is given, each _n_a_m_e refers to a shell variable,
+ and that variable is removed. Read-only variables may not be
unset. If --ff is specified, each _n_a_m_e refers to a shell func-
- tion, and the function definition is removed. 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
+ tion, and the function definition is removed. If the --nn option
+ is supplied, and _n_a_m_e is a variable with the _n_a_m_e_r_e_f attribute,
+ _n_a_m_e will be unset rather than the variable it references. --nn
+ has no effect if the --ff option is supplied. If no options are
+ supplied, each _n_a_m_e refers to a variable; if there is no vari-
+ able by that name, any function with that name is unset. Each
+ unset variable or function is removed from the environment
+ passed to subsequent commands. If any of CCOOMMPP__WWOORRDDBBRREEAAKKSS, RRAANN--
+ DDOOMM, SSEECCOONNDDSS, LLIINNEENNOO, HHIISSTTCCMMDD, FFUUNNCCNNAAMMEE, GGRROOUUPPSS, or DDIIRRSSTTAACCKK are
+ unset, they lose their special properties, even if they are sub-
+ sequently reset. The exit status is true unless a _n_a_m_e is read-
+ only.
+
+ wwaaiitt [--nn] [_n _._._.]
+ Wait for each specified child process and return its termination
+ status. 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.
+ cesses are waited for, and the return status is zero. If the --nn
+ option is supplied, wwaaiitt waits for any job to terminate and
+ returns its exit status. 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
bash(1), sh(1)
-GNU Bash-4.0 2004 Apr 20 BASH_BUILTINS(1)
+GNU Bash-4.2 2004 Apr 20 BASH_BUILTINS(1)