summaryrefslogtreecommitdiff
path: root/doc/builtins.0
diff options
context:
space:
mode:
Diffstat (limited to 'doc/builtins.0')
-rw-r--r--doc/builtins.0880
1 files changed, 444 insertions, 436 deletions
diff --git a/doc/builtins.0 b/doc/builtins.0
index aa257fd2..b406d43d 100644
--- a/doc/builtins.0
+++ b/doc/builtins.0
@@ -827,11 +827,13 @@ BBAASSHH BBUUIILLTTIINN CCOOMMMMAANNDDSS
is made local to the function in which llooccaall is invoked: shell
options changed using the sseett builtin inside the function are
restored to their original values when the function returns.
- With no operands, llooccaall writes a list of 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, or _n_a_m_e is a readonly
- variable.
+ The restore is effected as if a series of sseett commands were exe-
+ cuted to restore the values that were in place before the func-
+ tion. With no operands, llooccaall writes a list of 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, or _n_a_m_e is a
+ readonly variable.
llooggoouutt Exit a login shell.
@@ -1051,110 +1053,111 @@ BBAASSHH BBUUIILLTTIINN CCOOMMMMAANNDDSS
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 exit status is zero, unless end-of-file is en-
- countered, rreeaadd times out (in which case the status is greater
- than 128), a variable assignment error (such as assigning to a
- readonly variable) occurs, or an invalid file descriptor is sup-
- plied as the argument to --uu.
+ If no _n_a_m_e_s are supplied, the line read, without the ending de-
+ limiter but otherwise unmodified, is assigned to the variable
+ RREEPPLLYY. The exit status is zero, unless end-of-file is encoun-
+ tered, rreeaadd times out (in which case the status is greater than
+ 128), a variable assignment error (such as assigning to a read-
+ only variable) occurs, or an invalid file descriptor 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 ar-
- rays; the --AA option restricts the variables to associative ar-
+ 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 ar-
+ rays; the --AA option restricts the variables to associative ar-
rays. 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
+ _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
+ 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 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 rree--
+ 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 rree--
ttuurrnn is executed by a trap handler, the last command used to de-
- termine the status is the last command executed before the trap
- handler. If rreettuurrnn is executed during a DDEEBBUUGG trap, the last
- command used to determine the status is the last command exe-
- cuted by the trap handler before rreettuurrnn was invoked. 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
+ termine the status is the last command executed before the trap
+ handler. If rreettuurrnn is executed during a DDEEBBUUGG trap, the last
+ command used to determine the status is the last command exe-
+ cuted by the trap handler before rreettuurrnn was invoked. 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 signif-
- icant 8 bits. The return status is non-zero if rreettuurrnn is sup-
- plied a non-numeric argument, or is used outside a function and
- not during execution of a script by .. or ssoouurrccee. Any command
+ icant 8 bits. The return status is non-zero if rreettuurrnn is sup-
+ plied a non-numeric argument, or is used outside a function and
+ not during execution of a script by .. or ssoouurrccee. Any command
associated with the RREETTUURRNN trap is executed before execution re-
sumes 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 op-
- tions are specified, they set or unset shell attributes. Any
- arguments remaining after option processing are treated as val-
+ not be reset. In _p_o_s_i_x _m_o_d_e, only shell variables are listed.
+ The output is sorted according to the current locale. When op-
+ tions 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 Each variable or function that is created or modified is
- given the export attribute and marked for export to the
+ given the export attribute and marked 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 _l_i_s_t, or a _c_o_m_p_o_u_n_d _c_o_m_m_a_n_d
+ --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 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 &&&&
+ 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
+ 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
+ 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
+ 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
+ --hh Remember the location of commands as they are looked up
for execution. This is enabled by default.
- --kk All arguments in the form of assignment statements are
- placed in the environment for a command, not just those
+ --kk All arguments in the form of assignment statements are
+ placed in the environment for a command, not just those
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). All processes run
+ --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). 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 ig-
+ to check a shell script for syntax errors. This is ig-
nored by interactive shells.
--oo _o_p_t_i_o_n_-_n_a_m_e
The _o_p_t_i_o_n_-_n_a_m_e can be one of the following:
@@ -1162,10 +1165,10 @@ BBAASSHH BBUUIILLTTIINN CCOOMMMMAANNDDSS
Same as --aa.
bbrraacceeeexxppaanndd
Same as --BB.
- eemmaaccss Use an emacs-style command line editing inter-
+ eemmaaccss Use an emacs-style command line editing inter-
face. This is enabled by default when the shell
is interactive, unless the shell is started with
- the ----nnooeeddiittiinngg option. This also affects the
+ the ----nnooeeddiittiinngg option. This also affects the
editing interface used for rreeaadd --ee.
eerrrreexxiitt Same as --ee.
eerrrrttrraaccee
@@ -1179,8 +1182,8 @@ BBAASSHH BBUUIILLTTIINN CCOOMMMMAANNDDSS
HHIISSTTOORRYY. This option is on by default in inter-
active shells.
iiggnnoorreeeeooff
- The effect is as if the shell command ``IG-
- NOREEOF=10'' had been executed (see SShheellll VVaarrii--
+ The effect is as if the shell command ``IG-
+ NOREEOF=10'' had been executed (see SShheellll VVaarrii--
aabblleess above).
kkeeyywwoorrdd Same as --kk.
mmoonniittoorr Same as --mm.
@@ -1195,172 +1198,172 @@ BBAASSHH BBUUIILLTTIINN CCOOMMMMAANNDDSS
pphhyyssiiccaall
Same as --PP.
ppiippeeffaaiill
- If set, the return value of a pipeline is the
- value of the last (rightmost) command to exit
- with a non-zero status, or zero if all commands
- in the pipeline exit successfully. This option
+ If set, the return value of a pipeline is the
+ value of the last (rightmost) command to exit
+ with a non-zero status, or zero if all commands
+ in the pipeline exit successfully. This option
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). See SSEEEE AALLSSOO
+ 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). 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.
- vvii Use a vi-style command line editing interface.
+ vvii Use a vi-style command line editing interface.
This also affects the editing interface used for
rreeaadd --ee.
xxttrraaccee Same as --xx.
If --oo is supplied with no _o_p_t_i_o_n_-_n_a_m_e, the values of the
- current options are printed. If ++oo is supplied with no
- _o_p_t_i_o_n_-_n_a_m_e, a series of sseett commands to recreate the
- current option settings is displayed on the standard
+ current options are printed. If ++oo is supplied with no
+ _o_p_t_i_o_n_-_n_a_m_e, a series of sseett commands to recreate the
+ current option settings is displayed on the standard
output.
- --pp Turn on _p_r_i_v_i_l_e_g_e_d mode. In this mode, the $$EENNVV and
- $$BBAASSHH__EENNVV files are not processed, shell functions are
- not inherited from the environment, and the SSHHEELLLLOOPPTTSS,
- BBAASSHHOOPPTTSS, CCDDPPAATTHH, and GGLLOOBBIIGGNNOORREE variables, if they ap-
- pear in the environment, are ignored. If the shell is
- started with the effective user (group) id not equal to
- the real user (group) id, and the --pp option is not sup-
+ --pp Turn on _p_r_i_v_i_l_e_g_e_d mode. In this mode, the $$EENNVV and
+ $$BBAASSHH__EENNVV files are not processed, shell functions are
+ not inherited from the environment, and the SSHHEELLLLOOPPTTSS,
+ BBAASSHHOOPPTTSS, CCDDPPAATTHH, and GGLLOOBBIIGGNNOORREE variables, if they ap-
+ pear in the environment, are ignored. If the shell is
+ started with the effective user (group) id not equal to
+ the real user (group) id, and the --pp option is not sup-
plied, these actions are taken and the effective user id
- is set to the real user id. If the --pp option is sup-
- plied at startup, the effective user id is not reset.
- Turning this option off causes the effective user and
+ is set to the real user id. If the --pp option is sup-
+ plied at startup, the effective user id is not reset.
+ Turning this option off causes the effective user and
group ids to be set to the real user and group ids.
--tt Exit after reading and executing one command.
--uu Treat unset variables and parameters other than the spe-
- cial parameters "@" and "*" as an error when performing
- parameter expansion. If expansion is attempted on an
- unset variable or parameter, the shell prints an error
- message, and, if not interactive, exits with a non-zero
+ cial parameters "@" and "*" as an error when performing
+ parameter expansion. If expansion is attempted on an
+ unset variable or parameter, the shell prints an error
+ message, and, if not interactive, exits with a non-zero
status.
--vv Print shell input lines as they are read.
- --xx After expanding each _s_i_m_p_l_e _c_o_m_m_a_n_d, ffoorr command, ccaassee
+ --xx After expanding each _s_i_m_p_l_e _c_o_m_m_a_n_d, ffoorr command, ccaassee
command, sseelleecctt command, or arithmetic ffoorr command, dis-
- play the expanded value of PPSS44, followed by the command
+ play the expanded value of PPSS44, followed by the command
and its expanded arguments or associated word list.
- --BB The shell performs brace expansion (see BBrraaccee EExxppaannssiioonn
+ --BB The shell performs brace expansion (see BBrraaccee EExxppaannssiioonn
above). This is on by default.
- --CC If set, bbaasshh does not overwrite an existing file with
- the >>, >>&&, and <<>> redirection operators. This may be
+ --CC If set, bbaasshh does not overwrite an existing file with
+ the >>, >>&&, and <<>> redirection operators. This may be
overridden when creating output files by using the redi-
rection operator >>|| instead of >>.
--EE If set, any trap on EERRRR is inherited by shell functions,
- command substitutions, and commands executed in a sub-
- shell environment. The EERRRR trap is normally not inher-
+ command substitutions, and commands executed in a sub-
+ shell environment. The EERRRR trap is normally not inher-
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 resolve symbolic links when
- executing commands such as ccdd that change the current
+ --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
- chain of directories when performing commands which
+ chain of directories when performing commands which
change the current directory.
- --TT If set, any traps on DDEEBBUUGG and RREETTUURRNN are inherited by
+ --TT If set, any traps on DDEEBBUUGG and RREETTUURRNN are inherited by
shell functions, command substitutions, and commands ex-
- ecuted in a subshell environment. The DDEEBBUUGG and RREETTUURRNN
+ ecuted in a subshell environment. The DDEEBBUUGG and RREETTUURRNN
traps are normally not inherited in such cases.
- ---- If no arguments follow this option, then the positional
+ ---- If no arguments follow this option, then the positional
parameters are unset. Otherwise, the positional parame-
- ters are set to the _a_r_gs, even if some of them begin
+ ters are set to the _a_r_gs, even if some of them begin
with a --.
- -- Signal the end of options, cause all remaining _a_r_gs to
+ -- Signal the end of options, cause all remaining _a_r_gs to
be assigned to the positional parameters. The --xx and --vv
options are turned off. If there are no _a_r_gs, the posi-
tional parameters remain unchanged.
- The options are off by default unless otherwise noted. Using +
- rather than - causes these options to be turned off. The op-
+ The options are off by default unless otherwise noted. Using +
+ rather than - causes these options to be turned off. The op-
tions can also be specified as arguments to an invocation of the
- shell. The current set of options may be found in $$--. The re-
- turn status is always true unless an invalid option is encoun-
+ shell. The current set of options may be found in $$--. The re-
+ turn status is always true unless an invalid option is encoun-
tered.
sshhiifftt [_n]
- The positional parameters from _n+1 ... are renamed to $$11 ........
- Parameters represented by the numbers $$## down to $$##-_n+1 are un-
- set. _n must be a non-negative number less than or equal to $$##.
- If _n is 0, no parameters are changed. If _n is not given, it is
+ The positional parameters from _n+1 ... are renamed to $$11 ........
+ Parameters represented by the numbers $$## down to $$##-_n+1 are un-
+ set. _n must be a non-negative number less than or equal to $$##.
+ If _n is 0, no parameters are changed. If _n is not given, it is
assumed to be 1. If _n is greater than $$##, the positional param-
- eters are not changed. The return status is greater than zero
+ eters are not changed. The return status is greater than 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 settings controlling optional shell behav-
- ior. The settings can be either those listed below, or, if the
+ 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
+ of all settable options is displayed, with an indication of
whether or not each is set; if _o_p_t_n_a_m_e_s are supplied, the output
- is restricted to those options. The --pp option causes output to
- be displayed in a form that may be reused as input. Other op-
+ is restricted to those options. The --pp option causes output to
+ be displayed in a form that may be reused as input. Other op-
tions 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
+ --qq Suppresses normal output (quiet mode); the return status
indicates whether the _o_p_t_n_a_m_e is set or unset. If multi-
- ple _o_p_t_n_a_m_e arguments are given with --qq, the return sta-
- tus is zero if all _o_p_t_n_a_m_e_s are enabled; non-zero other-
+ ple _o_p_t_n_a_m_e arguments are given with --qq, the return sta-
+ tus is zero if all _o_p_t_n_a_m_e_s are enabled; non-zero other-
wise.
- --oo Restricts the values of _o_p_t_n_a_m_e to be those defined for
+ --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, sshhoopptt
- shows only those options which are set or unset, respectively.
- Unless otherwise noted, the sshhoopptt options are disabled (unset)
+ 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 op-
- tions, the return status is zero unless an _o_p_t_n_a_m_e is not a
+ 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 op-
+ tions, the return status is zero unless an _o_p_t_n_a_m_e is not a
valid shell option.
The list of sshhoopptt options is:
aassssoocc__eexxppaanndd__oonnccee
- If set, the shell suppresses multiple evaluation of as-
- sociative array subscripts during arithmetic expression
- evaluation, while executing builtins that can perform
- variable assignments, and while executing builtins that
+ If set, the shell suppresses multiple evaluation of as-
+ sociative array subscripts during arithmetic expression
+ evaluation, while executing builtins that can perform
+ variable assignments, and while executing builtins that
perform array dereferencing.
- aauuttooccdd If set, a command name that is the name of a directory
- is executed as if it were the argument to the ccdd com-
+ aauuttooccdd If set, a command name that is the name of a directory
+ is executed as if it were the argument to the ccdd com-
mand. This option is only used by interactive shells.
ccddaabbllee__vvaarrss
- If set, an argument to the ccdd builtin command that is
- not a directory is assumed to be the name of a variable
+ If set, an argument to the ccdd builtin command that is
+ not a directory is assumed to be the name of a variable
whose value is the directory to change to.
ccddssppeellll If set, minor errors in the spelling of a directory com-
- ponent in a ccdd command will be corrected. The errors
+ 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 filename is printed, and the com-
- mand proceeds. This option is only used by interactive
+ ter, and one character too many. If a correction is
+ found, the corrected filename is printed, and the com-
+ mand proceeds. This option is only used by interactive
shells.
cchheecckkhhaasshh
If set, bbaasshh checks that a command found in the hash ta-
- ble exists before trying to execute it. If a hashed
- command no longer exists, a normal path search is per-
+ ble exists before trying to execute it. If a hashed
+ command no longer exists, a normal path search is per-
formed.
cchheecckkjjoobbss
If set, bbaasshh lists the status of any stopped and running
- jobs before exiting an interactive shell. If any jobs
+ jobs before exiting an interactive shell. If any jobs
are running, this causes the exit to be deferred until a
- second exit is attempted without an intervening command
+ second exit is attempted without an intervening command
(see JJOOBB CCOONNTTRROOLL above). The shell always postpones ex-
iting if any jobs are stopped.
cchheecckkwwiinnssiizzee
- If set, bbaasshh checks the window size after each external
- (non-builtin) command and, if necessary, updates the
- values of LLIINNEESS and CCOOLLUUMMNNSS. This option is enabled by
+ If set, bbaasshh checks the window size after each external
+ (non-builtin) command and, if necessary, updates the
+ values of LLIINNEESS and CCOOLLUUMMNNSS. This option is enabled by
default.
- ccmmddhhiisstt If set, bbaasshh attempts to save all lines of a multiple-
- line command in the same history entry. This allows
- easy re-editing of multi-line commands. This option is
- enabled by default, but only has an effect if command
+ ccmmddhhiisstt If set, bbaasshh attempts to save all lines of a multiple-
+ line command in the same history entry. This allows
+ easy re-editing of multi-line commands. This option is
+ enabled by default, but only has an effect if command
history is enabled, as described above under HHIISSTTOORRYY.
ccoommppaatt3311
ccoommppaatt3322
@@ -1369,117 +1372,117 @@ BBAASSHH BBUUIILLTTIINN CCOOMMMMAANNDDSS
ccoommppaatt4422
ccoommppaatt4433
ccoommppaatt4444
- These control aspects of the shell's compatibility mode
+ These control aspects of the shell's compatibility mode
(see SSHHEELLLL CCOOMMPPAATTIIBBIILLIITTYY MMOODDEE below).
ccoommpplleettee__ffuullllqquuoottee
- If set, bbaasshh quotes all shell metacharacters in file-
- names and directory names when performing completion.
+ 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 ex-
- pand 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
+ 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 ex-
+ pand 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 buf-
- fer. If not set, bbaasshh attempts to preserve what the
+ If set, bbaasshh replaces directory names with the results
+ of word expansion when performing filename completion.
+ This changes the contents of the readline editing buf-
+ fer. 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
- the results of pathname expansion. The filenames ````..''''
- and ````....'''' must always be matched explicitly, even if
+ ddoottgglloobb If set, bbaasshh includes filenames beginning with a `.' in
+ the results of pathname expansion. The filenames ````..''''
+ and ````....'''' must always be matched explicitly, even if
ddoottgglloobb is set.
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 at shell invocation, or in a shell startup file,
+ If set at shell invocation, or in a shell startup file,
arrange to execute the debugger profile before the shell
- starts, identical to the ----ddeebbuuggggeerr option. If set af-
- ter invocation, behavior intended for use by debuggers
+ starts, identical to the ----ddeebbuuggggeerr option. If set af-
+ ter invocation, 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), the shell
+ 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), the shell
simulates a call to rreettuurrnn.
- 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 de-
- scription of FFIIGGNNOORREE. This option is enabled by de-
+ ble completions. See SSHHEELLLL VVAARRIIAABBLLEESS above for a de-
+ scription of FFIIGGNNOORREE. This option is enabled by de-
fault.
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 se-
- quence is not taken into account, so bb will not collate
- between AA and BB, and upper-case and lower-case ASCII
+ 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 se-
+ quence is not taken into account, so bb will not collate
+ 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 all files and zero or more directories
- and subdirectories. If the pattern is followed by a //,
+ 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
@@ -1487,25 +1490,25 @@ BBAASSHH BBUUIILLTTIINN CCOOMMMMAANNDDSS
GNU error message format.
hhiissttaappppeenndd
- If set, the history list is appended to the file named
+ If set, the history list is appended to the file named
by the value of the HHIISSTTFFIILLEE variable when the shell ex-
its, 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
@@ -1513,23 +1516,23 @@ BBAASSHH BBUUIILLTTIINN CCOOMMMMAANNDDSS
active login shell exits.
iinnhheerriitt__eerrrreexxiitt
- If set, command substitution inherits the value of the
- eerrrreexxiitt option, instead of unsetting it in the subshell
- environment. This option is enabled when _p_o_s_i_x _m_o_d_e is
+ If set, command substitution inherits the value of the
+ eerrrreexxiitt option, instead of unsetting it in the subshell
+ environment. This option is enabled when _p_o_s_i_x _m_o_d_e is
enabled.
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 op-
+ and all remaining characters on that line to be ignored
+ in an interactive shell (see CCOOMMMMEENNTTSS above). This op-
tion 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.
@@ -1540,43 +1543,43 @@ BBAASSHH BBUUIILLTTIINN CCOOMMMMAANNDDSS
tribute is not inherited.
llooccaallvvaarr__uunnsseett
- If set, calling uunnsseett on local variables in previous
- function scopes marks them so subsequent lookups find
- them unset until that function returns. This is identi-
- cal to the behavior of unsetting local variables at the
+ If set, calling uunnsseett on local variables in previous
+ function scopes marks them so subsequent lookups find
+ them unset until that function returns. This is identi-
+ cal to the behavior of unsetting local variables at the
current function scope.
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 at-
- tempt to search the PPAATTHH for possible completions when
+ If set, and rreeaaddlliinnee is being used, bbaasshh will not at-
+ tempt 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, when performing pattern substi-
- tution word expansions, or when filtering possible com-
+ tution word expansions, or when filtering possible com-
pletions as part of programmable completion.
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
@@ -1585,63 +1588,63 @@ BBAASSHH BBUUIILLTTIINN CCOOMMMMAANNDDSS
enabled by default.
pprrooggccoommpp__aalliiaass
- If set, and programmable completion is enabled, bbaasshh
- treats a command name that doesn't have any completions
- as a possible alias and attempts alias expansion. If it
- has an alias, bbaasshh attempts programmable completion us-
+ If set, and programmable completion is enabled, bbaasshh
+ treats a command name that doesn't have any completions
+ as a possible alias and attempts alias expansion. If it
+ has an alias, bbaasshh attempts programmable completion us-
ing the command word resulting from the expanded alias.
pprroommppttvvaarrss
If set, prompt strings undergo parameter expansion, com-
- mand substitution, arithmetic expansion, and quote re-
- moval after being expanded as described in PPRROOMMPPTTIINNGG
+ mand substitution, arithmetic expansion, and quote re-
+ moval 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 re-
- stricted 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-
+ The shell sets this option if it is started in re-
+ stricted 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-
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 se-
+ If set, the eecchhoo builtin expands backslash-escape se-
quences 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 (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 in the bbaasshh manual page under CCOONNDDII--
- TTIIOONNAALL EEXXPPRREESSSSIIOONNSS. tteesstt does not accept any options, nor does
- it accept and ignore an argument of ---- as signifying the end of
+ erand must be a separate argument. Expressions are composed of
+ the primaries described in the bbaasshh manual page under CCOONNDDII--
+ TTIIOONNAALL 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 de-
- pends on the number of arguments; see below. Operator prece-
+ Expressions may be combined using the following operators,
+ listed in decreasing order of precedence. The evaluation de-
+ pends 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.
@@ -1658,134 +1661,134 @@ 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 re-
+ The command _a_r_g is to be read and executed when the shell re-
ceives signal(s) _s_i_g_s_p_e_c. If _a_r_g is absent (and there is a sin-
- gle _s_i_g_s_p_e_c) or --, each specified signal is reset to its origi-
- nal disposition (the value it had upon entrance to the shell).
- If _a_r_g is the null string the signal specified by each _s_i_g_s_p_e_c
- is ignored by the shell and by the commands it invokes. If _a_r_g
- is not present and --pp has been supplied, then the trap commands
+ gle _s_i_g_s_p_e_c) or --, each specified signal is reset to its origi-
+ nal disposition (the value it had upon entrance to the shell).
+ If _a_r_g is the null string the signal specified by each _s_i_g_s_p_e_c
+ is ignored by the shell and by the commands it invokes. If _a_r_g
+ is not present and --pp has been supplied, then the trap commands
associated with each _s_i_g_s_p_e_c are displayed. If no arguments are
- supplied or if only --pp is given, ttrraapp prints the list of com-
- mands associated with each signal. The --ll option causes the
- shell to print a list of signal names and their corresponding
- numbers. Each _s_i_g_s_p_e_c is either a signal name defined in <_s_i_g_-
- _n_a_l_._h>, or a signal number. Signal names are case insensitive
+ supplied or if only --pp is given, ttrraapp prints the list of com-
+ mands associated with each signal. The --ll option causes the
+ shell to print a list of signal names and their corresponding
+ numbers. Each _s_i_g_s_p_e_c is either a signal name defined in <_s_i_g_-
+ _n_a_l_._h>, or a signal number. Signal names are case insensitive
and the SSIIGG prefix is optional.
- 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
+ If a _s_i_g_s_p_e_c is EERRRR, the command _a_r_g is executed whenever a
pipeline (which may consist of a single simple command), a list,
or a compound command returns a non-zero exit status, subject to
- the following conditions. The EERRRR trap is not executed if the
+ 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,
+ 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
+ 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) op-
tion.
Signals ignored upon entry to the shell cannot be trapped or re-
- set. Trapped signals that are not being ignored are reset to
+ set. Trapped signals that are not being ignored are reset to
their original values in a subshell or subshell environment when
- one is created. The return status is false if any _s_i_g_s_p_e_c is
+ one is created. The return status is false if any _s_i_g_s_p_e_c is
invalid; otherwise ttrraapp returns true.
ttyyppee [--aaffttppPP] _n_a_m_e [_n_a_m_e ...]
- With no options, indicate how each _n_a_m_e would be interpreted if
+ With no options, indicate how each _n_a_m_e would be interpreted if
used as a command name. If the --tt option is used, ttyyppee prints a
- string which is one of _a_l_i_a_s, _k_e_y_w_o_r_d, _f_u_n_c_t_i_o_n, _b_u_i_l_t_i_n, or
- _f_i_l_e if _n_a_m_e is an alias, shell reserved word, function,
- builtin, or disk file, respectively. If the _n_a_m_e is not found,
- then nothing is printed, and an exit status of false is re-
- turned. If the --pp option is used, ttyyppee either returns the name
- of the disk file that would be executed if _n_a_m_e were specified
- as a command name, or nothing if ``type -t name'' would not re-
- turn _f_i_l_e. The --PP option forces a PPAATTHH search for each _n_a_m_e,
+ string which is one of _a_l_i_a_s, _k_e_y_w_o_r_d, _f_u_n_c_t_i_o_n, _b_u_i_l_t_i_n, or
+ _f_i_l_e if _n_a_m_e is an alias, shell reserved word, function,
+ builtin, or disk file, respectively. If the _n_a_m_e is not found,
+ then nothing is printed, and an exit status of false is re-
+ turned. If the --pp option is used, ttyyppee either returns the name
+ of the disk file that would be executed if _n_a_m_e were specified
+ as a command name, or nothing if ``type -t name'' would not re-
+ turn _f_i_l_e. The --PP option forces a PPAATTHH search for each _n_a_m_e,
even if ``type -t name'' would not return _f_i_l_e. If a command is
hashed, --pp and --PP print the hashed value, which is not necessar-
- ily the file that appears first in PPAATTHH. If the --aa option is
- used, ttyyppee prints all of the places that contain an executable
+ ily the file that appears first in PPAATTHH. If the --aa option is
+ used, ttyyppee prints all of the places that contain an executable
named _n_a_m_e. This includes aliases and functions, if and only if
the --pp option is not also used. The table of hashed commands is
- not consulted when using --aa. The --ff option suppresses shell
+ not consulted when using --aa. The --ff option suppresses shell
function lookup, as with the ccoommmmaanndd builtin. ttyyppee returns true
if all of the arguments are found, false if any are not found.
uulliimmiitt [--HHSSaabbccddeeffiikkllmmnnppqqrrssttuuvvxxPPRRTT [_l_i_m_i_t]]
- Provides control over the resources available to the shell and
- to processes started by it, on systems that allow such control.
+ Provides control over the resources available to the shell and
+ to processes started by it, on systems that allow such control.
The --HH and --SS options specify that the hard or soft limit is set
- for the given resource. A hard limit cannot be increased by a
- non-root user once it is set; a soft limit may be increased up
- to the value of the hard limit. If neither --HH nor --SS is speci-
+ for the given resource. A hard limit cannot be increased by a
+ non-root user once it is set; a soft limit may be increased up
+ to the value of the hard limit. If neither --HH nor --SS is speci-
fied, both the soft and hard limits are set. The value of _l_i_m_i_t
can be a number in the unit specified for the resource or one of
the special values hhaarrdd, ssoofftt, or uunnlliimmiitteedd, which stand for the
- current hard limit, the current soft limit, and no limit, re-
- spectively. If _l_i_m_i_t is omitted, the current value of the soft
+ current hard limit, the current soft limit, and no limit, re-
+ spectively. If _l_i_m_i_t is omitted, the current value of the soft
limit of the resource is printed, unless the --HH option is given.
- When more than one resource is specified, the limit name and
- unit are printed before the value. Other options are inter-
+ When more than one resource is specified, the limit name and
+ unit are printed before the value. Other options are inter-
preted as follows:
--aa All current limits are reported
--bb The maximum socket buffer size
--cc The maximum size of core files created
--dd The maximum size of a process's data segment
--ee The maximum scheduling priority ("nice")
- --ff The maximum size of files written by the shell and its
+ --ff The maximum size of files written by the shell and its
children
--ii The maximum number of pending signals
--kk The maximum number of kqueues that may be allocated
--ll The maximum size that may be locked into memory
- --mm The maximum resident set size (many systems do not honor
+ --mm The maximum resident set size (many systems do not honor
this limit)
--nn The maximum number of open file descriptors (most systems
do not allow this value to be set)
@@ -1794,132 +1797,132 @@ BBAASSHH BBUUIILLTTIINN CCOOMMMMAANNDDSS
--rr The maximum real-time scheduling priority
--ss The maximum stack size
--tt The maximum amount of cpu time in seconds
- --uu The maximum number of processes available to a single
+ --uu The maximum number of processes available to a single
user
- --vv The maximum amount of virtual memory available to the
+ --vv The maximum amount of virtual memory available to the
shell and, on some systems, to its children
--xx The maximum number of file locks
--PP The maximum number of pseudoterminals
- --RR The maximum time a real-time process can run before
+ --RR The maximum time a real-time process can run before
blocking, in microseconds
--TT The maximum number of threads
- If _l_i_m_i_t is given, and the --aa option is not used, _l_i_m_i_t is the
- new value of the specified resource. If no option is given,
- then --ff is assumed. Values are in 1024-byte increments, except
- for --tt, which is in seconds; --RR, which is in microseconds; --pp,
- which is in units of 512-byte blocks; --PP, --TT, --bb, --kk, --nn, and
- --uu, which are unscaled values; and, when in posix mode, --cc and
- --ff, which are in 512-byte increments. The return status is 0
- unless an invalid option or argument is supplied, or an error
+ If _l_i_m_i_t is given, and the --aa option is not used, _l_i_m_i_t is the
+ new value of the specified resource. If no option is given,
+ then --ff is assumed. Values are in 1024-byte increments, except
+ for --tt, which is in seconds; --RR, which is in microseconds; --pp,
+ which is in units of 512-byte blocks; --PP, --TT, --bb, --kk, --nn, and
+ --uu, which are unscaled values; and, when in posix mode, --cc and
+ --ff, which are in 512-byte increments. The return status is 0
+ unless an invalid option or argument is supplied, or an error
occurs while setting a new limit.
uummaasskk [--pp] [--SS] [_m_o_d_e]
The user file-creation mask is set to _m_o_d_e. If _m_o_d_e begins with
- a digit, it is interpreted as an octal number; otherwise it is
- interpreted as a symbolic mode mask similar to that accepted by
- _c_h_m_o_d(1). If _m_o_d_e is omitted, the current value of the mask is
- printed. The --SS option causes the mask to be printed in sym-
- bolic form; the default output is an octal number. If the --pp
+ a digit, it is interpreted as an octal number; otherwise it is
+ interpreted as a symbolic mode mask similar to that accepted by
+ _c_h_m_o_d(1). If _m_o_d_e is omitted, the current value of the mask is
+ printed. The --SS option causes the mask to be printed in sym-
+ bolic form; the default output is an octal number. If the --pp
option is supplied, and _m_o_d_e is omitted, the output is in a form
that may be reused as input. The return status is 0 if the mode
- was successfully changed or if no _m_o_d_e argument was supplied,
+ was successfully changed or if no _m_o_d_e argument was supplied,
and false otherwise.
uunnaalliiaass [-aa] [_n_a_m_e ...]
- Remove each _n_a_m_e from the list of defined aliases. If --aa is
- supplied, all alias definitions are removed. The return value
+ Remove each _n_a_m_e from the list of defined aliases. If --aa is
+ supplied, all alias definitions are removed. The return value
is true unless a supplied _n_a_m_e is not a defined alias.
uunnsseett [-ffvv] [-nn] [_n_a_m_e ...]
- For each _n_a_m_e, remove the corresponding variable or function.
+ For each _n_a_m_e, remove the corresponding variable or function.
If the --vv option is given, each _n_a_m_e refers to a shell variable,
- and that variable is removed. Read-only variables may not be
- unset. If --ff is specified, each _n_a_m_e refers to a shell func-
- tion, and the function definition is removed. If the --nn option
- is supplied, and _n_a_m_e is a variable with the _n_a_m_e_r_e_f attribute,
- _n_a_m_e will be unset rather than the variable it references. --nn
- has no effect if the --ff option is supplied. If no options are
- supplied, each _n_a_m_e refers to a variable; if there is no vari-
- able by that name, a function with that name, if any, is unset.
- Each unset variable or function is removed from the environment
- passed to subsequent commands. If any of BBAASSHH__AALLIIAASSEESS,
+ and that variable is removed. Read-only variables may not be
+ unset. If --ff is specified, each _n_a_m_e refers to a shell func-
+ tion, and the function definition is removed. If the --nn option
+ is supplied, and _n_a_m_e is a variable with the _n_a_m_e_r_e_f attribute,
+ _n_a_m_e will be unset rather than the variable it references. --nn
+ has no effect if the --ff option is supplied. If no options are
+ supplied, each _n_a_m_e refers to a variable; if there is no vari-
+ able by that name, a function with that name, if any, is unset.
+ Each unset variable or function is removed from the environment
+ passed to subsequent commands. If any of BBAASSHH__AALLIIAASSEESS,
BBAASSHH__AARRGGVV00, BBAASSHH__CCMMDDSS, BBAASSHH__CCOOMMMMAANNDD, BBAASSHH__SSUUBBSSHHEELLLL, BBAASSHHPPIIDD,
- CCOOMMPP__WWOORRDDBBRREEAAKKSS, DDIIRRSSTTAACCKK, EEPPOOCCHHRREEAALLTTIIMMEE, EEPPOOCCHHSSEECCOONNDDSS, FFUUNNCC--
- NNAAMMEE, GGRROOUUPPSS, HHIISSTTCCMMDD, LLIINNEENNOO, RRAANNDDOOMM, SSEECCOONNDDSS, or SSRRAANNDDOOMM are
+ CCOOMMPP__WWOORRDDBBRREEAAKKSS, DDIIRRSSTTAACCKK, EEPPOOCCHHRREEAALLTTIIMMEE, EEPPOOCCHHSSEECCOONNDDSS, FFUUNNCC--
+ NNAAMMEE, GGRROOUUPPSS, HHIISSTTCCMMDD, LLIINNEENNOO, RRAANNDDOOMM, SSEECCOONNDDSS, or SSRRAANNDDOOMM are
unset, they lose their special properties, even if they are sub-
sequently reset. The exit status is true unless a _n_a_m_e is read-
only.
wwaaiitt [--ffnn] [--pp _v_a_r_n_a_m_e] [_i_d _._._.]
Wait for each specified child process and return its termination
- status. Each _i_d may be a process ID or a job specification; if
- a job spec is given, all processes in that job's pipeline are
- waited for. If _i_d is not given, wwaaiitt waits for all running
- background jobs and the last-executed process substitution, if
+ status. Each _i_d may be a process ID or a job specification; if
+ a job spec is given, all processes in that job's pipeline are
+ waited for. If _i_d is not given, wwaaiitt waits for all running
+ background jobs and the last-executed process substitution, if
its process id is the same as $$!!, and the return status is zero.
- If the --nn option is supplied, wwaaiitt waits for a single job from
+ If the --nn option is supplied, wwaaiitt waits for a single job from
the list of _i_ds or, if no _i_ds are supplied, any job, to complete
- and returns its exit status. If none of the supplied arguments
+ and returns its exit status. If none of the supplied arguments
is a child of the shell, or if no arguments are supplied and the
- shell has no unwaited-for children, the exit status is 127. If
- the --pp option is supplied, the process or job identifier of the
- job for which the exit status is returned is assigned to the
- variable _v_a_r_n_a_m_e named by the option argument. The variable
- will be unset initially, before any assignment. This is useful
- only when the --nn option is supplied. Supplying the --ff option,
- when job control is enabled, forces wwaaiitt to wait for _i_d to ter-
+ shell has no unwaited-for children, the exit status is 127. If
+ the --pp option is supplied, the process or job identifier of the
+ job for which the exit status is returned is assigned to the
+ variable _v_a_r_n_a_m_e named by the option argument. The variable
+ will be unset initially, before any assignment. This is useful
+ only when the --nn option is supplied. Supplying the --ff option,
+ when job control is enabled, forces wwaaiitt to wait for _i_d to ter-
minate before returning its status, instead of returning when it
- changes status. If _i_d specifies a non-existent process or job,
- the return status is 127. Otherwise, the return status is the
+ changes status. If _i_d 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.
SSHHEELLLL CCOOMMPPAATTIIBBIILLIITTYY MMOODDEE
Bash-4.0 introduced the concept of a `shell compatibility level', spec-
ified as a set of options to the shopt builtin ccoommppaatt3311, ccoommppaatt3322, ccoomm--
- ppaatt4400, ccoommppaatt4411, and so on). There is only one current compatibility
+ ppaatt4400, ccoommppaatt4411, and so on). There is only one current compatibility
level -- each option is mutually exclusive. The compatibility level is
- intended to allow users to select behavior from previous versions that
- is incompatible with newer versions while they migrate scripts to use
- current features and behavior. It's intended to be a temporary solu-
+ intended to allow users to select behavior from previous versions that
+ is incompatible with newer versions while they migrate scripts to use
+ current features and behavior. It's intended to be a temporary solu-
tion.
- This section does not mention behavior that is standard for a particu-
- lar version (e.g., setting ccoommppaatt3322 means that quoting the rhs of the
- regexp matching operator quotes special regexp characters in the word,
+ This section does not mention behavior that is standard for a particu-
+ lar version (e.g., setting ccoommppaatt3322 means that quoting the rhs of the
+ regexp matching operator quotes special regexp characters in the word,
which is default behavior in bash-3.2 and above).
- If a user enables, say, ccoommppaatt3322, it may affect the behavior of other
- compatibility levels up to and including the current compatibility
- level. The idea is that each compatibility level controls behavior
- that changed in that version of bbaasshh, but that behavior may have been
- present in earlier versions. For instance, the change to use locale-
- based comparisons with the [[[[ command came in bash-4.1, and earlier
+ If a user enables, say, ccoommppaatt3322, it may affect the behavior of other
+ compatibility levels up to and including the current compatibility
+ level. The idea is that each compatibility level controls behavior
+ that changed in that version of bbaasshh, but that behavior may have been
+ present in earlier versions. For instance, the change to use locale-
+ based comparisons with the [[[[ command came in bash-4.1, and earlier
versions used ASCII-based comparisons, so enabling ccoommppaatt3322 will enable
- ASCII-based comparisons as well. That granularity may not be suffi-
- cient for all uses, and as a result users should employ compatibility
- levels carefully. Read the documentation for a particular feature to
+ ASCII-based comparisons as well. That granularity may not be suffi-
+ cient for all uses, and as a result users should employ compatibility
+ levels carefully. Read the documentation for a particular feature to
find out the current behavior.
- Bash-4.3 introduced a new shell variable: BBAASSHH__CCOOMMPPAATT. The value as-
+ Bash-4.3 introduced a new shell variable: BBAASSHH__CCOOMMPPAATT. The value as-
signed to this variable (a decimal version number like 4.2, or an inte-
- ger corresponding to the ccoommppaatt_N_N option, like 42) determines the com-
+ ger corresponding to the ccoommppaatt_N_N option, like 42) determines the com-
patibility level.
- Starting with bash-4.4, Bash has begun deprecating older compatibility
- levels. Eventually, the options will be removed in favor of BBAASSHH__CCOOMM--
+ Starting with bash-4.4, Bash has begun deprecating older compatibility
+ levels. Eventually, the options will be removed in favor of BBAASSHH__CCOOMM--
PPAATT.
- Bash-5.0 is the final version for which there will be an individual
- shopt option for the previous version. Users should use BBAASSHH__CCOOMMPPAATT on
+ Bash-5.0 is the final version for which there will be an individual
+ shopt option for the previous version. Users should use BBAASSHH__CCOOMMPPAATT on
bash-5.0 and later versions.
- The following table describes the behavior changes controlled by each
+ The following table describes the behavior changes controlled by each
compatibility level setting. The ccoommppaatt_N_N tag is used as shorthand for
setting the compatibility level to _N_N using one of the following mecha-
- nisms. For versions prior to bash-5.0, the compatibility level may be
- set using the corresponding ccoommppaatt_N_N shopt option. For bash-4.3 and
- later versions, the BBAASSHH__CCOOMMPPAATT variable is preferred, and it is re-
+ nisms. For versions prior to bash-5.0, the compatibility level may be
+ set using the corresponding ccoommppaatt_N_N shopt option. For bash-4.3 and
+ later versions, the BBAASSHH__CCOOMMPPAATT variable is preferred, and it is re-
quired for bash-5.1 and later versions.
ccoommppaatt3311
@@ -1927,75 +1930,80 @@ SSHHEELLLL CCOOMMPPAATTIIBBIILLIITTYY MMOODDEE
ator (=~) has no special effect
ccoommppaatt3322
- +o interrupting a command list such as "a ; b ; c" causes
- the execution of the next command in the list (in
- bash-4.0 and later versions, the shell acts as if it re-
- ceived the interrupt, so interrupting one command in a
+ +o interrupting a command list such as "a ; b ; c" causes
+ the execution of the next command in the list (in
+ bash-4.0 and later versions, the shell acts as if it re-
+ ceived the interrupt, so interrupting one command in a
list aborts the execution of the entire list)
ccoommppaatt4400
- +o the << and >> operators to the [[[[ command do not consider
+ +o the << and >> operators to the [[[[ command do not consider
the current locale when comparing strings; they use ASCII
ordering. Bash versions prior to bash-4.1 use ASCII col-
- lation and _s_t_r_c_m_p(3); bash-4.1 and later use the current
+ lation and _s_t_r_c_m_p(3); bash-4.1 and later use the current
locale's collation sequence and _s_t_r_c_o_l_l(3).
ccoommppaatt4411
- +o in _p_o_s_i_x mode, ttiimmee may be followed by options and still
+ +o in _p_o_s_i_x mode, ttiimmee may be followed by options and still
be recognized as a reserved word (this is POSIX interpre-
tation 267)
+o in _p_o_s_i_x mode, the parser requires that an even number of
- single quotes occur in the _w_o_r_d portion of a double-
- quoted parameter expansion and treats them specially, so
- that characters within the single quotes are considered
+ single quotes occur in the _w_o_r_d portion of a double-
+ quoted parameter expansion and treats them specially, so
+ that characters within the single quotes are considered
quoted (this is POSIX interpretation 221)
ccoommppaatt4422
+o the replacement string in double-quoted pattern substitu-
- tion does not undergo quote removal, as it does in ver-
+ tion does not undergo quote removal, as it does in ver-
sions after bash-4.2
- +o in posix mode, single quotes are considered special when
- expanding the _w_o_r_d portion of a double-quoted parameter
- expansion and can be used to quote a closing brace or
- other special character (this is part of POSIX interpre-
- tation 221); in later versions, single quotes are not
+ +o in posix mode, single quotes are considered special when
+ expanding the _w_o_r_d portion of a double-quoted parameter
+ expansion and can be used to quote a closing brace or
+ other special character (this is part of POSIX interpre-
+ tation 221); in later versions, single quotes are not
special within double-quoted word expansions
ccoommppaatt4433
- +o the shell does not print a warning message if an attempt
- is made to use a quoted compound assignment as an argu-
- ment to declare (declare -a foo='(1 2)'). Later versions
+ +o the shell does not print a warning message if an attempt
+ is made to use a quoted compound assignment as an argu-
+ ment to declare (declare -a foo='(1 2)'). Later versions
warn that this usage is deprecated
- +o word expansion errors are considered non-fatal errors
- that cause the current command to fail, even in posix
- mode (the default behavior is to make them fatal errors
+ +o word expansion errors are considered non-fatal errors
+ that cause the current command to fail, even in posix
+ mode (the default behavior is to make them fatal errors
that cause the shell to exit)
- +o when executing a shell function, the loop state
+ +o when executing a shell function, the loop state
(while/until/etc.) is not reset, so bbrreeaakk or ccoonnttiinnuuee in
that function will break or continue loops in the calling
- context. Bash-4.4 and later reset the loop state to pre-
+ context. Bash-4.4 and later reset the loop state to pre-
vent this
ccoommppaatt4444
- +o the shell sets up the values used by BBAASSHH__AARRGGVV and
- BBAASSHH__AARRGGCC so they can expand to the shell's positional
+ +o the shell sets up the values used by BBAASSHH__AARRGGVV and
+ BBAASSHH__AARRGGCC so they can expand to the shell's positional
parameters even if extended debugging mode is not enabled
- +o a subshell inherits loops from its parent context, so
- bbrreeaakk or ccoonnttiinnuuee will cause the subshell to exit.
- Bash-5.0 and later reset the loop state to prevent the
+ +o a subshell inherits loops from its parent context, so
+ bbrreeaakk or ccoonnttiinnuuee will cause the subshell to exit.
+ Bash-5.0 and later reset the loop state to prevent the
exit
- +o variable assignments preceding builtins like eexxppoorrtt and
+ +o variable assignments preceding builtins like eexxppoorrtt and
rreeaaddoonnllyy that set attributes continue to affect variables
with the same name in the calling environment even if the
shell is not in posix mode
ccoommppaatt5500
- +o Bash-5.1 changed the way $$RRAANNDDOOMM is generated to intro-
+ +o Bash-5.1 changed the way $$RRAANNDDOOMM is generated to intro-
duce slightly more randomness. If the shell compatibility
- level is set to 50 or lower, it reverts to the method
- from bash-5.0 and previous versions, so seeding the ran-
- dom number generator by assigning a value to RRAANNDDOOMM will
+ level is set to 50 or lower, it reverts to the method
+ from bash-5.0 and previous versions, so seeding the ran-
+ dom number generator by assigning a value to RRAANNDDOOMM will
produce the same sequence as in bash-5.0
+ +o If the command hash table is empty, bash versions prior
+ to bash-5.1 printed an informational message to that ef-
+ fect, even when producing output that can be reused as
+ input. Bash-5.1 suppresses that message when the --ll op-
+ tion is supplied.
SSEEEE AALLSSOO
bash(1), sh(1)