N\bNA\bAM\bME\bE
- bash, :, ., [, alias, bg, bind, break, builtin, caller, cd, command,
- compgen, complete, compopt, continue, declare, dirs, disown, echo, en-
- able, eval, exec, exit, export, false, fc, fg, getopts, hash, help,
- history, jobs, kill, let, local, logout, mapfile, popd, printf, pushd,
- pwd, read, readonly, return, set, shift, shopt, source, suspend, test,
+ :, ., [, alias, bg, bind, break, builtin, caller, cd, command, compgen,
+ complete, compopt, continue, declare, dirs, disown, echo, enable, eval,
+ exec, exit, export, false, fc, fg, getopts, hash, help, history, jobs,
+ kill, let, local, logout, mapfile, popd, printf, pushd, pwd, read,
+ readarray, readonly, return, set, shift, shopt, source, suspend, test,
times, trap, true, type, typeset, ulimit, umask, unalias, unset, wait -
bash built-in commands, see b\bba\bas\bsh\bh(1)
vironment and return the exit status of the last command exe-
cuted from _\bf_\bi_\bl_\be_\bn_\ba_\bm_\be. If _\bf_\bi_\bl_\be_\bn_\ba_\bm_\be does not contain a slash,
filenames in P\bPA\bAT\bTH\bH are used to find the directory containing
- _\bf_\bi_\bl_\be_\bn_\ba_\bm_\be. The file searched for in P\bPA\bAT\bTH\bH need not be executable.
- When b\bba\bas\bsh\bh is not in _\bp_\bo_\bs_\bi_\bx _\bm_\bo_\bd_\be, the current directory is
- searched if no file is found in P\bPA\bAT\bTH\bH. If the s\bso\bou\bur\brc\bce\bep\bpa\bat\bth\bh option
- to the s\bsh\bho\bop\bpt\bt builtin command is turned off, the P\bPA\bAT\bTH\bH is not
- searched. If any _\ba_\br_\bg_\bu_\bm_\be_\bn_\bt_\bs are supplied, they become the posi-
- tional parameters when _\bf_\bi_\bl_\be_\bn_\ba_\bm_\be is executed. Otherwise the po-
- sitional parameters are unchanged. If the -\b-T\bT option is enabled,
- s\bso\bou\bur\brc\bce\be inherits any trap on D\bDE\bEB\bBU\bUG\bG; if it is not, any D\bDE\bEB\bBU\bUG\bG trap
- string is saved and restored around the call to s\bso\bou\bur\brc\bce\be, and
- s\bso\bou\bur\brc\bce\be unsets the D\bDE\bEB\bBU\bUG\bG trap while it executes. If -\b-T\bT is not
- set, and the sourced file changes the D\bDE\bEB\bBU\bUG\bG trap, the new value
- is retained when s\bso\bou\bur\brc\bce\be completes. The return status is the
- status of the last command exited within the script (0 if no
- commands are executed), and false if _\bf_\bi_\bl_\be_\bn_\ba_\bm_\be is not found or
- cannot be read.
+ _\bf_\bi_\bl_\be_\bn_\ba_\bm_\be, but _\bf_\bi_\bl_\be_\bn_\ba_\bm_\be does not need to be executable. The file
+ searched for in P\bPA\bAT\bTH\bH need not be executable. When b\bba\bas\bsh\bh is not
+ in _\bp_\bo_\bs_\bi_\bx _\bm_\bo_\bd_\be, it searches the current directory if no file is
+ found in P\bPA\bAT\bTH\bH. If the s\bso\bou\bur\brc\bce\bep\bpa\bat\bth\bh option to the s\bsh\bho\bop\bpt\bt builtin
+ command is turned off, the P\bPA\bAT\bTH\bH is not searched. If any _\ba_\br_\bg_\bu_\b-
+ _\bm_\be_\bn_\bt_\bs are supplied, they become the positional parameters when
+ _\bf_\bi_\bl_\be_\bn_\ba_\bm_\be is executed. Otherwise the positional parameters are
+ unchanged. If the -\b-T\bT option is enabled, .\b. inherits any trap on
+ D\bDE\bEB\bBU\bUG\bG; if it is not, any D\bDE\bEB\bBU\bUG\bG trap string is saved and restored
+ around the call to .\b., and .\b. unsets the D\bDE\bEB\bBU\bUG\bG trap while it exe-
+ cutes. If -\b-T\bT is not set, and the sourced file changes the D\bDE\bEB\bBU\bUG\bG
+ trap, the new value is retained when .\b. completes. The return
+ status is the status of the last command exited within the
+ script (0 if no commands are executed), and false if _\bf_\bi_\bl_\be_\bn_\ba_\bm_\be is
+ not found or cannot be read.
a\bal\bli\bia\bas\bs [-\b-p\bp] [_\bn_\ba_\bm_\be[=_\bv_\ba_\bl_\bu_\be] ...]
A\bAl\bli\bia\bas\bs with no arguments or with the -\b-p\bp option prints the list of
b\bbi\bin\bnd\bd [-\b-m\bm _\bk_\be_\by_\bm_\ba_\bp] -\b-x\bx _\bk_\be_\by_\bs_\be_\bq:_\bs_\bh_\be_\bl_\bl_\b-_\bc_\bo_\bm_\bm_\ba_\bn_\bd
b\bbi\bin\bnd\bd [-\b-m\bm _\bk_\be_\by_\bm_\ba_\bp] _\bk_\be_\by_\bs_\be_\bq:_\bf_\bu_\bn_\bc_\bt_\bi_\bo_\bn_\b-_\bn_\ba_\bm_\be
b\bbi\bin\bnd\bd [-\b-m\bm _\bk_\be_\by_\bm_\ba_\bp] _\bk_\be_\by_\bs_\be_\bq:_\br_\be_\ba_\bd_\bl_\bi_\bn_\be_\b-_\bc_\bo_\bm_\bm_\ba_\bn_\bd
+ b\bbi\bin\bnd\bd _\br_\be_\ba_\bd_\bl_\bi_\bn_\be_\b-_\bc_\bo_\bm_\bm_\ba_\bn_\bd_\b-_\bl_\bi_\bn_\be
Display current r\bre\bea\bad\bdl\bli\bin\bne\be key and function bindings, bind a key
sequence to a r\bre\bea\bad\bdl\bli\bin\bne\be function or macro, or set a r\bre\bea\bad\bdl\bli\bin\bne\be
variable. Each non-option argument is a command as it would ap-
- pear in _\b._\bi_\bn_\bp_\bu_\bt_\br_\bc, but each binding or command must be passed as
- a separate argument; e.g., '"\C-x\C-r": re-read-init-file'. Op-
- tions, if supplied, have the following meanings:
+ pear in a r\bre\bea\bad\bdl\bli\bin\bne\be initialization file such as _\b._\bi_\bn_\bp_\bu_\bt_\br_\bc, but
+ each binding or command must be passed as a separate argument;
+ e.g., '"\C-x\C-r": re-read-init-file'. Options, if supplied,
+ have the following meanings:
-\b-m\bm _\bk_\be_\by_\bm_\ba_\bp
Use _\bk_\be_\by_\bm_\ba_\bp as the keymap to be affected by the subsequent
bindings. Acceptable _\bk_\be_\by_\bm_\ba_\bp names are _\be_\bm_\ba_\bc_\bs_\b, _\be_\bm_\ba_\bc_\bs_\b-_\bs_\bt_\ba_\bn_\b-
- _\bd_\ba_\br_\bd_\b, _\be_\bm_\ba_\bc_\bs_\b-_\bm_\be_\bt_\ba_\b, _\be_\bm_\ba_\bc_\bs_\b-_\bc_\bt_\bl_\bx_\b, _\bv_\bi_\b, _\bv_\bi_\b-_\bm_\bo_\bv_\be_\b, _\bv_\bi_\b-_\bc_\bo_\bm_\bm_\ba_\bn_\bd,
- and _\bv_\bi_\b-_\bi_\bn_\bs_\be_\br_\bt. _\bv_\bi is equivalent to _\bv_\bi_\b-_\bc_\bo_\bm_\bm_\ba_\bn_\bd (_\bv_\bi_\b-_\bm_\bo_\bv_\be
- is also a synonym); _\be_\bm_\ba_\bc_\bs is equivalent to _\be_\bm_\ba_\bc_\bs_\b-_\bs_\bt_\ba_\bn_\b-
+ _\bd_\ba_\br_\bd_\b, _\be_\bm_\ba_\bc_\bs_\b-_\bm_\be_\bt_\ba_\b, _\be_\bm_\ba_\bc_\bs_\b-_\bc_\bt_\bl_\bx_\b, _\bv_\bi_\b, _\bv_\bi_\b-_\bm_\bo_\bv_\be_\b, _\bv_\bi_\b-_\bc_\bo_\bm_\bm_\ba_\bn_\bd,
+ and _\bv_\bi_\b-_\bi_\bn_\bs_\be_\br_\bt. _\bv_\bi is equivalent to _\bv_\bi_\b-_\bc_\bo_\bm_\bm_\ba_\bn_\bd (_\bv_\bi_\b-_\bm_\bo_\bv_\be
+ is also a synonym); _\be_\bm_\ba_\bc_\bs is equivalent to _\be_\bm_\ba_\bc_\bs_\b-_\bs_\bt_\ba_\bn_\b-
_\bd_\ba_\br_\bd.
-\b-l\bl List the names of all r\bre\bea\bad\bdl\bli\bin\bne\be functions.
- -\b-p\bp Display r\bre\bea\bad\bdl\bli\bin\bne\be function names and bindings in such a
+ -\b-p\bp Display r\bre\bea\bad\bdl\bli\bin\bne\be function names and bindings in such a
way that they can be re-read.
-\b-P\bP List current r\bre\bea\bad\bdl\bli\bin\bne\be function names and bindings.
- -\b-s\bs Display r\bre\bea\bad\bdl\bli\bin\bne\be key sequences bound to macros and the
- strings they output in such a way that they can be re-
+ -\b-s\bs Display r\bre\bea\bad\bdl\bli\bin\bne\be key sequences bound to macros and the
+ strings they output in such a way that they can be re-
read.
- -\b-S\bS Display r\bre\bea\bad\bdl\bli\bin\bne\be key sequences bound to macros and the
+ -\b-S\bS Display r\bre\bea\bad\bdl\bli\bin\bne\be key sequences bound to macros and the
strings they output.
- -\b-v\bv Display r\bre\bea\bad\bdl\bli\bin\bne\be variable names and values in such a way
+ -\b-v\bv Display r\bre\bea\bad\bdl\bli\bin\bne\be variable names and values in such a way
that they can be re-read.
-\b-V\bV List current r\bre\bea\bad\bdl\bli\bin\bne\be variable names and values.
-\b-f\bf _\bf_\bi_\bl_\be_\bn_\ba_\bm_\be
Remove any current binding for _\bk_\be_\by_\bs_\be_\bq.
-\b-x\bx _\bk_\be_\by_\bs_\be_\bq:\b:_\bs_\bh_\be_\bl_\bl_\b-_\bc_\bo_\bm_\bm_\ba_\bn_\bd
Cause _\bs_\bh_\be_\bl_\bl_\b-_\bc_\bo_\bm_\bm_\ba_\bn_\bd to be executed whenever _\bk_\be_\by_\bs_\be_\bq is en-
- tered. When _\bs_\bh_\be_\bl_\bl_\b-_\bc_\bo_\bm_\bm_\ba_\bn_\bd is executed, the shell sets
- the R\bRE\bEA\bAD\bDL\bLI\bIN\bNE\bE_\b_L\bLI\bIN\bNE\bE variable to the contents of the r\bre\bea\bad\bd-\b-
+ tered. When _\bs_\bh_\be_\bl_\bl_\b-_\bc_\bo_\bm_\bm_\ba_\bn_\bd is executed, the shell sets
+ the R\bRE\bEA\bAD\bDL\bLI\bIN\bNE\bE_\b_L\bLI\bIN\bNE\bE variable to the contents of the r\bre\bea\bad\bd-\b-
l\bli\bin\bne\be line buffer and the R\bRE\bEA\bAD\bDL\bLI\bIN\bNE\bE_\b_P\bPO\bOI\bIN\bNT\bT and R\bRE\bEA\bAD\bDL\bLI\bIN\bNE\bE_\b_M\bMA\bAR\bRK\bK
- variables to the current location of the insertion point
- and the saved insertion point (the mark), respectively.
- If the executed command changes the value of any of R\bRE\bEA\bAD\bD-\b-
- L\bLI\bIN\bNE\bE_\b_L\bLI\bIN\bNE\bE, R\bRE\bEA\bAD\bDL\bLI\bIN\bNE\bE_\b_P\bPO\bOI\bIN\bNT\bT, or R\bRE\bEA\bAD\bDL\bLI\bIN\bNE\bE_\b_M\bMA\bAR\bRK\bK, those new
- values will be reflected in the editing state.
+ variables to the current location of the insertion point
+ and the saved insertion point (the mark), respectively.
+ The shell assigns any numeric argument the user supplied
+ to the R\bRE\bEA\bAD\bDL\bLI\bIN\bNE\bE_\b_A\bAR\bRG\bGU\bUM\bME\bEN\bNT\bT variable. If there was no argu-
+ ment, that variable is not set. If the executed command
+ changes the value of any of R\bRE\bEA\bAD\bDL\bLI\bIN\bNE\bE_\b_L\bLI\bIN\bNE\bE, R\bRE\bEA\bAD\bD-\b-
+ L\bLI\bIN\bNE\bE_\b_P\bPO\bOI\bIN\bNT\bT, or R\bRE\bEA\bAD\bDL\bLI\bIN\bNE\bE_\b_M\bMA\bAR\bRK\bK, those new values will be
+ reflected in the editing state.
-\b-X\bX List all key sequences bound to shell commands and the
associated commands in a format that can be reused as in-
put.
c\bcd\bd [-\b-L\bL|[-\b-P\bP [-\b-e\be]] [-@]] [_\bd_\bi_\br]
Change the current directory to _\bd_\bi_\br. if _\bd_\bi_\br is not supplied,
- the value of the H\bHO\bOM\bME\bE shell variable is the default. Any addi-
- tional arguments following _\bd_\bi_\br are ignored. The variable C\bCD\bDP\bPA\bAT\bTH\bH
- defines the search path for the directory containing _\bd_\bi_\br: each
- directory name in C\bCD\bDP\bPA\bAT\bTH\bH is searched for _\bd_\bi_\br. Alternative di-
- rectory names in C\bCD\bDP\bPA\bAT\bTH\bH are separated by a colon (:). A null
- directory name in C\bCD\bDP\bPA\bAT\bTH\bH is the same as the current directory,
- i.e., ``.\b.''. If _\bd_\bi_\br begins with a slash (/), then C\bCD\bDP\bPA\bAT\bTH\bH is not
- used. The -\b-P\bP option causes c\bcd\bd to use the physical directory
- structure by resolving symbolic links while traversing _\bd_\bi_\br and
- before processing instances of _\b._\b. in _\bd_\bi_\br (see also the -\b-P\bP option
- to the s\bse\bet\bt builtin command); the -\b-L\bL option forces symbolic links
- to be followed by resolving the link after processing instances
- of _\b._\b. in _\bd_\bi_\br. If _\b._\b. appears in _\bd_\bi_\br, it is processed by removing
- the immediately previous pathname component from _\bd_\bi_\br, back to a
- slash or the beginning of _\bd_\bi_\br. If the -\b-e\be option is supplied
- with -\b-P\bP, and the current working directory cannot be success-
- fully determined after a successful directory change, c\bcd\bd will
- return an unsuccessful status. On systems that support it, the
- -\b-@\b@ option presents the extended attributes associated with a
- file as a directory. An argument of -\b- is converted to $\b$O\bOL\bLD\bDP\bPW\bWD\bD
- before the directory change is attempted. If a non-empty direc-
- tory name from C\bCD\bDP\bPA\bAT\bTH\bH is used, or if -\b- 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.
+ the value of the H\bHO\bOM\bME\bE shell variable is the default. The vari-
+ able C\bCD\bDP\bPA\bAT\bTH\bH defines the search path for the directory containing
+ _\bd_\bi_\br: each directory name in C\bCD\bDP\bPA\bAT\bTH\bH is searched for _\bd_\bi_\br. Alter-
+ native directory names in C\bCD\bDP\bPA\bAT\bTH\bH are separated by a colon (:).
+ A null directory name in C\bCD\bDP\bPA\bAT\bTH\bH is the same as the current di-
+ rectory, i.e., ``.\b.''. If _\bd_\bi_\br begins with a slash (/), then C\bCD\bD-\b-
+ P\bPA\bAT\bTH\bH is not used. The -\b-P\bP option causes c\bcd\bd to use the physical
+ directory structure by resolving symbolic links while traversing
+ _\bd_\bi_\br and before processing instances of _\b._\b. in _\bd_\bi_\br (see also the
+ -\b-P\bP option to the s\bse\bet\bt builtin command); the -\b-L\bL option forces sym-
+ bolic links to be followed by resolving the link after process-
+ ing instances of _\b._\b. in _\bd_\bi_\br. If _\b._\b. appears in _\bd_\bi_\br, it is pro-
+ cessed by removing the immediately previous pathname component
+ from _\bd_\bi_\br, back to a slash or the beginning of _\bd_\bi_\br. If the -\b-e\be
+ option is supplied with -\b-P\bP, and the current working directory
+ cannot be successfully determined after a successful directory
+ change, c\bcd\bd will return an unsuccessful status. On systems that
+ support it, the -\b-@\b@ option presents the extended attributes asso-
+ ciated with a file as a directory. An argument of -\b- is con-
+ verted to $\b$O\bOL\bLD\bDP\bPW\bWD\bD before the directory change is attempted. If
+ a non-empty directory name from C\bCD\bDP\bPA\bAT\bTH\bH is used, or if -\b- is the
+ first argument, and the directory change is successful, the ab-
+ solute pathname of the new working directory is written to the
+ standard output. If the directory change is successful, c\bcd\bd sets
+ the value of the P\bPW\bWD\bD environment variable to the new directory
+ name, and sets the O\bOL\bLD\bDP\bPW\bWD\bD environment variable to the value of
+ the current working directory before the change. The return
+ value is true if the directory was successfully changed; false
+ otherwise.
c\bco\bom\bmm\bma\ban\bnd\bd [-\b-p\bpV\bVv\bv] _\bc_\bo_\bm_\bm_\ba_\bn_\bd [_\ba_\br_\bg ...]
- Run _\bc_\bo_\bm_\bm_\ba_\bn_\bd with _\ba_\br_\bg_\bs suppressing the normal shell function
+ Run _\bc_\bo_\bm_\bm_\ba_\bn_\bd with _\ba_\br_\bg_\bs suppressing the normal shell function
lookup. Only builtin commands or commands found in the P\bPA\bAT\bTH\bH are
- executed. If the -\b-p\bp option is given, the search for _\bc_\bo_\bm_\bm_\ba_\bn_\bd is
- performed using a default value for P\bPA\bAT\bTH\bH that is guaranteed to
- find all of the standard utilities. If either the -\b-V\bV or -\b-v\bv op-
- tion is supplied, a description of _\bc_\bo_\bm_\bm_\ba_\bn_\bd is printed. The -\b-v\bv
- option causes a single word indicating the command or filename
+ executed. If the -\b-p\bp option is given, the search for _\bc_\bo_\bm_\bm_\ba_\bn_\bd is
+ performed using a default value for P\bPA\bAT\bTH\bH that is guaranteed to
+ find all of the standard utilities. If either the -\b-V\bV or -\b-v\bv op-
+ tion is supplied, a description of _\bc_\bo_\bm_\bm_\ba_\bn_\bd is printed. The -\b-v\bv
+ option causes a single word indicating the command or filename
used to invoke _\bc_\bo_\bm_\bm_\ba_\bn_\bd to be displayed; the -\b-V\bV option produces a
- more verbose description. If the -\b-V\bV or -\b-v\bv option is supplied,
- the exit status is 0 if _\bc_\bo_\bm_\bm_\ba_\bn_\bd was found, and 1 if not. If
+ more verbose description. If the -\b-V\bV or -\b-v\bv option is supplied,
+ the exit status is 0 if _\bc_\bo_\bm_\bm_\ba_\bn_\bd was found, and 1 if not. If
neither option is supplied and an error occurred or _\bc_\bo_\bm_\bm_\ba_\bn_\bd 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 c\bco\bom\bmm\bma\ban\bnd\bd builtin is the exit status of _\bc_\bo_\bm_\bm_\ba_\bn_\bd.
c\bco\bom\bmp\bpg\bge\ben\bn [_\bo_\bp_\bt_\bi_\bo_\bn] [_\bw_\bo_\br_\bd]
- Generate possible completion matches for _\bw_\bo_\br_\bd according to the
- _\bo_\bp_\bt_\bi_\bo_\bns, which may be any option accepted by the c\bco\bom\bmp\bpl\ble\bet\bte\be
- builtin with the exception of -\b-p\bp and -\b-r\br, and write the matches
- to the standard output. When using the -\b-F\bF or -\b-C\bC options, the
- various shell variables set by the programmable completion fa-
+ Generate possible completion matches for _\bw_\bo_\br_\bd according to the
+ _\bo_\bp_\bt_\bi_\bo_\bns, which may be any option accepted by the c\bco\bom\bmp\bpl\ble\bet\bte\be
+ builtin with the exception of -\b-p\bp and -\b-r\br, and write the matches
+ to the standard output. When using the -\b-F\bF or -\b-C\bC options, the
+ various shell variables set by the programmable completion fa-
cilities, while available, will not have useful values.
The matches will be generated in the same way as if the program-
mable completion code had generated them directly from a comple-
- tion specification with the same flags. If _\bw_\bo_\br_\bd is specified,
+ tion specification with the same flags. If _\bw_\bo_\br_\bd is specified,
only those completions matching _\bw_\bo_\br_\bd 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.
- c\bco\bom\bmp\bpl\ble\bet\bte\be [-\b-a\bab\bbc\bcd\bde\bef\bfg\bgj\bjk\bks\bsu\buv\bv] [-\b-o\bo _\bc_\bo_\bm_\bp_\b-_\bo_\bp_\bt_\bi_\bo_\bn] [-\b-D\bDE\bEI\bI] [-\b-A\bA _\ba_\bc_\bt_\bi_\bo_\bn] [-\b-G\bG _\bg_\bl_\bo_\bb_\b-
+ c\bco\bom\bmp\bpl\ble\bet\bte\be [-\b-a\bab\bbc\bcd\bde\bef\bfg\bgj\bjk\bks\bsu\buv\bv] [-\b-o\bo _\bc_\bo_\bm_\bp_\b-_\bo_\bp_\bt_\bi_\bo_\bn] [-\b-D\bDE\bEI\bI] [-\b-A\bA _\ba_\bc_\bt_\bi_\bo_\bn] [-\b-G\bG _\bg_\bl_\bo_\bb_\b-
_\bp_\ba_\bt] [-\b-W\bW _\bw_\bo_\br_\bd_\bl_\bi_\bs_\bt]
- [-\b-F\bF _\bf_\bu_\bn_\bc_\bt_\bi_\bo_\bn] [-\b-C\bC _\bc_\bo_\bm_\bm_\ba_\bn_\bd] [-\b-X\bX _\bf_\bi_\bl_\bt_\be_\br_\bp_\ba_\bt] [-\b-P\bP _\bp_\br_\be_\bf_\bi_\bx] [-\b-S\bS _\bs_\bu_\bf_\b-
+ [-\b-F\bF _\bf_\bu_\bn_\bc_\bt_\bi_\bo_\bn] [-\b-C\bC _\bc_\bo_\bm_\bm_\ba_\bn_\bd] [-\b-X\bX _\bf_\bi_\bl_\bt_\be_\br_\bp_\ba_\bt] [-\b-P\bP _\bp_\br_\be_\bf_\bi_\bx] [-\b-S\bS _\bs_\bu_\bf_\b-
_\bf_\bi_\bx] _\bn_\ba_\bm_\be [_\bn_\ba_\bm_\be _\b._\b._\b.]
c\bco\bom\bmp\bpl\ble\bet\bte\be -\b-p\bpr\br [-\b-D\bDE\bEI\bI] [_\bn_\ba_\bm_\be ...]
- Specify how arguments to each _\bn_\ba_\bm_\be should be completed. If the
- -\b-p\bp 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 _\bn_\ba_\bm_\be should be completed. If the
+ -\b-p\bp 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 -\b-r\br option removes a completion spec-
- ification for each _\bn_\ba_\bm_\be, or, if no _\bn_\ba_\bm_\bes are supplied, all com-
+ ification for each _\bn_\ba_\bm_\be, or, if no _\bn_\ba_\bm_\bes are supplied, all com-
pletion specifications. The -\b-D\bD option indicates that other sup-
- plied options and actions should apply to the ``default'' com-
- mand completion; that is, completion attempted on a command for
- which no completion has previously been defined. The -\b-E\bE option
- indicates that other supplied options and actions should apply
- to ``empty'' command completion; that is, completion attempted
- on a blank line. The -\b-I\bI option indicates that other supplied
- options and actions should apply to completion on the initial
- non-assignment word on the line, or after a command delimiter
- such as ;\b; or |\b|, which is usually command name completion. If
- multiple options are supplied, the -\b-D\bD option takes precedence
+ plied options and actions should apply to the ``default'' com-
+ mand completion; that is, completion attempted on a command for
+ which no completion has previously been defined. The -\b-E\bE option
+ indicates that other supplied options and actions should apply
+ to ``empty'' command completion; that is, completion attempted
+ on a blank line. The -\b-I\bI option indicates that other supplied
+ options and actions should apply to completion on the initial
+ non-assignment word on the line, or after a command delimiter
+ such as ;\b; or |\b|, which is usually command name completion. If
+ multiple options are supplied, the -\b-D\bD option takes precedence
over -\b-E\bE, and both take precedence over -\b-I\bI. If any of -\b-D\bD, -\b-E\bE, or
- -\b-I\bI are supplied, any other _\bn_\ba_\bm_\be arguments are ignored; these
+ -\b-I\bI are supplied, any other _\bn_\ba_\bm_\be arguments are ignored; these
completions only apply to the case specified by the option.
- The process of applying these completion specifications when
- word completion is attempted is described above under P\bPr\bro\bog\bgr\bra\bam\bm-\b-
- m\bma\bab\bbl\ble\be C\bCo\bom\bmp\bpl\ble\bet\bti\bio\bon\bn.
+ The process of applying these completion specifications when
+ word completion is attempted is described in _\bb_\ba_\bs_\bh_\b(_\b1_\b).
Other options, if specified, have the following meanings. The
arguments to the -\b-G\bG, -\b-W\bW, and -\b-X\bX options (and, if necessary, the
ified as -\b-v\bv.
-\b-C\bC _\bc_\bo_\bm_\bm_\ba_\bn_\bd
_\bc_\bo_\bm_\bm_\ba_\bn_\bd is executed in a subshell environment, and its
- output is used as the possible completions.
+ output is used as the possible completions. Arguments
+ are passed as with the -\b-F\bF option.
-\b-F\bF _\bf_\bu_\bn_\bc_\bt_\bi_\bo_\bn
- The shell function _\bf_\bu_\bn_\bc_\bt_\bi_\bo_\bn is executed in the current
- shell environment. When the function is executed, the
+ The shell function _\bf_\bu_\bn_\bc_\bt_\bi_\bo_\bn is executed in the current
+ shell environment. When the function is executed, the
first argument ($\b$1\b1) is the name of the command whose ar-
guments are being completed, the second argument ($\b$2\b2) is
the word being completed, and the third argument ($\b$3\b3) is
- the word preceding the word being completed on the cur-
- rent command line. When it finishes, the possible com-
- pletions are retrieved from the value of the C\bCO\bOM\bMP\bPR\bRE\bEP\bPL\bLY\bY
+ the word preceding the word being completed on the cur-
+ rent command line. When it finishes, the possible com-
+ pletions are retrieved from the value of the C\bCO\bOM\bMP\bPR\bRE\bEP\bPL\bLY\bY
array variable.
-\b-G\bG _\bg_\bl_\bo_\bb_\bp_\ba_\bt
- The pathname expansion pattern _\bg_\bl_\bo_\bb_\bp_\ba_\bt is expanded to
+ The pathname expansion pattern _\bg_\bl_\bo_\bb_\bp_\ba_\bt is expanded to
generate the possible completions.
-\b-P\bP _\bp_\br_\be_\bf_\bi_\bx
- _\bp_\br_\be_\bf_\bi_\bx is added at the beginning of each possible com-
+ _\bp_\br_\be_\bf_\bi_\bx is added at the beginning of each possible com-
pletion after all other options have been applied.
-\b-S\bS _\bs_\bu_\bf_\bf_\bi_\bx
_\bs_\bu_\bf_\bf_\bi_\bx is appended to each possible completion after all
other options have been applied.
-\b-W\bW _\bw_\bo_\br_\bd_\bl_\bi_\bs_\bt
- The _\bw_\bo_\br_\bd_\bl_\bi_\bs_\bt is split using the characters in the I\bIF\bFS\bS
- special variable as delimiters, and each resultant word
- is expanded. Shell quoting is honored within _\bw_\bo_\br_\bd_\bl_\bi_\bs_\bt,
+ The _\bw_\bo_\br_\bd_\bl_\bi_\bs_\bt is split using the characters in the I\bIF\bFS\bS
+ special variable as delimiters, and each resultant word
+ is expanded. Shell quoting is honored within _\bw_\bo_\br_\bd_\bl_\bi_\bs_\bt,
in order to provide a mechanism for the words to contain
- shell metacharacters or characters in the value of I\bIF\bFS\bS.
- The possible completions are the members of the resul-
+ shell metacharacters or characters in the value of I\bIF\bFS\bS.
+ The possible completions are the members of the resul-
tant list which match the word being completed.
-\b-X\bX _\bf_\bi_\bl_\bt_\be_\br_\bp_\ba_\bt
- _\bf_\bi_\bl_\bt_\be_\br_\bp_\ba_\bt is a pattern as used for pathname expansion.
+ _\bf_\bi_\bl_\bt_\be_\br_\bp_\ba_\bt is a pattern as used for pathname expansion.
It is applied to the list of possible completions gener-
- ated by the preceding options and arguments, and each
- completion matching _\bf_\bi_\bl_\bt_\be_\br_\bp_\ba_\bt is removed from the list.
- A leading !\b! in _\bf_\bi_\bl_\bt_\be_\br_\bp_\ba_\bt negates the pattern; in this
+ ated by the preceding options and arguments, and each
+ completion matching _\bf_\bi_\bl_\bt_\be_\br_\bp_\ba_\bt is removed from the list.
+ A leading !\b! in _\bf_\bi_\bl_\bt_\be_\br_\bp_\ba_\bt negates the pattern; in this
case, any completion not matching _\bf_\bi_\bl_\bt_\be_\br_\bp_\ba_\bt is removed.
- The return value is true unless an invalid option is supplied,
- an option other than -\b-p\bp or -\b-r\br is supplied without a _\bn_\ba_\bm_\be argu-
- ment, an attempt is made to remove a completion specification
+ The return value is true unless an invalid option is supplied,
+ an option other than -\b-p\bp or -\b-r\br is supplied without a _\bn_\ba_\bm_\be argu-
+ ment, an attempt is made to remove a completion specification
for a _\bn_\ba_\bm_\be for which no specification exists, or an error occurs
adding a completion specification.
c\bco\bom\bmp\bpo\bop\bpt\bt [-\b-o\bo _\bo_\bp_\bt_\bi_\bo_\bn] [-\b-D\bDE\bEI\bI] [+\b+o\bo _\bo_\bp_\bt_\bi_\bo_\bn] [_\bn_\ba_\bm_\be]
- Modify completion options for each _\bn_\ba_\bm_\be according to the _\bo_\bp_\b-
+ Modify completion options for each _\bn_\ba_\bm_\be according to the _\bo_\bp_\b-
_\bt_\bi_\bo_\bns, or for the currently-executing completion if no _\bn_\ba_\bm_\bes are
- supplied. If no _\bo_\bp_\bt_\bi_\bo_\bns are given, display the completion op-
- tions for each _\bn_\ba_\bm_\be or the current completion. The possible
- values of _\bo_\bp_\bt_\bi_\bo_\bn are those valid for the c\bco\bom\bmp\bpl\ble\bet\bte\be builtin de-
- scribed above. The -\b-D\bD option indicates that other supplied op-
- tions should apply to the ``default'' command completion; that
- is, completion attempted on a command for which no completion
+ supplied. If no _\bo_\bp_\bt_\bi_\bo_\bns are given, display the completion op-
+ tions for each _\bn_\ba_\bm_\be or the current completion. The possible
+ values of _\bo_\bp_\bt_\bi_\bo_\bn are those valid for the c\bco\bom\bmp\bpl\ble\bet\bte\be builtin de-
+ scribed above. The -\b-D\bD option indicates that other supplied op-
+ tions should apply to the ``default'' command completion; that
+ is, completion attempted on a command for which no completion
has previously been defined. The -\b-E\bE option indicates that other
- supplied options should apply to ``empty'' command completion;
- that is, completion attempted on a blank line. The -\b-I\bI option
+ supplied options should apply to ``empty'' command completion;
+ that is, completion attempted on a blank line. The -\b-I\bI option
indicates that other supplied options should apply to completion
- on the initial non-assignment word on the line, or after a com-
- mand delimiter such as ;\b; or |\b|, which is usually command name
+ on the initial non-assignment word on the line, or after a com-
+ mand delimiter such as ;\b; or |\b|, which is usually command name
completion.
- The return value is true unless an invalid option is supplied,
+ The return value is true unless an invalid option is supplied,
an attempt is made to modify the options for a _\bn_\ba_\bm_\be for which no
completion specification exists, or an output error occurs.
c\bco\bon\bnt\bti\bin\bnu\bue\be [_\bn]
Resume the next iteration of the enclosing f\bfo\bor\br, w\bwh\bhi\bil\ble\be, u\bun\bnt\bti\bil\bl, or
- s\bse\bel\ble\bec\bct\bt loop. If _\bn is specified, resume at the _\bnth enclosing
- loop. _\bn must be >= 1. If _\bn is greater than the number of en-
- closing loops, the last enclosing loop (the ``top-level'' loop)
- is resumed. The return value is 0 unless _\bn is not greater than
+ s\bse\bel\ble\bec\bct\bt loop. If _\bn is specified, resume at the _\bnth enclosing
+ loop. _\bn must be >= 1. If _\bn is greater than the number of en-
+ closing loops, the last enclosing loop (the ``top-level'' loop)
+ is resumed. The return value is 0 unless _\bn is not greater than
or equal to 1.
d\bde\bec\bcl\bla\bar\bre\be [-\b-a\baA\bAf\bfF\bFg\bgi\biI\bIl\bln\bnr\brt\btu\bux\bx] [-\b-p\bp] [_\bn_\ba_\bm_\be[=_\bv_\ba_\bl_\bu_\be] ...]
t\bty\byp\bpe\bes\bse\bet\bt [-\b-a\baA\bAf\bfF\bFg\bgi\biI\bIl\bln\bnr\brt\btu\bux\bx] [-\b-p\bp] [_\bn_\ba_\bm_\be[=_\bv_\ba_\bl_\bu_\be] ...]
- Declare variables and/or give them attributes. If no _\bn_\ba_\bm_\bes are
- given then display the values of variables. The -\b-p\bp option will
+ Declare variables and/or give them attributes. If no _\bn_\ba_\bm_\bes are
+ given then display the values of variables. The -\b-p\bp option will
display the attributes and values of each _\bn_\ba_\bm_\be. When -\b-p\bp is used
- with _\bn_\ba_\bm_\be arguments, additional options, other than -\b-f\bf and -\b-F\bF,
- are ignored. When -\b-p\bp is supplied without _\bn_\ba_\bm_\be arguments, it
- will display the attributes and values of all variables having
+ with _\bn_\ba_\bm_\be arguments, additional options, other than -\b-f\bf and -\b-F\bF,
+ are ignored. When -\b-p\bp is supplied without _\bn_\ba_\bm_\be 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 -\b-p\bp, d\bde\bec\bcl\bla\bar\bre\be will display the at-
- tributes and values of all shell variables. The -\b-f\bf option will
+ options are supplied with -\b-p\bp, d\bde\bec\bcl\bla\bar\bre\be will display the at-
+ tributes and values of all shell variables. The -\b-f\bf option will
restrict the display to shell functions. The -\b-F\bF option inhibits
- the display of function definitions; only the function name and
+ the display of function definitions; only the function name and
attributes are printed. If the e\bex\bxt\btd\bde\beb\bbu\bug\bg shell option is enabled
- using s\bsh\bho\bop\bpt\bt, the source file name and line number where each
- _\bn_\ba_\bm_\be is defined are displayed as well. The -\b-F\bF option implies
+ using s\bsh\bho\bop\bpt\bt, the source file name and line number where each
+ _\bn_\ba_\bm_\be is defined are displayed as well. The -\b-F\bF option implies
-\b-f\bf. The -\b-g\bg option forces variables to be created or modified at
the global scope, even when d\bde\bec\bcl\bla\bar\bre\be is executed in a shell func-
- tion. It is ignored in all other cases. The -\b-I\bI option causes
- local variables to inherit the attributes (except the _\bn_\ba_\bm_\be_\br_\be_\bf
+ tion. It is ignored in all other cases. The -\b-I\bI option causes
+ local variables to inherit the attributes (except the _\bn_\ba_\bm_\be_\br_\be_\bf
attribute) and value of any existing variable with the same _\bn_\ba_\bm_\be
- at a surrounding scope. If there is no existing variable, the
+ at a surrounding scope. If there is no existing variable, the
local variable is initially unset. The following options can be
- used to restrict output to variables with the specified attri-
+ used to restrict output to variables with the specified attri-
bute or to give variables attributes:
- -\b-a\ba Each _\bn_\ba_\bm_\be is an indexed array variable (see A\bAr\brr\bra\bay\bys\bs
- above).
- -\b-A\bA Each _\bn_\ba_\bm_\be is an associative array variable (see A\bAr\brr\bra\bay\bys\bs
- above).
+ -\b-a\ba Each _\bn_\ba_\bm_\be is an indexed array variable (see A\bAr\brr\bra\bay\bys\bs in
+ _\bb_\ba_\bs_\bh_\b(_\b1_\b)).
+ -\b-A\bA Each _\bn_\ba_\bm_\be is an associative array variable (see A\bAr\brr\bra\bay\bys\bs in
+ _\bb_\ba_\bs_\bh_\b(_\b1_\b)).
-\b-f\bf Use function names only.
-\b-i\bi The variable is treated as an integer; arithmetic evalua-
- tion (see A\bAR\bRI\bIT\bTH\bHM\bME\bET\bTI\bIC\bC E\bEV\bVA\bAL\bLU\bUA\bAT\bTI\bIO\bON\bN above) is performed when
- the variable is assigned a value.
- -\b-l\bl When the variable is assigned a value, all upper-case
- characters are converted to lower-case. The upper-case
+ tion (see A\bAR\bRI\bIT\bTH\bHM\bME\bET\bTI\bIC\bC E\bEV\bVA\bAL\bLU\bUA\bAT\bTI\bIO\bON\bN in _\bb_\ba_\bs_\bh_\b(_\b1_\b)) is performed
+ when the variable is assigned a value.
+ -\b-l\bl When the variable is assigned a value, all upper-case
+ characters are converted to lower-case. The upper-case
attribute is disabled.
- -\b-n\bn Give each _\bn_\ba_\bm_\be the _\bn_\ba_\bm_\be_\br_\be_\bf attribute, making it a name
- reference to another variable. That other variable is
- defined by the value of _\bn_\ba_\bm_\be. All references, assign-
- ments, and attribute modifications to _\bn_\ba_\bm_\be, except those
- using or changing the -\b-n\bn attribute itself, are performed
- on the variable referenced by _\bn_\ba_\bm_\be's value. The nameref
+ -\b-n\bn Give each _\bn_\ba_\bm_\be the _\bn_\ba_\bm_\be_\br_\be_\bf attribute, making it a name
+ reference to another variable. That other variable is
+ defined by the value of _\bn_\ba_\bm_\be. All references, assign-
+ ments, and attribute modifications to _\bn_\ba_\bm_\be, except those
+ using or changing the -\b-n\bn attribute itself, are performed
+ on the variable referenced by _\bn_\ba_\bm_\be's value. The nameref
attribute cannot be applied to array variables.
-\b-r\br Make _\bn_\ba_\bm_\bes readonly. These names cannot then be assigned
values by subsequent assignment statements or unset.
-\b-t\bt Give each _\bn_\ba_\bm_\be the _\bt_\br_\ba_\bc_\be attribute. Traced functions in-
- herit the D\bDE\bEB\bBU\bUG\bG and R\bRE\bET\bTU\bUR\bRN\bN traps from the calling shell.
+ herit the D\bDE\bEB\bBU\bUG\bG and R\bRE\bET\bTU\bUR\bRN\bN traps from the calling shell.
The trace attribute has no special meaning for variables.
- -\b-u\bu When the variable is assigned a value, all lower-case
- characters are converted to upper-case. The lower-case
+ -\b-u\bu When the variable is assigned a value, all lower-case
+ characters are converted to upper-case. The lower-case
attribute is disabled.
- -\b-x\bx Mark _\bn_\ba_\bm_\bes for export to subsequent commands via the en-
+ -\b-x\bx Mark _\bn_\ba_\bm_\bes for export to subsequent commands via the en-
vironment.
- Using `+' instead of `-' turns off the attribute instead, with
- the exceptions that +\b+a\ba and +\b+A\bA may not be used to destroy array
- variables and +\b+r\br will not remove the readonly attribute. When
+ Using `+' instead of `-' turns off the attribute instead, with
+ the exceptions that +\b+a\ba and +\b+A\bA may not be used to destroy array
+ variables and +\b+r\br will not remove the readonly attribute. When
used in a function, d\bde\bec\bcl\bla\bar\bre\be and t\bty\byp\bpe\bes\bse\bet\bt make each _\bn_\ba_\bm_\be local, as
- with the l\blo\boc\bca\bal\bl command, unless the -\b-g\bg option is supplied. If a
- variable name is followed by =_\bv_\ba_\bl_\bu_\be, the value of the variable
- is set to _\bv_\ba_\bl_\bu_\be. When using -\b-a\ba or -\b-A\bA and the compound assign-
- ment syntax to create array variables, additional attributes do
- not take effect until subsequent assignments. The return value
+ with the l\blo\boc\bca\bal\bl command, unless the -\b-g\bg option is supplied. If a
+ variable name is followed by =_\bv_\ba_\bl_\bu_\be, the value of the variable
+ is set to _\bv_\ba_\bl_\bu_\be. When using -\b-a\ba or -\b-A\bA and the compound assign-
+ ment 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 as-
sign a value to an array variable without using the compound as-
- signment syntax (see A\bAr\brr\bra\bay\bys\bs above), one of the _\bn_\ba_\bm_\be_\bs 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 -\b-f\bf.
+ signment syntax (see A\bAr\brr\bra\bay\bys\bs in _\bb_\ba_\bs_\bh_\b(_\b1_\b)), one of the _\bn_\ba_\bm_\be_\bs 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 -\b-f\bf.
d\bdi\bir\brs\bs [\b[-\b-c\bcl\blp\bpv\bv]\b] [\b[+\b+_\bn]\b] [\b[-\b-_\bn]\b]
- Without options, displays the list of currently remembered di-
- rectories. The default display is on a single line with direc-
- tory names separated by spaces. Directories are added to the
- list with the p\bpu\bus\bsh\bhd\bd command; the p\bpo\bop\bpd\bd command removes entries
+ Without options, displays the list of currently remembered di-
+ rectories. The default display is on a single line with direc-
+ tory names separated by spaces. Directories are added to the
+ list with the p\bpu\bus\bsh\bhd\bd command; the p\bpo\bop\bpd\bd command removes entries
from the list. The current directory is always the first direc-
tory in the stack.
- -\b-c\bc Clears the directory stack by deleting all of the en-
+ -\b-c\bc Clears the directory stack by deleting all of the en-
tries.
- -\b-l\bl Produces a listing using full pathnames; the default
+ -\b-l\bl Produces a listing using full pathnames; the default
listing format uses a tilde to denote the home directory.
-\b-p\bp Print the directory stack with one entry per line.
- -\b-v\bv Print the directory stack with one entry per line, pre-
+ -\b-v\bv Print the directory stack with one entry per line, pre-
fixing each entry with its index in the stack.
+\b+_\bn Displays the _\bnth entry counting from the left of the list
shown by d\bdi\bir\brs\bs when invoked without options, starting with
zero.
- -\b-_\bn Displays the _\bnth entry counting from the right of the
+ -\b-_\bn Displays the _\bnth entry counting from the right of the
list shown by d\bdi\bir\brs\bs when invoked without options, starting
with zero.
- The return value is 0 unless an invalid option is supplied or _\bn
+ The return value is 0 unless an invalid option is supplied or _\bn
indexes beyond the end of the directory stack.
d\bdi\bis\bso\bow\bwn\bn [-\b-a\bar\br] [-\b-h\bh] [_\bj_\bo_\bb_\bs_\bp_\be_\bc ... | _\bp_\bi_\bd ... ]
- Without options, remove each _\bj_\bo_\bb_\bs_\bp_\be_\bc from the table of active
- jobs. If _\bj_\bo_\bb_\bs_\bp_\be_\bc is not present, and neither the -\b-a\ba nor the -\b-r\br
- option is supplied, the _\bc_\bu_\br_\br_\be_\bn_\bt _\bj_\bo_\bb is used. If the -\b-h\bh option
- is given, each _\bj_\bo_\bb_\bs_\bp_\be_\bc is not removed from the table, but is
- marked so that S\bSI\bIG\bGH\bHU\bUP\bP is not sent to the job if the shell re-
+ Without options, remove each _\bj_\bo_\bb_\bs_\bp_\be_\bc from the table of active
+ jobs. If _\bj_\bo_\bb_\bs_\bp_\be_\bc is not present, and neither the -\b-a\ba nor the -\b-r\br
+ option is supplied, the _\bc_\bu_\br_\br_\be_\bn_\bt _\bj_\bo_\bb is used. If the -\b-h\bh option
+ is given, each _\bj_\bo_\bb_\bs_\bp_\be_\bc is not removed from the table, but is
+ marked so that S\bSI\bIG\bGH\bHU\bUP\bP is not sent to the job if the shell re-
ceives a S\bSI\bIG\bGH\bHU\bUP\bP. If no _\bj_\bo_\bb_\bs_\bp_\be_\bc is supplied, the -\b-a\ba option means
- to remove or mark all jobs; the -\b-r\br option without a _\bj_\bo_\bb_\bs_\bp_\be_\bc ar-
+ to remove or mark all jobs; the -\b-r\br option without a _\bj_\bo_\bb_\bs_\bp_\be_\bc ar-
gument restricts operation to running jobs. The return value is
0 unless a _\bj_\bo_\bb_\bs_\bp_\be_\bc does not specify a valid job.
e\bec\bch\bho\bo [-\b-n\bne\beE\bE] [_\ba_\br_\bg ...]
- Output the _\ba_\br_\bgs, separated by spaces, followed by a newline.
- The return status is 0 unless a write error occurs. If -\b-n\bn is
+ Output the _\ba_\br_\bgs, separated by spaces, followed by a newline.
+ The return status is 0 unless a write error occurs. If -\b-n\bn is
specified, the trailing newline is suppressed. If the -\b-e\be option
- is given, interpretation of the following backslash-escaped
- characters is enabled. The -\b-E\bE option disables the interpreta-
- tion of these escape characters, even on systems where they are
- interpreted by default. The x\bxp\bpg\bg_\b_e\bec\bch\bho\bo shell option may be used
- to dynamically determine whether or not e\bec\bch\bho\bo expands these es-
- cape characters by default. e\bec\bch\bho\bo does not interpret -\b--\b- to mean
- the end of options. e\bec\bch\bho\bo interprets the following escape se-
+ is given, interpretation of the following backslash-escaped
+ characters is enabled. The -\b-E\bE option disables the interpreta-
+ tion of these escape characters, even on systems where they are
+ interpreted by default. The x\bxp\bpg\bg_\b_e\bec\bch\bho\bo shell option may be used
+ to dynamically determine whether or not e\bec\bch\bho\bo expands these es-
+ cape characters by default. e\bec\bch\bho\bo does not interpret -\b--\b- to mean
+ the end of options. e\bec\bch\bho\bo interprets the following escape se-
quences:
\\b\a\ba alert (bell)
\\b\b\bb backspace
\\b\t\bt horizontal tab
\\b\v\bv vertical tab
\\b\\\b\ backslash
- \\b\0\b0_\bn_\bn_\bn the eight-bit character whose value is the octal value
+ \\b\0\b0_\bn_\bn_\bn the eight-bit character whose value is the octal value
_\bn_\bn_\bn (zero to three octal digits)
- \\b\x\bx_\bH_\bH the eight-bit character whose value is the hexadecimal
+ \\b\x\bx_\bH_\bH the eight-bit character whose value is the hexadecimal
value _\bH_\bH (one or two hex digits)
- \\b\u\bu_\bH_\bH_\bH_\bH the Unicode (ISO/IEC 10646) character whose value is the
+ \\b\u\bu_\bH_\bH_\bH_\bH the Unicode (ISO/IEC 10646) character whose value is the
hexadecimal value _\bH_\bH_\bH_\bH (one to four hex digits)
\\b\U\bU_\bH_\bH_\bH_\bH_\bH_\bH_\bH_\bH
- the Unicode (ISO/IEC 10646) character whose value is the
+ the Unicode (ISO/IEC 10646) character whose value is the
hexadecimal value _\bH_\bH_\bH_\bH_\bH_\bH_\bH_\bH (one to eight hex digits)
e\ben\bna\bab\bbl\ble\be [-\b-a\ba] [-\b-d\bdn\bnp\bps\bs] [-\b-f\bf _\bf_\bi_\bl_\be_\bn_\ba_\bm_\be] [_\bn_\ba_\bm_\be ...]
- 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 -\b-n\bn is used, each _\bn_\ba_\bm_\be is disabled; otherwise, _\bn_\ba_\bm_\be_\bs are en-
- abled. For example, to use the t\bte\bes\bst\bt binary found via the P\bPA\bAT\bTH\bH
- instead of the shell builtin version, run ``enable -n test''.
- The -\b-f\bf option means to load the new builtin command _\bn_\ba_\bm_\be from
+ to be executed without specifying a full pathname, even though
+ the shell normally searches for builtins before disk commands.
+ If -\b-n\bn is used, each _\bn_\ba_\bm_\be is disabled; otherwise, _\bn_\ba_\bm_\be_\bs are en-
+ abled. For example, to use the t\bte\bes\bst\bt binary found via the P\bPA\bAT\bTH\bH
+ instead of the shell builtin version, run ``enable -n test''.
+ The -\b-f\bf option means to load the new builtin command _\bn_\ba_\bm_\be from
shared object _\bf_\bi_\bl_\be_\bn_\ba_\bm_\be, on systems that support dynamic loading.
- The -\b-d\bd option will delete a builtin previously loaded with -\b-f\bf.
- If no _\bn_\ba_\bm_\be arguments are given, or if the -\b-p\bp 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 -\b-n\bn
- is supplied, only disabled builtins are printed. If -\b-a\ba is sup-
- plied, the list printed includes all builtins, with an indica-
- tion of whether or not each is enabled. If -\b-s\bs is supplied, the
- output is restricted to the POSIX _\bs_\bp_\be_\bc_\bi_\ba_\bl builtins. The return
- value is 0 unless a _\bn_\ba_\bm_\be is not a shell builtin or there is an
- error loading a new builtin from a shared object.
+ Bash will use the value of the B\bBA\bAS\bSH\bH_\b_L\bLO\bOA\bAD\bDA\bAB\bBL\bLE\bES\bS_\b_P\bPA\bAT\bTH\bH variable as a
+ colon-separated list of directories in which to search for _\bf_\bi_\bl_\be_\b-
+ _\bn_\ba_\bm_\be. The default is system-dependent. The -\b-d\bd option will
+ delete a builtin previously loaded with -\b-f\bf. If no _\bn_\ba_\bm_\be argu-
+ ments are given, or if the -\b-p\bp option is supplied, a list of
+ shell builtins is printed. With no other option arguments, the
+ list consists of all enabled shell builtins. If -\b-n\bn is supplied,
+ only disabled builtins are printed. If -\b-a\ba is supplied, the list
+ printed includes all builtins, with an indication of whether or
+ not each is enabled. If -\b-s\bs is supplied, the output is re-
+ stricted to the POSIX _\bs_\bp_\be_\bc_\bi_\ba_\bl builtins. If no options are sup-
+ plied and a _\bn_\ba_\bm_\be is not a shell builtin, e\ben\bna\bab\bbl\ble\be will attempt to
+ load _\bn_\ba_\bm_\be from a shared object named _\bn_\ba_\bm_\be, as if the command
+ were ``enable -f _\bn_\ba_\bm_\be _\bn_\ba_\bm_\be . The return value is 0 unless a
+ _\bn_\ba_\bm_\be is not a shell builtin or there is an error loading a new
+ builtin from a shared object.
e\bev\bva\bal\bl [_\ba_\br_\bg ...]
- The _\ba_\br_\bgs 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 e\bev\bva\bal\bl. If there are
+ The _\ba_\br_\bgs 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 e\bev\bva\bal\bl. If there are
no _\ba_\br_\bg_\bs, or only null arguments, e\bev\bva\bal\bl returns 0.
e\bex\bxe\bec\bc [-\b-c\bcl\bl] [-\b-a\ba _\bn_\ba_\bm_\be] [_\bc_\bo_\bm_\bm_\ba_\bn_\bd [_\ba_\br_\bg_\bu_\bm_\be_\bn_\bt_\bs]]
- If _\bc_\bo_\bm_\bm_\ba_\bn_\bd is specified, it replaces the shell. No new process
- is created. The _\ba_\br_\bg_\bu_\bm_\be_\bn_\bt_\bs become the arguments to _\bc_\bo_\bm_\bm_\ba_\bn_\bd. If
+ If _\bc_\bo_\bm_\bm_\ba_\bn_\bd is specified, it replaces the shell. No new process
+ is created. The _\ba_\br_\bg_\bu_\bm_\be_\bn_\bt_\bs become the arguments to _\bc_\bo_\bm_\bm_\ba_\bn_\bd. If
the -\b-l\bl option is supplied, the shell places a dash at the begin-
ning of the zeroth argument passed to _\bc_\bo_\bm_\bm_\ba_\bn_\bd. This is what _\bl_\bo_\b-
- _\bg_\bi_\bn(1) does. The -\b-c\bc option causes _\bc_\bo_\bm_\bm_\ba_\bn_\bd to be executed with
- an empty environment. If -\b-a\ba is supplied, the shell passes _\bn_\ba_\bm_\be
+ _\bg_\bi_\bn(1) does. The -\b-c\bc option causes _\bc_\bo_\bm_\bm_\ba_\bn_\bd to be executed with
+ an empty environment. If -\b-a\ba is supplied, the shell passes _\bn_\ba_\bm_\be
as the zeroth argument to the executed command. If _\bc_\bo_\bm_\bm_\ba_\bn_\bd can-
- not be executed for some reason, a non-interactive shell exits,
- unless the e\bex\bxe\bec\bcf\bfa\bai\bil\bl shell option is enabled. In that case, it
- returns failure. An interactive shell returns failure if the
- file cannot be executed. A subshell exits unconditionally if
- e\bex\bxe\bec\bc fails. If _\bc_\bo_\bm_\bm_\ba_\bn_\bd is not specified, any redirections take
- effect in the current shell, and the return status is 0. If
+ not be executed for some reason, a non-interactive shell exits,
+ unless the e\bex\bxe\bec\bcf\bfa\bai\bil\bl shell option is enabled. In that case, it
+ returns failure. An interactive shell returns failure if the
+ file cannot be executed. A subshell exits unconditionally if
+ e\bex\bxe\bec\bc fails. If _\bc_\bo_\bm_\bm_\ba_\bn_\bd is not specified, any redirections take
+ effect in the current shell, and the return status is 0. If
there is a redirection error, the return status is 1.
e\bex\bxi\bit\bt [_\bn]
- Cause the shell to exit with a status of _\bn. If _\bn is omitted,
+ Cause the shell to exit with a status of _\bn. If _\bn is omitted,
the exit status is that of the last command executed. A trap on
E\bEX\bXI\bIT\bT is executed before the shell terminates.
e\bex\bxp\bpo\bor\brt\bt [-\b-f\bfn\bn] [_\bn_\ba_\bm_\be[=_\bw_\bo_\br_\bd]] ...
e\bex\bxp\bpo\bor\brt\bt -\b-p\bp
- The supplied _\bn_\ba_\bm_\be_\bs are marked for automatic export to the envi-
- ronment of subsequently executed commands. If the -\b-f\bf option is
- given, the _\bn_\ba_\bm_\be_\bs refer to functions. If no _\bn_\ba_\bm_\be_\bs are given, or
- if the -\b-p\bp option is supplied, a list of names of all exported
- variables is printed. The -\b-n\bn option causes the export property
+ The supplied _\bn_\ba_\bm_\be_\bs are marked for automatic export to the envi-
+ ronment of subsequently executed commands. If the -\b-f\bf option is
+ given, the _\bn_\ba_\bm_\be_\bs refer to functions. If no _\bn_\ba_\bm_\be_\bs are given, or
+ if the -\b-p\bp option is supplied, a list of names of all exported
+ variables is printed. The -\b-n\bn option causes the export property
to be removed from each _\bn_\ba_\bm_\be. If a variable name is followed by
=_\bw_\bo_\br_\bd, the value of the variable is set to _\bw_\bo_\br_\bd. e\bex\bxp\bpo\bor\brt\bt returns
an exit status of 0 unless an invalid option is encountered, one
- of the _\bn_\ba_\bm_\be_\bs is not a valid shell variable name, or -\b-f\bf is sup-
+ of the _\bn_\ba_\bm_\be_\bs is not a valid shell variable name, or -\b-f\bf is sup-
plied with a _\bn_\ba_\bm_\be that is not a function.
f\bfc\bc [-\b-e\be _\be_\bn_\ba_\bm_\be] [-\b-l\bln\bnr\br] [_\bf_\bi_\br_\bs_\bt] [_\bl_\ba_\bs_\bt]
f\bfc\bc -\b-s\bs [_\bp_\ba_\bt=_\br_\be_\bp] [_\bc_\bm_\bd]
- The first form selects a range of commands from _\bf_\bi_\br_\bs_\bt to _\bl_\ba_\bs_\bt
- from the history list and displays or edits and re-executes
- them. _\bF_\bi_\br_\bs_\bt and _\bl_\ba_\bs_\bt 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). When listing, a
- _\bf_\bi_\br_\bs_\bt or _\bl_\ba_\bs_\bt of 0 is equivalent to -1 and -0 is equivalent to
- the current command (usually the f\bfc\bc command); otherwise 0 is
- equivalent to -1 and -0 is invalid. If _\bl_\ba_\bs_\bt is not specified,
- it is set to the current command for listing (so that ``fc -l
- -10'' prints the last 10 commands) and to _\bf_\bi_\br_\bs_\bt otherwise. If
- _\bf_\bi_\br_\bs_\bt is not specified, it is set to the previous command for
+ The first form selects a range of commands from _\bf_\bi_\br_\bs_\bt to _\bl_\ba_\bs_\bt
+ from the history list and displays or edits and re-executes
+ them. _\bF_\bi_\br_\bs_\bt and _\bl_\ba_\bs_\bt 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). When listing, a
+ _\bf_\bi_\br_\bs_\bt or _\bl_\ba_\bs_\bt of 0 is equivalent to -1 and -0 is equivalent to
+ the current command (usually the f\bfc\bc command); otherwise 0 is
+ equivalent to -1 and -0 is invalid. If _\bl_\ba_\bs_\bt is not specified,
+ it is set to the current command for listing (so that ``fc -l
+ -10'' prints the last 10 commands) and to _\bf_\bi_\br_\bs_\bt otherwise. If
+ _\bf_\bi_\br_\bs_\bt is not specified, it is set to the previous command for
editing and -16 for listing.
- The -\b-n\bn option suppresses the command numbers when listing. The
- -\b-r\br option reverses the order of the commands. If the -\b-l\bl option
- is given, the commands are listed on standard output. Other-
- wise, the editor given by _\be_\bn_\ba_\bm_\be is invoked on a file containing
- those commands. If _\be_\bn_\ba_\bm_\be is not given, the value of the F\bFC\bCE\bED\bDI\bIT\bT
- variable is used, and the value of E\bED\bDI\bIT\bTO\bOR\bR if F\bFC\bCE\bED\bDI\bIT\bT is not set.
- If neither variable is set, _\bv_\bi is used. When editing is com-
+ The -\b-n\bn option suppresses the command numbers when listing. The
+ -\b-r\br option reverses the order of the commands. If the -\b-l\bl option
+ is given, the commands are listed on standard output. Other-
+ wise, the editor given by _\be_\bn_\ba_\bm_\be is invoked on a file containing
+ those commands. If _\be_\bn_\ba_\bm_\be is not given, the value of the F\bFC\bCE\bED\bDI\bIT\bT
+ variable is used, and the value of E\bED\bDI\bIT\bTO\bOR\bR if F\bFC\bCE\bED\bDI\bIT\bT is not set.
+ If neither variable is set, _\bv_\bi is used. When editing is com-
plete, the edited commands are echoed and executed.
- In the second form, _\bc_\bo_\bm_\bm_\ba_\bn_\bd is re-executed after each instance
- of _\bp_\ba_\bt is replaced by _\br_\be_\bp. _\bC_\bo_\bm_\bm_\ba_\bn_\bd is interpreted the same as
- _\bf_\bi_\br_\bs_\bt above. A useful alias to use with this is ``r="fc -s"'',
- so that typing ``r cc'' runs the last command beginning with
+ In the second form, _\bc_\bo_\bm_\bm_\ba_\bn_\bd is re-executed after each instance
+ of _\bp_\ba_\bt is replaced by _\br_\be_\bp. _\bC_\bo_\bm_\bm_\ba_\bn_\bd is interpreted the same as
+ _\bf_\bi_\br_\bs_\bt 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 in-
- valid option is encountered or _\bf_\bi_\br_\bs_\bt or _\bl_\ba_\bs_\bt specify history
- lines out of range. If the -\b-e\be option is supplied, the return
+ If the first form is used, the return value is 0 unless an in-
+ valid option is encountered or _\bf_\bi_\br_\bs_\bt or _\bl_\ba_\bs_\bt specify history
+ lines out of range. If the -\b-e\be option is supplied, the return
value is the value of the last command executed or failure if an
error occurs with the temporary file of commands. If the second
- form is used, the return status is that of the command re-exe-
- cuted, unless _\bc_\bm_\bd does not specify a valid history line, in
+ form is used, the return status is that of the command re-exe-
+ cuted, unless _\bc_\bm_\bd does not specify a valid history line, in
which case f\bfc\bc returns failure.
f\bfg\bg [_\bj_\bo_\bb_\bs_\bp_\be_\bc]
- Resume _\bj_\bo_\bb_\bs_\bp_\be_\bc in the foreground, and make it the current job.
+ Resume _\bj_\bo_\bb_\bs_\bp_\be_\bc in the foreground, and make it the current job.
If _\bj_\bo_\bb_\bs_\bp_\be_\bc is not present, the shell's notion of the _\bc_\bu_\br_\br_\be_\bn_\bt _\bj_\bo_\bb
- is used. The return value is that of the command placed into
- the foreground, or failure if run when job control is disabled
+ is used. The return value is that of the command placed into
+ the foreground, or failure if run when job control is disabled
or, when run with job control enabled, if _\bj_\bo_\bb_\bs_\bp_\be_\bc does not spec-
- ify a valid job or _\bj_\bo_\bb_\bs_\bp_\be_\bc specifies a job that was started
+ ify a valid job or _\bj_\bo_\bb_\bs_\bp_\be_\bc specifies a job that was started
without job control.
g\bge\bet\bto\bop\bpt\bts\bs _\bo_\bp_\bt_\bs_\bt_\br_\bi_\bn_\bg _\bn_\ba_\bm_\be [_\ba_\br_\bg _\b._\b._\b.]
- g\bge\bet\bto\bop\bpt\bts\bs is used by shell procedures to parse positional parame-
- ters. _\bo_\bp_\bt_\bs_\bt_\br_\bi_\bn_\bg contains the option characters to be recog-
- nized; if a character is followed by a colon, the option is ex-
+ g\bge\bet\bto\bop\bpt\bts\bs is used by shell procedures to parse positional parame-
+ ters. _\bo_\bp_\bt_\bs_\bt_\br_\bi_\bn_\bg contains the option characters to be recog-
+ nized; if a character is followed by a colon, the option is ex-
pected to have an argument, which should be separated from it by
- white space. The colon and question mark characters may not be
- used as option characters. Each time it is invoked, g\bge\bet\bto\bop\bpt\bts\bs
- places the next option in the shell variable _\bn_\ba_\bm_\be, initializing
+ white space. The colon and question mark characters may not be
+ used as option characters. Each time it is invoked, g\bge\bet\bto\bop\bpt\bts\bs
+ places the next option in the shell variable _\bn_\ba_\bm_\be, initializing
_\bn_\ba_\bm_\be if it does not exist, and the index of the next argument to
be processed into the variable O\bOP\bPT\bTI\bIN\bND\bD. O\bOP\bPT\bTI\bIN\bND\bD is initialized to
1 each time the shell or a shell script is invoked. When an op-
tion requires an argument, g\bge\bet\bto\bop\bpt\bts\bs places that argument into the
variable O\bOP\bPT\bTA\bAR\bRG\bG. The shell does not reset O\bOP\bPT\bTI\bIN\bND\bD automatically;
- it must be manually reset between multiple calls to g\bge\bet\bto\bop\bpt\bts\bs
- within the same shell invocation if a new set of parameters is
+ it must be manually reset between multiple calls to g\bge\bet\bto\bop\bpt\bts\bs
+ within the same shell invocation if a new set of parameters is
to be used.
When the end of options is encountered, g\bge\bet\bto\bop\bpt\bts\bs exits with a re-
turn value greater than zero. O\bOP\bPT\bTI\bIN\bND\bD is set to the index of the
first non-option argument, and _\bn_\ba_\bm_\be is set to ?.
- g\bge\bet\bto\bop\bpt\bts\bs normally parses the positional parameters, but if more
- arguments are supplied as _\ba_\br_\bg values, g\bge\bet\bto\bop\bpt\bts\bs parses those in-
+ g\bge\bet\bto\bop\bpt\bts\bs normally parses the positional parameters, but if more
+ arguments are supplied as _\ba_\br_\bg values, g\bge\bet\bto\bop\bpt\bts\bs parses those in-
stead.
- g\bge\bet\bto\bop\bpt\bts\bs can report errors in two ways. If the first character
- of _\bo_\bp_\bt_\bs_\bt_\br_\bi_\bn_\bg is a colon, _\bs_\bi_\bl_\be_\bn_\bt error reporting is used. In
- normal operation, diagnostic messages are printed when invalid
- options or missing option arguments are encountered. If the
- variable O\bOP\bPT\bTE\bER\bRR\bR is set to 0, no error messages will be dis-
+ g\bge\bet\bto\bop\bpt\bts\bs can report errors in two ways. If the first character
+ of _\bo_\bp_\bt_\bs_\bt_\br_\bi_\bn_\bg is a colon, _\bs_\bi_\bl_\be_\bn_\bt error reporting is used. In
+ normal operation, diagnostic messages are printed when invalid
+ options or missing option arguments are encountered. If the
+ variable O\bOP\bPT\bTE\bER\bRR\bR is set to 0, no error messages will be dis-
played, even if the first character of _\bo_\bp_\bt_\bs_\bt_\br_\bi_\bn_\bg is not a colon.
If an invalid option is seen, g\bge\bet\bto\bop\bpt\bts\bs places ? into _\bn_\ba_\bm_\be and, if
- not silent, prints an error message and unsets O\bOP\bPT\bTA\bAR\bRG\bG. If
- g\bge\bet\bto\bop\bpt\bts\bs is silent, the option character found is placed in O\bOP\bP-\b-
+ not silent, prints an error message and unsets O\bOP\bPT\bTA\bAR\bRG\bG. If
+ g\bge\bet\bto\bop\bpt\bts\bs is silent, the option character found is placed in O\bOP\bP-\b-
T\bTA\bAR\bRG\bG and no diagnostic message is printed.
- If a required argument is not found, and g\bge\bet\bto\bop\bpt\bts\bs is not silent,
- a question mark (?\b?) is placed in _\bn_\ba_\bm_\be, O\bOP\bPT\bTA\bAR\bRG\bG is unset, and a
- diagnostic message is printed. If g\bge\bet\bto\bop\bpt\bts\bs is silent, then a
- colon (:\b:) is placed in _\bn_\ba_\bm_\be and O\bOP\bPT\bTA\bAR\bRG\bG is set to the option
+ If a required argument is not found, and g\bge\bet\bto\bop\bpt\bts\bs is not silent,
+ a question mark (?\b?) is placed in _\bn_\ba_\bm_\be, O\bOP\bPT\bTA\bAR\bRG\bG is unset, and a
+ diagnostic message is printed. If g\bge\bet\bto\bop\bpt\bts\bs is silent, then a
+ colon (:\b:) is placed in _\bn_\ba_\bm_\be and O\bOP\bPT\bTA\bAR\bRG\bG is set to the option
character found.
- g\bge\bet\bto\bop\bpt\bts\bs returns true if an option, specified or unspecified, is
+ g\bge\bet\bto\bop\bpt\bts\bs returns true if an option, specified or unspecified, is
found. It returns false if the end of options is encountered or
an error occurs.
h\bha\bas\bsh\bh [-\b-l\blr\br] [-\b-p\bp _\bf_\bi_\bl_\be_\bn_\ba_\bm_\be] [-\b-d\bdt\bt] [_\bn_\ba_\bm_\be]
Each time h\bha\bas\bsh\bh is invoked, the full pathname of the command _\bn_\ba_\bm_\be
- is determined by searching the directories in $\b$P\bPA\bAT\bTH\bH and remem-
+ is determined by searching the directories in $\b$P\bPA\bAT\bTH\bH and remem-
bered. Any previously-remembered pathname is discarded. If the
-\b-p\bp option is supplied, no path search is performed, and _\bf_\bi_\bl_\be_\bn_\ba_\bm_\be
- is used as the full filename of the command. The -\b-r\br option
+ is used as the full filename of the command. The -\b-r\br option
causes the shell to forget all remembered locations. The -\b-d\bd op-
- tion causes the shell to forget the remembered location of each
- _\bn_\ba_\bm_\be. If the -\b-t\bt option is supplied, the full pathname to which
- each _\bn_\ba_\bm_\be corresponds is printed. If multiple _\bn_\ba_\bm_\be arguments
+ tion causes the shell to forget the remembered location of each
+ _\bn_\ba_\bm_\be. If the -\b-t\bt option is supplied, the full pathname to which
+ each _\bn_\ba_\bm_\be corresponds is printed. If multiple _\bn_\ba_\bm_\be arguments
are supplied with -\b-t\bt, the _\bn_\ba_\bm_\be is printed before the hashed full
pathname. The -\b-l\bl option causes output to be displayed in a for-
- mat that may be reused as input. If no arguments are given, or
+ mat that may be reused as input. If no arguments are given, or
if only -\b-l\bl is supplied, information about remembered commands is
- printed. The return status is true unless a _\bn_\ba_\bm_\be is not found
+ printed. The return status is true unless a _\bn_\ba_\bm_\be is not found
or an invalid option is supplied.
h\bhe\bel\blp\bp [-\b-d\bdm\bms\bs] [_\bp_\ba_\bt_\bt_\be_\br_\bn]
- Display helpful information about builtin commands. If _\bp_\ba_\bt_\bt_\be_\br_\bn
- is specified, h\bhe\bel\blp\bp gives detailed help on all commands matching
- _\bp_\ba_\bt_\bt_\be_\br_\bn; otherwise help for all the builtins and shell control
+ Display helpful information about builtin commands. If _\bp_\ba_\bt_\bt_\be_\br_\bn
+ is specified, h\bhe\bel\blp\bp gives detailed help on all commands matching
+ _\bp_\ba_\bt_\bt_\be_\br_\bn; otherwise help for all the builtins and shell control
structures is printed.
-\b-d\bd Display a short description of each _\bp_\ba_\bt_\bt_\be_\br_\bn
-\b-m\bm Display the description of each _\bp_\ba_\bt_\bt_\be_\br_\bn in a manpage-like
h\bhi\bis\bst\bto\bor\bry\by -\b-s\bs _\ba_\br_\bg [_\ba_\br_\bg _\b._\b._\b.]
With no options, display the command history list with line num-
bers. Lines listed with a *\b* have been modified. An argument of
- _\bn lists only the last _\bn lines. If the shell variable H\bHI\bIS\bST\bTT\bTI\bIM\bME\bE-\b-
- F\bFO\bOR\bRM\bMA\bAT\bT is set and not null, it is used as a format string for
- _\bs_\bt_\br_\bf_\bt_\bi_\bm_\be(3) to display the time stamp associated with each dis-
- played history entry. No intervening blank is printed between
- the formatted time stamp and the history line. If _\bf_\bi_\bl_\be_\bn_\ba_\bm_\be is
- supplied, it is used as the name of the history file; if not,
- the value of H\bHI\bIS\bST\bTF\bFI\bIL\bLE\bE is used. Options, if supplied, have the
+ _\bn lists only the last _\bn lines. If the shell variable H\bHI\bIS\bST\bTT\bTI\bIM\bME\bE-\b-
+ F\bFO\bOR\bRM\bMA\bAT\bT is set and not null, it is used as a format string for
+ _\bs_\bt_\br_\bf_\bt_\bi_\bm_\be(3) to display the time stamp associated with each dis-
+ played history entry. No intervening blank is printed between
+ the formatted time stamp and the history line. If _\bf_\bi_\bl_\be_\bn_\ba_\bm_\be is
+ supplied, it is used as the name of the history file; if not,
+ the value of H\bHI\bIS\bST\bTF\bFI\bIL\bLE\bE is used. Options, if supplied, have the
following meanings:
-\b-c\bc Clear the history list by deleting all the entries.
-\b-d\bd _\bo_\bf_\bf_\bs_\be_\bt
- Delete the history entry at position _\bo_\bf_\bf_\bs_\be_\bt. If _\bo_\bf_\bf_\bs_\be_\bt
+ Delete the history entry at position _\bo_\bf_\bf_\bs_\be_\bt. If _\bo_\bf_\bf_\bs_\be_\bt
is negative, it is interpreted as relative to one greater
than the last history position, so negative indices count
- back from the end of the history, and an index of -1
+ back from the end of the history, and an index of -1
refers to the current h\bhi\bis\bst\bto\bor\bry\by -\b-d\bd command.
-\b-d\bd _\bs_\bt_\ba_\br_\bt-_\be_\bn_\bd
- Delete the history entries between positions _\bs_\bt_\ba_\br_\bt and
- _\be_\bn_\bd, inclusive. Positive and negative values for _\bs_\bt_\ba_\br_\bt
- and _\be_\bn_\bd are interpreted as described above.
- -\b-a\ba Append the ``new'' history lines to the history file.
- These are history lines entered since the beginning of
+ Delete the range of history entries between positions
+ _\bs_\bt_\ba_\br_\bt and _\be_\bn_\bd, inclusive. Positive and negative values
+ for _\bs_\bt_\ba_\br_\bt and _\be_\bn_\bd are interpreted as described above.
+ -\b-a\ba Append the ``new'' history lines to the history file.
+ These are history lines entered since the beginning of
the current b\bba\bas\bsh\bh session, but not already appended to the
history file.
- -\b-n\bn Read the history lines not already read from the history
- file into the current history list. These are lines ap-
- pended to the history file since the beginning of the
+ -\b-n\bn Read the history lines not already read from the history
+ file into the current history list. These are lines ap-
+ pended to the history file since the beginning of the
current b\bba\bas\bsh\bh session.
- -\b-r\br Read the contents of the history file and append them to
+ -\b-r\br Read the contents of the history file and append them to
the current history list.
-\b-w\bw Write the current history list to the history file, over-
writing the history file's contents.
- -\b-p\bp Perform history substitution on the following _\ba_\br_\bg_\bs and
- display the result on the standard output. Does not
- store the results in the history list. Each _\ba_\br_\bg must be
+ -\b-p\bp Perform history substitution on the following _\ba_\br_\bg_\bs and
+ display the result on the standard output. Does not
+ store the results in the history list. Each _\ba_\br_\bg must be
quoted to disable normal history expansion.
- -\b-s\bs Store the _\ba_\br_\bg_\bs in the history list as a single entry.
- The last command in the history list is removed before
+ -\b-s\bs Store the _\ba_\br_\bg_\bs in the history list as a single entry.
+ The last command in the history list is removed before
the _\ba_\br_\bg_\bs are added.
- If the H\bHI\bIS\bST\bTT\bTI\bIM\bME\bEF\bFO\bOR\bRM\bMA\bAT\bT variable is set, the time stamp informa-
- tion associated with each history entry is written to the his-
- tory file, marked with the history comment character. When the
- history file is read, lines beginning with the history comment
- character followed immediately by a digit are interpreted as
+ If the H\bHI\bIS\bST\bTT\bTI\bIM\bME\bEF\bFO\bOR\bRM\bMA\bAT\bT variable is set, the time stamp informa-
+ tion associated with each history entry is written to the his-
+ tory file, marked with the history comment character. When the
+ history file is read, lines beginning with the history comment
+ character followed immediately by a digit are interpreted as
timestamps for the following history entry. The return value is
0 unless an invalid option is encountered, an error occurs while
- reading or writing the history file, an invalid _\bo_\bf_\bf_\bs_\be_\bt is sup-
- plied as an argument to -\b-d\bd, or the history expansion supplied as
- an argument to -\b-p\bp fails.
+ reading or writing the history file, an invalid _\bo_\bf_\bf_\bs_\be_\bt or range
+ is supplied as an argument to -\b-d\bd, or the history expansion sup-
+ plied as an argument to -\b-p\bp fails.
j\bjo\bob\bbs\bs [-\b-l\bln\bnp\bpr\brs\bs] [ _\bj_\bo_\bb_\bs_\bp_\be_\bc ... ]
j\bjo\bob\bbs\bs -\b-x\bx _\bc_\bo_\bm_\bm_\ba_\bn_\bd [ _\ba_\br_\bg_\bs ... ]
The first form lists the active jobs. The options have the fol-
lowing meanings:
-\b-l\bl List process IDs in addition to the normal information.
- -\b-n\bn Display information only about jobs that have changed
+ -\b-n\bn Display information only about jobs that have changed
status since the user was last notified of their status.
- -\b-p\bp List only the process ID of the job's process group
+ -\b-p\bp List only the process ID of the job's process group
leader.
-\b-r\br Display only running jobs.
-\b-s\bs Display only stopped jobs.
- If _\bj_\bo_\bb_\bs_\bp_\be_\bc is given, output is restricted to information about
- that job. The return status is 0 unless an invalid option is
+ If _\bj_\bo_\bb_\bs_\bp_\be_\bc is given, output is restricted to information about
+ that job. The return status is 0 unless an invalid option is
encountered or an invalid _\bj_\bo_\bb_\bs_\bp_\be_\bc is supplied.
If the -\b-x\bx option is supplied, j\bjo\bob\bbs\bs replaces any _\bj_\bo_\bb_\bs_\bp_\be_\bc found in
k\bki\bil\bll\bl [-\b-s\bs _\bs_\bi_\bg_\bs_\bp_\be_\bc | -\b-n\bn _\bs_\bi_\bg_\bn_\bu_\bm | -\b-_\bs_\bi_\bg_\bs_\bp_\be_\bc] [_\bp_\bi_\bd | _\bj_\bo_\bb_\bs_\bp_\be_\bc] ...
k\bki\bil\bll\bl -\b-l\bl|-\b-L\bL [_\bs_\bi_\bg_\bs_\bp_\be_\bc | _\be_\bx_\bi_\bt_\b__\bs_\bt_\ba_\bt_\bu_\bs]
- Send the signal named by _\bs_\bi_\bg_\bs_\bp_\be_\bc or _\bs_\bi_\bg_\bn_\bu_\bm to the processes
- named by _\bp_\bi_\bd or _\bj_\bo_\bb_\bs_\bp_\be_\bc. _\bs_\bi_\bg_\bs_\bp_\be_\bc is either a case-insensitive
- signal name such as S\bSI\bIG\bGK\bKI\bIL\bLL\bL (with or without the S\bSI\bIG\bG prefix) or
- a signal number; _\bs_\bi_\bg_\bn_\bu_\bm is a signal number. If _\bs_\bi_\bg_\bs_\bp_\be_\bc is not
- present, then S\bSI\bIG\bGT\bTE\bER\bRM\bM is assumed. An argument of -\b-l\bl lists the
- signal names. If any arguments are supplied when -\b-l\bl is given,
- the names of the signals corresponding to the arguments are
+ Send the signal named by _\bs_\bi_\bg_\bs_\bp_\be_\bc or _\bs_\bi_\bg_\bn_\bu_\bm to the processes
+ named by _\bp_\bi_\bd or _\bj_\bo_\bb_\bs_\bp_\be_\bc. _\bs_\bi_\bg_\bs_\bp_\be_\bc is either a case-insensitive
+ signal name such as S\bSI\bIG\bGK\bKI\bIL\bLL\bL (with or without the S\bSI\bIG\bG prefix) or
+ a signal number; _\bs_\bi_\bg_\bn_\bu_\bm is a signal number. If _\bs_\bi_\bg_\bs_\bp_\be_\bc is not
+ present, then S\bSI\bIG\bGT\bTE\bER\bRM\bM is assumed. An argument of -\b-l\bl lists the
+ signal names. If any arguments are supplied when -\b-l\bl is given,
+ the names of the signals corresponding to the arguments are
listed, and the return status is 0. The _\be_\bx_\bi_\bt_\b__\bs_\bt_\ba_\bt_\bu_\bs argument to
- -\b-l\bl is a number specifying either a signal number or the exit
- status of a process terminated by a signal. The -\b-L\bL option is
- equivalent to -\b-l\bl. k\bki\bil\bll\bl returns true if at least one signal was
+ -\b-l\bl is a number specifying either a signal number or the exit
+ status of a process terminated by a signal. The -\b-L\bL option is
+ equivalent to -\b-l\bl. k\bki\bil\bll\bl returns true if at least one signal was
successfully sent, or false if an error occurs or an invalid op-
tion is encountered.
l\ble\bet\bt _\ba_\br_\bg [_\ba_\br_\bg ...]
Each _\ba_\br_\bg is an arithmetic expression to be evaluated (see A\bAR\bRI\bIT\bTH\bH-\b-
- M\bME\bET\bTI\bIC\bC E\bEV\bVA\bAL\bLU\bUA\bAT\bTI\bIO\bON\bN above). If the last _\ba_\br_\bg evaluates to 0, l\ble\bet\bt
- returns 1; 0 is returned otherwise.
+ M\bME\bET\bTI\bIC\bC E\bEV\bVA\bAL\bLU\bUA\bAT\bTI\bIO\bON\bN in _\bb_\ba_\bs_\bh_\b(_\b1_\b)). If the last _\ba_\br_\bg evaluates to 0,
+ l\ble\bet\bt returns 1; 0 is returned otherwise.
l\blo\boc\bca\bal\bl [_\bo_\bp_\bt_\bi_\bo_\bn] [_\bn_\ba_\bm_\be[=_\bv_\ba_\bl_\bu_\be] ... | - ]
- For each argument, a local variable named _\bn_\ba_\bm_\be is created, and
- assigned _\bv_\ba_\bl_\bu_\be. The _\bo_\bp_\bt_\bi_\bo_\bn can be any of the options accepted
+ For each argument, a local variable named _\bn_\ba_\bm_\be is created, and
+ assigned _\bv_\ba_\bl_\bu_\be. The _\bo_\bp_\bt_\bi_\bo_\bn can be any of the options accepted
by d\bde\bec\bcl\bla\bar\bre\be. When l\blo\boc\bca\bal\bl is used within a function, it causes the
- variable _\bn_\ba_\bm_\be to have a visible scope restricted to that func-
- tion and its children. If _\bn_\ba_\bm_\be is -, the set of shell options
- is made local to the function in which l\blo\boc\bca\bal\bl is invoked: shell
- options changed using the s\bse\bet\bt builtin inside the function are
- restored to their original values when the function returns.
+ variable _\bn_\ba_\bm_\be to have a visible scope restricted to that func-
+ tion and its children. If _\bn_\ba_\bm_\be is -, the set of shell options
+ is made local to the function in which l\blo\boc\bca\bal\bl is invoked: shell
+ options changed using the s\bse\bet\bt builtin inside the function are
+ restored to their original values when the function returns.
The restore is effected as if a series of s\bse\bet\bt commands were exe-
- cuted to restore the values that were in place before the func-
- tion. With no operands, l\blo\boc\bca\bal\bl writes a list of local variables
- to the standard output. It is an error to use l\blo\boc\bca\bal\bl when not
- within a function. The return status is 0 unless l\blo\boc\bca\bal\bl is used
- outside a function, an invalid _\bn_\ba_\bm_\be is supplied, or _\bn_\ba_\bm_\be is a
+ cuted to restore the values that were in place before the func-
+ tion. With no operands, l\blo\boc\bca\bal\bl writes a list of local variables
+ to the standard output. It is an error to use l\blo\boc\bca\bal\bl when not
+ within a function. The return status is 0 unless l\blo\boc\bca\bal\bl is used
+ outside a function, an invalid _\bn_\ba_\bm_\be is supplied, or _\bn_\ba_\bm_\be is a
readonly variable.
l\blo\bog\bgo\bou\but\bt Exit a login shell.
- m\bma\bap\bpf\bfi\bil\ble\be [-\b-d\bd _\bd_\be_\bl_\bi_\bm] [-\b-n\bn _\bc_\bo_\bu_\bn_\bt] [-\b-O\bO _\bo_\br_\bi_\bg_\bi_\bn] [-\b-s\bs _\bc_\bo_\bu_\bn_\bt] [-\b-t\bt] [-\b-u\bu _\bf_\bd] [-\b-C\bC
+ m\bma\bap\bpf\bfi\bil\ble\be [-\b-d\bd _\bd_\be_\bl_\bi_\bm] [-\b-n\bn _\bc_\bo_\bu_\bn_\bt] [-\b-O\bO _\bo_\br_\bi_\bg_\bi_\bn] [-\b-s\bs _\bc_\bo_\bu_\bn_\bt] [-\b-t\bt] [-\b-u\bu _\bf_\bd] [-\b-C\bC
_\bc_\ba_\bl_\bl_\bb_\ba_\bc_\bk] [-\b-c\bc _\bq_\bu_\ba_\bn_\bt_\bu_\bm] [_\ba_\br_\br_\ba_\by]
r\bre\bea\bad\bda\bar\brr\bra\bay\by [-\b-d\bd _\bd_\be_\bl_\bi_\bm] [-\b-n\bn _\bc_\bo_\bu_\bn_\bt] [-\b-O\bO _\bo_\br_\bi_\bg_\bi_\bn] [-\b-s\bs _\bc_\bo_\bu_\bn_\bt] [-\b-t\bt] [-\b-u\bu _\bf_\bd] [-\b-C\bC
_\bc_\ba_\bl_\bl_\bb_\ba_\bc_\bk] [-\b-c\bc _\bq_\bu_\ba_\bn_\bt_\bu_\bm] [_\ba_\br_\br_\ba_\by]
- Read lines from the standard input into the indexed array vari-
- able _\ba_\br_\br_\ba_\by, or from file descriptor _\bf_\bd if the -\b-u\bu option is sup-
- plied. The variable M\bMA\bAP\bPF\bFI\bIL\bLE\bE is the default _\ba_\br_\br_\ba_\by. Options, if
+ Read lines from the standard input into the indexed array vari-
+ able _\ba_\br_\br_\ba_\by, or from file descriptor _\bf_\bd if the -\b-u\bu option is sup-
+ plied. The variable M\bMA\bAP\bPF\bFI\bIL\bLE\bE is the default _\ba_\br_\br_\ba_\by. Options, if
supplied, have the following meanings:
- -\b-d\bd The first character of _\bd_\be_\bl_\bi_\bm is used to terminate each
- input line, rather than newline. If _\bd_\be_\bl_\bi_\bm is the empty
+ -\b-d\bd The first character of _\bd_\be_\bl_\bi_\bm is used to terminate each
+ input line, rather than newline. If _\bd_\be_\bl_\bi_\bm is the empty
string, m\bma\bap\bpf\bfi\bil\ble\be will terminate a line when it reads a NUL
character.
- -\b-n\bn Copy at most _\bc_\bo_\bu_\bn_\bt lines. If _\bc_\bo_\bu_\bn_\bt is 0, all lines are
+ -\b-n\bn Copy at most _\bc_\bo_\bu_\bn_\bt lines. If _\bc_\bo_\bu_\bn_\bt is 0, all lines are
copied.
- -\b-O\bO Begin assigning to _\ba_\br_\br_\ba_\by at index _\bo_\br_\bi_\bg_\bi_\bn. The default
+ -\b-O\bO Begin assigning to _\ba_\br_\br_\ba_\by at index _\bo_\br_\bi_\bg_\bi_\bn. The default
index is 0.
-\b-s\bs Discard the first _\bc_\bo_\bu_\bn_\bt lines read.
- -\b-t\bt Remove a trailing _\bd_\be_\bl_\bi_\bm (default newline) from each line
+ -\b-t\bt Remove a trailing _\bd_\be_\bl_\bi_\bm (default newline) from each line
read.
- -\b-u\bu Read lines from file descriptor _\bf_\bd instead of the stan-
+ -\b-u\bu Read lines from file descriptor _\bf_\bd instead of the stan-
dard input.
- -\b-C\bC Evaluate _\bc_\ba_\bl_\bl_\bb_\ba_\bc_\bk each time _\bq_\bu_\ba_\bn_\bt_\bu_\bm lines are read. The
+ -\b-C\bC Evaluate _\bc_\ba_\bl_\bl_\bb_\ba_\bc_\bk each time _\bq_\bu_\ba_\bn_\bt_\bu_\bm lines are read. The
-\b-c\bc option specifies _\bq_\bu_\ba_\bn_\bt_\bu_\bm.
- -\b-c\bc Specify the number of lines read between each call to
+ -\b-c\bc Specify the number of lines read between each call to
_\bc_\ba_\bl_\bl_\bb_\ba_\bc_\bk.
- If -\b-C\bC is specified without -\b-c\bc, the default quantum is 5000.
+ If -\b-C\bC is specified without -\b-c\bc, the default quantum is 5000.
When _\bc_\ba_\bl_\bl_\bb_\ba_\bc_\bk is evaluated, it is supplied the index of the next
array element to be assigned and the line to be assigned to that
- element as additional arguments. _\bc_\ba_\bl_\bl_\bb_\ba_\bc_\bk is evaluated after
+ element as additional arguments. _\bc_\ba_\bl_\bl_\bb_\ba_\bc_\bk is evaluated after
the line is read but before the array element is assigned.
- If not supplied with an explicit origin, m\bma\bap\bpf\bfi\bil\ble\be will clear _\ba_\br_\b-
+ If not supplied with an explicit origin, m\bma\bap\bpf\bfi\bil\ble\be will clear _\ba_\br_\b-
_\br_\ba_\by before assigning to it.
- m\bma\bap\bpf\bfi\bil\ble\be returns successfully unless an invalid option or option
- argument is supplied, _\ba_\br_\br_\ba_\by is invalid or unassignable, or if
+ m\bma\bap\bpf\bfi\bil\ble\be returns successfully unless an invalid option or option
+ argument is supplied, _\ba_\br_\br_\ba_\by is invalid or unassignable, or if
_\ba_\br_\br_\ba_\by is not an indexed array.
p\bpo\bop\bpd\bd [-n\bn] [+_\bn] [-_\bn]
- Removes entries from the directory stack. With no arguments,
- removes the top directory from the stack, and performs a c\bcd\bd to
- the new top directory. Arguments, if supplied, have the follow-
- ing meanings:
+ Removes entries from the directory stack. The elements are num-
+ bered from 0 starting at the first directory listed by d\bdi\bir\brs\bs.
+ With no arguments, p\bpo\bop\bpd\bd removes the top directory from the
+ stack, and changes to the new top directory. Arguments, if sup-
+ plied, have the following meanings:
-\b-n\bn Suppresses the normal change of directory when removing
directories from the stack, so that only the stack is ma-
nipulated.
+\b+_\bn Removes the _\bnth entry counting from the left of the list
- shown by d\bdi\bir\brs\bs, starting with zero. For example: ``popd
- +0'' removes the first directory, ``popd +1'' the second.
+ shown by d\bdi\bir\brs\bs, starting with zero, from the stack. For
+ example: ``popd +0'' removes the first directory, ``popd
+ +1'' the second.
-\b-_\bn Removes the _\bnth entry counting from the right of the list
- shown by d\bdi\bir\brs\bs, starting with zero. For example: ``popd
- -0'' removes the last directory, ``popd -1'' the next to
+ shown by d\bdi\bir\brs\bs, starting with zero. For example: ``popd
+ -0'' removes the last directory, ``popd -1'' the next to
last.
- If the p\bpo\bop\bpd\bd command is successful, a d\bdi\bir\brs\bs is performed as well,
- and the return status is 0. p\bpo\bop\bpd\bd returns false if an invalid
- option is encountered, the directory stack is empty, a non-exis-
- tent directory stack entry is specified, or the directory change
- fails.
+ If the top element of the directory stack is modified, and the
+ _\b-_\bn option was not supplied, p\bpo\bop\bpd\bd uses the c\bcd\bd builtin to change
+ to the directory at the top of the stack. If the c\bcd\bd fails, p\bpo\bop\bpd\bd
+ returns a non-zero value.
+
+ Otherwise, p\bpo\bop\bpd\bd returns false if an invalid option is encoun-
+ tered, the directory stack is empty, or a non-existent directory
+ stack entry is specified.
+
+ If the p\bpo\bop\bpd\bd command is successful, bash runs d\bdi\bir\brs\bs to show the
+ final contents of the directory stack, and the return status is
+ 0.
p\bpr\bri\bin\bnt\btf\bf [-\b-v\bv _\bv_\ba_\br] _\bf_\bo_\br_\bm_\ba_\bt [_\ba_\br_\bg_\bu_\bm_\be_\bn_\bt_\bs]
Write the formatted _\ba_\br_\bg_\bu_\bm_\be_\bn_\bt_\bs to the standard output under the
corresponding _\ba_\br_\bg_\bu_\bm_\be_\bn_\bt in the same way as e\bec\bch\bho\bo -\b-e\be.
%\b%q\bq causes p\bpr\bri\bin\bnt\btf\bf to output the corresponding _\ba_\br_\bg_\bu_\bm_\be_\bn_\bt in a
format that can be reused as shell input.
+ %\b%Q\bQ like %\b%q\bq, but applies any supplied precision to the _\ba_\br_\bg_\bu_\b-
+ _\bm_\be_\bn_\bt before quoting it.
%\b%(\b(_\bd_\ba_\bt_\be_\bf_\bm_\bt)\b)T\bT
- causes p\bpr\bri\bin\bnt\btf\bf to output the date-time string resulting
- from using _\bd_\ba_\bt_\be_\bf_\bm_\bt as a format string for _\bs_\bt_\br_\bf_\bt_\bi_\bm_\be(3).
+ causes p\bpr\bri\bin\bnt\btf\bf to output the date-time string resulting
+ from using _\bd_\ba_\bt_\be_\bf_\bm_\bt as a format string for _\bs_\bt_\br_\bf_\bt_\bi_\bm_\be(3).
The corresponding _\ba_\br_\bg_\bu_\bm_\be_\bn_\bt 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. If no ar-
+ 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. If no ar-
gument is specified, conversion behaves as if -1 had been
- given. This is an exception to the usual p\bpr\bri\bin\bnt\btf\bf behav-
+ given. This is an exception to the usual p\bpr\bri\bin\bnt\btf\bf behav-
ior.
The %b, %q, and %T directives all use the field width and preci-
bytes from (or use that wide a field for) the expanded argument,
which usually contains more characters than the original.
- 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 _\bf_\bo_\br_\bm_\ba_\bt is reused as necessary to consume all of the _\ba_\br_\bg_\bu_\b-
+ The _\bf_\bo_\br_\bm_\ba_\bt is reused as necessary to consume all of the _\ba_\br_\bg_\bu_\b-
_\bm_\be_\bn_\bt_\bs. If the _\bf_\bo_\br_\bm_\ba_\bt requires more _\ba_\br_\bg_\bu_\bm_\be_\bn_\bt_\bs 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.
p\bpu\bus\bsh\bhd\bd [-\b-n\bn] [+_\bn] [-_\bn]
p\bpu\bus\bsh\bhd\bd [-\b-n\bn] [_\bd_\bi_\br]
- 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, p\bpu\bus\bsh\bhd\bd exchanges the top two di-
- rectories and returns 0, unless the directory stack is empty.
- Arguments, if supplied, have the following meanings:
- -\b-n\bn Suppresses the normal change of directory when rotating
- or adding directories to the stack, so that only the
+ 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, p\bpu\bus\bsh\bhd\bd exchanges the top two ele-
+ ments of the directory stack. Arguments, if supplied, have the
+ following meanings:
+ -\b-n\bn Suppresses the normal change of directory when rotating
+ or adding directories to the stack, so that only the
stack is manipulated.
- +\b+_\bn Rotates the stack so that the _\bnth directory (counting
- from the left of the list shown by d\bdi\bir\brs\bs, starting with
+ +\b+_\bn Rotates the stack so that the _\bnth directory (counting
+ from the left of the list shown by d\bdi\bir\brs\bs, starting with
zero) is at the top.
- -\b-_\bn Rotates the stack so that the _\bnth directory (counting
- from the right of the list shown by d\bdi\bir\brs\bs, starting with
+ -\b-_\bn Rotates the stack so that the _\bnth directory (counting
+ from the right of the list shown by d\bdi\bir\brs\bs, starting with
zero) is at the top.
- _\bd_\bi_\br Adds _\bd_\bi_\br to the directory stack at the top, making it the
- new current working directory as if it had been supplied
- as the argument to the c\bcd\bd builtin.
+ _\bd_\bi_\br Adds _\bd_\bi_\br to the directory stack at the top
+
+ After the stack has been modified, if the -\b-n\bn option was not sup-
+ plied, p\bpu\bus\bsh\bhd\bd uses the c\bcd\bd builtin to change to the directory at
+ the top of the stack. If the c\bcd\bd fails, p\bpu\bus\bsh\bhd\bd returns a non-zero
+ value.
- If the p\bpu\bus\bsh\bhd\bd command is successful, a d\bdi\bir\brs\bs is performed as well.
- If the first form is used, p\bpu\bus\bsh\bhd\bd returns 0 unless the cd to _\bd_\bi_\br
- fails. With the second form, p\bpu\bus\bsh\bhd\bd returns 0 unless the direc-
- tory stack is empty, a non-existent directory stack element is
- specified, or the directory change to the specified new current
- directory fails.
+ Otherwise, if no arguments are supplied, p\bpu\bus\bsh\bhd\bd returns 0 unless
+ the directory stack is empty. When rotating the directory
+ stack, p\bpu\bus\bsh\bhd\bd returns 0 unless the directory stack is empty or a
+ non-existent directory stack element is specified.
+
+ If the p\bpu\bus\bsh\bhd\bd command is successful, bash runs d\bdi\bir\brs\bs to show the
+ final contents of the directory stack.
p\bpw\bwd\bd [-\b-L\bLP\bP]
- Print the absolute pathname of the current working directory.
+ Print the absolute pathname of the current working directory.
The pathname printed contains no symbolic links if the -\b-P\bP option
is supplied or the -\b-o\bo p\bph\bhy\bys\bsi\bic\bca\bal\bl option to the s\bse\bet\bt builtin command
- is enabled. If the -\b-L\bL option is used, the pathname printed may
- contain symbolic links. The return status is 0 unless an error
+ is enabled. If the -\b-L\bL option is used, the pathname printed may
+ contain symbolic links. The return status is 0 unless an error
occurs while reading the name of the current directory or an in-
valid option is supplied.
r\bre\bea\bad\bd [-\b-e\ber\brs\bs] [-\b-a\ba _\ba_\bn_\ba_\bm_\be] [-\b-d\bd _\bd_\be_\bl_\bi_\bm] [-\b-i\bi _\bt_\be_\bx_\bt] [-\b-n\bn _\bn_\bc_\bh_\ba_\br_\bs] [-\b-N\bN _\bn_\bc_\bh_\ba_\br_\bs] [-\b-p\bp
_\bp_\br_\bo_\bm_\bp_\bt] [-\b-t\bt _\bt_\bi_\bm_\be_\bo_\bu_\bt] [-\b-u\bu _\bf_\bd] [_\bn_\ba_\bm_\be ...]
- One line is read from the standard input, or from the file de-
+ One line is read from the standard input, or from the file de-
scriptor _\bf_\bd supplied as an argument to the -\b-u\bu option, split into
- words as described above under W\bWo\bor\brd\bd S\bSp\bpl\bli\bit\btt\bti\bin\bng\bg, and the first
- word is assigned to the first _\bn_\ba_\bm_\be, the second word to the sec-
- ond _\bn_\ba_\bm_\be, and so on. If there are more words than names, the
+ words as described in _\bb_\ba_\bs_\bh_\b(_\b1_\b) under W\bWo\bor\brd\bd S\bSp\bpl\bli\bit\btt\bti\bin\bng\bg, and the
+ first word is assigned to the first _\bn_\ba_\bm_\be, the second word to the
+ second _\bn_\ba_\bm_\be, and so on. If there are more words than names, the
remaining words and their intervening delimiters are assigned to
- the last _\bn_\ba_\bm_\be. If there are fewer words read from the input
- stream than names, the remaining names are assigned empty val-
- ues. The characters in I\bIF\bFS\bS are used to split the line into
- words using the same rules the shell uses for expansion (de-
- scribed above under W\bWo\bor\brd\bd S\bSp\bpl\bli\bit\btt\bti\bin\bng\bg). The backslash character
- (\\b\) may be used to remove any special meaning for the next char-
- acter read and for line continuation. Options, if supplied,
+ the last _\bn_\ba_\bm_\be. If there are fewer words read from the input
+ stream than names, the remaining names are assigned empty val-
+ ues. The characters in I\bIF\bFS\bS are used to split the line into
+ words using the same rules the shell uses for expansion (de-
+ scribed in _\bb_\ba_\bs_\bh_\b(_\b1_\b) under W\bWo\bor\brd\bd S\bSp\bpl\bli\bit\btt\bti\bin\bng\bg). The backslash charac-
+ ter (\\b\) may be used to remove any special meaning for the next
+ character read and for line continuation. Options, if supplied,
have the following meanings:
-\b-a\ba _\ba_\bn_\ba_\bm_\be
The words are assigned to sequential indices of the array
variable _\ba_\bn_\ba_\bm_\be, starting at 0. _\ba_\bn_\ba_\bm_\be is unset before any
- new values are assigned. Other _\bn_\ba_\bm_\be arguments are ig-
+ new values are assigned. Other _\bn_\ba_\bm_\be arguments are ig-
nored.
-\b-d\bd _\bd_\be_\bl_\bi_\bm
The first character of _\bd_\be_\bl_\bi_\bm is used to terminate the in-
- put line, rather than newline. If _\bd_\be_\bl_\bi_\bm is the empty
- string, r\bre\bea\bad\bd will terminate a line when it reads a NUL
+ put line, rather than newline. If _\bd_\be_\bl_\bi_\bm is the empty
+ string, r\bre\bea\bad\bd will terminate a line when it reads a NUL
character.
-\b-e\be If the standard input is coming from a terminal, r\bre\bea\bad\bdl\bli\bin\bne\be
- (see R\bRE\bEA\bAD\bDL\bLI\bIN\bNE\bE above) is used to obtain the line. Read-
- line uses the current (or default, if line editing was
- not previously active) editing settings, but uses Read-
- line's default filename completion.
+ (see R\bRE\bEA\bAD\bDL\bLI\bIN\bNE\bE in _\bb_\ba_\bs_\bh_\b(_\b1_\b)) is used to obtain the line.
+ Readline uses the current (or default, if line editing
+ was not previously active) editing settings, but uses
+ readline's default filename completion.
-\b-i\bi _\bt_\be_\bx_\bt
- If r\bre\bea\bad\bdl\bli\bin\bne\be is being used to read the line, _\bt_\be_\bx_\bt is
+ If r\bre\bea\bad\bdl\bli\bin\bne\be is being used to read the line, _\bt_\be_\bx_\bt is
placed into the editing buffer before editing begins.
-\b-n\bn _\bn_\bc_\bh_\ba_\br_\bs
- r\bre\bea\bad\bd returns after reading _\bn_\bc_\bh_\ba_\br_\bs characters rather than
+ r\bre\bea\bad\bd returns after reading _\bn_\bc_\bh_\ba_\br_\bs characters rather than
waiting for a complete line of input, but honors a delim-
- iter if fewer than _\bn_\bc_\bh_\ba_\br_\bs characters are read before the
+ iter if fewer than _\bn_\bc_\bh_\ba_\br_\bs characters are read before the
delimiter.
-\b-N\bN _\bn_\bc_\bh_\ba_\br_\bs
- r\bre\bea\bad\bd returns after reading exactly _\bn_\bc_\bh_\ba_\br_\bs characters
- rather than waiting for a complete line of input, unless
- EOF is encountered or r\bre\bea\bad\bd times out. Delimiter charac-
- ters encountered in the input are not treated specially
- and do not cause r\bre\bea\bad\bd to return until _\bn_\bc_\bh_\ba_\br_\bs characters
- are read. The result is not split on the characters in
- I\bIF\bFS\bS; the intent is that the variable is assigned exactly
+ r\bre\bea\bad\bd returns after reading exactly _\bn_\bc_\bh_\ba_\br_\bs characters
+ rather than waiting for a complete line of input, unless
+ EOF is encountered or r\bre\bea\bad\bd times out. Delimiter charac-
+ ters encountered in the input are not treated specially
+ and do not cause r\bre\bea\bad\bd to return until _\bn_\bc_\bh_\ba_\br_\bs characters
+ are read. The result is not split on the characters in
+ I\bIF\bFS\bS; the intent is that the variable is assigned exactly
the characters read (with the exception of backslash; see
the -\b-r\br option below).
-\b-p\bp _\bp_\br_\bo_\bm_\bp_\bt
line, before attempting to read any input. The prompt is
displayed only if input is coming from a terminal.
-\b-r\br 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 then be used as a
+ slash is considered to be part of the line. In particu-
+ lar, a backslash-newline pair may not then be used as a
line continuation.
-\b-s\bs Silent mode. If input is coming from a terminal, charac-
ters are not echoed.
-\b-t\bt _\bt_\bi_\bm_\be_\bo_\bu_\bt
- Cause r\bre\bea\bad\bd to time out and return failure if a complete
- line of input (or a specified number of characters) is
- not read within _\bt_\bi_\bm_\be_\bo_\bu_\bt seconds. _\bt_\bi_\bm_\be_\bo_\bu_\bt may be a deci-
- mal number with a fractional portion following the deci-
- mal point. This option is only effective if r\bre\bea\bad\bd is
- reading input from a terminal, pipe, or other special
- file; it has no effect when reading from regular files.
+ Cause r\bre\bea\bad\bd to time out and return failure if a complete
+ line of input (or a specified number of characters) is
+ not read within _\bt_\bi_\bm_\be_\bo_\bu_\bt seconds. _\bt_\bi_\bm_\be_\bo_\bu_\bt may be a deci-
+ mal number with a fractional portion following the deci-
+ mal point. This option is only effective if r\bre\bea\bad\bd is
+ reading input from a terminal, pipe, or other special
+ file; it has no effect when reading from regular files.
If r\bre\bea\bad\bd times out, r\bre\bea\bad\bd saves any partial input read into
- the specified variable _\bn_\ba_\bm_\be. If _\bt_\bi_\bm_\be_\bo_\bu_\bt is 0, r\bre\bea\bad\bd re-
- turns immediately, without trying to read any data. The
- exit status is 0 if input is available on the specified
- file descriptor, non-zero otherwise. The exit status is
- greater than 128 if the timeout is exceeded.
+ the specified variable _\bn_\ba_\bm_\be. If _\bt_\bi_\bm_\be_\bo_\bu_\bt is 0, r\bre\bea\bad\bd re-
+ turns immediately, without trying to read any data. The
+ exit status is 0 if input is available on the specified
+ file descriptor, or the read will return EOF, non-zero
+ otherwise. The exit status is greater than 128 if the
+ timeout is exceeded.
-\b-u\bu _\bf_\bd Read input from file descriptor _\bf_\bd.
If no _\bn_\ba_\bm_\be_\bs are supplied, the line read, without the ending de-
associated with the R\bRE\bET\bTU\bUR\bRN\bN trap is executed before execution re-
sumes after the function or script.
- s\bse\bet\bt [-\b--\b-a\bab\bbe\bef\bfh\bhk\bkm\bmn\bnp\bpt\btu\buv\bvx\bxB\bBC\bCE\bEH\bHP\bPT\bT] [-\b-o\bo _\bo_\bp_\bt_\bi_\bo_\bn_\b-_\bn_\ba_\bm_\be] [_\ba_\br_\bg ...]
- s\bse\bet\bt [+\b+a\bab\bbe\bef\bfh\bhk\bkm\bmn\bnp\bpt\btu\buv\bvx\bxB\bBC\bCE\bEH\bHP\bPT\bT] [+\b+o\bo _\bo_\bp_\bt_\bi_\bo_\bn_\b-_\bn_\ba_\bm_\be] [_\ba_\br_\bg ...]
- 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 _\bp_\bo_\bs_\bi_\bx _\bm_\bo_\bd_\be, 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
- $\b$1\b1, $\b$2\b2, .\b..\b..\b. $\b$_\bn. Options, if specified, have the following
- meanings:
+ s\bse\bet\bt [-\b-a\bab\bbe\bef\bfh\bhk\bkm\bmn\bnp\bpt\btu\buv\bvx\bxB\bBC\bCE\bEH\bHP\bPT\bT] [-\b-o\bo _\bo_\bp_\bt_\bi_\bo_\bn_\b-_\bn_\ba_\bm_\be] [-\b--\b-] [-\b-] [_\ba_\br_\bg ...]
+ s\bse\bet\bt [+\b+a\bab\bbe\bef\bfh\bhk\bkm\bmn\bnp\bpt\btu\buv\bvx\bxB\bBC\bCE\bEH\bHP\bPT\bT] [+\b+o\bo _\bo_\bp_\bt_\bi_\bo_\bn_\b-_\bn_\ba_\bm_\be] [-\b--\b-] [-\b-] [_\ba_\br_\bg ...]
+ Without options, display the name and value of each shell vari-
+ able in a format that can be reused as input for setting or re-
+ setting the currently-set variables. Read-only variables cannot
+ be reset. In _\bp_\bo_\bs_\bi_\bx _\bm_\bo_\bd_\be, 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 argu-
+ ments remaining after option processing are treated as values
+ for the positional parameters and are assigned, in order, to $\b$1\b1,
+ $\b$2\b2, .\b..\b..\b. $\b$_\bn. Options, if specified, have the following mean-
+ ings:
-\b-a\ba Each variable or function that is created or modified is
given the export attribute and marked for export to the
environment of subsequent commands.
is effective only when job control is enabled.
-\b-e\be Exit immediately if a _\bp_\bi_\bp_\be_\bl_\bi_\bn_\be (which may consist of a
single _\bs_\bi_\bm_\bp_\bl_\be _\bc_\bo_\bm_\bm_\ba_\bn_\bd), a _\bl_\bi_\bs_\bt, or a _\bc_\bo_\bm_\bp_\bo_\bu_\bn_\bd _\bc_\bo_\bm_\bm_\ba_\bn_\bd
- (see S\bSH\bHE\bEL\bLL\bL G\bGR\bRA\bAM\bMM\bMA\bAR\bR 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 w\bwh\bhi\bil\ble\be
- or u\bun\bnt\bti\bil\bl keyword, part of the test following the i\bif\bf or
- e\bel\bli\bif\bf reserved words, part of any command executed in a
- &\b&&\b& or |\b||\b| list except the command following the final &\b&&\b&
- or |\b||\b|, any command in a pipeline but the last, or if the
- command's return value is being inverted with !\b!. If a
- compound command other than a subshell returns a non-
- zero status because a command failed while -\b-e\be was being
- ignored, the shell does not exit. A trap on E\bER\bRR\bR, if
- set, is executed before the shell exits. This option
+ (see S\bSH\bHE\bEL\bLL\bL G\bGR\bRA\bAM\bMM\bMA\bAR\bR in _\bb_\ba_\bs_\bh_\b(_\b1_\b)), 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 w\bwh\bhi\bil\ble\be or u\bun\bnt\bti\bil\bl keyword, part of the test following the
+ i\bif\bf or e\bel\bli\bif\bf reserved words, part of any command executed
+ in a &\b&&\b& or |\b||\b| list except the command following the fi-
+ nal &\b&&\b& or |\b||\b|, any command in a pipeline but the last, or
+ if the command's return value is being inverted with !\b!.
+ If a compound command other than a subshell returns a
+ non-zero status because a command failed while -\b-e\be was
+ being ignored, the shell does not exit. A trap on E\bER\bRR\bR,
+ if set, is executed before the shell exits. This option
applies to the shell environment and each subshell envi-
- ronment separately (see C\bCO\bOM\bMM\bMA\bAN\bND\bD E\bEX\bXE\bEC\bCU\bUT\bTI\bIO\bON\bN E\bEN\bNV\bVI\bIR\bRO\bON\bNM\bME\bEN\bNT\bT
- above), and may cause subshells to exit before executing
- all the commands in the subshell.
+ ronment separately (see C\bCO\bOM\bMM\bMA\bAN\bND\bD E\bEX\bXE\bEC\bCU\bUT\bTI\bIO\bON\bN E\bEN\bNV\bVI\bIR\bRO\bON\bNM\bME\bEN\bNT\bT in
+ _\bb_\ba_\bs_\bh_\b(_\b1_\b)), and may cause subshells to exit before execut-
+ ing all the commands in the subshell.
If a compound command or shell function executes in a
context where -\b-e\be is being ignored, none of the commands
that precede the command name.
-\b-m\bm Monitor mode. Job control is enabled. This option is
on by default for interactive shells on systems that
- support it (see J\bJO\bOB\bB C\bCO\bON\bNT\bTR\bRO\bOL\bL 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.
+ support it (see J\bJO\bOB\bB C\bCO\bON\bNT\bTR\bRO\bOL\bL in _\bb_\ba_\bs_\bh_\b(_\b1_\b)). All processes
+ run in a separate process group. When a background job
+ completes, the shell prints a line containing its exit
+ status.
-\b-n\bn Read commands but do not execute them. This may be used
to check a shell script for syntax errors. This is ig-
nored by interactive shells.
h\bha\bas\bsh\bha\bal\bll\bl Same as -\b-h\bh.
h\bhi\bis\bst\bte\bex\bxp\bpa\ban\bnd\bd
Same as -\b-H\bH.
- h\bhi\bis\bst\bto\bor\bry\by Enable command history, as described above under
- H\bHI\bIS\bST\bTO\bOR\bRY\bY. This option is on by default in inter-
- active shells.
+ h\bhi\bis\bst\bto\bor\bry\by Enable command history, as described in _\bb_\ba_\bs_\bh_\b(_\b1_\b)
+ under H\bHI\bIS\bST\bTO\bOR\bRY\bY. This option is on by default in
+ interactive shells.
i\big\bgn\bno\bor\bre\bee\beo\bof\bf
The effect is as if the shell command ``IG-
NOREEOF=10'' had been executed (see S\bSh\bhe\bel\bll\bl V\bVa\bar\bri\bi-\b-
- a\bab\bbl\ble\bes\bs above).
+ a\bab\bbl\ble\bes\bs in _\bb_\ba_\bs_\bh_\b(_\b1_\b)).
k\bke\bey\byw\bwo\bor\brd\bd Same as -\b-k\bk.
m\bmo\bon\bni\bit\bto\bor\br Same as -\b-m\bm.
n\bno\boc\bcl\blo\bob\bbb\bbe\ber\br
p\bpo\bos\bsi\bix\bx Change the behavior of b\bba\bas\bsh\bh where the default
operation differs from the POSIX standard to
match the standard (_\bp_\bo_\bs_\bi_\bx _\bm_\bo_\bd_\be). See S\bSE\bEE\bE A\bAL\bLS\bSO\bO
- below for a reference to a document that details
- how posix mode affects bash's behavior.
+ in _\bb_\ba_\bs_\bh_\b(_\b1_\b) for a reference to a document that
+ details how posix mode affects bash's behavior.
p\bpr\bri\biv\bvi\bil\ble\beg\bge\bed\bd
Same as -\b-p\bp.
v\bve\ber\brb\bbo\bos\bse\be Same as -\b-v\bv.
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.
+ -\b-r\br Enable restricted shell mode. This option cannot be un-
+ set once it has been set.
-\b-t\bt Exit after reading and executing one command.
-\b-u\bu Treat unset variables and parameters other than the spe-
- cial parameters "@" and "*" as an error when performing
+ cial parameters "@" and "*", or array variables sub-
+ scripted with "@" or "*", 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
play the expanded value of P\bPS\bS4\b4, followed by the command
and its expanded arguments or associated word list.
-\b-B\bB The shell performs brace expansion (see B\bBr\bra\bac\bce\be E\bEx\bxp\bpa\ban\bns\bsi\bio\bon\bn
- above). This is on by default.
+ in _\bb_\ba_\bs_\bh_\b(_\b1_\b)). This is on by default.
-\b-C\bC If set, b\bba\bas\bsh\bh does not overwrite an existing file with
the >\b>, >\b>&\b&, and <\b<>\b> redirection operators. This may be
overridden when creating output files by using the redi-
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
- (see J\bJO\bOB\bB C\bCO\bON\bNT\bTR\bRO\bOL\bL above). The shell always postpones ex-
- iting if any jobs are stopped.
+ (see J\bJO\bOB\bB C\bCO\bON\bNT\bTR\bRO\bOL\bL in _\bb_\ba_\bs_\bh_\b(_\b1_\b)). The shell always post-
+ pones exiting if any jobs are stopped.
c\bch\bhe\bec\bck\bkw\bwi\bin\bns\bsi\biz\bze\be
If set, b\bba\bas\bsh\bh checks the window size after each external
(non-builtin) command and, if necessary, updates the
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 H\bHI\bIS\bST\bTO\bOR\bRY\bY.
+ history is enabled, as described in _\bb_\ba_\bs_\bh_\b(_\b1_\b) under H\bHI\bIS\bS-\b-
+ T\bTO\bOR\bRY\bY.
c\bco\bom\bmp\bpa\bat\bt3\b31\b1
c\bco\bom\bmp\bpa\bat\bt3\b32\b2
c\bco\bom\bmp\bpa\bat\bt4\b40\b0
c\bco\bom\bmp\bpa\bat\bt4\b42\b2
c\bco\bom\bmp\bpa\bat\bt4\b43\b3
c\bco\bom\bmp\bpa\bat\bt4\b44\b4
- These control aspects of the shell's compatibility mode
- (see S\bSH\bHE\bEL\bLL\bL C\bCO\bOM\bMP\bPA\bAT\bTI\bIB\bBI\bIL\bLI\bIT\bTY\bY M\bMO\bOD\bDE\bE below).
+ c\bco\bom\bmp\bpa\bat\bt5\b50\b0
+ These control aspects of the shell's compatibility mode
+ (see S\bSH\bHE\bEL\bLL\bL C\bCO\bOM\bMP\bPA\bAT\bTI\bIB\bBI\bIL\bLI\bIT\bTY\bY M\bMO\bOD\bDE\bE in _\bb_\ba_\bs_\bh_\b(_\b1_\b)).
c\bco\bom\bmp\bpl\ble\bet\bte\be_\b_f\bfu\bul\bll\blq\bqu\buo\bot\bte\be
- If set, b\bba\bas\bsh\bh quotes all shell metacharacters in file-
- names and directory names when performing completion.
+ If set, b\bba\bas\bsh\bh quotes all shell metacharacters in file-
+ names and directory names when performing completion.
If not set, b\bba\bas\bsh\bh 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.
d\bdi\bir\bre\bex\bxp\bpa\ban\bnd\bd
- If set, b\bba\bas\bsh\bh 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, b\bba\bas\bsh\bh attempts to preserve what the
+ If set, b\bba\bas\bsh\bh 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, b\bba\bas\bsh\bh attempts to preserve what the
user typed.
d\bdi\bir\brs\bsp\bpe\bel\bll\bl
- If set, b\bba\bas\bsh\bh attempts spelling correction on directory
- names during word completion if the directory name ini-
+ If set, b\bba\bas\bsh\bh attempts spelling correction on directory
+ names during word completion if the directory name ini-
tially supplied does not exist.
- d\bdo\bot\btg\bgl\blo\bob\bb If set, b\bba\bas\bsh\bh includes filenames beginning with a `.' in
- the results of pathname expansion. The filenames `\b``\b`.\b.'\b''\b'
- and `\b``\b`.\b..\b.'\b''\b' must always be matched explicitly, even if
+ d\bdo\bot\btg\bgl\blo\bob\bb If set, b\bba\bas\bsh\bh includes filenames beginning with a `.' in
+ the results of pathname expansion. The filenames `\b``\b`.\b.'\b''\b'
+ and `\b``\b`.\b..\b.'\b''\b' must always be matched explicitly, even if
d\bdo\bot\btg\bgl\blo\bob\bb is set.
e\bex\bxe\bec\bcf\bfa\bai\bil\bl
If set, a non-interactive shell will not exit if it can-
- not execute the file specified as an argument to the
- e\bex\bxe\bec\bc builtin command. An interactive shell does not
+ not execute the file specified as an argument to the
+ e\bex\bxe\bec\bc builtin command. An interactive shell does not
exit if e\bex\bxe\bec\bc fails.
e\bex\bxp\bpa\ban\bnd\bd_\b_a\bal\bli\bia\bas\bse\bes\bs
- If set, aliases are expanded as described above under
- A\bAL\bLI\bIA\bAS\bSE\bES\bS. This option is enabled by default for interac-
- tive shells.
+ If set, aliases are expanded as described in _\bb_\ba_\bs_\bh_\b(_\b1_\b) un-
+ der A\bAL\bLI\bIA\bAS\bSE\bES\bS. This option is enabled by default for in-
+ teractive shells.
e\bex\bxt\btd\bde\beb\bbu\bug\bg
- 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 -\b--\b-d\bde\beb\bbu\bug\bgg\bge\ber\br option. If set af-
- ter invocation, behavior intended for use by debuggers
+ starts, identical to the -\b--\b-d\bde\beb\bbu\bug\bgg\bge\ber\br option. If set af-
+ ter invocation, behavior intended for use by debuggers
is enabled:
1\b1.\b. The -\b-F\bF option to the d\bde\bec\bcl\bla\bar\bre\be builtin displays the
source file name and line number corresponding to
each function name supplied as an argument.
- 2\b2.\b. If the command run by the D\bDE\bEB\bBU\bUG\bG trap returns a
- non-zero value, the next command is skipped and
+ 2\b2.\b. If the command run by the D\bDE\bEB\bBU\bUG\bG trap returns a
+ non-zero value, the next command is skipped and
not executed.
- 3\b3.\b. If the command run by the D\bDE\bEB\bBU\bUG\bG 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 .\b. or s\bso\bou\bur\brc\bce\be builtins), the shell
+ 3\b3.\b. If the command run by the D\bDE\bEB\bBU\bUG\bG 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 .\b. or s\bso\bou\bur\brc\bce\be builtins), the shell
simulates a call to r\bre\bet\btu\bur\brn\bn.
- 4\b4.\b. B\bBA\bAS\bSH\bH_\b_A\bAR\bRG\bGC\bC and B\bBA\bAS\bSH\bH_\b_A\bAR\bRG\bGV\bV are updated as described
- in their descriptions above.
+ 4\b4.\b. B\bBA\bAS\bSH\bH_\b_A\bAR\bRG\bGC\bC and B\bBA\bAS\bSH\bH_\b_A\bAR\bRG\bGV\bV are updated as described
+ in their descriptions in _\bb_\ba_\bs_\bh_\b(_\b1_\b)).
- 5\b5.\b. Function tracing is enabled: command substitu-
+ 5\b5.\b. Function tracing is enabled: command substitu-
tion, shell functions, and subshells invoked with
(\b( _\bc_\bo_\bm_\bm_\ba_\bn_\bd )\b) inherit the D\bDE\bEB\bBU\bUG\bG and R\bRE\bET\bTU\bUR\bRN\bN traps.
- 6\b6.\b. Error tracing is enabled: command substitution,
- shell functions, and subshells invoked with (\b(
+ 6\b6.\b. Error tracing is enabled: command substitution,
+ shell functions, and subshells invoked with (\b(
_\bc_\bo_\bm_\bm_\ba_\bn_\bd )\b) inherit the E\bER\bRR\bR trap.
e\bex\bxt\btg\bgl\blo\bob\bb If set, the extended pattern matching features described
- above under P\bPa\bat\bth\bhn\bna\bam\bme\be E\bEx\bxp\bpa\ban\bns\bsi\bio\bon\bn are enabled.
+ in _\bb_\ba_\bs_\bh_\b(_\b1_\b) under P\bPa\bat\bth\bhn\bna\bam\bme\be E\bEx\bxp\bpa\ban\bns\bsi\bio\bon\bn are enabled.
e\bex\bxt\btq\bqu\buo\bot\bte\be
- If set, $\b$'_\bs_\bt_\br_\bi_\bn_\bg' and $\b$"_\bs_\bt_\br_\bi_\bn_\bg" quoting is performed
- within $\b${\b{_\bp_\ba_\br_\ba_\bm_\be_\bt_\be_\br}\b} expansions enclosed in double
+ If set, $\b$'_\bs_\bt_\br_\bi_\bn_\bg' and $\b$"_\bs_\bt_\br_\bi_\bn_\bg" quoting is performed
+ within $\b${\b{_\bp_\ba_\br_\ba_\bm_\be_\bt_\be_\br}\b} expansions enclosed in double
quotes. This option is enabled by default.
f\bfa\bai\bil\blg\bgl\blo\bob\bb
- 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.
f\bfo\bor\brc\bce\be_\b_f\bfi\big\bgn\bno\bor\bre\be
- If set, the suffixes specified by the F\bFI\bIG\bGN\bNO\bOR\bRE\bE shell
- variable cause words to be ignored when performing word
+ If set, the suffixes specified by the F\bFI\bIG\bGN\bNO\bOR\bRE\bE shell
+ variable cause words to be ignored when performing word
completion even if the ignored words are the only possi-
- ble completions. See S\bSH\bHE\bEL\bLL\bL V\bVA\bAR\bRI\bIA\bAB\bBL\bLE\bES\bS above for a de-
- scription of F\bFI\bIG\bGN\bNO\bOR\bRE\bE. This option is enabled by de-
+ ble completions. See S\bSH\bHE\bEL\bLL\bL V\bVA\bAR\bRI\bIA\bAB\bBL\bLE\bES\bS in _\bb_\ba_\bs_\bh_\b(_\b1_\b) for a
+ description of F\bFI\bIG\bGN\bNO\bOR\bRE\bE. This option is enabled by de-
fault.
g\bgl\blo\bob\bba\bas\bsc\bci\bii\bir\bra\ban\bng\bge\bes\bs
- If set, range expressions used in pattern matching
- bracket expressions (see P\bPa\bat\btt\bte\ber\brn\bn M\bMa\bat\btc\bch\bhi\bin\bng\bg 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 b\bb will not collate
- between A\bA and B\bB, and upper-case and lower-case ASCII
- characters will collate together.
+ If set, range expressions used in pattern matching
+ bracket expressions (see P\bPa\bat\btt\bte\ber\brn\bn M\bMa\bat\btc\bch\bhi\bin\bng\bg in _\bb_\ba_\bs_\bh_\b(_\b1_\b))
+ behave as if in the traditional C locale when performing
+ comparisons. That is, the current locale's collating
+ sequence is not taken into account, so b\bb will not col-
+ late between A\bA and B\bB, and upper-case and lower-case
+ ASCII characters will collate together.
+
+ g\bgl\blo\bob\bbs\bsk\bki\bip\bpd\bdo\bot\bts\bs
+ If set, pathname expansion will never match the file-
+ names `\b``\b`.\b.'\b''\b' and `\b``\b`.\b..\b.'\b''\b', even if the pattern begins with
+ a `\b``\b`.\b.'\b''\b'. This option is enabled by default.
g\bgl\blo\bob\bbs\bst\bta\bar\br
If set, the pattern *\b**\b* 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 /\b/,
+ text will match all files and zero or more directories
+ and subdirectories. If the pattern is followed by a /\b/,
only directories and subdirectories match.
g\bgn\bnu\bu_\b_e\ber\brr\brf\bfm\bmt\bt
GNU error message format.
h\bhi\bis\bst\bta\bap\bpp\bpe\ben\bnd\bd
- 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 H\bHI\bIS\bST\bTF\bFI\bIL\bLE\bE variable when the shell ex-
its, rather than overwriting the file.
h\bhi\bis\bst\btr\bre\bee\bed\bdi\bit\bt
- If set, and r\bre\bea\bad\bdl\bli\bin\bne\be is being used, a user is given the
+ If set, and r\bre\bea\bad\bdl\bli\bin\bne\be is being used, a user is given the
opportunity to re-edit a failed history substitution.
h\bhi\bis\bst\btv\bve\ber\bri\bif\bfy\by
- If set, and r\bre\bea\bad\bdl\bli\bin\bne\be 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 r\bre\bea\bad\bdl\bli\bin\bne\be 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 r\bre\bea\bad\bdl\bli\bin\bne\be editing buffer, allowing further modi-
fication.
h\bho\bos\bst\btc\bco\bom\bmp\bpl\ble\bet\bte\be
If set, and r\bre\bea\bad\bdl\bli\bin\bne\be is being used, b\bba\bas\bsh\bh will attempt to
- perform hostname completion when a word containing a @\b@
- is being completed (see C\bCo\bom\bmp\bpl\ble\bet\bti\bin\bng\bg under R\bRE\bEA\bAD\bDL\bLI\bIN\bNE\bE
- above). This is enabled by default.
+ perform hostname completion when a word containing a @\b@
+ is being completed (see C\bCo\bom\bmp\bpl\ble\bet\bti\bin\bng\bg under R\bRE\bEA\bAD\bDL\bLI\bIN\bNE\bE in
+ _\bb_\ba_\bs_\bh_\b(_\b1_\b)). This is enabled by default.
h\bhu\bup\bpo\bon\bne\bex\bxi\bit\bt
If set, b\bba\bas\bsh\bh will send S\bSI\bIG\bGH\bHU\bUP\bP to all jobs when an inter-
active login shell exits.
i\bin\bnh\bhe\ber\bri\bit\bt_\b_e\ber\brr\bre\bex\bxi\bit\bt
- If set, command substitution inherits the value of the
- e\ber\brr\bre\bex\bxi\bit\bt option, instead of unsetting it in the subshell
- environment. This option is enabled when _\bp_\bo_\bs_\bi_\bx _\bm_\bo_\bd_\be is
+ If set, command substitution inherits the value of the
+ e\ber\brr\bre\bex\bxi\bit\bt option, instead of unsetting it in the subshell
+ environment. This option is enabled when _\bp_\bo_\bs_\bi_\bx _\bm_\bo_\bd_\be is
enabled.
i\bin\bnt\bte\ber\bra\bac\bct\bti\biv\bve\be_\b_c\bco\bom\bmm\bme\ben\bnt\bts\bs
If set, allow a word beginning with #\b# to cause that word
- and all remaining characters on that line to be ignored
- in an interactive shell (see C\bCO\bOM\bMM\bME\bEN\bNT\bTS\bS above). This op-
- tion is enabled by default.
+ and all remaining characters on that line to be ignored
+ in an interactive shell (see C\bCO\bOM\bMM\bME\bEN\bNT\bTS\bS in _\bb_\ba_\bs_\bh_\b(_\b1_\b)). This
+ option is enabled by default.
l\bla\bas\bst\btp\bpi\bip\bpe\be
- 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.
- l\bli\bit\bth\bhi\bis\bst\bt If set, and the c\bcm\bmd\bdh\bhi\bis\bst\bt option is enabled, multi-line
+ l\bli\bit\bth\bhi\bis\bst\bt If set, and the c\bcm\bmd\bdh\bhi\bis\bst\bt option is enabled, multi-line
commands are saved to the history with embedded newlines
rather than using semicolon separators where possible.
tribute is not inherited.
l\blo\boc\bca\bal\blv\bva\bar\br_\b_u\bun\bns\bse\bet\bt
- If set, calling u\bun\bns\bse\bet\bt 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 u\bun\bns\bse\bet\bt 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.
l\blo\bog\bgi\bin\bn_\b_s\bsh\bhe\bel\bll\bl
- The shell sets this option if it is started as a login
- shell (see I\bIN\bNV\bVO\bOC\bCA\bAT\bTI\bIO\bON\bN above). The value may not be
+ The shell sets this option if it is started as a login
+ shell (see I\bIN\bNV\bVO\bOC\bCA\bAT\bTI\bIO\bON\bN in _\bb_\ba_\bs_\bh_\b(_\b1_\b)). The value may not be
changed.
m\bma\bai\bil\blw\bwa\bar\brn\bn
- If set, and a file that b\bba\bas\bsh\bh is checking for mail has
- been accessed since the last time it was checked, the
- message ``The mail in _\bm_\ba_\bi_\bl_\bf_\bi_\bl_\be has been read'' is dis-
+ If set, and a file that b\bba\bas\bsh\bh is checking for mail has
+ been accessed since the last time it was checked, the
+ message ``The mail in _\bm_\ba_\bi_\bl_\bf_\bi_\bl_\be has been read'' is dis-
played.
n\bno\bo_\b_e\bem\bmp\bpt\bty\by_\b_c\bcm\bmd\bd_\b_c\bco\bom\bmp\bpl\ble\bet\bti\bio\bon\bn
- If set, and r\bre\bea\bad\bdl\bli\bin\bne\be is being used, b\bba\bas\bsh\bh will not at-
- tempt to search the P\bPA\bAT\bTH\bH for possible completions when
+ If set, and r\bre\bea\bad\bdl\bli\bin\bne\be is being used, b\bba\bas\bsh\bh will not at-
+ tempt to search the P\bPA\bAT\bTH\bH for possible completions when
completion is attempted on an empty line.
n\bno\boc\bca\bas\bse\beg\bgl\blo\bob\bb
- If set, b\bba\bas\bsh\bh matches filenames in a case-insensitive
+ If set, b\bba\bas\bsh\bh matches filenames in a case-insensitive
fashion when performing pathname expansion (see P\bPa\bat\bth\bhn\bna\bam\bme\be
- E\bEx\bxp\bpa\ban\bns\bsi\bio\bon\bn above).
+ E\bEx\bxp\bpa\ban\bns\bsi\bio\bon\bn in _\bb_\ba_\bs_\bh_\b(_\b1_\b)).
n\bno\boc\bca\bas\bse\bem\bma\bat\btc\bch\bh
- If set, b\bba\bas\bsh\bh matches patterns in a case-insensitive
+ If set, b\bba\bas\bsh\bh matches patterns in a case-insensitive
fashion when performing matching while executing c\bca\bas\bse\be or
[\b[[\b[ 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.
+ n\bno\boe\bex\bxp\bpa\ban\bnd\bd_\b_t\btr\bra\ban\bns\bsl\bla\bat\bti\bio\bon\bn
+ If set, b\bba\bas\bsh\bh encloses the translated results of $"..."
+ quoting in single quotes instead of double quotes. If
+ the string is not translated, this has no effect.
+
n\bnu\bul\bll\blg\bgl\blo\bob\bb
- If set, b\bba\bas\bsh\bh allows patterns which match no files (see
- P\bPa\bat\bth\bhn\bna\bam\bme\be E\bEx\bxp\bpa\ban\bns\bsi\bio\bon\bn above) to expand to a null string,
- rather than themselves.
+ If set, b\bba\bas\bsh\bh allows patterns which match no files (see
+ P\bPa\bat\bth\bhn\bna\bam\bme\be E\bEx\bxp\bpa\ban\bns\bsi\bio\bon\bn in _\bb_\ba_\bs_\bh_\b(_\b1_\b)) to expand to a null
+ string, rather than themselves.
+
+ p\bpa\bat\bts\bsu\bub\bb_\b_r\bre\bep\bpl\bla\bac\bce\bem\bme\ben\bnt\bt
+ If set, b\bba\bas\bsh\bh expands occurrences of &\b& in the replacement
+ string of pattern substitution to the text matched by
+ the pattern, as described under P\bPa\bar\bra\bam\bme\bet\bte\ber\br E\bEx\bxp\bpa\ban\bns\bsi\bio\bon\bn in
+ _\bb_\ba_\bs_\bh_\b(_\b1_\b). This option is enabled by default.
p\bpr\bro\bog\bgc\bco\bom\bmp\bp
If set, the programmable completion facilities (see P\bPr\bro\bo-\b-
- g\bgr\bra\bam\bmm\bma\bab\bbl\ble\be C\bCo\bom\bmp\bpl\ble\bet\bti\bio\bon\bn above) are enabled. This option is
- enabled by default.
+ g\bgr\bra\bam\bmm\bma\bab\bbl\ble\be C\bCo\bom\bmp\bpl\ble\bet\bti\bio\bon\bn in _\bb_\ba_\bs_\bh_\b(_\b1_\b)) are enabled. This op-
+ tion is enabled by default.
p\bpr\bro\bog\bgc\bco\bom\bmp\bp_\b_a\bal\bli\bia\bas\bs
If set, and programmable completion is enabled, b\bba\bas\bsh\bh
p\bpr\bro\bom\bmp\bpt\btv\bva\bar\brs\bs
If set, prompt strings undergo parameter expansion, com-
mand substitution, arithmetic expansion, and quote re-
- moval after being expanded as described in P\bPR\bRO\bOM\bMP\bPT\bTI\bIN\bNG\bG
- above. This option is enabled by default.
+ moval after being expanded as described in P\bPR\bRO\bOM\bMP\bPT\bTI\bIN\bNG\bG in
+ _\bb_\ba_\bs_\bh_\b(_\b1_\b). This option is enabled by default.
r\bre\bes\bst\btr\bri\bic\bct\bte\bed\bd_\b_s\bsh\bhe\bel\bll\bl
The shell sets this option if it is started in re-
- stricted mode (see R\bRE\bES\bST\bTR\bRI\bIC\bCT\bTE\bED\bD S\bSH\bHE\bEL\bLL\bL 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.
+ stricted mode (see R\bRE\bES\bST\bTR\bRI\bIC\bCT\bTE\bED\bD S\bSH\bHE\bEL\bLL\bL in _\bb_\ba_\bs_\bh_\b(_\b1_\b)). The
+ value may not be changed. This is not reset when the
+ startup files are executed, allowing the startup files
+ to discover whether or not a shell is restricted.
s\bsh\bhi\bif\bft\bt_\b_v\bve\ber\brb\bbo\bos\bse\be
If set, the s\bsh\bhi\bif\bft\bt builtin prints an error message when
ters.
s\bso\bou\bur\brc\bce\bep\bpa\bat\bth\bh
- If set, the s\bso\bou\bur\brc\bce\be (.\b.) builtin uses the value of P\bPA\bAT\bTH\bH to
+ If set, the .\b. (s\bso\bou\bur\brc\bce\be) builtin uses the value of P\bPA\bAT\bTH\bH to
find the directory containing the file supplied as an
argument. This option is enabled by default.
+ v\bva\bar\brr\bre\bed\bdi\bir\br_\b_c\bcl\blo\bos\bse\be
+ If set, the shell automatically closes file descriptors
+ assigned using the _\b{_\bv_\ba_\br_\bn_\ba_\bm_\be_\b} redirection syntax (see R\bRE\bE-\b-
+ D\bDI\bIR\bRE\bEC\bCT\bTI\bIO\bON\bN in _\bb_\ba_\bs_\bh_\b(_\b1_\b)) instead of leaving them open when
+ the command completes.
+
x\bxp\bpg\bg_\b_e\bec\bch\bho\bo
- If set, the e\bec\bch\bho\bo builtin expands backslash-escape se-
+ If set, the e\bec\bch\bho\bo builtin expands backslash-escape se-
quences by default.
s\bsu\bus\bsp\bpe\ben\bnd\bd [-\b-f\bf]
- Suspend the execution of this shell until it receives a S\bSI\bIG\bGC\bCO\bON\bNT\bT
- signal. A login shell cannot be suspended; the -\b-f\bf 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 -\b-f\bf is not sup-
- plied, or if job control is not enabled.
+ Suspend the execution of this shell until it receives a S\bSI\bIG\bGC\bCO\bON\bNT\bT
+ signal. A login shell, or a shell without job control enabled,
+ cannot be suspended; the -\b-f\bf option can be used to override this
+ and force the suspension. The return status is 0 unless the
+ shell is a login shell or job control is not enabled and -\b-f\bf is
+ not supplied.
t\bte\bes\bst\bt _\be_\bx_\bp_\br
[\b[ _\be_\bx_\bp_\br ]\b]
Return a status of 0 (true) or 1 (false) depending on the evalu-
ation of the conditional expression _\be_\bx_\bp_\br. Each operator and op-
erand must be a separate argument. Expressions are composed of
- the primaries described in the b\bba\bas\bsh\bh manual page under C\bCO\bON\bND\bDI\bI-\b-
- T\bTI\bIO\bON\bNA\bAL\bL E\bEX\bXP\bPR\bRE\bES\bSS\bSI\bIO\bON\bNS\bS. t\bte\bes\bst\bt does not accept any options, nor does
- it accept and ignore an argument of -\b--\b- 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-
+ the primaries described in _\bb_\ba_\bs_\bh_\b(_\b1_\b) under C\bCO\bON\bND\bDI\bIT\bTI\bIO\bON\bNA\bAL\bL E\bEX\bXP\bPR\bRE\bES\bS-\b-
+ S\bSI\bIO\bON\bNS\bS. t\bte\bes\bst\bt does not accept any options, nor does it accept and
+ ignore an argument of -\b--\b- 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-
dence is used when there are five or more arguments.
!\b! _\be_\bx_\bp_\br True if _\be_\bx_\bp_\br is false.
(\b( _\be_\bx_\bp_\br )\b)
- Returns the value of _\be_\bx_\bp_\br. This may be used to override
+ Returns the value of _\be_\bx_\bp_\br. This may be used to override
the normal precedence of operators.
_\be_\bx_\bp_\br_\b1 -a\ba _\be_\bx_\bp_\br_\b2
True if both _\be_\bx_\bp_\br_\b1 and _\be_\bx_\bp_\br_\b2 are true.
null.
2 arguments
If the first argument is !\b!, 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 C\bCO\bON\bND\bDI\bIT\bTI\bIO\bON\bNA\bAL\bL E\bEX\bXP\bPR\bRE\bES\bSS\bSI\bIO\bON\bNS\bS, the expression is
+ only if the second argument is null. If the first argu-
+ ment is one of the unary conditional operators listed in
+ _\bb_\ba_\bs_\bh_\b(_\b1_\b) under C\bCO\bON\bND\bDI\bIT\bTI\bIO\bON\bNA\bAL\bL E\bEX\bXP\bPR\bRE\bES\bSS\bSI\bIO\bON\bNS\bS, the expression is
true if the unary test is true. If the first argument is
not a valid unary conditional operator, the expression is
false.
3 arguments
The following conditions are applied in the order listed.
- If the second argument is one of the binary conditional
- operators listed above under C\bCO\bON\bND\bDI\bIT\bTI\bIO\bON\bNA\bAL\bL E\bEX\bXP\bPR\bRE\bES\bSS\bSI\bIO\bON\bNS\bS, the
- result of the expression is the result of the binary test
- using the first and third arguments as operands. The -\b-a\ba
- and -\b-o\bo operators are considered binary operators when
- there are three arguments. If the first argument is !\b!,
- the value is the negation of the two-argument test using
- the second and third arguments. If the first argument is
- exactly (\b( and the third argument is exactly )\b), the result
- is the one-argument test of the second argument. Other-
- wise, the expression is false.
+ If the second argument is one of the binary conditional
+ operators listed in _\bb_\ba_\bs_\bh_\b(_\b1_\b) under C\bCO\bON\bND\bDI\bIT\bTI\bIO\bON\bNA\bAL\bL E\bEX\bXP\bPR\bRE\bES\bS-\b-
+ S\bSI\bIO\bON\bNS\bS, the result of the expression is the result of the
+ binary test using the first and third arguments as oper-
+ ands. The -\b-a\ba and -\b-o\bo operators are considered binary op-
+ erators when there are three arguments. If the first ar-
+ gument is !\b!, the value is the negation of the two-argu-
+ ment test using the second and third arguments. If the
+ first argument is exactly (\b( and the third argument is ex-
+ actly )\b), the result is the one-argument test of the sec-
+ ond argument. Otherwise, the expression is false.
4 arguments
+ The following conditions are applied in the order listed.
If the first argument is !\b!, the result is the negation of
the three-argument expression composed of the remaining
- arguments. Otherwise, the expression is parsed and eval-
- uated according to precedence using the rules listed
- above.
+ arguments. the two-argument test using the second and
+ third arguments. If the first argument is exactly (\b( and
+ the fourth argument is exactly )\b), the result is the two-
+ argument test of the second and third arguments. Other-
+ wise, the expression is parsed and evaluated 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 t\bte\bes\bst\bt or [\b[, the <\b< and >\b> operators sort lexico-
+ When used with t\bte\bes\bst\bt or [\b[, the <\b< and >\b> operators sort lexico-
graphically using ASCII ordering.
- t\bti\bim\bme\bes\bs Print the accumulated user and system times for the shell and
+ t\bti\bim\bme\bes\bs Print the accumulated user and system times for the shell and
for processes run from the shell. The return status is 0.
t\btr\bra\bap\bp [-\b-l\blp\bp] [[_\ba_\br_\bg] _\bs_\bi_\bg_\bs_\bp_\be_\bc ...]
- The command _\ba_\br_\bg is to be read and executed when the shell re-
+ The command _\ba_\br_\bg is to be read and executed when the shell re-
ceives signal(s) _\bs_\bi_\bg_\bs_\bp_\be_\bc. If _\ba_\br_\bg is absent (and there is a sin-
- gle _\bs_\bi_\bg_\bs_\bp_\be_\bc) or -\b-, each specified signal is reset to its origi-
- nal disposition (the value it had upon entrance to the shell).
- If _\ba_\br_\bg is the null string the signal specified by each _\bs_\bi_\bg_\bs_\bp_\be_\bc
- is ignored by the shell and by the commands it invokes. If _\ba_\br_\bg
- is not present and -\b-p\bp has been supplied, then the trap commands
+ gle _\bs_\bi_\bg_\bs_\bp_\be_\bc) or -\b-, each specified signal is reset to its origi-
+ nal disposition (the value it had upon entrance to the shell).
+ If _\ba_\br_\bg is the null string the signal specified by each _\bs_\bi_\bg_\bs_\bp_\be_\bc
+ is ignored by the shell and by the commands it invokes. If _\ba_\br_\bg
+ is not present and -\b-p\bp has been supplied, then the trap commands
associated with each _\bs_\bi_\bg_\bs_\bp_\be_\bc are displayed. If no arguments are
- supplied or if only -\b-p\bp is given, t\btr\bra\bap\bp prints the list of com-
- mands associated with each signal. The -\b-l\bl option causes the
- shell to print a list of signal names and their corresponding
- numbers. Each _\bs_\bi_\bg_\bs_\bp_\be_\bc is either a signal name defined in <_\bs_\bi_\bg_\b-
- _\bn_\ba_\bl_\b._\bh>, or a signal number. Signal names are case insensitive
+ supplied or if only -\b-p\bp is given, t\btr\bra\bap\bp prints the list of com-
+ mands associated with each signal. The -\b-l\bl option causes the
+ shell to print a list of signal names and their corresponding
+ numbers. Each _\bs_\bi_\bg_\bs_\bp_\be_\bc is either a signal name defined in <_\bs_\bi_\bg_\b-
+ _\bn_\ba_\bl_\b._\bh>, or a signal number. Signal names are case insensitive
and the S\bSI\bIG\bG prefix is optional.
- If a _\bs_\bi_\bg_\bs_\bp_\be_\bc is E\bEX\bXI\bIT\bT (0) the command _\ba_\br_\bg is executed on exit
- from the shell. If a _\bs_\bi_\bg_\bs_\bp_\be_\bc is D\bDE\bEB\bBU\bUG\bG, the command _\ba_\br_\bg is exe-
- cuted before every _\bs_\bi_\bm_\bp_\bl_\be _\bc_\bo_\bm_\bm_\ba_\bn_\bd, _\bf_\bo_\br command, _\bc_\ba_\bs_\be command,
- _\bs_\be_\bl_\be_\bc_\bt command, every arithmetic _\bf_\bo_\br command, and before the
- first command executes in a shell function (see S\bSH\bHE\bEL\bLL\bL G\bGR\bRA\bAM\bMM\bMA\bAR\bR
- above). Refer to the description of the e\bex\bxt\btd\bde\beb\bbu\bug\bg option to the
- s\bsh\bho\bop\bpt\bt builtin for details of its effect on the D\bDE\bEB\bBU\bUG\bG trap. If a
- _\bs_\bi_\bg_\bs_\bp_\be_\bc is R\bRE\bET\bTU\bUR\bRN\bN, the command _\ba_\br_\bg is executed each time a shell
- function or a script executed with the .\b. or s\bso\bou\bur\brc\bce\be builtins fin-
- ishes executing.
-
- If a _\bs_\bi_\bg_\bs_\bp_\be_\bc is E\bER\bRR\bR, the command _\ba_\br_\bg is executed whenever a
+ If a _\bs_\bi_\bg_\bs_\bp_\be_\bc is E\bEX\bXI\bIT\bT (0) the command _\ba_\br_\bg is executed on exit
+ from the shell. If a _\bs_\bi_\bg_\bs_\bp_\be_\bc is D\bDE\bEB\bBU\bUG\bG, the command _\ba_\br_\bg is exe-
+ cuted before every _\bs_\bi_\bm_\bp_\bl_\be _\bc_\bo_\bm_\bm_\ba_\bn_\bd, _\bf_\bo_\br command, _\bc_\ba_\bs_\be command,
+ _\bs_\be_\bl_\be_\bc_\bt command, every arithmetic _\bf_\bo_\br command, and before the
+ first command executes in a shell function (see S\bSH\bHE\bEL\bLL\bL G\bGR\bRA\bAM\bMM\bMA\bAR\bR in
+ _\bb_\ba_\bs_\bh_\b(_\b1_\b)). Refer to the description of the e\bex\bxt\btd\bde\beb\bbu\bug\bg option to
+ the s\bsh\bho\bop\bpt\bt builtin for details of its effect on the D\bDE\bEB\bBU\bUG\bG trap.
+ If a _\bs_\bi_\bg_\bs_\bp_\be_\bc is R\bRE\bET\bTU\bUR\bRN\bN, the command _\ba_\br_\bg is executed each time a
+ shell function or a script executed with the .\b. or s\bso\bou\bur\brc\bce\be
+ builtins finishes executing.
+
+ If a _\bs_\bi_\bg_\bs_\bp_\be_\bc is E\bER\bRR\bR, the command _\ba_\br_\bg 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 E\bER\bRR\bR trap is not executed if the
+ the following conditions. The E\bER\bRR\bR trap is not executed if the
failed command is part of the command list immediately following
- a w\bwh\bhi\bil\ble\be or u\bun\bnt\bti\bil\bl keyword, part of the test in an _\bi_\bf statement,
+ a w\bwh\bhi\bil\ble\be or u\bun\bnt\bti\bil\bl keyword, part of the test in an _\bi_\bf statement,
part of a command executed in a &\b&&\b& or |\b||\b| list except the command
- following the final &\b&&\b& or |\b||\b|, any command in a pipeline but the
- last, or if the command's return value is being inverted using
+ following the final &\b&&\b& or |\b||\b|, any command in a pipeline but the
+ last, or if the command's return value is being inverted using
!\b!. These are the same conditions obeyed by the e\ber\brr\bre\bex\bxi\bit\bt (-\b-e\be) 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 _\bs_\bi_\bg_\bs_\bp_\be_\bc is
+ one is created. The return status is false if any _\bs_\bi_\bg_\bs_\bp_\be_\bc is
invalid; otherwise t\btr\bra\bap\bp returns true.
t\bty\byp\bpe\be [-\b-a\baf\bft\btp\bpP\bP] _\bn_\ba_\bm_\be [_\bn_\ba_\bm_\be ...]
- With no options, indicate how each _\bn_\ba_\bm_\be would be interpreted if
+ With no options, indicate how each _\bn_\ba_\bm_\be would be interpreted if
used as a command name. If the -\b-t\bt option is used, t\bty\byp\bpe\be prints a
- string which is one of _\ba_\bl_\bi_\ba_\bs, _\bk_\be_\by_\bw_\bo_\br_\bd, _\bf_\bu_\bn_\bc_\bt_\bi_\bo_\bn, _\bb_\bu_\bi_\bl_\bt_\bi_\bn, or
- _\bf_\bi_\bl_\be if _\bn_\ba_\bm_\be is an alias, shell reserved word, function,
- builtin, or disk file, respectively. If the _\bn_\ba_\bm_\be is not found,
- then nothing is printed, and an exit status of false is re-
- turned. If the -\b-p\bp option is used, t\bty\byp\bpe\be either returns the name
- of the disk file that would be executed if _\bn_\ba_\bm_\be were specified
- as a command name, or nothing if ``type -t name'' would not re-
- turn _\bf_\bi_\bl_\be. The -\b-P\bP option forces a P\bPA\bAT\bTH\bH search for each _\bn_\ba_\bm_\be,
+ string which is one of _\ba_\bl_\bi_\ba_\bs, _\bk_\be_\by_\bw_\bo_\br_\bd, _\bf_\bu_\bn_\bc_\bt_\bi_\bo_\bn, _\bb_\bu_\bi_\bl_\bt_\bi_\bn, or
+ _\bf_\bi_\bl_\be if _\bn_\ba_\bm_\be is an alias, shell reserved word, function,
+ builtin, or disk file, respectively. If the _\bn_\ba_\bm_\be is not found,
+ then nothing is printed, and an exit status of false is re-
+ turned. If the -\b-p\bp option is used, t\bty\byp\bpe\be either returns the name
+ of the disk file that would be executed if _\bn_\ba_\bm_\be were specified
+ as a command name, or nothing if ``type -t name'' would not re-
+ turn _\bf_\bi_\bl_\be. The -\b-P\bP option forces a P\bPA\bAT\bTH\bH search for each _\bn_\ba_\bm_\be,
even if ``type -t name'' would not return _\bf_\bi_\bl_\be. If a command is
hashed, -\b-p\bp and -\b-P\bP print the hashed value, which is not necessar-
- ily the file that appears first in P\bPA\bAT\bTH\bH. If the -\b-a\ba option is
- used, t\bty\byp\bpe\be prints all of the places that contain an executable
+ ily the file that appears first in P\bPA\bAT\bTH\bH. If the -\b-a\ba option is
+ used, t\bty\byp\bpe\be prints all of the places that contain an executable
named _\bn_\ba_\bm_\be. This includes aliases and functions, if and only if
the -\b-p\bp option is not also used. The table of hashed commands is
- not consulted when using -\b-a\ba. The -\b-f\bf option suppresses shell
+ not consulted when using -\b-a\ba. The -\b-f\bf option suppresses shell
function lookup, as with the c\bco\bom\bmm\bma\ban\bnd\bd builtin. t\bty\byp\bpe\be returns true
if all of the arguments are found, false if any are not found.
u\bul\bli\bim\bmi\bit\bt [-\b-H\bHS\bS] -\b-a\ba
u\bul\bli\bim\bmi\bit\bt [-\b-H\bHS\bS] [-\b-b\bbc\bcd\bde\bef\bfi\bik\bkl\blm\bmn\bnp\bpq\bqr\brs\bst\btu\buv\bvx\bxP\bPR\bRT\bT [_\bl_\bi_\bm_\bi_\bt]]
- 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 -\b-H\bH and -\b-S\bS 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 -\b-H\bH nor -\b-S\bS 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 -\b-H\bH nor -\b-S\bS is speci-
fied, both the soft and hard limits are set. The value of _\bl_\bi_\bm_\bi_\bt
can be a number in the unit specified for the resource or one of
the special values h\bha\bar\brd\bd, s\bso\bof\bft\bt, or u\bun\bnl\bli\bim\bmi\bit\bte\bed\bd, which stand for the
- current hard limit, the current soft limit, and no limit, re-
- spectively. If _\bl_\bi_\bm_\bi_\bt is omitted, the current value of the soft
+ current hard limit, the current soft limit, and no limit, re-
+ spectively. If _\bl_\bi_\bm_\bi_\bt is omitted, the current value of the soft
limit of the resource is printed, unless the -\b-H\bH option is given.
- When more than one resource is specified, the limit name and
- unit, if appropriate, are printed before the value. Other op-
+ When more than one resource is specified, the limit name and
+ unit, if appropriate, are printed before the value. Other op-
tions are interpreted as follows:
-\b-a\ba All current limits are reported; no limits are set
-\b-b\bb The maximum socket buffer size
-\b-c\bc The maximum size of core files created
-\b-d\bd The maximum size of a process's data segment
-\b-e\be The maximum scheduling priority ("nice")
- -\b-f\bf The maximum size of files written by the shell and its
+ -\b-f\bf The maximum size of files written by the shell and its
children
-\b-i\bi The maximum number of pending signals
-\b-k\bk The maximum number of kqueues that may be allocated
-\b-l\bl The maximum size that may be locked into memory
- -\b-m\bm The maximum resident set size (many systems do not honor
+ -\b-m\bm The maximum resident set size (many systems do not honor
this limit)
-\b-n\bn The maximum number of open file descriptors (most systems
do not allow this value to be set)
-\b-r\br The maximum real-time scheduling priority
-\b-s\bs The maximum stack size
-\b-t\bt The maximum amount of cpu time in seconds
- -\b-u\bu The maximum number of processes available to a single
+ -\b-u\bu The maximum number of processes available to a single
user
- -\b-v\bv The maximum amount of virtual memory available to the
+ -\b-v\bv The maximum amount of virtual memory available to the
shell and, on some systems, to its children
-\b-x\bx The maximum number of file locks
-\b-P\bP The maximum number of pseudoterminals
- -\b-R\bR The maximum time a real-time process can run before
+ -\b-R\bR The maximum time a real-time process can run before
blocking, in microseconds
-\b-T\bT The maximum number of threads
- If _\bl_\bi_\bm_\bi_\bt is given, and the -\b-a\ba option is not used, _\bl_\bi_\bm_\bi_\bt is the
- new value of the specified resource. If no option is given,
- then -\b-f\bf is assumed. Values are in 1024-byte increments, except
- for -\b-t\bt, which is in seconds; -\b-R\bR, which is in microseconds; -\b-p\bp,
- which is in units of 512-byte blocks; -\b-P\bP, -\b-T\bT, -\b-b\bb, -\b-k\bk, -\b-n\bn, and
- -\b-u\bu, which are unscaled values; and, when in posix mode, -\b-c\bc and
- -\b-f\bf, which are in 512-byte increments. The return status is 0
- unless an invalid option or argument is supplied, or an error
+ If _\bl_\bi_\bm_\bi_\bt is given, and the -\b-a\ba option is not used, _\bl_\bi_\bm_\bi_\bt is the
+ new value of the specified resource. If no option is given,
+ then -\b-f\bf is assumed. Values are in 1024-byte increments, except
+ for -\b-t\bt, which is in seconds; -\b-R\bR, which is in microseconds; -\b-p\bp,
+ which is in units of 512-byte blocks; -\b-P\bP, -\b-T\bT, -\b-b\bb, -\b-k\bk, -\b-n\bn, and
+ -\b-u\bu, which are unscaled values; and, when in posix mode, -\b-c\bc and
+ -\b-f\bf, 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.
u\bum\bma\bas\bsk\bk [-\b-p\bp] [-\b-S\bS] [_\bm_\bo_\bd_\be]
The user file-creation mask is set to _\bm_\bo_\bd_\be. If _\bm_\bo_\bd_\be 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
- _\bc_\bh_\bm_\bo_\bd(1). If _\bm_\bo_\bd_\be is omitted, the current value of the mask is
- printed. The -\b-S\bS option causes the mask to be printed in sym-
- bolic form; the default output is an octal number. If the -\b-p\bp
+ a digit, it is interpreted as an octal number; otherwise it is
+ interpreted as a symbolic mode mask similar to that accepted by
+ _\bc_\bh_\bm_\bo_\bd(1). If _\bm_\bo_\bd_\be is omitted, the current value of the mask is
+ printed. The -\b-S\bS option causes the mask to be printed in sym-
+ bolic form; the default output is an octal number. If the -\b-p\bp
option is supplied, and _\bm_\bo_\bd_\be 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 _\bm_\bo_\bd_\be argument was supplied,
+ was successfully changed or if no _\bm_\bo_\bd_\be argument was supplied,
and false otherwise.
u\bun\bna\bal\bli\bia\bas\bs [-a\ba] [_\bn_\ba_\bm_\be ...]
- Remove each _\bn_\ba_\bm_\be from the list of defined aliases. If -\b-a\ba is
- supplied, all alias definitions are removed. The return value
+ Remove each _\bn_\ba_\bm_\be from the list of defined aliases. If -\b-a\ba is
+ supplied, all alias definitions are removed. The return value
is true unless a supplied _\bn_\ba_\bm_\be is not a defined alias.
u\bun\bns\bse\bet\bt [-f\bfv\bv] [-n\bn] [_\bn_\ba_\bm_\be ...]
- For each _\bn_\ba_\bm_\be, remove the corresponding variable or function.
+ For each _\bn_\ba_\bm_\be, remove the corresponding variable or function.
If the -\b-v\bv option is given, each _\bn_\ba_\bm_\be refers to a shell variable,
- and that variable is removed. Read-only variables may not be
- unset. If -\b-f\bf is specified, each _\bn_\ba_\bm_\be refers to a shell func-
- tion, and the function definition is removed. If the -\b-n\bn option
- is supplied, and _\bn_\ba_\bm_\be is a variable with the _\bn_\ba_\bm_\be_\br_\be_\bf attribute,
- _\bn_\ba_\bm_\be will be unset rather than the variable it references. -\b-n\bn
- has no effect if the -\b-f\bf option is supplied. If no options are
- supplied, each _\bn_\ba_\bm_\be 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 B\bBA\bAS\bSH\bH_\b_A\bAL\bLI\bIA\bAS\bSE\bES\bS,
+ and that variable is removed. Read-only variables may not be
+ unset. If -\b-f\bf is specified, each _\bn_\ba_\bm_\be refers to a shell func-
+ tion, and the function definition is removed. If the -\b-n\bn option
+ is supplied, and _\bn_\ba_\bm_\be is a variable with the _\bn_\ba_\bm_\be_\br_\be_\bf attribute,
+ _\bn_\ba_\bm_\be will be unset rather than the variable it references. -\b-n\bn
+ has no effect if the -\b-f\bf option is supplied. If no options are
+ supplied, each _\bn_\ba_\bm_\be 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 B\bBA\bAS\bSH\bH_\b_A\bAL\bLI\bIA\bAS\bSE\bES\bS,
B\bBA\bAS\bSH\bH_\b_A\bAR\bRG\bGV\bV0\b0, B\bBA\bAS\bSH\bH_\b_C\bCM\bMD\bDS\bS, B\bBA\bAS\bSH\bH_\b_C\bCO\bOM\bMM\bMA\bAN\bND\bD, B\bBA\bAS\bSH\bH_\b_S\bSU\bUB\bBS\bSH\bHE\bEL\bLL\bL, B\bBA\bAS\bSH\bHP\bPI\bID\bD,
- C\bCO\bOM\bMP\bP_\b_W\bWO\bOR\bRD\bDB\bBR\bRE\bEA\bAK\bKS\bS, D\bDI\bIR\bRS\bST\bTA\bAC\bCK\bK, E\bEP\bPO\bOC\bCH\bHR\bRE\bEA\bAL\bLT\bTI\bIM\bME\bE, E\bEP\bPO\bOC\bCH\bHS\bSE\bEC\bCO\bON\bND\bDS\bS, F\bFU\bUN\bNC\bC-\b-
- N\bNA\bAM\bME\bE, G\bGR\bRO\bOU\bUP\bPS\bS, H\bHI\bIS\bST\bTC\bCM\bMD\bD, L\bLI\bIN\bNE\bEN\bNO\bO, R\bRA\bAN\bND\bDO\bOM\bM, S\bSE\bEC\bCO\bON\bND\bDS\bS, or S\bSR\bRA\bAN\bND\bDO\bOM\bM are
+ C\bCO\bOM\bMP\bP_\b_W\bWO\bOR\bRD\bDB\bBR\bRE\bEA\bAK\bKS\bS, D\bDI\bIR\bRS\bST\bTA\bAC\bCK\bK, E\bEP\bPO\bOC\bCH\bHR\bRE\bEA\bAL\bLT\bTI\bIM\bME\bE, E\bEP\bPO\bOC\bCH\bHS\bSE\bEC\bCO\bON\bND\bDS\bS, F\bFU\bUN\bNC\bC-\b-
+ N\bNA\bAM\bME\bE, G\bGR\bRO\bOU\bUP\bPS\bS, H\bHI\bIS\bST\bTC\bCM\bMD\bD, L\bLI\bIN\bNE\bEN\bNO\bO, R\bRA\bAN\bND\bDO\bOM\bM, S\bSE\bEC\bCO\bON\bND\bDS\bS, or S\bSR\bRA\bAN\bND\bDO\bOM\bM are
unset, they lose their special properties, even if they are sub-
sequently reset. The exit status is true unless a _\bn_\ba_\bm_\be is read-
- only.
+ only or may not be unset.
w\bwa\bai\bit\bt [-\b-f\bfn\bn] [-\b-p\bp _\bv_\ba_\br_\bn_\ba_\bm_\be] [_\bi_\bd _\b._\b._\b.]
Wait for each specified child process and return its termination
- status. Each _\bi_\bd 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 _\bi_\bd is not given, w\bwa\bai\bit\bt waits for all running
- background jobs and the last-executed process substitution, if
+ status. Each _\bi_\bd 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 _\bi_\bd is not given, w\bwa\bai\bit\bt waits for all running
+ background jobs and the last-executed process substitution, if
its process id is the same as $\b$!\b!, and the return status is zero.
- If the -\b-n\bn option is supplied, w\bwa\bai\bit\bt waits for a single job from
+ If the -\b-n\bn option is supplied, w\bwa\bai\bit\bt waits for a single job from
the list of _\bi_\bds or, if no _\bi_\bds 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 -\b-p\bp option is supplied, the process or job identifier of the
- job for which the exit status is returned is assigned to the
- variable _\bv_\ba_\br_\bn_\ba_\bm_\be named by the option argument. The variable
- will be unset initially, before any assignment. This is useful
- only when the -\b-n\bn option is supplied. Supplying the -\b-f\bf option,
- when job control is enabled, forces w\bwa\bai\bit\bt to wait for _\bi_\bd to ter-
+ shell has no unwaited-for children, the exit status is 127. If
+ the -\b-p\bp option is supplied, the process or job identifier of the
+ job for which the exit status is returned is assigned to the
+ variable _\bv_\ba_\br_\bn_\ba_\bm_\be named by the option argument. The variable
+ will be unset initially, before any assignment. This is useful
+ only when the -\b-n\bn option is supplied. Supplying the -\b-f\bf option,
+ when job control is enabled, forces w\bwa\bai\bit\bt to wait for _\bi_\bd to ter-
minate before returning its status, instead of returning when it
- changes status. If _\bi_\bd 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.
+ changes status. If _\bi_\bd specifies a non-existent process or job,
+ the return status is 127. If w\bwa\bai\bit\bt is interrupted by a signal,
+ the return status will be greater than 128, as described under
+ S\bSI\bIG\bGN\bNA\bAL\bLS\bS in _\bb_\ba_\bs_\bh_\b(_\b1_\b). Otherwise, the return status is the exit
+ status of the last process or job waited for.
S\bSH\bHE\bEL\bLL\bL C\bCO\bOM\bMP\bPA\bAT\bTI\bIB\bBI\bIL\bLI\bIT\bTY\bY M\bMO\bOD\bDE\bE
- Bash-4.0 introduced the concept of a `shell compatibility level', spec-
- ified as a set of options to the shopt builtin c\bco\bom\bmp\bpa\bat\bt3\b31\b1, c\bco\bom\bmp\bpa\bat\bt3\b32\b2, c\bco\bom\bm-\b-
- p\bpa\bat\bt4\b40\b0, c\bco\bom\bmp\bpa\bat\bt4\b41\b1, 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-
- tion.
-
- This section does not mention behavior that is standard for a particu-
- lar version (e.g., setting c\bco\bom\bmp\bpa\bat\bt3\b32\b2 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, c\bco\bom\bmp\bpa\bat\bt3\b32\b2, 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 b\bba\bas\bsh\bh, but that behavior may have been
- present in earlier versions. For instance, the change to use locale-
- based comparisons with the [\b[[\b[ command came in bash-4.1, and earlier
+ Bash-4.0 introduced the concept of a _\bs_\bh_\be_\bl_\bl _\bc_\bo_\bm_\bp_\ba_\bt_\bi_\bb_\bi_\bl_\bi_\bt_\by _\bl_\be_\bv_\be_\bl, speci-
+ fied as a set of options to the shopt builtin ( c\bco\bom\bmp\bpa\bat\bt3\b31\b1, c\bco\bom\bmp\bpa\bat\bt3\b32\b2,
+ c\bco\bom\bmp\bpa\bat\bt4\b40\b0, c\bco\bom\bmp\bpa\bat\bt4\b41\b1, and so on). There is only one current compatibil-
+ ity level -- each option is mutually exclusive. The compatibility
+ level is intended to allow users to select behavior from previous ver-
+ sions that is incompatible with newer versions while they migrate
+ scripts to use current features and behavior. It's intended to be a
+ temporary solution.
+
+ This section does not mention behavior that is standard for a particu-
+ lar version (e.g., setting c\bco\bom\bmp\bpa\bat\bt3\b32\b2 means that quoting the rhs of the
+ regexp matching operator quotes special regexp characters in the word,
+ which is default behavior in bash-3.2 and subsequent versions).
+
+ If a user enables, say, c\bco\bom\bmp\bpa\bat\bt3\b32\b2, 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 b\bba\bas\bsh\bh, but that behavior may have been
+ present in earlier versions. For instance, the change to use locale-
+ based comparisons with the [\b[[\b[ command came in bash-4.1, and earlier
versions used ASCII-based comparisons, so enabling c\bco\bom\bmp\bpa\bat\bt3\b32\b2 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: B\bBA\bAS\bSH\bH_\b_C\bCO\bOM\bMP\bPA\bAT\bT. The value as-
+ Bash-4.3 introduced a new shell variable: B\bBA\bAS\bSH\bH_\b_C\bCO\bOM\bMP\bPA\bAT\bT. The value as-
signed to this variable (a decimal version number like 4.2, or an inte-
- ger corresponding to the c\bco\bom\bmp\bpa\bat\bt_\bN_\bN option, like 42) determines the com-
+ ger corresponding to the c\bco\bom\bmp\bpa\bat\bt_\bN_\bN 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 B\bBA\bAS\bSH\bH_\b_C\bCO\bOM\bM-\b-
+ Starting with bash-4.4, Bash has begun deprecating older compatibility
+ levels. Eventually, the options will be removed in favor of B\bBA\bAS\bSH\bH_\b_C\bCO\bOM\bM-\b-
P\bPA\bAT\bT.
- Bash-5.0 is the final version for which there will be an individual
- shopt option for the previous version. Users should use B\bBA\bAS\bSH\bH_\b_C\bCO\bOM\bMP\bPA\bAT\bT on
+ Bash-5.0 is the final version for which there will be an individual
+ shopt option for the previous version. Users should use B\bBA\bAS\bSH\bH_\b_C\bCO\bOM\bMP\bPA\bAT\bT 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 c\bco\bom\bmp\bpa\bat\bt_\bN_\bN tag is used as shorthand for
setting the compatibility level to _\bN_\bN using one of the following mecha-
- nisms. For versions prior to bash-5.0, the compatibility level may be
- set using the corresponding c\bco\bom\bmp\bpa\bat\bt_\bN_\bN shopt option. For bash-4.3 and
- later versions, the B\bBA\bAS\bSH\bH_\b_C\bCO\bOM\bMP\bPA\bAT\bT variable is preferred, and it is re-
+ nisms. For versions prior to bash-5.0, the compatibility level may be
+ set using the corresponding c\bco\bom\bmp\bpa\bat\bt_\bN_\bN shopt option. For bash-4.3 and
+ later versions, the B\bBA\bAS\bSH\bH_\b_C\bCO\bOM\bMP\bPA\bAT\bT variable is preferred, and it is re-
quired for bash-5.1 and later versions.
c\bco\bom\bmp\bpa\bat\bt3\b31\b1
ator (=~) has no special effect
c\bco\bom\bmp\bpa\bat\bt3\b32\b2
- +\bo 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
+ +\bo 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)
c\bco\bom\bmp\bpa\bat\bt4\b40\b0
- +\bo the <\b< and >\b> operators to the [\b[[\b[ command do not consider
+ +\bo the <\b< and >\b> operators to the [\b[[\b[ 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 _\bs_\bt_\br_\bc_\bm_\bp(3); bash-4.1 and later use the current
+ lation and _\bs_\bt_\br_\bc_\bm_\bp(3); bash-4.1 and later use the current
locale's collation sequence and _\bs_\bt_\br_\bc_\bo_\bl_\bl(3).
c\bco\bom\bmp\bpa\bat\bt4\b41\b1
- +\bo in _\bp_\bo_\bs_\bi_\bx mode, t\bti\bim\bme\be may be followed by options and still
+ +\bo in _\bp_\bo_\bs_\bi_\bx mode, t\bti\bim\bme\be may be followed by options and still
be recognized as a reserved word (this is POSIX interpre-
tation 267)
+\bo in _\bp_\bo_\bs_\bi_\bx mode, the parser requires that an even number of
- single quotes occur in the _\bw_\bo_\br_\bd 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 _\bw_\bo_\br_\bd 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)
c\bco\bom\bmp\bpa\bat\bt4\b42\b2
+\bo 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
- +\bo in posix mode, single quotes are considered special when
- expanding the _\bw_\bo_\br_\bd 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
+ +\bo in posix mode, single quotes are considered special when
+ expanding the _\bw_\bo_\br_\bd 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
c\bco\bom\bmp\bpa\bat\bt4\b43\b3
- +\bo 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
- +\bo 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
+ +\bo the shell does not print a warning message if an attempt
+ is made to use a quoted compound assignment as an argu-
+ ment to declare (e.g., declare -a foo='(1 2)'). Later
+ versions warn that this usage is deprecated
+ +\bo 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)
- +\bo when executing a shell function, the loop state
+ +\bo when executing a shell function, the loop state
(while/until/etc.) is not reset, so b\bbr\bre\bea\bak\bk or c\bco\bon\bnt\bti\bin\bnu\bue\be 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
c\bco\bom\bmp\bpa\bat\bt4\b44\b4
- +\bo the shell sets up the values used by B\bBA\bAS\bSH\bH_\b_A\bAR\bRG\bGV\bV and
- B\bBA\bAS\bSH\bH_\b_A\bAR\bRG\bGC\bC so they can expand to the shell's positional
+ +\bo the shell sets up the values used by B\bBA\bAS\bSH\bH_\b_A\bAR\bRG\bGV\bV and
+ B\bBA\bAS\bSH\bH_\b_A\bAR\bRG\bGC\bC so they can expand to the shell's positional
parameters even if extended debugging mode is not enabled
- +\bo a subshell inherits loops from its parent context, so
- b\bbr\bre\bea\bak\bk or c\bco\bon\bnt\bti\bin\bnu\bue\be will cause the subshell to exit.
- Bash-5.0 and later reset the loop state to prevent the
+ +\bo a subshell inherits loops from its parent context, so
+ b\bbr\bre\bea\bak\bk or c\bco\bon\bnt\bti\bin\bnu\bue\be will cause the subshell to exit.
+ Bash-5.0 and later reset the loop state to prevent the
exit
- +\bo variable assignments preceding builtins like e\bex\bxp\bpo\bor\brt\bt and
+ +\bo variable assignments preceding builtins like e\bex\bxp\bpo\bor\brt\bt and
r\bre\bea\bad\bdo\bon\bnl\bly\by that set attributes continue to affect variables
with the same name in the calling environment even if the
shell is not in posix mode
c\bco\bom\bmp\bpa\bat\bt5\b50\b0
- +\bo Bash-5.1 changed the way $\b$R\bRA\bAN\bND\bDO\bOM\bM is generated to intro-
+ +\bo Bash-5.1 changed the way $\b$R\bRA\bAN\bND\bDO\bOM\bM 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 R\bRA\bAN\bND\bDO\bOM\bM 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 R\bRA\bAN\bND\bDO\bOM\bM will
produce the same sequence as in bash-5.0
- +\bo 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 -\b-l\bl op-
+ +\bo 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 -\b-l\bl op-
tion is supplied.
+ c\bco\bom\bmp\bpa\bat\bt5\b51\b1
+ +\bo The u\bun\bns\bse\bet\bt builtin treats attempts to unset array sub-
+ scripts @\b@ and *\b* differently depending on whether the ar-
+ ray is indexed or associative, and differently than in
+ previous versions.
+
S\bSE\bEE\bE A\bAL\bLS\bSO\bO
bash(1), sh(1)
-GNU Bash 5.0 2004 Apr 20 BASH_BUILTINS(1)
+GNU Bash 5.2 2021 November 22 BASH_BUILTINS(1)