The following definitions are used throughout the rest of this docu-
ment.
b\bbl\bla\ban\bnk\bk A space or tab.
- w\bwo\bor\brd\bd A sequence of characters considered as a single unit by the
+ w\bwh\bhi\bit\bte\bes\bsp\bpa\bac\bce\be
+ A character belonging to the s\bsp\bpa\bac\bce\be character class in the cur-
+ rent locale, or for which _\bi_\bs_\bs_\bp_\ba_\bc_\be(3) returns true.
+ w\bwo\bor\brd\bd A sequence of characters considered as a single unit by the
shell. Also known as a t\bto\bok\bke\ben\bn.
- n\bna\bam\bme\be A _\bw_\bo_\br_\bd consisting only of alphanumeric characters and under-
- scores, and beginning with an alphabetic character or an under-
+ n\bna\bam\bme\be A _\bw_\bo_\br_\bd consisting only of alphanumeric characters and under-
+ scores, and beginning with an alphabetic character or an under-
score. Also referred to as an i\bid\bde\ben\bnt\bti\bif\bfi\bie\ber\br.
m\bme\bet\bta\bac\bch\bha\bar\bra\bac\bct\bte\ber\br
- A character that, when unquoted, separates words. One of the
+ A character that, when unquoted, separates words. One of the
following:
|\b| &\b& ;\b; (\b( )\b) <\b< >\b> s\bsp\bpa\bac\bce\be t\bta\bab\bb n\bne\bew\bwl\bli\bin\bne\be
c\bco\bon\bnt\btr\bro\bol\bl o\bop\bpe\ber\bra\bat\bto\bor\br
R\bRE\bES\bSE\bER\bRV\bVE\bED\bD W\bWO\bOR\bRD\bDS\bS
_\bR_\be_\bs_\be_\br_\bv_\be_\bd _\bw_\bo_\br_\bd_\bs are words that have a special meaning to the shell. The
following words are recognized as reserved when unquoted and either the
- first word of a command (see S\bSH\bHE\bEL\bLL\bL G\bGR\bRA\bAM\bMM\bMA\bAR\bR below), the third word of a
- c\bca\bas\bse\be or s\bse\bel\ble\bec\bct\bt command (only i\bin\bn is valid), or the third word of a f\bfo\bor\br
+ first word of a command (see S\bSH\bHE\bEL\bLL\bL G\bGR\bRA\bAM\bMM\bMA\bAR\bR below), the third word of a
+ c\bca\bas\bse\be or s\bse\bel\ble\bec\bct\bt command (only i\bin\bn is valid), or the third word of a f\bfo\bor\br
command (only i\bin\bn and d\bdo\bo are valid):
- !\b! c\bca\bas\bse\be c\bco\bop\bpr\bro\boc\bc d\bdo\bo d\bdo\bon\bne\be e\bel\bli\bif\bf e\bel\bls\bse\be e\bes\bsa\bac\bc f\bfi\bi f\bfo\bor\br f\bfu\bun\bnc\bct\bti\bio\bon\bn i\bif\bf i\bin\bn s\bse\bel\ble\bec\bct\bt
+ !\b! c\bca\bas\bse\be c\bco\bop\bpr\bro\boc\bc d\bdo\bo d\bdo\bon\bne\be e\bel\bli\bif\bf e\bel\bls\bse\be e\bes\bsa\bac\bc f\bfi\bi f\bfo\bor\br f\bfu\bun\bnc\bct\bti\bio\bon\bn i\bif\bf i\bin\bn s\bse\bel\ble\bec\bct\bt
t\bth\bhe\ben\bn u\bun\bnt\bti\bil\bl w\bwh\bhi\bil\ble\be {\b{ }\b} t\bti\bim\bme\be [\b[[\b[ ]\b]]\b]
S\bSH\bHE\bEL\bLL\bL G\bGR\bRA\bAM\bMM\bMA\bAR\bR
- This section describes the syntax of the various forms of shell com-
+ This section describes the syntax of the various forms of shell com-
mands.
S\bSi\bim\bmp\bpl\ble\be C\bCo\bom\bmm\bma\ban\bnd\bds\bs
- A _\bs_\bi_\bm_\bp_\bl_\be _\bc_\bo_\bm_\bm_\ba_\bn_\bd is a sequence of optional variable assignments fol-
- lowed by b\bbl\bla\ban\bnk\bk-separated words and redirections, and terminated by a
+ A _\bs_\bi_\bm_\bp_\bl_\be _\bc_\bo_\bm_\bm_\ba_\bn_\bd is a sequence of optional variable assignments fol-
+ lowed by b\bbl\bla\ban\bnk\bk-separated words and redirections, and terminated by a
_\bc_\bo_\bn_\bt_\br_\bo_\bl _\bo_\bp_\be_\br_\ba_\bt_\bo_\br. The first word specifies the command to be executed,
- and is passed as argument zero. The remaining words are passed as ar-
+ and is passed as argument zero. The remaining words are passed as ar-
guments to the invoked command.
- The return value of a _\bs_\bi_\bm_\bp_\bl_\be _\bc_\bo_\bm_\bm_\ba_\bn_\bd is its exit status, or 128+_\bn if
+ The return value of a _\bs_\bi_\bm_\bp_\bl_\be _\bc_\bo_\bm_\bm_\ba_\bn_\bd is its exit status, or 128+_\bn if
the command is terminated by signal _\bn.
P\bPi\bip\bpe\bel\bli\bin\bne\bes\bs
- A _\bp_\bi_\bp_\be_\bl_\bi_\bn_\be is a sequence of one or more commands separated by one of
+ A _\bp_\bi_\bp_\be_\bl_\bi_\bn_\be is a sequence of one or more commands separated by one of
the control operators |\b| or |\b|&\b&. The format for a pipeline is:
[t\bti\bim\bme\be [-\b-p\bp]] [ ! ] _\bc_\bo_\bm_\bm_\ba_\bn_\bd_\b1 [ [|\b|||\b|&\b&] _\bc_\bo_\bm_\bm_\ba_\bn_\bd_\b2 ... ]
The standard output of _\bc_\bo_\bm_\bm_\ba_\bn_\bd_\b1 is connected via a pipe to the standard
- input of _\bc_\bo_\bm_\bm_\ba_\bn_\bd_\b2. This connection is performed before any redirec-
- tions specified by the _\bc_\bo_\bm_\bm_\ba_\bn_\bd_\b1(see R\bRE\bED\bDI\bIR\bRE\bEC\bCT\bTI\bIO\bON\bN below). If |\b|&\b& is the
- pipeline operator, _\bc_\bo_\bm_\bm_\ba_\bn_\bd_\b1's standard error, in addition to its stan-
- dard output, is connected to _\bc_\bo_\bm_\bm_\ba_\bn_\bd_\b2's standard input through the
- pipe; it is shorthand for 2\b2>\b>&\b&1\b1 |\b|. This implicit redirection of the
- standard error to the standard output is performed after any redirec-
+ input of _\bc_\bo_\bm_\bm_\ba_\bn_\bd_\b2. This connection is performed before any redirec-
+ tions specified by the _\bc_\bo_\bm_\bm_\ba_\bn_\bd_\b1(see R\bRE\bED\bDI\bIR\bRE\bEC\bCT\bTI\bIO\bON\bN below). If |\b|&\b& is the
+ pipeline operator, _\bc_\bo_\bm_\bm_\ba_\bn_\bd_\b1's standard error, in addition to its stan-
+ dard output, is connected to _\bc_\bo_\bm_\bm_\ba_\bn_\bd_\b2's standard input through the
+ pipe; it is shorthand for 2\b2>\b>&\b&1\b1 |\b|. This implicit redirection of the
+ standard error to the standard output is performed after any redirec-
tions specified by _\bc_\bo_\bm_\bm_\ba_\bn_\bd_\b1.
The return status of a pipeline is the exit status of the last command,
- unless the p\bpi\bip\bpe\bef\bfa\bai\bil\bl option is enabled. If p\bpi\bip\bpe\bef\bfa\bai\bil\bl is enabled, the
- pipeline's return status is the value of the last (rightmost) command
- to exit with a non-zero status, or zero if all commands exit success-
+ unless the p\bpi\bip\bpe\bef\bfa\bai\bil\bl option is enabled. If p\bpi\bip\bpe\bef\bfa\bai\bil\bl is enabled, the
+ pipeline's return status is the value of the last (rightmost) command
+ to exit with a non-zero status, or zero if all commands exit success-
fully. If the reserved word !\b! precedes a pipeline, the exit status of
- that pipeline is the logical negation of the exit status as described
- above. If a pipeline is executed synchronously, the shell waits for
+ that pipeline is the logical negation of the exit status as described
+ above. If a pipeline is executed synchronously, the shell waits for
all commands in the pipeline to terminate before returning a value.
- If the t\bti\bim\bme\be reserved word precedes a pipeline, the shell reports the
- elapsed as well as user and system time consumed by its execution when
- the pipeline terminates. The -\b-p\bp option changes the output format to
- that specified by POSIX. When the shell is in posix mode, it does not
- recognize t\bti\bim\bme\be as a reserved word if the next token begins with a "-".
- The value of the T\bTI\bIM\bME\bEF\bFO\bOR\bRM\bMA\bAT\bT variable is a format string that specifies
- how the timing information should be displayed; see the description of
+ If the t\bti\bim\bme\be reserved word precedes a pipeline, the shell reports the
+ elapsed as well as user and system time consumed by its execution when
+ the pipeline terminates. The -\b-p\bp option changes the output format to
+ that specified by POSIX. When the shell is in posix mode, it does not
+ recognize t\bti\bim\bme\be as a reserved word if the next token begins with a "-".
+ The value of the T\bTI\bIM\bME\bEF\bFO\bOR\bRM\bMA\bAT\bT variable is a format string that specifies
+ how the timing information should be displayed; see the description of
T\bTI\bIM\bME\bEF\bFO\bOR\bRM\bMA\bAT\bT below under S\bSh\bhe\bel\bll\bl V\bVa\bar\bri\bia\bab\bbl\ble\bes\bs.
- When the shell is in posix mode, t\bti\bim\bme\be may appear by itself as the only
- word in a simple command. In this case, the shell displays the total
+ When the shell is in posix mode, t\bti\bim\bme\be may appear by itself as the only
+ word in a simple command. In this case, the shell displays the total
user and system time consumed by the shell and its children. The T\bTI\bIM\bME\bE-\b-
F\bFO\bOR\bRM\bMA\bAT\bT variable specifies the format of the time information.
- Each command in a multi-command pipeline, where pipes are created, is
- executed in a _\bs_\bu_\bb_\bs_\bh_\be_\bl_\bl, which is a separate process. See C\bCO\bOM\bMM\bMA\bAN\bND\bD E\bEX\bXE\bE-\b-
- C\bCU\bUT\bTI\bIO\bON\bN E\bEN\bNV\bVI\bIR\bRO\bON\bNM\bME\bEN\bNT\bT for a description of subshells and a subshell envi-
- ronment. If the l\bla\bas\bst\btp\bpi\bip\bpe\be option is enabled using the s\bsh\bho\bop\bpt\bt builtin
- (see the description of s\bsh\bho\bop\bpt\bt below), and job control is not active,
+ Each command in a multi-command pipeline, where pipes are created, is
+ executed in a _\bs_\bu_\bb_\bs_\bh_\be_\bl_\bl, which is a separate process. See C\bCO\bOM\bMM\bMA\bAN\bND\bD E\bEX\bXE\bE-\b-
+ C\bCU\bUT\bTI\bIO\bON\bN E\bEN\bNV\bVI\bIR\bRO\bON\bNM\bME\bEN\bNT\bT for a description of subshells and a subshell envi-
+ ronment. If the l\bla\bas\bst\btp\bpi\bip\bpe\be option is enabled using the s\bsh\bho\bop\bpt\bt builtin
+ (see the description of s\bsh\bho\bop\bpt\bt below), and job control is not active,
the last element of a pipeline may be run by the shell process.
L\bLi\bis\bst\bts\bs
- A _\bl_\bi_\bs_\bt is a sequence of one or more pipelines separated by one of the
+ A _\bl_\bi_\bs_\bt is a sequence of one or more pipelines separated by one of the
operators ;\b;, &\b&, &\b&&\b&, or |\b||\b|, and optionally terminated by one of ;\b;, &\b&, or
<\b<n\bne\bew\bwl\bli\bin\bne\be>\b>.
Of these list operators, &\b&&\b& and |\b||\b| have equal precedence, followed by ;\b;
and &\b&, which have equal precedence.
- A sequence of one or more newlines may appear in a _\bl_\bi_\bs_\bt instead of a
+ A sequence of one or more newlines may appear in a _\bl_\bi_\bs_\bt instead of a
semicolon to delimit commands.
- If a command is terminated by the control operator &\b&, the shell exe-
- cutes the command in the _\bb_\ba_\bc_\bk_\bg_\br_\bo_\bu_\bn_\bd in a subshell. The shell does not
- wait for the command to finish, and the return status is 0. These are
- referred to as _\ba_\bs_\by_\bn_\bc_\bh_\br_\bo_\bn_\bo_\bu_\bs commands. Commands separated by a ;\b; are
+ If a command is terminated by the control operator &\b&, the shell exe-
+ cutes the command in the _\bb_\ba_\bc_\bk_\bg_\br_\bo_\bu_\bn_\bd in a subshell. The shell does not
+ wait for the command to finish, and the return status is 0. These are
+ referred to as _\ba_\bs_\by_\bn_\bc_\bh_\br_\bo_\bn_\bo_\bu_\bs commands. Commands separated by a ;\b; are
executed sequentially; the shell waits for each command to terminate in
- turn. The return status is the exit status of the last command exe-
+ turn. The return status is the exit status of the last command exe-
cuted.
- AND and OR lists are sequences of one or more pipelines separated by
- the &\b&&\b& and |\b||\b| control operators, respectively. AND and OR lists are
+ AND and OR lists are sequences of one or more pipelines separated by
+ the &\b&&\b& and |\b||\b| control operators, respectively. AND and OR lists are
executed with left associativity. An AND list has the form
_\bc_\bo_\bm_\bm_\ba_\bn_\bd_\b1 &\b&&\b& _\bc_\bo_\bm_\bm_\ba_\bn_\bd_\b2
- _\bc_\bo_\bm_\bm_\ba_\bn_\bd_\b2 is executed if, and only if, _\bc_\bo_\bm_\bm_\ba_\bn_\bd_\b1 returns an exit status
+ _\bc_\bo_\bm_\bm_\ba_\bn_\bd_\b2 is executed if, and only if, _\bc_\bo_\bm_\bm_\ba_\bn_\bd_\b1 returns an exit status
of zero (success).
An OR list has the form
_\bc_\bo_\bm_\bm_\ba_\bn_\bd_\b1 |\b||\b| _\bc_\bo_\bm_\bm_\ba_\bn_\bd_\b2
- _\bc_\bo_\bm_\bm_\ba_\bn_\bd_\b2 is executed if, and only if, _\bc_\bo_\bm_\bm_\ba_\bn_\bd_\b1 returns a non-zero exit
- status. The return status of AND and OR lists is the exit status of
+ _\bc_\bo_\bm_\bm_\ba_\bn_\bd_\b2 is executed if, and only if, _\bc_\bo_\bm_\bm_\ba_\bn_\bd_\b1 returns a non-zero exit
+ status. The return status of AND and OR lists is the exit status of
the last command executed in the list.
C\bCo\bom\bmp\bpo\bou\bun\bnd\bd C\bCo\bom\bmm\bma\ban\bnd\bds\bs
- A _\bc_\bo_\bm_\bp_\bo_\bu_\bn_\bd _\bc_\bo_\bm_\bm_\ba_\bn_\bd is one of the following. In most cases a _\bl_\bi_\bs_\bt in a
- command's description may be separated from the rest of the command by
- one or more newlines, and may be followed by a newline in place of a
+ A _\bc_\bo_\bm_\bp_\bo_\bu_\bn_\bd _\bc_\bo_\bm_\bm_\ba_\bn_\bd is one of the following. In most cases a _\bl_\bi_\bs_\bt in a
+ command's description may be separated from the rest of the command by
+ one or more newlines, and may be followed by a newline in place of a
semicolon.
- (_\bl_\bi_\bs_\bt) _\bl_\bi_\bs_\bt is executed in a subshell (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\bN-\b-
- M\bME\bEN\bNT\bT below for a description of a subshell environment). Vari-
- able assignments and builtin commands that affect the shell's
+ (_\bl_\bi_\bs_\bt) _\bl_\bi_\bs_\bt is executed in a subshell (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\bN-\b-
+ M\bME\bEN\bNT\bT below for a description of a subshell environment). Vari-
+ able assignments and builtin commands that affect the shell's
environment do not remain in effect after the command completes.
The return status is the exit status of _\bl_\bi_\bs_\bt.
{ _\bl_\bi_\bs_\bt; }
_\bl_\bi_\bs_\bt is executed in the current shell environment. _\bl_\bi_\bs_\bt must be
- terminated with a newline or semicolon. This is known as a
+ terminated with a newline or semicolon. This is known as a
_\bg_\br_\bo_\bu_\bp _\bc_\bo_\bm_\bm_\ba_\bn_\bd. The return status is the exit status of _\bl_\bi_\bs_\bt.
- Note that unlike the metacharacters (\b( and )\b), {\b{ and }\b} are _\br_\be_\b-
- _\bs_\be_\br_\bv_\be_\bd _\bw_\bo_\br_\bd_\bs and must occur where a reserved word is permitted
- to be recognized. Since they do not cause a word break, they
- must be separated from _\bl_\bi_\bs_\bt by whitespace or another shell
+ Note that unlike the metacharacters (\b( and )\b), {\b{ and }\b} are _\br_\be_\b-
+ _\bs_\be_\br_\bv_\be_\bd _\bw_\bo_\br_\bd_\bs and must occur where a reserved word is permitted
+ to be recognized. Since they do not cause a word break, they
+ must be separated from _\bl_\bi_\bs_\bt by whitespace or another shell
metacharacter.
((_\be_\bx_\bp_\br_\be_\bs_\bs_\bi_\bo_\bn))
- The arithmetic _\be_\bx_\bp_\br_\be_\bs_\bs_\bi_\bo_\bn is evaluated according to the rules
- described below under A\bAR\bRI\bIT\bTH\bHM\bME\bET\bTI\bIC\bC E\bEV\bVA\bAL\bLU\bUA\bAT\bTI\bIO\bON\bN. If the value of
- the expression is non-zero, the return status is 0; otherwise
- the return status is 1. The _\be_\bx_\bp_\br_\be_\bs_\bs_\bi_\bo_\bn undergoes the same ex-
- pansions as if it were within double quotes, but double quote
- characters in _\be_\bx_\bp_\br_\be_\bs_\bs_\bi_\bo_\bn are not treated specially and are re-
+ The arithmetic _\be_\bx_\bp_\br_\be_\bs_\bs_\bi_\bo_\bn is evaluated according to the rules
+ described below under A\bAR\bRI\bIT\bTH\bHM\bME\bET\bTI\bIC\bC E\bEV\bVA\bAL\bLU\bUA\bAT\bTI\bIO\bON\bN. If the value of
+ the expression is non-zero, the return status is 0; otherwise
+ the return status is 1. The _\be_\bx_\bp_\br_\be_\bs_\bs_\bi_\bo_\bn undergoes the same ex-
+ pansions as if it were within double quotes, but double quote
+ characters in _\be_\bx_\bp_\br_\be_\bs_\bs_\bi_\bo_\bn are not treated specially and are re-
moved.
[\b[[\b[ _\be_\bx_\bp_\br_\be_\bs_\bs_\bi_\bo_\bn ]\b]]\b]
Evaluate the conditional expression _\be_\bx_\bp_\br_\be_\bs_\bs_\bi_\bo_\bn and return a sta-
- tus of zero (true) or non-zero (false). Expressions are com-
+ tus of zero (true) or non-zero (false). Expressions are com-
posed of the primaries described below 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 words between the [\b[[\b[ and ]\b]]\b] do not undergo word
- splitting and pathname expansion. The shell performs tilde ex-
+ S\bSI\bIO\bON\bNS\bS. The words between the [\b[[\b[ and ]\b]]\b] do not undergo word
+ splitting and pathname expansion. The shell performs tilde ex-
pansion, parameter and variable expansion, arithmetic expansion,
command substitution, process substitution, and quote removal on
- those words. Conditional operators such as -\b-f\bf must be unquoted
+ those words. Conditional operators such as -\b-f\bf must be unquoted
to be recognized as primaries.
- When used with [\b[[\b[, the <\b< and >\b> operators sort lexicographically
+ When used with [\b[[\b[, the <\b< and >\b> operators sort lexicographically
using the current locale.
- When the =\b==\b= and !\b!=\b= operators are used, the string to the right
+ When the =\b==\b= and !\b!=\b= operators are used, the string to the right
of the operator is considered a pattern and matched according to
the rules described below under P\bPa\bat\btt\bte\ber\brn\bn M\bMa\bat\btc\bch\bhi\bin\bng\bg, as if the e\bex\bxt\bt-\b-
g\bgl\blo\bob\bb shell option were enabled. The =\b= operator is equivalent to
- =\b==\b=. If the n\bno\boc\bca\bas\bse\bem\bma\bat\btc\bch\bh shell option is enabled, the match is
- performed without regard to the case of alphabetic characters.
- The return value is 0 if the string matches (=\b==\b=) or does not
- match (!\b!=\b=) the pattern, and 1 otherwise. If any part of the
- pattern is quoted, the quoted portion is matched as a string:
+ =\b==\b=. If the n\bno\boc\bca\bas\bse\bem\bma\bat\btc\bch\bh shell option is enabled, the match is
+ performed without regard to the case of alphabetic characters.
+ The return value is 0 if the string matches (=\b==\b=) or does not
+ match (!\b!=\b=) the pattern, and 1 otherwise. If any part of the
+ pattern is quoted, the quoted portion is matched as a string:
every character in the quoted portion matches itself, instead of
having any special pattern matching meaning.
- An additional binary operator, =\b=~\b~, is available, with the same
- precedence as =\b==\b= and !\b!=\b=. When it is used, the string to the
+ An additional binary operator, =\b=~\b~, is available, with the same
+ precedence as =\b==\b= and !\b!=\b=. When it is used, the string to the
right of the operator is considered a POSIX extended regular ex-
- pression and matched accordingly (using the POSIX _\br_\be_\bg_\bc_\bo_\bm_\bp and
- _\br_\be_\bg_\be_\bx_\be_\bc interfaces usually described in _\br_\be_\bg_\be_\bx(3)). The return
- value is 0 if the string matches the pattern, and 1 otherwise.
+ pression and matched accordingly (using the POSIX _\br_\be_\bg_\bc_\bo_\bm_\bp and
+ _\br_\be_\bg_\be_\bx_\be_\bc interfaces usually described in _\br_\be_\bg_\be_\bx(3)). The return
+ value is 0 if the string matches the pattern, and 1 otherwise.
If the regular expression is syntactically incorrect, the condi-
tional expression's return value is 2. If the n\bno\boc\bca\bas\bse\bem\bma\bat\btc\bch\bh shell
- option is enabled, the match is performed without regard to the
+ option is enabled, the match is performed without regard to the
case of alphabetic characters.
- If any part of the pattern is quoted, the quoted portion is
- matched literally, as above. If the pattern is stored in a
+ If any part of the pattern is quoted, the quoted portion is
+ matched literally, as above. If the pattern is stored in a
shell variable, quoting the variable expansion forces the entire
- pattern to be matched literally. Treat bracket expressions in
- regular expressions carefully, since normal quoting and pattern
+ pattern to be matched literally. Treat bracket expressions in
+ regular expressions carefully, since normal quoting and pattern
characters lose their meanings between brackets.
- The pattern will match if it matches any part of the string.
- Anchor the pattern using the ^\b^ and $\b$ regular expression opera-
+ The pattern will match if it matches any part of the string.
+ Anchor the pattern using the ^\b^ and $\b$ regular expression opera-
tors to force it to match the entire string.
- The array variable B\bBA\bAS\bSH\bH_\b_R\bRE\bEM\bMA\bAT\bTC\bCH\bH records which parts of the
- string matched the pattern. The element of B\bBA\bAS\bSH\bH_\b_R\bRE\bEM\bMA\bAT\bTC\bCH\bH with
- index 0 contains the portion of the string matching the entire
- regular expression. Substrings matched by parenthesized subex-
+ The array variable B\bBA\bAS\bSH\bH_\b_R\bRE\bEM\bMA\bAT\bTC\bCH\bH records which parts of the
+ string matched the pattern. The element of B\bBA\bAS\bSH\bH_\b_R\bRE\bEM\bMA\bAT\bTC\bCH\bH with
+ index 0 contains the portion of the string matching the entire
+ regular expression. Substrings matched by parenthesized subex-
pressions within the regular expression are saved in the remain-
- ing B\bBA\bAS\bSH\bH_\b_R\bRE\bEM\bMA\bAT\bTC\bCH\bH indices. The element of B\bBA\bAS\bSH\bH_\b_R\bRE\bEM\bMA\bAT\bTC\bCH\bH with in-
- dex _\bn is the portion of the string matching the _\bnth parenthe-
- sized subexpression. B\bBa\bas\bsh\bh sets B\bBA\bAS\bSH\bH_\b_R\bRE\bEM\bMA\bAT\bTC\bCH\bH in the global
- scope; declaring it as a local variable will lead to unexpected
+ ing B\bBA\bAS\bSH\bH_\b_R\bRE\bEM\bMA\bAT\bTC\bCH\bH indices. The element of B\bBA\bAS\bSH\bH_\b_R\bRE\bEM\bMA\bAT\bTC\bCH\bH with in-
+ dex _\bn is the portion of the string matching the _\bnth parenthe-
+ sized subexpression. B\bBa\bas\bsh\bh sets B\bBA\bAS\bSH\bH_\b_R\bRE\bEM\bMA\bAT\bTC\bCH\bH in the global
+ scope; declaring it as a local variable will lead to unexpected
results.
- Expressions may be combined using the following operators,
+ Expressions may be combined using the following operators,
listed in decreasing order of precedence:
(\b( _\be_\bx_\bp_\br_\be_\bs_\bs_\bi_\bo_\bn )\b)
- Returns the value of _\be_\bx_\bp_\br_\be_\bs_\bs_\bi_\bo_\bn. This may be used to
+ Returns the value of _\be_\bx_\bp_\br_\be_\bs_\bs_\bi_\bo_\bn. This may be used to
override the normal precedence of operators.
!\b! _\be_\bx_\bp_\br_\be_\bs_\bs_\bi_\bo_\bn
True if _\be_\bx_\bp_\br_\be_\bs_\bs_\bi_\bo_\bn is false.
True if either _\be_\bx_\bp_\br_\be_\bs_\bs_\bi_\bo_\bn_\b1 or _\be_\bx_\bp_\br_\be_\bs_\bs_\bi_\bo_\bn_\b2 is true.
The &\b&&\b& and |\b||\b| operators do not evaluate _\be_\bx_\bp_\br_\be_\bs_\bs_\bi_\bo_\bn_\b2 if the value
- of _\be_\bx_\bp_\br_\be_\bs_\bs_\bi_\bo_\bn_\b1 is sufficient to determine the return value of
+ of _\be_\bx_\bp_\br_\be_\bs_\bs_\bi_\bo_\bn_\b1 is sufficient to determine the return value of
the entire conditional expression.
f\bfo\bor\br _\bn_\ba_\bm_\be [ [ i\bin\bn [ _\bw_\bo_\br_\bd _\b._\b._\b. ] ] ; ] d\bdo\bo _\bl_\bi_\bs_\bt ; d\bdo\bon\bne\be
- First, expand The list of words following i\bin\bn, generating a list
- of items. Then, the variable _\bn_\ba_\bm_\be is set to each element of
- this list in turn, and _\bl_\bi_\bs_\bt is executed each time. If the i\bin\bn
+ First, expand The list of words following i\bin\bn, generating a list
+ of items. Then, the variable _\bn_\ba_\bm_\be is set to each element of
+ this list in turn, and _\bl_\bi_\bs_\bt is executed each time. If the i\bin\bn
_\bw_\bo_\br_\bd is omitted, the f\bfo\bor\br command executes _\bl_\bi_\bs_\bt once for each po-
- sitional parameter that is set (see P\bPA\bAR\bRA\bAM\bME\bET\bTE\bER\bRS\bS below). The re-
- turn status is the exit status of the last command that exe-
+ sitional parameter that is set (see P\bPA\bAR\bRA\bAM\bME\bET\bTE\bER\bRS\bS below). The re-
+ turn status is the exit status of the last command that exe-
cutes. If the expansion of the items following i\bin\bn results in an
- empty list, no commands are executed, and the return status is
+ empty list, no commands are executed, and the return status is
0.
f\bfo\bor\br (( _\be_\bx_\bp_\br_\b1 ; _\be_\bx_\bp_\br_\b2 ; _\be_\bx_\bp_\br_\b3 )) ; d\bdo\bo _\bl_\bi_\bs_\bt ; d\bdo\bon\bne\be
First, evaluate the arithmetic expression _\be_\bx_\bp_\br_\b1 according to the
- rules described below under A\bAR\bRI\bIT\bTH\bHM\bME\bET\bTI\bIC\bC E\bEV\bVA\bAL\bLU\bUA\bAT\bTI\bIO\bON\bN. Then, re-
+ rules described below under A\bAR\bRI\bIT\bTH\bHM\bME\bET\bTI\bIC\bC E\bEV\bVA\bAL\bLU\bUA\bAT\bTI\bIO\bON\bN. Then, re-
peatedly evaluate the arithmetic expression _\be_\bx_\bp_\br_\b2 until it eval-
- uates to zero. Each time _\be_\bx_\bp_\br_\b2 evaluates to a non-zero value,
- execute _\bl_\bi_\bs_\bt and evaluate the arithmetic expression _\be_\bx_\bp_\br_\b3. If
- any expression is omitted, it behaves as if it evaluates to 1.
- The return value is the exit status of the last command in _\bl_\bi_\bs_\bt
- that is executed, or non-zero if any of the expressions is in-
+ uates to zero. Each time _\be_\bx_\bp_\br_\b2 evaluates to a non-zero value,
+ execute _\bl_\bi_\bs_\bt and evaluate the arithmetic expression _\be_\bx_\bp_\br_\b3. If
+ any expression is omitted, it behaves as if it evaluates to 1.
+ The return value is the exit status of the last command in _\bl_\bi_\bs_\bt
+ that is executed, or non-zero if any of the expressions is in-
valid.
- Use the b\bbr\bre\bea\bak\bk and c\bco\bon\bnt\bti\bin\bnu\bue\be builtins (see S\bSH\bHE\bEL\bLL\bL B\bBU\bUI\bIL\bLT\bTI\bIN\bN C\bCO\bOM\bMM\bMA\bAN\bND\bDS\bS
+ Use the b\bbr\bre\bea\bak\bk and c\bco\bon\bnt\bti\bin\bnu\bue\be builtins (see S\bSH\bHE\bEL\bLL\bL B\bBU\bUI\bIL\bLT\bTI\bIN\bN C\bCO\bOM\bMM\bMA\bAN\bND\bDS\bS
below) to control loop execution.
s\bse\bel\ble\bec\bct\bt _\bn_\ba_\bm_\be [ i\bin\bn _\bw_\bo_\br_\bd ] ; d\bdo\bo _\bl_\bi_\bs_\bt ; d\bdo\bon\bne\be
- First, expand the list of words following i\bin\bn, generating a list
- of items, and print the set of expanded words the standard er-
- ror, each preceded by a number. If the i\bin\bn _\bw_\bo_\br_\bd is omitted,
- print the positional parameters (see P\bPA\bAR\bRA\bAM\bME\bET\bTE\bER\bRS\bS below). s\bse\bel\ble\bec\bct\bt
- then displays the P\bPS\bS3\b3 prompt and reads a line from the standard
+ First, expand the list of words following i\bin\bn, generating a list
+ of items, and print the set of expanded words the standard er-
+ ror, each preceded by a number. If the i\bin\bn _\bw_\bo_\br_\bd is omitted,
+ print the positional parameters (see P\bPA\bAR\bRA\bAM\bME\bET\bTE\bER\bRS\bS below). s\bse\bel\ble\bec\bct\bt
+ then displays the P\bPS\bS3\b3 prompt and reads a line from the standard
input. If the line consists of a number corresponding to one of
- the displayed words, then s\bse\bel\ble\bec\bct\bt sets the value of _\bn_\ba_\bm_\be to that
- word. If the line is empty, s\bse\bel\ble\bec\bct\bt displays the words and
- prompt again. If EOF is read, s\bse\bel\ble\bec\bct\bt completes and returns 1.
- Any other value sets _\bn_\ba_\bm_\be to null. The line read is saved in
- the variable R\bRE\bEP\bPL\bLY\bY. The _\bl_\bi_\bs_\bt is executed after each selection
+ the displayed words, then s\bse\bel\ble\bec\bct\bt sets the value of _\bn_\ba_\bm_\be to that
+ word. If the line is empty, s\bse\bel\ble\bec\bct\bt displays the words and
+ prompt again. If EOF is read, s\bse\bel\ble\bec\bct\bt completes and returns 1.
+ Any other value sets _\bn_\ba_\bm_\be to null. The line read is saved in
+ the variable R\bRE\bEP\bPL\bLY\bY. The _\bl_\bi_\bs_\bt is executed after each selection
until a b\bbr\bre\bea\bak\bk command is executed. The exit status of s\bse\bel\ble\bec\bct\bt is
the exit status of the last command executed in _\bl_\bi_\bs_\bt, or zero if
no commands were executed.
c\bca\bas\bse\be _\bw_\bo_\br_\bd i\bin\bn [ [(] _\bp_\ba_\bt_\bt_\be_\br_\bn [ |\b| _\bp_\ba_\bt_\bt_\be_\br_\bn ] ... ) _\bl_\bi_\bs_\bt ;; ] ... e\bes\bsa\bac\bc
A c\bca\bas\bse\be command first expands _\bw_\bo_\br_\bd, and tries to match it against
- each _\bp_\ba_\bt_\bt_\be_\br_\bn in turn, proceeding from first to last, using the
- matching rules described under P\bPa\bat\btt\bte\ber\brn\bn M\bMa\bat\btc\bch\bhi\bin\bng\bg below. A pat-
- tern list is a set of one or more patterns separated by , and
- the ) operator terminates the pattern list. The _\bw_\bo_\br_\bd is ex-
- panded using tilde expansion, parameter and variable expansion,
+ each _\bp_\ba_\bt_\bt_\be_\br_\bn in turn, proceeding from first to last, using the
+ matching rules described under P\bPa\bat\btt\bte\ber\brn\bn M\bMa\bat\btc\bch\bhi\bin\bng\bg below. A pat-
+ tern list is a set of one or more patterns separated by , and
+ the ) operator terminates the pattern list. The _\bw_\bo_\br_\bd is ex-
+ panded using tilde expansion, parameter and variable expansion,
arithmetic expansion, command substitution, process substitution
- and quote removal. Each _\bp_\ba_\bt_\bt_\be_\br_\bn examined is expanded using
- tilde expansion, parameter and variable expansion, arithmetic
+ and quote removal. Each _\bp_\ba_\bt_\bt_\be_\br_\bn examined is expanded using
+ tilde expansion, parameter and variable expansion, arithmetic
expansion, command substitution, process substitution, and quote
- removal. If the n\bno\boc\bca\bas\bse\bem\bma\bat\btc\bch\bh shell option is enabled, the match
- is performed without regard to the case of alphabetic charac-
+ removal. If the n\bno\boc\bca\bas\bse\bem\bma\bat\btc\bch\bh shell option is enabled, the match
+ is performed without regard to the case of alphabetic charac-
ters. A _\bc_\bl_\ba_\bu_\bs_\be is a pattern list and an associated _\bl_\bi_\bs_\bt.
When a match is found, c\bca\bas\bse\be executes the corresponding _\bl_\bi_\bs_\bt. If
- the ;\b;;\b; operator terminates the case clause, the c\bca\bas\bse\be command
+ the ;\b;;\b; operator terminates the case clause, the c\bca\bas\bse\be command
completes after the first match. Using ;\b;&\b& in place of ;\b;;\b; causes
- execution to continue with the _\bl_\bi_\bs_\bt associated with the next
+ execution to continue with the _\bl_\bi_\bs_\bt associated with the next
pattern list. Using ;\b;;\b;&\b& in place of ;\b;;\b; causes the shell to test
- the next pattern list in the statement, if any, and execute any
- associated _\bl_\bi_\bs_\bt if the match succeeds. continuing the case
+ the next pattern list in the statement, if any, and execute any
+ associated _\bl_\bi_\bs_\bt if the match succeeds. continuing the case
statement execution as if the pattern list had not matched. The
exit status is zero if no pattern matches.
the last _\bl_\bi_\bs_\bt executed.
i\bif\bf _\bl_\bi_\bs_\bt; t\bth\bhe\ben\bn _\bl_\bi_\bs_\bt; [ e\bel\bli\bif\bf _\bl_\bi_\bs_\bt; t\bth\bhe\ben\bn _\bl_\bi_\bs_\bt; ] ... [ e\bel\bls\bse\be _\bl_\bi_\bs_\bt; ] f\bfi\bi
- The i\bif\bf _\bl_\bi_\bs_\bt is executed. If its exit status is zero, the t\bth\bhe\ben\bn
- _\bl_\bi_\bs_\bt is executed. Otherwise, each e\bel\bli\bif\bf _\bl_\bi_\bs_\bt is executed in
- turn, and if its exit status is zero, the corresponding t\bth\bhe\ben\bn
+ The i\bif\bf _\bl_\bi_\bs_\bt is executed. If its exit status is zero, the t\bth\bhe\ben\bn
+ _\bl_\bi_\bs_\bt is executed. Otherwise, each e\bel\bli\bif\bf _\bl_\bi_\bs_\bt is executed in
+ turn, and if its exit status is zero, the corresponding t\bth\bhe\ben\bn
_\bl_\bi_\bs_\bt is executed and the command completes. Otherwise, the e\bel\bls\bse\be
- _\bl_\bi_\bs_\bt is executed, if present. The exit status is the exit sta-
+ _\bl_\bi_\bs_\bt is executed, if present. The exit status is the exit sta-
tus of the last command executed, or zero if no condition tested
true.
w\bwh\bhi\bil\ble\be _\bl_\bi_\bs_\bt_\b-_\b1; d\bdo\bo _\bl_\bi_\bs_\bt_\b-_\b2; d\bdo\bon\bne\be
u\bun\bnt\bti\bil\bl _\bl_\bi_\bs_\bt_\b-_\b1; d\bdo\bo _\bl_\bi_\bs_\bt_\b-_\b2; d\bdo\bon\bne\be
- The w\bwh\bhi\bil\ble\be command continuously executes the list _\bl_\bi_\bs_\bt_\b-_\b2 as long
+ The w\bwh\bhi\bil\ble\be command continuously executes the list _\bl_\bi_\bs_\bt_\b-_\b2 as long
as the last command in the list _\bl_\bi_\bs_\bt_\b-_\b1 returns an exit status of
- zero. The u\bun\bnt\bti\bil\bl command is identical to the w\bwh\bhi\bil\ble\be command, ex-
+ zero. The u\bun\bnt\bti\bil\bl command is identical to the w\bwh\bhi\bil\ble\be command, ex-
cept that the test is negated: _\bl_\bi_\bs_\bt_\b-_\b2 is executed as long as the
last command in _\bl_\bi_\bs_\bt_\b-_\b1 returns a non-zero exit status. The exit
status of the w\bwh\bhi\bil\ble\be and u\bun\bnt\bti\bil\bl commands is the exit status of the
C\bCo\bop\bpr\bro\boc\bce\bes\bss\bse\bes\bs
A _\bc_\bo_\bp_\br_\bo_\bc_\be_\bs_\bs is a shell command preceded by the c\bco\bop\bpr\bro\boc\bc reserved word. A
- coprocess is executed asynchronously in a subshell, as if the command
- had been terminated with the &\b& control operator, with a two-way pipe
+ coprocess is executed asynchronously in a subshell, as if the command
+ had been terminated with the &\b& control operator, with a two-way pipe
established between the executing shell and the coprocess.
The syntax for a coprocess is:
c\bco\bop\bpr\bro\boc\bc [_\bN_\bA_\bM_\bE] _\bc_\bo_\bm_\bm_\ba_\bn_\bd [_\br_\be_\bd_\bi_\br_\be_\bc_\bt_\bi_\bo_\bn_\bs]
- This creates a coprocess named _\bN_\bA_\bM_\bE. _\bc_\bo_\bm_\bm_\ba_\bn_\bd may be either a simple
- command or a compound command (see above). _\bN_\bA_\bM_\bE is a shell variable
+ This creates a coprocess named _\bN_\bA_\bM_\bE. _\bc_\bo_\bm_\bm_\ba_\bn_\bd may be either a simple
+ command or a compound command (see above). _\bN_\bA_\bM_\bE is a shell variable
name. If _\bN_\bA_\bM_\bE is not supplied, the default name is C\bCO\bOP\bPR\bRO\bOC\bC.
The recommended form to use for a coprocess is
c\bco\bop\bpr\bro\boc\bc _\bN_\bA_\bM_\bE { _\bc_\bo_\bm_\bm_\ba_\bn_\bd [_\br_\be_\bd_\bi_\br_\be_\bc_\bt_\bi_\bo_\bn_\bs]; }
- This form is preferred because simple commands result in the coprocess
- always being named C\bCO\bOP\bPR\bRO\bOC\bC, and it is simpler to use and more complete
+ This form is preferred because simple commands result in the coprocess
+ always being named C\bCO\bOP\bPR\bRO\bOC\bC, and it is simpler to use and more complete
than the other compound commands.
- If _\bc_\bo_\bm_\bm_\ba_\bn_\bd is a compound command, _\bN_\bA_\bM_\bE is optional. The word following
- c\bco\bop\bpr\bro\boc\bc determines whether that word is interpreted as a variable name:
- it is interpreted as _\bN_\bA_\bM_\bE if it is not a reserved word that introduces
- a compound command. If _\bc_\bo_\bm_\bm_\ba_\bn_\bd is a simple command, _\bN_\bA_\bM_\bE is not al-
- lowed; this is to avoid confusion between _\bN_\bA_\bM_\bE and the first word of
+ If _\bc_\bo_\bm_\bm_\ba_\bn_\bd is a compound command, _\bN_\bA_\bM_\bE is optional. The word following
+ c\bco\bop\bpr\bro\boc\bc determines whether that word is interpreted as a variable name:
+ it is interpreted as _\bN_\bA_\bM_\bE if it is not a reserved word that introduces
+ a compound command. If _\bc_\bo_\bm_\bm_\ba_\bn_\bd is a simple command, _\bN_\bA_\bM_\bE is not al-
+ lowed; this is to avoid confusion between _\bN_\bA_\bM_\bE and the first word of
the simple command.
- When the coprocess is executed, the shell creates an array variable
- (see A\bAr\brr\bra\bay\bys\bs below) named _\bN_\bA_\bM_\bE in the context of the executing shell.
- The standard output of _\bc_\bo_\bm_\bm_\ba_\bn_\bd is connected via a pipe to a file de-
- scriptor in the executing shell, and that file descriptor is assigned
+ When the coprocess is executed, the shell creates an array variable
+ (see A\bAr\brr\bra\bay\bys\bs below) named _\bN_\bA_\bM_\bE in the context of the executing shell.
+ The standard output of _\bc_\bo_\bm_\bm_\ba_\bn_\bd is connected via a pipe to a file de-
+ scriptor in the executing shell, and that file descriptor is assigned
to _\bN_\bA_\bM_\bE[0]. The standard input of _\bc_\bo_\bm_\bm_\ba_\bn_\bd is connected via a pipe to a
file descriptor in the executing shell, and that file descriptor is as-
- signed to _\bN_\bA_\bM_\bE[1]. This pipe is established before any redirections
+ signed to _\bN_\bA_\bM_\bE[1]. This pipe is established before any redirections
specified by the command (see R\bRE\bED\bDI\bIR\bRE\bEC\bCT\bTI\bIO\bON\bN below). The file descriptors
- can be utilized as arguments to shell commands and redirections using
- standard word expansions. Other than those created to execute command
- and process substitutions, the file descriptors are not available in
+ can be utilized as arguments to shell commands and redirections using
+ standard word expansions. Other than those created to execute command
+ and process substitutions, the file descriptors are not available in
subshells.
- The process ID of the shell spawned to execute the coprocess is avail-
- able as the value of the variable _\bN_\bA_\bM_\bE_PID. The w\bwa\bai\bit\bt builtin may be
+ The process ID of the shell spawned to execute the coprocess is avail-
+ able as the value of the variable _\bN_\bA_\bM_\bE_PID. The w\bwa\bai\bit\bt builtin may be
used to wait for the coprocess to terminate.
- Since the coprocess is created as an asynchronous command, the c\bco\bop\bpr\bro\boc\bc
- command always returns success. The return status of a coprocess is
+ Since the coprocess is created as an asynchronous command, the c\bco\bop\bpr\bro\boc\bc
+ command always returns success. The return status of a coprocess is
the exit status of _\bc_\bo_\bm_\bm_\ba_\bn_\bd.
S\bSh\bhe\bel\bll\bl F\bFu\bun\bnc\bct\bti\bio\bon\bn D\bDe\bef\bfi\bin\bni\bit\bti\bio\bon\bns\bs
- A shell function is an object that is called like a simple command and
- executes a compound command with a new set of positional parameters.
+ A shell function is an object that is called like a simple command and
+ executes a compound command with a new set of positional parameters.
Shell functions are declared as follows:
_\bf_\bn_\ba_\bm_\be () _\bc_\bo_\bm_\bp_\bo_\bu_\bn_\bd_\b-_\bc_\bo_\bm_\bm_\ba_\bn_\bd [_\br_\be_\bd_\bi_\br_\be_\bc_\bt_\bi_\bo_\bn]
f\bfu\bun\bnc\bct\bti\bio\bon\bn _\bf_\bn_\ba_\bm_\be [()] _\bc_\bo_\bm_\bp_\bo_\bu_\bn_\bd_\b-_\bc_\bo_\bm_\bm_\ba_\bn_\bd [_\br_\be_\bd_\bi_\br_\be_\bc_\bt_\bi_\bo_\bn]
This defines a function named _\bf_\bn_\ba_\bm_\be. The reserved word f\bfu\bun\bnc\bct\bti\bio\bon\bn
- is optional. If the f\bfu\bun\bnc\bct\bti\bio\bon\bn reserved word is supplied, the
- parentheses are optional. The _\bb_\bo_\bd_\by of the function is the com-
- pound command _\bc_\bo_\bm_\bp_\bo_\bu_\bn_\bd_\b-_\bc_\bo_\bm_\bm_\ba_\bn_\bd (see C\bCo\bom\bmp\bpo\bou\bun\bnd\bd C\bCo\bom\bmm\bma\ban\bnd\bds\bs above).
- That command is usually a _\bl_\bi_\bs_\bt of commands between { and }, but
+ is optional. If the f\bfu\bun\bnc\bct\bti\bio\bon\bn reserved word is supplied, the
+ parentheses are optional. The _\bb_\bo_\bd_\by of the function is the com-
+ pound command _\bc_\bo_\bm_\bp_\bo_\bu_\bn_\bd_\b-_\bc_\bo_\bm_\bm_\ba_\bn_\bd (see C\bCo\bom\bmp\bpo\bou\bun\bnd\bd C\bCo\bom\bmm\bma\ban\bnd\bds\bs above).
+ That command is usually a _\bl_\bi_\bs_\bt of commands between { and }, but
may be any command listed under C\bCo\bom\bmp\bpo\bou\bun\bnd\bd C\bCo\bom\bmm\bma\ban\bnd\bds\bs above. If the
f\bfu\bun\bnc\bct\bti\bio\bon\bn reserved word is used, but the parentheses are not sup-
plied, the braces are recommended. _\bc_\bo_\bm_\bp_\bo_\bu_\bn_\bd_\b-_\bc_\bo_\bm_\bm_\ba_\bn_\bd is executed
- whenever _\bf_\bn_\ba_\bm_\be is specified as the name of a simple command.
+ whenever _\bf_\bn_\ba_\bm_\be is specified as the name of a simple command.
When in posix mode, _\bf_\bn_\ba_\bm_\be must be a valid shell _\bn_\ba_\bm_\be and may not
- be the name of one of the POSIX _\bs_\bp_\be_\bc_\bi_\ba_\bl _\bb_\bu_\bi_\bl_\bt_\bi_\bn_\bs. In default
- mode, a function name can be any unquoted shell word that does
+ be the name of one of the POSIX _\bs_\bp_\be_\bc_\bi_\ba_\bl _\bb_\bu_\bi_\bl_\bt_\bi_\bn_\bs. In default
+ mode, a function name can be any unquoted shell word that does
not contain $\b$.
- Any redirections (see R\bRE\bED\bDI\bIR\bRE\bEC\bCT\bTI\bIO\bON\bN below) specified when a function is
+ Any redirections (see R\bRE\bED\bDI\bIR\bRE\bEC\bCT\bTI\bIO\bON\bN below) specified when a function is
defined are performed when the function is executed.
- The exit status of a function definition is zero unless a syntax error
- occurs or a readonly function with the same name already exists. When
- executed, the exit status of a function is the exit status of the last
+ The exit status of a function definition is zero unless a syntax error
+ occurs or a readonly function with the same name already exists. When
+ executed, the exit status of a function is the exit status of the last
command executed in the body. (See F\bFU\bUN\bNC\bCT\bTI\bIO\bON\bNS\bS below.)
C\bCO\bOM\bMM\bME\bEN\bNT\bTS\bS
In a non-interactive shell, or an interactive shell in which the i\bin\bnt\bte\ber\br-\b-
- a\bac\bct\bti\biv\bve\be_\b_c\bco\bom\bmm\bme\ben\bnt\bts\bs option to the s\bsh\bho\bop\bpt\bt builtin is enabled (see S\bSH\bHE\bEL\bLL\bL
- B\bBU\bUI\bIL\bLT\bTI\bIN\bN C\bCO\bOM\bMM\bMA\bAN\bND\bDS\bS below), a word beginning with #\b# introduces a comment.
+ a\bac\bct\bti\biv\bve\be_\b_c\bco\bom\bmm\bme\ben\bnt\bts\bs option to the s\bsh\bho\bop\bpt\bt builtin is enabled (see S\bSH\bHE\bEL\bLL\bL
+ B\bBU\bUI\bIL\bLT\bTI\bIN\bN C\bCO\bOM\bMM\bMA\bAN\bND\bDS\bS below), a word beginning with #\b# introduces a comment.
A word begins at the beginning of a line, after unquoted whitespace, or
- after an operator. The comment causes that word and all remaining
- characters on that line to be ignored. An interactive shell without
- the i\bin\bnt\bte\ber\bra\bac\bct\bti\biv\bve\be_\b_c\bco\bom\bmm\bme\ben\bnt\bts\bs option enabled does not allow comments. The
+ after an operator. The comment causes that word and all remaining
+ characters on that line to be ignored. An interactive shell without
+ the i\bin\bnt\bte\ber\bra\bac\bct\bti\biv\bve\be_\b_c\bco\bom\bmm\bme\ben\bnt\bts\bs option enabled does not allow comments. The
i\bin\bnt\bte\ber\bra\bac\bct\bti\biv\bve\be_\b_c\bco\bom\bmm\bme\ben\bnt\bts\bs option is enabled by default in interactive
shells.
Q\bQU\bUO\bOT\bTI\bIN\bNG\bG
- _\bQ_\bu_\bo_\bt_\bi_\bn_\bg is used to remove the special meaning of certain characters or
- words to the shell. Quoting can be used to disable special treatment
+ _\bQ_\bu_\bo_\bt_\bi_\bn_\bg is used to remove the special meaning of certain characters or
+ words to the shell. Quoting can be used to disable special treatment
for special characters, to prevent reserved words from being recognized
as such, and to prevent parameter expansion.
- Each of the _\bm_\be_\bt_\ba_\bc_\bh_\ba_\br_\ba_\bc_\bt_\be_\br_\bs listed above under D\bDE\bEF\bFI\bIN\bNI\bIT\bTI\bIO\bON\bNS\bS has special
+ Each of the _\bm_\be_\bt_\ba_\bc_\bh_\ba_\br_\ba_\bc_\bt_\be_\br_\bs listed above under D\bDE\bEF\bFI\bIN\bNI\bIT\bTI\bIO\bON\bNS\bS has special
meaning to the shell and must be quoted if it is to represent itself.
- When the command history expansion facilities are being used (see H\bHI\bIS\bS-\b-
+ When the command history expansion facilities are being used (see H\bHI\bIS\bS-\b-
T\bTO\bOR\bRY\bY E\bEX\bXP\bPA\bAN\bNS\bSI\bIO\bON\bN below), the _\bh_\bi_\bs_\bt_\bo_\br_\by _\be_\bx_\bp_\ba_\bn_\bs_\bi_\bo_\bn character, usually !\b!, must
be quoted to prevent history expansion.
There are four quoting mechanisms: the _\be_\bs_\bc_\ba_\bp_\be _\bc_\bh_\ba_\br_\ba_\bc_\bt_\be_\br, single quotes,
double quotes, and dollar-single quotes.
- A non-quoted backslash (\\b\) is the _\be_\bs_\bc_\ba_\bp_\be _\bc_\bh_\ba_\br_\ba_\bc_\bt_\be_\br. It preserves the
- literal value of the next character that follows, removing any special
- meaning it has, with the exception of <newline>. If a \\b\<newline> pair
- appears, and the backslash is not itself quoted, the \\b\<newline> is
- treated as a line continuation (that is, it is removed from the input
+ A non-quoted backslash (\\b\) is the _\be_\bs_\bc_\ba_\bp_\be _\bc_\bh_\ba_\br_\ba_\bc_\bt_\be_\br. It preserves the
+ literal value of the next character that follows, removing any special
+ meaning it has, with the exception of <newline>. If a \\b\<newline> pair
+ appears, and the backslash is not itself quoted, the \\b\<newline> is
+ treated as a line continuation (that is, it is removed from the input
stream and effectively ignored).
- Enclosing characters in single quotes preserves the literal value of
+ Enclosing characters in single quotes preserves the literal value of
each character within the quotes. A single quote may not occur between
single quotes, even when preceded by a backslash.
- Enclosing characters in double quotes preserves the literal value of
- all characters within the quotes, with the exception of $\b$, `\b`, \\b\, and,
+ Enclosing characters in double quotes preserves the literal value of
+ all characters within the quotes, with the exception of $\b$, `\b`, \\b\, and,
when history expansion is enabled, !\b!. When the shell is in posix mode,
- the !\b! has no special meaning within double quotes, even when history
- expansion is enabled. The characters $\b$ and `\b` retain their special
- meaning within double quotes. The backslash retains its special mean-
- ing only when followed by one of the following characters: $\b$, `\b`, "\b", \\b\,
+ the !\b! has no special meaning within double quotes, even when history
+ expansion is enabled. The characters $\b$ and `\b` retain their special
+ meaning within double quotes. The backslash retains its special mean-
+ ing only when followed by one of the following characters: $\b$, `\b`, "\b", \\b\,
or <\b<n\bne\bew\bwl\bli\bin\bne\be>\b>. Backslashes preceding characters without a special mean-
ing are left unmodified.
- A double quote may be quoted within double quotes by preceding it with
+ A double quote may be quoted within double quotes by preceding it with
a backslash. If enabled, history expansion will be performed unless an
- !\b! appearing in double quotes is escaped using a backslash. The back-
+ !\b! appearing in double quotes is escaped using a backslash. The back-
slash preceding the !\b! is not removed.
- The special parameters *\b* and @\b@ have special meaning when in double
+ The special parameters *\b* and @\b@ have special meaning when in double
quotes (see P\bPA\bAR\bRA\bAM\bME\bET\bTE\bER\bRS\bS below).
- Character sequences of the form $\b$'_\bs_\bt_\br_\bi_\bn_\bg' are treated as a special
- variant of single quotes. The sequence expands to _\bs_\bt_\br_\bi_\bn_\bg, with back-
- slash-escaped characters in _\bs_\bt_\br_\bi_\bn_\bg replaced as specified by the ANSI C
- standard. Backslash escape sequences, if present, are decoded as fol-
+ Character sequences of the form $\b$'_\bs_\bt_\br_\bi_\bn_\bg' are treated as a special
+ variant of single quotes. The sequence expands to _\bs_\bt_\br_\bi_\bn_\bg, with back-
+ slash-escaped characters in _\bs_\bt_\br_\bi_\bn_\bg replaced as specified by the ANSI C
+ standard. Backslash escape sequences, if present, are decoded as fol-
lows:
\\b\a\ba alert (bell)
\\b\b\bb backspace
\\b\'\b' single quote
\\b\"\b" double quote
\\b\?\b? question mark
- \\b\_\bn_\bn_\bn The eight-bit character whose value is the octal value
+ \\b\_\bn_\bn_\bn The eight-bit character whose value is the octal value
_\bn_\bn_\bn (one 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).
\\b\c\bc_\bx A control-_\bx character.
- The expanded result is single-quoted, as if the dollar sign had not
+ The expanded result is single-quoted, as if the dollar sign had not
been present.
T\bTr\bra\ban\bns\bsl\bla\bat\bti\bin\bng\bg S\bSt\btr\bri\bin\bng\bgs\bs
A double-quoted string preceded by a dollar sign ($\b$"_\bs_\bt_\br_\bi_\bn_\bg") will cause
- the string to be translated according to the current locale. The _\bg_\be_\bt_\b-
- _\bt_\be_\bx_\bt infrastructure performs the lookup and translation, using the
- L\bLC\bC_\b_M\bME\bES\bSS\bSA\bAG\bGE\bES\bS, T\bTE\bEX\bXT\bTD\bDO\bOM\bMA\bAI\bIN\bND\bDI\bIR\bR, and T\bTE\bEX\bXT\bTD\bDO\bOM\bMA\bAI\bIN\bN shell variables. If the
- current locale is C\bC or P\bPO\bOS\bSI\bIX\bX, if there are no translations available,
+ the string to be translated according to the current locale. The _\bg_\be_\bt_\b-
+ _\bt_\be_\bx_\bt infrastructure performs the lookup and translation, using the
+ L\bLC\bC_\b_M\bME\bES\bSS\bSA\bAG\bGE\bES\bS, T\bTE\bEX\bXT\bTD\bDO\bOM\bMA\bAI\bIN\bND\bDI\bIR\bR, and T\bTE\bEX\bXT\bTD\bDO\bOM\bMA\bAI\bIN\bN shell variables. If the
+ current locale is C\bC or P\bPO\bOS\bSI\bIX\bX, if there are no translations available,
or if the string is not translated, the dollar sign is ignored, and the
- string is treated as double-quoted as described above. This is a form
- of double quoting, so the string remains double-quoted by default,
+ string is treated as double-quoted as described above. This is a form
+ of double quoting, so the string remains double-quoted by default,
whether or not it is translated and replaced. If the n\bno\boe\bex\bxp\bpa\ban\bnd\bd_\b_t\btr\bra\ban\bns\bsl\bla\ba-\b-
- t\bti\bio\bon\bn option is enabled using the s\bsh\bho\bop\bpt\bt builtin, translated strings are
- single-quoted instead of double-quoted. See the description of s\bsh\bho\bop\bpt\bt
+ t\bti\bio\bon\bn option is enabled using the s\bsh\bho\bop\bpt\bt builtin, translated strings are
+ single-quoted instead of double-quoted. See the description of s\bsh\bho\bop\bpt\bt
below under S\bSH\bHE\bEL\bLL\bL B\bBU\bUI\bIL\bLT\bTI\bIN\bN C\bCO\bOM\bMM\bMA\bAN\bND\bDS\bS.
P\bPA\bAR\bRA\bAM\bME\bET\bTE\bER\bRS\bS
- A _\bp_\ba_\br_\ba_\bm_\be_\bt_\be_\br is an entity that stores values. It can be a _\bn_\ba_\bm_\be, a num-
- ber, or one of the special characters listed below under S\bSp\bpe\bec\bci\bia\bal\bl P\bPa\bar\bra\ba-\b-
+ A _\bp_\ba_\br_\ba_\bm_\be_\bt_\be_\br is an entity that stores values. It can be a _\bn_\ba_\bm_\be, a num-
+ ber, or one of the special characters listed below under S\bSp\bpe\bec\bci\bia\bal\bl P\bPa\bar\bra\ba-\b-
m\bme\bet\bte\ber\brs\bs. A _\bv_\ba_\br_\bi_\ba_\bb_\bl_\be is a parameter denoted by a _\bn_\ba_\bm_\be. A variable has a
- _\bv_\ba_\bl_\bu_\be and zero or more _\ba_\bt_\bt_\br_\bi_\bb_\bu_\bt_\be_\bs. Attributes are assigned using the
- d\bde\bec\bcl\bla\bar\bre\be builtin command (see d\bde\bec\bcl\bla\bar\bre\be below in S\bSH\bHE\bEL\bLL\bL B\bBU\bUI\bIL\bLT\bTI\bIN\bN C\bCO\bOM\bMM\bMA\bAN\bND\bDS\bS).
+ _\bv_\ba_\bl_\bu_\be and zero or more _\ba_\bt_\bt_\br_\bi_\bb_\bu_\bt_\be_\bs. Attributes are assigned using the
+ d\bde\bec\bcl\bla\bar\bre\be builtin command (see d\bde\bec\bcl\bla\bar\bre\be below in S\bSH\bHE\bEL\bLL\bL B\bBU\bUI\bIL\bLT\bTI\bIN\bN C\bCO\bOM\bMM\bMA\bAN\bND\bDS\bS).
The e\bex\bxp\bpo\bor\brt\bt and r\bre\bea\bad\bdo\bon\bnl\bly\by builtins assign specific attributes.
A parameter is set if it has been assigned a value. The null string is
- a valid value. Once a variable is set, it may be unset only by using
+ a valid value. Once a variable is set, it may be unset only by using
the u\bun\bns\bse\bet\bt builtin command (see S\bSH\bHE\bEL\bLL\bL B\bBU\bUI\bIL\bLT\bTI\bIN\bN C\bCO\bOM\bMM\bMA\bAN\bND\bDS\bS below).
A _\bv_\ba_\br_\bi_\ba_\bb_\bl_\be may be assigned to by a statement of the form
_\bn_\ba_\bm_\be=[_\bv_\ba_\bl_\bu_\be]
- If _\bv_\ba_\bl_\bu_\be is not given, the variable is assigned the null string. All
- _\bv_\ba_\bl_\bu_\be_\bs undergo tilde expansion, parameter and variable expansion, com-
- mand substitution, arithmetic expansion, and quote removal (see E\bEX\bXP\bPA\bAN\bN-\b-
+ If _\bv_\ba_\bl_\bu_\be is not given, the variable is assigned the null string. All
+ _\bv_\ba_\bl_\bu_\be_\bs undergo tilde expansion, parameter and variable expansion, com-
+ mand substitution, arithmetic expansion, and quote removal (see E\bEX\bXP\bPA\bAN\bN-\b-
S\bSI\bIO\bON\bN below). If the variable has its i\bin\bnt\bte\beg\bge\ber\br attribute set, then _\bv_\ba_\bl_\bu_\be
is evaluated as an arithmetic expression even if the $\b$(\b((\b(...)\b))\b) expansion
is not used (see A\bAr\bri\bit\bth\bhm\bme\bet\bti\bic\bc E\bEx\bxp\bpa\ban\bns\bsi\bio\bon\bn below). Word splitting and path-
- name expansion are not performed. Assignment statements may also ap-
+ name expansion are not performed. Assignment statements may also ap-
pear as arguments to the a\bal\bli\bia\bas\bs, d\bde\bec\bcl\bla\bar\bre\be, t\bty\byp\bpe\bes\bse\bet\bt, e\bex\bxp\bpo\bor\brt\bt, r\bre\bea\bad\bdo\bon\bnl\bly\by, and
- l\blo\boc\bca\bal\bl builtin commands (_\bd_\be_\bc_\bl_\ba_\br_\ba_\bt_\bi_\bo_\bn commands). When in posix mode,
- these builtins may appear in a command after one or more instances of
+ l\blo\boc\bca\bal\bl builtin commands (_\bd_\be_\bc_\bl_\ba_\br_\ba_\bt_\bi_\bo_\bn commands). When in posix mode,
+ these builtins may appear in a command after one or more instances of
the c\bco\bom\bmm\bma\ban\bnd\bd builtin and retain these assignment statement properties.
- In the context where an assignment statement is assigning a value to a
+ In the context where an assignment statement is assigning a value to a
shell variable or array index, the += operator will append to or add to
- the variable's previous value. This includes arguments to _\bd_\be_\bc_\bl_\ba_\br_\ba_\bt_\bi_\bo_\bn
+ the variable's previous value. This includes arguments to _\bd_\be_\bc_\bl_\ba_\br_\ba_\bt_\bi_\bo_\bn
commands such as d\bde\bec\bcl\bla\bar\bre\be that accept assignment statements. When += is
applied to a variable for which the i\bin\bnt\bte\beg\bge\ber\br attribute has been set, the
variable's current value and _\bv_\ba_\bl_\bu_\be are each evaluated as arithmetic ex-
- pressions, and the sum of the results is assigned as the variable's
+ pressions, and the sum of the results is assigned as the variable's
value. The current value is usually an integer constant, but may be an
expression. When += is applied to an array variable using compound as-
- signment (see A\bAr\brr\bra\bay\bys\bs below), the variable's value is not unset (as it
+ signment (see A\bAr\brr\bra\bay\bys\bs below), the variable's value is not unset (as it
is when using =), and new values are appended to the array beginning at
- one greater than the array's maximum index (for indexed arrays) or
- added as additional key-value pairs in an associative array. When ap-
- plied to a string-valued variable, _\bv_\ba_\bl_\bu_\be is expanded and appended to
+ one greater than the array's maximum index (for indexed arrays) or
+ added as additional key-value pairs in an associative array. When ap-
+ plied to a string-valued variable, _\bv_\ba_\bl_\bu_\be is expanded and appended to
the variable's value.
A variable can be assigned the _\bn_\ba_\bm_\be_\br_\be_\bf attribute using the -\b-n\bn option to
- the d\bde\bec\bcl\bla\bar\bre\be or l\blo\boc\bca\bal\bl builtin commands (see the descriptions of d\bde\bec\bcl\bla\bar\bre\be
- and l\blo\boc\bca\bal\bl below) to create a _\bn_\ba_\bm_\be_\br_\be_\bf, or a reference to another vari-
- able. This allows variables to be manipulated indirectly. Whenever
- the nameref variable is referenced, assigned to, unset, or has its at-
- tributes modified (other than using or changing the _\bn_\ba_\bm_\be_\br_\be_\bf attribute
- itself), the operation is actually performed on the variable specified
- by the nameref variable's value. A nameref is commonly used within
+ the d\bde\bec\bcl\bla\bar\bre\be or l\blo\boc\bca\bal\bl builtin commands (see the descriptions of d\bde\bec\bcl\bla\bar\bre\be
+ and l\blo\boc\bca\bal\bl below) to create a _\bn_\ba_\bm_\be_\br_\be_\bf, or a reference to another vari-
+ able. This allows variables to be manipulated indirectly. Whenever
+ the nameref variable is referenced, assigned to, unset, or has its at-
+ tributes modified (other than using or changing the _\bn_\ba_\bm_\be_\br_\be_\bf attribute
+ itself), the operation is actually performed on the variable specified
+ by the nameref variable's value. A nameref is commonly used within
shell functions to refer to a variable whose name is passed as an argu-
- ment to the function. For instance, if a variable name is passed to a
+ ment to the function. For instance, if a variable name is passed to a
shell function as its first argument, running
declare -n ref=$1
the variable name passed as the first argument. References and assign-
ments to r\bre\bef\bf, and changes to its attributes, are treated as references,
assignments, and attribute modifications to the variable whose name was
- passed as $\b$1\b1. If the control variable in a f\bfo\bor\br loop has the nameref
- attribute, the list of words can be a list of shell variables, and a
- name reference will be established for each word in the list, in turn,
+ passed as $\b$1\b1. If the control variable in a f\bfo\bor\br loop has the nameref
+ attribute, the list of words can be a list of shell variables, and a
+ name reference will be established for each word in the list, in turn,
when the loop is executed. Array variables cannot be given the n\bna\bam\bme\ber\bre\bef\bf
- attribute. However, nameref variables can reference array variables
- and subscripted array variables. Namerefs can be unset using the -\b-n\bn
- option to the u\bun\bns\bse\bet\bt builtin. Otherwise, if u\bun\bns\bse\bet\bt is executed with the
- name of a nameref variable as an argument, the variable referenced by
+ attribute. However, nameref variables can reference array variables
+ and subscripted array variables. Namerefs can be unset using the -\b-n\bn
+ option to the u\bun\bns\bse\bet\bt builtin. Otherwise, if u\bun\bns\bse\bet\bt is executed with the
+ name of a nameref variable as an argument, the variable referenced by
the nameref variable will be unset.
P\bPo\bos\bsi\bit\bti\bio\bon\bna\bal\bl P\bPa\bar\bra\bam\bme\bet\bte\ber\brs\bs
- A _\bp_\bo_\bs_\bi_\bt_\bi_\bo_\bn_\ba_\bl _\bp_\ba_\br_\ba_\bm_\be_\bt_\be_\br is a parameter denoted by one or more digits,
+ A _\bp_\bo_\bs_\bi_\bt_\bi_\bo_\bn_\ba_\bl _\bp_\ba_\br_\ba_\bm_\be_\bt_\be_\br is a parameter denoted by one or more digits,
other than the single digit 0. Positional parameters are assigned from
- the shell's arguments when it is invoked, and may be reassigned using
- the s\bse\bet\bt builtin command. Positional parameters may not be assigned to
- with assignment statements. The positional parameters are temporarily
+ the shell's arguments when it is invoked, and may be reassigned using
+ the s\bse\bet\bt builtin command. Positional parameters may not be assigned to
+ with assignment statements. The positional parameters are temporarily
replaced when a shell function is executed (see F\bFU\bUN\bNC\bCT\bTI\bIO\bON\bNS\bS below).
- When a positional parameter consisting of more than a single digit is
+ When a positional parameter consisting of more than a single digit is
expanded, it must be enclosed in braces (see E\bEX\bXP\bPA\bAN\bNS\bSI\bIO\bON\bN below). Without
braces, a digit following $ can only refer to one of the first nine po-
- sitional parameters ($\b$1\b1-\b-$\b$9\b9) or the special parameter $\b$0\b0 (see the next
+ sitional parameters ($\b$1\b1-\b-$\b$9\b9) or the special parameter $\b$0\b0 (see the next
section).
S\bSp\bpe\bec\bci\bia\bal\bl P\bPa\bar\bra\bam\bme\bet\bte\ber\brs\bs
- The shell treats several parameters specially. These parameters may
+ The shell treats several parameters specially. These parameters may
only be referenced; assignment to them is not allowed. Special parame-
ters are denoted by one of the following characters.
- *\b* ($\b$*\b*) Expands to the positional parameters, starting from one.
- When the expansion is not within double quotes, each positional
- parameter expands to a separate word. In contexts where word
- expansions are performed, those words are subject to further
- word splitting and pathname expansion. When the expansion oc-
- curs within double quotes, it expands to a single word with the
- value of each parameter separated by the first character of the
+ *\b* ($\b$*\b*) Expands to the positional parameters, starting from one.
+ When the expansion is not within double quotes, each positional
+ parameter expands to a separate word. In contexts where word
+ expansions are performed, those words are subject to further
+ word splitting and pathname expansion. When the expansion oc-
+ curs within double quotes, it expands to a single word with the
+ value of each parameter separated by the first character of the
I\bIF\bFS\bS variable. That is, "\b"$\b$*\b*"\b" is equivalent to "\b"$\b$1\b1_\bc$\b$2\b2_\bc.\b..\b..\b."\b", where
- _\bc is the first character of the value of the I\bIF\bFS\bS variable. If
+ _\bc is the first character of the value of the I\bIF\bFS\bS variable. If
I\bIF\bFS\bS is unset, the parameters are separated by spaces. If I\bIF\bFS\bS is
null, the parameters are joined without intervening separators.
- @\b@ ($\b$@\b@) Expands to the positional parameters, starting from one.
+ @\b@ ($\b$@\b@) Expands to the positional parameters, starting from one.
In contexts where word splitting is performed, this expands each
- positional parameter to a separate word; if not within double
- quotes, these words are subject to word splitting. In contexts
+ positional parameter to a separate word; if not within double
+ quotes, these words are subject to word splitting. In contexts
where word splitting is not performed, such as the value portion
- of an assignment statement, this expands to a single word with
+ of an assignment statement, this expands to a single word with
each positional parameter separated by a space. When the expan-
- sion occurs within double quotes, and word splitting is per-
- formed, each parameter expands to a separate word. That is,
+ sion occurs within double quotes, and word splitting is per-
+ formed, each parameter expands to a separate word. That is,
"\b"$\b$@\b@"\b" is equivalent to "\b"$\b$1\b1"\b" "\b"$\b$2\b2"\b" .\b..\b..\b. If the double-quoted expan-
- sion occurs within a word, the expansion of the first parameter
+ sion occurs within a word, the expansion of the first parameter
is joined with the expansion of the beginning part of the origi-
nal word, and the expansion of the last parameter is joined with
the expansion of the last part of the original word. When there
- are no positional parameters, "\b"$\b$@\b@"\b" and $\b$@\b@ expand to nothing
+ are no positional parameters, "\b"$\b$@\b@"\b" and $\b$@\b@ expand to nothing
(i.e., they are removed).
#\b# ($\b$#\b#) Expands to the number of positional parameters in decimal.
- ?\b? ($\b$?\b?) Expands to the exit status of the most recently executed
+ ?\b? ($\b$?\b?) Expands to the exit status of the most recently executed
command.
-\b- ($\b$-\b-) Expands to the current option flags as specified upon invo-
- cation, by the s\bse\bet\bt builtin command, or those set by the shell
+ cation, by the s\bse\bet\bt builtin command, or those set by the shell
itself (such as the -\b-i\bi option).
- $\b$ ($\b$$\b$) Expands to the process ID of the shell. In a subshell, it
+ $\b$ ($\b$$\b$) Expands to the process ID of the shell. In a subshell, it
expands to the process ID of the parent shell, not the subshell.
- !\b! ($\b$!\b!)Expands to the process ID of the job most recently placed
+ !\b! ($\b$!\b!)Expands to the process ID of the job most recently placed
into the background, whether executed as an asynchronous command
or using the b\bbg\bg builtin (see J\bJO\bOB\bB C\bCO\bON\bNT\bTR\bRO\bOL\bL below).
- 0\b0 ($\b$0\b0) Expands to the name of the shell or shell script. This is
- set at shell initialization. If b\bba\bas\bsh\bh is invoked with a file of
- commands, $\b$0\b0 is set to the name of that file. If b\bba\bas\bsh\bh is
+ 0\b0 ($\b$0\b0) Expands to the name of the shell or shell script. This is
+ set at shell initialization. If b\bba\bas\bsh\bh is invoked with a file of
+ commands, $\b$0\b0 is set to the name of that file. If b\bba\bas\bsh\bh is
started with the -\b-c\bc option, then $\b$0\b0 is set to the first argument
- after the string to be executed, if one is present. Otherwise,
+ after the string to be executed, if one is present. Otherwise,
it is set to the filename used to invoke b\bba\bas\bsh\bh, as given by argu-
ment zero.
S\bSh\bhe\bel\bll\bl V\bVa\bar\bri\bia\bab\bbl\ble\bes\bs
The shell sets following variables:
- _\b_ ($\b$_\b_, an underscore) This has a number of meanings depending on
+ _\b_ ($\b$_\b_, an underscore) This has a number of meanings depending on
context. At shell startup, _\b_ is set to the pathname used to in-
- voke the shell or shell script being executed as passed in the
- environment or argument list. Subsequently, it expands to the
- last argument to the previous simple command executed in the
- foreground, after expansion. It is also set to the full path-
- name used to invoke each command executed and placed in the en-
- vironment exported to that command. When checking mail, $\b$_\b_ ex-
+ voke the shell or shell script being executed as passed in the
+ environment or argument list. Subsequently, it expands to the
+ last argument to the previous simple command executed in the
+ foreground, after expansion. It is also set to the full path-
+ name used to invoke each command executed and placed in the en-
+ vironment exported to that command. When checking mail, $\b$_\b_ ex-
pands to the name of the mail file currently being checked.
- B\bBA\bAS\bSH\bH Expands to the full filename used to invoke this instance of
+ B\bBA\bAS\bSH\bH Expands to the full filename used to invoke this instance of
b\bba\bas\bsh\bh.
B\bBA\bAS\bSH\bHO\bOP\bPT\bTS\bS
- A colon-separated list of enabled shell options. Each word in
- the list is a valid argument for the -\b-s\bs option to the s\bsh\bho\bop\bpt\bt
+ A colon-separated list of enabled shell options. Each word in
+ the list is a valid argument for the -\b-s\bs option to the s\bsh\bho\bop\bpt\bt
builtin command (see S\bSH\bHE\bEL\bLL\bL B\bBU\bUI\bIL\bLT\bTI\bIN\bN C\bCO\bOM\bMM\bMA\bAN\bND\bDS\bS below). The options
- appearing in B\bBA\bAS\bSH\bHO\bOP\bPT\bTS\bS are those reported as _\bo_\bn by s\bsh\bho\bop\bpt\bt. If
- this variable is in the environment when b\bba\bas\bsh\bh starts up, the
+ appearing in B\bBA\bAS\bSH\bHO\bOP\bPT\bTS\bS are those reported as _\bo_\bn by s\bsh\bho\bop\bpt\bt. If
+ this variable is in the environment when b\bba\bas\bsh\bh starts up, the
shell enables each option in the list before reading any startup
files. This variable is read-only.
B\bBA\bAS\bSH\bHP\bPI\bID\bD
- Expands to the process ID of the current b\bba\bas\bsh\bh process. This
- differs from $\b$$\b$ under certain circumstances, such as subshells
- that do not require b\bba\bas\bsh\bh to be re-initialized. Assignments to
- B\bBA\bAS\bSH\bHP\bPI\bID\bD have no effect. If B\bBA\bAS\bSH\bHP\bPI\bID\bD is unset, it loses its spe-
+ Expands to the process ID of the current b\bba\bas\bsh\bh process. This
+ differs from $\b$$\b$ under certain circumstances, such as subshells
+ that do not require b\bba\bas\bsh\bh to be re-initialized. Assignments to
+ B\bBA\bAS\bSH\bHP\bPI\bID\bD have no effect. If B\bBA\bAS\bSH\bHP\bPI\bID\bD is unset, it loses its spe-
cial properties, even if it is subsequently reset.
B\bBA\bAS\bSH\bH_\b_A\bAL\bLI\bIA\bAS\bSE\bES\bS
- An associative array variable whose members correspond to the
- internal list of aliases as maintained by the a\bal\bli\bia\bas\bs builtin.
- Elements added to this array appear in the alias list; however,
- unsetting array elements currently does not remove aliases from
- the alias list. If B\bBA\bAS\bSH\bH_\b_A\bAL\bLI\bIA\bAS\bSE\bES\bS is unset, it loses its special
+ An associative array variable whose members correspond to the
+ internal list of aliases as maintained by the a\bal\bli\bia\bas\bs builtin.
+ Elements added to this array appear in the alias list; however,
+ unsetting array elements currently does not remove aliases from
+ the alias list. If B\bBA\bAS\bSH\bH_\b_A\bAL\bLI\bIA\bAS\bSE\bES\bS is unset, it loses its special
properties, even if it is subsequently reset.
B\bBA\bAS\bSH\bH_\b_A\bAR\bRG\bGC\bC
- An array variable whose values are the number of parameters in
+ An array variable whose values are the number of parameters in
each frame of the current b\bba\bas\bsh\bh execution call stack. The number
- of parameters to the current subroutine (shell function or
- script executed with .\b. or s\bso\bou\bur\brc\bce\be) is at the top of the stack.
- When a subroutine is executed, the number of parameters passed
+ of parameters to the current subroutine (shell function or
+ script executed with .\b. or s\bso\bou\bur\brc\bce\be) is at the top of the stack.
+ When a subroutine is executed, the number of parameters passed
is pushed onto B\bBA\bAS\bSH\bH_\b_A\bAR\bRG\bGC\bC. The shell sets B\bBA\bAS\bSH\bH_\b_A\bAR\bRG\bGC\bC only when in
extended debugging mode (see the description of the e\bex\bxt\btd\bde\beb\bbu\bug\bg op-
- tion to the s\bsh\bho\bop\bpt\bt builtin below). Setting e\bex\bxt\btd\bde\beb\bbu\bug\bg after the
+ tion to the s\bsh\bho\bop\bpt\bt builtin below). Setting e\bex\bxt\btd\bde\beb\bbu\bug\bg after the
shell has started to execute a script, or referencing this vari-
- able when e\bex\bxt\btd\bde\beb\bbu\bug\bg is not set, may result in inconsistent val-
+ able when e\bex\bxt\btd\bde\beb\bbu\bug\bg is not set, may result in inconsistent val-
ues. Assignments to B\bBA\bAS\bSH\bH_\b_A\bAR\bRG\bGC\bC have no effect, and it may not be
unset.
B\bBA\bAS\bSH\bH_\b_A\bAR\bRG\bGV\bV
- An array variable containing all of the parameters in the cur-
+ An array variable containing all of the parameters in the cur-
rent b\bba\bas\bsh\bh execution call stack. The final parameter of the last
- subroutine call is at the top of the stack; the first parameter
+ subroutine call is at the top of the stack; the first parameter
of the initial call is at the bottom. When a subroutine is exe-
- cuted, the shell pushes the supplied parameters onto B\bBA\bAS\bSH\bH_\b_A\bAR\bRG\bGV\bV.
- The shell sets B\bBA\bAS\bSH\bH_\b_A\bAR\bRG\bGV\bV only when in extended debugging mode
+ cuted, the shell pushes the supplied parameters onto B\bBA\bAS\bSH\bH_\b_A\bAR\bRG\bGV\bV.
+ The shell sets B\bBA\bAS\bSH\bH_\b_A\bAR\bRG\bGV\bV only when in extended debugging mode
(see the description of the e\bex\bxt\btd\bde\beb\bbu\bug\bg option to the s\bsh\bho\bop\bpt\bt builtin
below). Setting e\bex\bxt\btd\bde\beb\bbu\bug\bg after the shell has started to execute
a script, or referencing this variable when e\bex\bxt\btd\bde\beb\bbu\bug\bg is not set,
- may result in inconsistent values. Assignments to B\bBA\bAS\bSH\bH_\b_A\bAR\bRG\bGV\bV
+ may result in inconsistent values. Assignments to B\bBA\bAS\bSH\bH_\b_A\bAR\bRG\bGV\bV
have no effect, and it may not be unset.
B\bBA\bAS\bSH\bH_\b_A\bAR\bRG\bGV\bV0\b0
- When referenced, this variable expands to the name of the shell
+ When referenced, this variable expands to the name of the shell
or shell script (identical to $\b$0\b0; see the description of special
parameter 0 above). Assigning a value to B\bBA\bAS\bSH\bH_\b_A\bAR\bRG\bGV\bV0\b0 assigns the
- same value to $\b$0\b0. If B\bBA\bAS\bSH\bH_\b_A\bAR\bRG\bGV\bV0\b0 is unset, it loses its special
+ same value to $\b$0\b0. If B\bBA\bAS\bSH\bH_\b_A\bAR\bRG\bGV\bV0\b0 is unset, it loses its special
properties, even if it is subsequently reset.
B\bBA\bAS\bSH\bH_\b_C\bCM\bMD\bDS\bS
- An associative array variable whose members correspond to the
- internal hash table of commands as maintained by the h\bha\bas\bsh\bh
+ An associative array variable whose members correspond to the
+ internal hash table of commands as maintained by the h\bha\bas\bsh\bh
builtin. Adding elements to this array makes them appear in the
hash table; however, unsetting array elements currently does not
- remove command names from the hash table. If B\bBA\bAS\bSH\bH_\b_C\bCM\bMD\bDS\bS is un-
+ remove command names from the hash table. If B\bBA\bAS\bSH\bH_\b_C\bCM\bMD\bDS\bS is un-
set, it loses its special properties, even if it is subsequently
reset.
B\bBA\bAS\bSH\bH_\b_C\bCO\bOM\bMM\bMA\bAN\bND\bD
- Expands to the command currently being executed or about to be
- executed, unless the shell is executing a command as the result
+ Expands to the command currently being executed or about to be
+ executed, unless the shell is executing a command as the result
of a trap, in which case it is the command executing at the time
- of the trap. If B\bBA\bAS\bSH\bH_\b_C\bCO\bOM\bMM\bMA\bAN\bND\bD is unset, it loses its special
+ of the trap. If B\bBA\bAS\bSH\bH_\b_C\bCO\bOM\bMM\bMA\bAN\bND\bD is unset, it loses its special
properties, even if it is subsequently reset.
B\bBA\bAS\bSH\bH_\b_E\bEX\bXE\bEC\bCU\bUT\bTI\bIO\bON\bN_\b_S\bST\bTR\bRI\bIN\bNG\bG
The command argument to the -\b-c\bc invocation option.
B\bBA\bAS\bSH\bH_\b_L\bLI\bIN\bNE\bEN\bNO\bO
- An array variable whose members are the line numbers in source
- files where each corresponding member of F\bFU\bUN\bNC\bCN\bNA\bAM\bME\bE was invoked.
+ An array variable whose members are the line numbers in source
+ files where each corresponding member of F\bFU\bUN\bNC\bCN\bNA\bAM\bME\bE was invoked.
$\b${\b{B\bBA\bAS\bSH\bH_\b_L\bLI\bIN\bNE\bEN\bNO\bO[\b[_\b$_\bi]\b]}\b} is the line number in the source file
($\b${\b{B\bBA\bAS\bSH\bH_\b_S\bSO\bOU\bUR\bRC\bCE\bE[\b[_\b$_\bi_\b+_\b1]\b]}\b}) where $\b${\b{F\bFU\bUN\bNC\bCN\bNA\bAM\bME\bE[\b[_\b$_\bi]\b]}\b} was called (or
- $\b${\b{B\bBA\bAS\bSH\bH_\b_L\bLI\bIN\bNE\bEN\bNO\bO[\b[_\b$_\bi_\b-_\b1]\b]}\b} if referenced within another shell func-
- tion). Use L\bLI\bIN\bNE\bEN\bNO\bO to obtain the current line number. Assign-
+ $\b${\b{B\bBA\bAS\bSH\bH_\b_L\bLI\bIN\bNE\bEN\bNO\bO[\b[_\b$_\bi_\b-_\b1]\b]}\b} if referenced within another shell func-
+ tion). Use L\bLI\bIN\bNE\bEN\bNO\bO to obtain the current line number. Assign-
ments to B\bBA\bAS\bSH\bH_\b_L\bLI\bIN\bNE\bEN\bNO\bO have no effect, and it may not be unset.
B\bBA\bAS\bSH\bH_\b_L\bLO\bOA\bAD\bDA\bAB\bBL\bLE\bES\bS_\b_P\bPA\bAT\bTH\bH
- A colon-separated list of directories in which the e\ben\bna\bab\bbl\ble\be com-
+ A colon-separated list of directories in which the e\ben\bna\bab\bbl\ble\be com-
mand. looks for dynamically loadable builtins.
B\bBA\bAS\bSH\bH_\b_M\bMO\bON\bNO\bOS\bSE\bEC\bCO\bON\bND\bDS\bS
- Each time this variable is referenced, it expands to the value
- returned by the system's monotonic clock, if one is available.
- If there is no monotonic clock, this is equivalent to E\bEP\bPO\bOC\bCH\bHS\bSE\bEC\bC-\b-
- O\bON\bND\bDS\bS. If B\bBA\bAS\bSH\bH_\b_M\bMO\bON\bNO\bOS\bSE\bEC\bCO\bON\bND\bDS\bS is unset, it loses its special prop-
+ Each time this variable is referenced, it expands to the value
+ returned by the system's monotonic clock, if one is available.
+ If there is no monotonic clock, this is equivalent to E\bEP\bPO\bOC\bCH\bHS\bSE\bEC\bC-\b-
+ O\bON\bND\bDS\bS. If B\bBA\bAS\bSH\bH_\b_M\bMO\bON\bNO\bOS\bSE\bEC\bCO\bON\bND\bDS\bS is unset, it loses its special prop-
erties, even if it is subsequently reset.
B\bBA\bAS\bSH\bH_\b_R\bRE\bEM\bMA\bAT\bTC\bCH\bH
- An array variable whose members are assigned by the =\b=~\b~ binary
- operator to the [\b[[\b[ conditional command. The element with index
- 0 is the portion of the string matching the entire regular ex-
+ An array variable whose members are assigned by the =\b=~\b~ binary
+ operator to the [\b[[\b[ conditional command. The element with index
+ 0 is the portion of the string matching the entire regular ex-
pression. The element with index _\bn is the portion of the string
matching the _\bnth parenthesized subexpression.
B\bBA\bAS\bSH\bH_\b_S\bSO\bOU\bUR\bRC\bCE\bE
- An array variable whose members are the source filenames where
- the corresponding shell function names in the F\bFU\bUN\bNC\bCN\bNA\bAM\bME\bE array
+ An array variable whose members are the source filenames where
+ the corresponding shell function names in the F\bFU\bUN\bNC\bCN\bNA\bAM\bME\bE array
variable are defined. The shell function $\b${\b{F\bFU\bUN\bNC\bCN\bNA\bAM\bME\bE[\b[_\b$_\bi]\b]}\b} is de-
- fined in the file $\b${\b{B\bBA\bAS\bSH\bH_\b_S\bSO\bOU\bUR\bRC\bCE\bE[\b[_\b$_\bi]\b]}\b} and called from
- $\b${\b{B\bBA\bAS\bSH\bH_\b_S\bSO\bOU\bUR\bRC\bCE\bE[\b[_\b$_\bi_\b+_\b1]\b]}\b}. Assignments to B\bBA\bAS\bSH\bH_\b_S\bSO\bOU\bUR\bRC\bCE\bE have no ef-
+ fined in the file $\b${\b{B\bBA\bAS\bSH\bH_\b_S\bSO\bOU\bUR\bRC\bCE\bE[\b[_\b$_\bi]\b]}\b} and called from
+ $\b${\b{B\bBA\bAS\bSH\bH_\b_S\bSO\bOU\bUR\bRC\bCE\bE[\b[_\b$_\bi_\b+_\b1]\b]}\b}. Assignments to B\bBA\bAS\bSH\bH_\b_S\bSO\bOU\bUR\bRC\bCE\bE have no ef-
fect, and it may not be unset.
B\bBA\bAS\bSH\bH_\b_S\bSU\bUB\bBS\bSH\bHE\bEL\bLL\bL
- Incremented by one within each subshell or subshell environment
- when the shell begins executing in that environment. The ini-
- tial value is 0. If B\bBA\bAS\bSH\bH_\b_S\bSU\bUB\bBS\bSH\bHE\bEL\bLL\bL is unset, it loses its spe-
+ Incremented by one within each subshell or subshell environment
+ when the shell begins executing in that environment. The ini-
+ tial value is 0. If B\bBA\bAS\bSH\bH_\b_S\bSU\bUB\bBS\bSH\bHE\bEL\bLL\bL is unset, it loses its spe-
cial properties, even if it is subsequently reset.
B\bBA\bAS\bSH\bH_\b_T\bTR\bRA\bAP\bPS\bSI\bIG\bG
- Set to the signal number corresponding to the trap action being
- executed during its execution. See the description of t\btr\bra\bap\bp un-
- der S\bSH\bHE\bEL\bLL\bL B\bBU\bUI\bIL\bLT\bTI\bIN\bN C\bCO\bOM\bMM\bMA\bAN\bND\bDS\bS below for information about signal
+ Set to the signal number corresponding to the trap action being
+ executed during its execution. See the description of t\btr\bra\bap\bp un-
+ der S\bSH\bHE\bEL\bLL\bL B\bBU\bUI\bIL\bLT\bTI\bIN\bN C\bCO\bOM\bMM\bMA\bAN\bND\bDS\bS below for information about signal
numbers and trap execution.
B\bBA\bAS\bSH\bH_\b_V\bVE\bER\bRS\bSI\bIN\bNF\bFO\bO
A readonly array variable whose members hold version information
- for this instance of b\bba\bas\bsh\bh. The values assigned to the array
+ for this instance of b\bba\bas\bsh\bh. The values assigned to the array
members are as follows:
B\bBA\bAS\bSH\bH_\b_V\bVE\bER\bRS\bSI\bIN\bNF\bFO\bO[\b[0]\b] The major version number (the _\br_\be_\bl_\be_\ba_\bs_\be).
B\bBA\bAS\bSH\bH_\b_V\bVE\bER\bRS\bSI\bIN\bNF\bFO\bO[\b[1]\b] The minor version number (the _\bv_\be_\br_\bs_\bi_\bo_\bn).
B\bBA\bAS\bSH\bH_\b_V\bVE\bER\bRS\bSI\bIN\bNF\bFO\bO[\b[4]\b] The release status (e.g., _\bb_\be_\bt_\ba).
B\bBA\bAS\bSH\bH_\b_V\bVE\bER\bRS\bSI\bIN\bNF\bFO\bO[\b[5]\b] The value of M\bMA\bAC\bCH\bHT\bTY\bYP\bPE\bE.
B\bBA\bAS\bSH\bH_\b_V\bVE\bER\bRS\bSI\bIO\bON\bN
- Expands to a string describing the version of this instance of
+ Expands to a string describing the version of this instance of
b\bba\bas\bsh\bh (e.g., 5.2.37(3)-release).
C\bCO\bOM\bMP\bP_\b_C\bCW\bWO\bOR\bRD\bD
- An index into $\b${\b{C\bCO\bOM\bMP\bP_\b_W\bWO\bOR\bRD\bDS\bS}\b} of the word containing the current
+ An index into $\b${\b{C\bCO\bOM\bMP\bP_\b_W\bWO\bOR\bRD\bDS\bS}\b} of the word containing the current
cursor position. This variable is available only in shell func-
- tions invoked by the programmable completion facilities (see
+ tions invoked by the programmable completion facilities (see
P\bPr\bro\bog\bgr\bra\bam\bmm\bma\bab\bbl\ble\be C\bCo\bom\bmp\bpl\ble\bet\bti\bio\bon\bn below).
C\bCO\bOM\bMP\bP_\b_K\bKE\bEY\bY
The key (or final key of a key sequence) used to invoke the cur-
- rent completion function. This variable is available only in
- shell functions and external commands invoked by the programma-
+ rent completion function. This variable is available only in
+ shell functions and external commands invoked by the programma-
ble completion facilities (see P\bPr\bro\bog\bgr\bra\bam\bmm\bma\bab\bbl\ble\be C\bCo\bom\bmp\bpl\ble\bet\bti\bio\bon\bn below).
C\bCO\bOM\bMP\bP_\b_L\bLI\bIN\bNE\bE
- The current command line. This variable is available only in
- shell functions and external commands invoked by the programma-
+ The current command line. This variable is available only in
+ shell functions and external commands invoked by the programma-
ble completion facilities (see P\bPr\bro\bog\bgr\bra\bam\bmm\bma\bab\bbl\ble\be C\bCo\bom\bmp\bpl\ble\bet\bti\bio\bon\bn below).
C\bCO\bOM\bMP\bP_\b_P\bPO\bOI\bIN\bNT\bT
- The index of the current cursor position relative to the begin-
- ning of the current command. If the current cursor position is
+ The index of the current cursor position relative to the begin-
+ ning of the current command. If the current cursor position is
at the end of the current command, the value of this variable is
- equal to $\b${\b{#\b#C\bCO\bOM\bMP\bP_\b_L\bLI\bIN\bNE\bE}\b}. This variable is available only in
- shell functions and external commands invoked by the programma-
+ equal to $\b${\b{#\b#C\bCO\bOM\bMP\bP_\b_L\bLI\bIN\bNE\bE}\b}. This variable is available only in
+ shell functions and external commands invoked by the programma-
ble completion facilities (see P\bPr\bro\bog\bgr\bra\bam\bmm\bma\bab\bbl\ble\be C\bCo\bom\bmp\bpl\ble\bet\bti\bio\bon\bn below).
C\bCO\bOM\bMP\bP_\b_T\bTY\bYP\bPE\bE
- Set to an integer value corresponding to the type of attempted
- completion that caused a completion function to be called: _\bT_\bA_\bB,
- for normal completion, _\b?, for listing completions after succes-
- sive tabs, _\b!, for listing alternatives on partial word comple-
- tion, _\b@, to list completions if the word is not unmodified, or
- _\b%, for menu completion. This variable is available only in
- shell functions and external commands invoked by the programma-
+ Set to an integer value corresponding to the type of attempted
+ completion that caused a completion function to be called: _\bT_\bA_\bB,
+ for normal completion, _\b?, for listing completions after succes-
+ sive tabs, _\b!, for listing alternatives on partial word comple-
+ tion, _\b@, to list completions if the word is not unmodified, or
+ _\b%, for menu completion. This variable is available only in
+ shell functions and external commands invoked by the programma-
ble completion facilities (see P\bPr\bro\bog\bgr\bra\bam\bmm\bma\bab\bbl\ble\be C\bCo\bom\bmp\bpl\ble\bet\bti\bio\bon\bn below).
C\bCO\bOM\bMP\bP_\b_W\bWO\bOR\bRD\bDB\bBR\bRE\bEA\bAK\bKS\bS
- The set of characters that the r\bre\bea\bad\bdl\bli\bin\bne\be library treats as word
- separators when performing word completion. If C\bCO\bOM\bMP\bP_\b_W\bWO\bOR\bRD\bDB\bBR\bRE\bEA\bAK\bKS\bS
- is unset, it loses its special properties, even if it is subse-
+ The set of characters that the r\bre\bea\bad\bdl\bli\bin\bne\be library treats as word
+ separators when performing word completion. If C\bCO\bOM\bMP\bP_\b_W\bWO\bOR\bRD\bDB\bBR\bRE\bEA\bAK\bKS\bS
+ is unset, it loses its special properties, even if it is subse-
quently reset.
C\bCO\bOM\bMP\bP_\b_W\bWO\bOR\bRD\bDS\bS
- An array variable (see A\bAr\brr\bra\bay\bys\bs below) consisting of the individ-
- ual words in the current command line. The line is split into
- words as r\bre\bea\bad\bdl\bli\bin\bne\be would split it, using C\bCO\bOM\bMP\bP_\b_W\bWO\bOR\bRD\bDB\bBR\bRE\bEA\bAK\bKS\bS as de-
- scribed above. This variable is available only in shell func-
- tions invoked by the programmable completion facilities (see
+ An array variable (see A\bAr\brr\bra\bay\bys\bs below) consisting of the individ-
+ ual words in the current command line. The line is split into
+ words as r\bre\bea\bad\bdl\bli\bin\bne\be would split it, using C\bCO\bOM\bMP\bP_\b_W\bWO\bOR\bRD\bDB\bBR\bRE\bEA\bAK\bKS\bS as de-
+ scribed above. This variable is available only in shell func-
+ tions invoked by the programmable completion facilities (see
P\bPr\bro\bog\bgr\bra\bam\bmm\bma\bab\bbl\ble\be C\bCo\bom\bmp\bpl\ble\bet\bti\bio\bon\bn below).
- C\bCO\bOP\bPR\bRO\bOC\bC An array variable (see A\bAr\brr\bra\bay\bys\bs below) created to hold the file
- descriptors for output from and input to an unnamed coprocess
+ C\bCO\bOP\bPR\bRO\bOC\bC An array variable (see A\bAr\brr\bra\bay\bys\bs below) created to hold the file
+ descriptors for output from and input to an unnamed coprocess
(see C\bCo\bop\bpr\bro\boc\bce\bes\bss\bse\bes\bs above).
D\bDI\bIR\bRS\bST\bTA\bAC\bCK\bK
An array variable (see A\bAr\brr\bra\bay\bys\bs below) containing the current con-
- tents of the directory stack. Directories appear in the stack
- in the order they are displayed by the d\bdi\bir\brs\bs builtin. Assigning
+ tents of the directory stack. Directories appear in the stack
+ in the order they are displayed by the d\bdi\bir\brs\bs builtin. Assigning
to members of this array variable may be used to modify directo-
- ries already in the stack, but the p\bpu\bus\bsh\bhd\bd and p\bpo\bop\bpd\bd builtins must
+ ries already in the stack, but the p\bpu\bus\bsh\bhd\bd and p\bpo\bop\bpd\bd builtins must
be used to add and remove directories. Assignment to this vari-
- able will not change the current directory. If D\bDI\bIR\bRS\bST\bTA\bAC\bCK\bK is un-
+ able will not change the current directory. If D\bDI\bIR\bRS\bST\bTA\bAC\bCK\bK is un-
set, it loses its special properties, even if it is subsequently
reset.
E\bEP\bPO\bOC\bCH\bHR\bRE\bEA\bAL\bLT\bTI\bIM\bME\bE
Each time this parameter is referenced, it expands to the number
- of seconds since the Unix Epoch (see _\bt_\bi_\bm_\be(3)) as a floating-
+ of seconds since the Unix Epoch (see _\bt_\bi_\bm_\be(3)) as a floating-
point value with micro-second granularity. Assignments to
- E\bEP\bPO\bOC\bCH\bHR\bRE\bEA\bAL\bLT\bTI\bIM\bME\bE are ignored. If E\bEP\bPO\bOC\bCH\bHR\bRE\bEA\bAL\bLT\bTI\bIM\bME\bE is unset, it loses
+ E\bEP\bPO\bOC\bCH\bHR\bRE\bEA\bAL\bLT\bTI\bIM\bME\bE are ignored. If E\bEP\bPO\bOC\bCH\bHR\bRE\bEA\bAL\bLT\bTI\bIM\bME\bE is unset, it loses
its special properties, even if it is subsequently reset.
E\bEP\bPO\bOC\bCH\bHS\bSE\bEC\bCO\bON\bND\bDS\bS
Each time this parameter is referenced, it expands to the number
- of seconds since the Unix Epoch (see _\bt_\bi_\bm_\be(3)). Assignments to
- E\bEP\bPO\bOC\bCH\bHS\bSE\bEC\bCO\bON\bND\bDS\bS are ignored. If E\bEP\bPO\bOC\bCH\bHS\bSE\bEC\bCO\bON\bND\bDS\bS is unset, it loses
+ of seconds since the Unix Epoch (see _\bt_\bi_\bm_\be(3)). Assignments to
+ E\bEP\bPO\bOC\bCH\bHS\bSE\bEC\bCO\bON\bND\bDS\bS are ignored. If E\bEP\bPO\bOC\bCH\bHS\bSE\bEC\bCO\bON\bND\bDS\bS is unset, it loses
its special properties, even if it is subsequently reset.
- E\bEU\bUI\bID\bD Expands to the effective user ID of the current user, initial-
+ E\bEU\bUI\bID\bD Expands to the effective user ID of the current user, initial-
ized at shell startup. This variable is readonly.
F\bFU\bUN\bNC\bCN\bNA\bAM\bME\bE
- An array variable containing the names of all shell functions
+ An array variable containing the names of all shell functions
currently in the execution call stack. The element with index 0
is the name of any currently-executing shell function. The bot-
- tom-most element (the one with the highest index) is "main".
- This variable exists only when a shell function is executing.
- Assignments to F\bFU\bUN\bNC\bCN\bNA\bAM\bME\bE have no effect. If F\bFU\bUN\bNC\bCN\bNA\bAM\bME\bE is unset,
- it loses its special properties, even if it is subsequently re-
+ tom-most element (the one with the highest index) is "main".
+ This variable exists only when a shell function is executing.
+ Assignments to F\bFU\bUN\bNC\bCN\bNA\bAM\bME\bE have no effect. If F\bFU\bUN\bNC\bCN\bNA\bAM\bME\bE is unset,
+ it loses its special properties, even if it is subsequently re-
set.
- This variable can be used with B\bBA\bAS\bSH\bH_\b_L\bLI\bIN\bNE\bEN\bNO\bO and B\bBA\bAS\bSH\bH_\b_S\bSO\bOU\bUR\bRC\bCE\bE.
- Each element of F\bFU\bUN\bNC\bCN\bNA\bAM\bME\bE has corresponding elements in
+ This variable can be used with B\bBA\bAS\bSH\bH_\b_L\bLI\bIN\bNE\bEN\bNO\bO and B\bBA\bAS\bSH\bH_\b_S\bSO\bOU\bUR\bRC\bCE\bE.
+ Each element of F\bFU\bUN\bNC\bCN\bNA\bAM\bME\bE has corresponding elements in
B\bBA\bAS\bSH\bH_\b_L\bLI\bIN\bNE\bEN\bNO\bO and B\bBA\bAS\bSH\bH_\b_S\bSO\bOU\bUR\bRC\bCE\bE to describe the call stack. For in-
- stance, $\b${\b{F\bFU\bUN\bNC\bCN\bNA\bAM\bME\bE[\b[_\b$_\bi]\b]}\b} was called from the file
- $\b${\b{B\bBA\bAS\bSH\bH_\b_S\bSO\bOU\bUR\bRC\bCE\bE[\b[_\b$_\bi_\b+_\b1]\b]}\b} at line number $\b${\b{B\bBA\bAS\bSH\bH_\b_L\bLI\bIN\bNE\bEN\bNO\bO[\b[_\b$_\bi]\b]}\b}. The
+ stance, $\b${\b{F\bFU\bUN\bNC\bCN\bNA\bAM\bME\bE[\b[_\b$_\bi]\b]}\b} was called from the file
+ $\b${\b{B\bBA\bAS\bSH\bH_\b_S\bSO\bOU\bUR\bRC\bCE\bE[\b[_\b$_\bi_\b+_\b1]\b]}\b} at line number $\b${\b{B\bBA\bAS\bSH\bH_\b_L\bLI\bIN\bNE\bEN\bNO\bO[\b[_\b$_\bi]\b]}\b}. The
c\bca\bal\bll\ble\ber\br builtin displays the current call stack using this infor-
mation.
- G\bGR\bRO\bOU\bUP\bPS\bS An array variable containing the list of groups of which the
+ G\bGR\bRO\bOU\bUP\bPS\bS An array variable containing the list of groups of which the
current user is a member. Assignments to G\bGR\bRO\bOU\bUP\bPS\bS have no effect.
- If G\bGR\bRO\bOU\bUP\bPS\bS is unset, it loses its special properties, even if it
+ If G\bGR\bRO\bOU\bUP\bPS\bS is unset, it loses its special properties, even if it
is subsequently reset.
H\bHI\bIS\bST\bTC\bCM\bMD\bD
The history number, or index in the history list, of the current
H\bHO\bOS\bST\bTN\bNA\bAM\bME\bE
Automatically set to the name of the current host.
H\bHO\bOS\bST\bTT\bTY\bYP\bPE\bE
- Automatically set to a string that uniquely describes the type
- of machine on which b\bba\bas\bsh\bh is executing. The default is system-
+ Automatically set to a string that uniquely describes the type
+ of machine on which b\bba\bas\bsh\bh is executing. The default is system-
dependent.
- L\bLI\bIN\bNE\bEN\bNO\bO Each time this parameter is referenced, the shell substitutes a
- decimal number representing the current sequential line number
- (starting with 1) within a script or function. When not in a
- script or function, the value substituted is not guaranteed to
+ L\bLI\bIN\bNE\bEN\bNO\bO Each time this parameter is referenced, the shell substitutes a
+ decimal number representing the current sequential line number
+ (starting with 1) within a script or function. When not in a
+ script or function, the value substituted is not guaranteed to
be meaningful. If L\bLI\bIN\bNE\bEN\bNO\bO is unset, it loses its special proper-
ties, even if it is subsequently reset.
M\bMA\bAC\bCH\bHT\bTY\bYP\bPE\bE
- Automatically set to a string that fully describes the system
- type on which b\bba\bas\bsh\bh is executing, in the standard GNU _\bc_\bp_\bu_\b-_\bc_\bo_\bm_\b-
+ Automatically set to a string that fully describes the system
+ type on which b\bba\bas\bsh\bh is executing, in the standard GNU _\bc_\bp_\bu_\b-_\bc_\bo_\bm_\b-
_\bp_\ba_\bn_\by_\b-_\bs_\by_\bs_\bt_\be_\bm format. The default is system-dependent.
M\bMA\bAP\bPF\bFI\bIL\bLE\bE
- An array variable (see A\bAr\brr\bra\bay\bys\bs below) created to hold the text
+ An array variable (see A\bAr\brr\bra\bay\bys\bs below) created to hold the text
read by the m\bma\bap\bpf\bfi\bil\ble\be builtin when no variable name is supplied.
O\bOL\bLD\bDP\bPW\bWD\bD The previous working directory as set by the c\bcd\bd command.
- O\bOP\bPT\bTA\bAR\bRG\bG The value of the last option argument processed by the g\bge\bet\bto\bop\bpt\bts\bs
+ O\bOP\bPT\bTA\bAR\bRG\bG The value of the last option argument processed by the g\bge\bet\bto\bop\bpt\bts\bs
builtin command (see S\bSH\bHE\bEL\bLL\bL B\bBU\bUI\bIL\bLT\bTI\bIN\bN C\bCO\bOM\bMM\bMA\bAN\bND\bDS\bS below).
- O\bOP\bPT\bTI\bIN\bND\bD The index of the next argument to be processed by the g\bge\bet\bto\bop\bpt\bts\bs
+ O\bOP\bPT\bTI\bIN\bND\bD The index of the next argument to be processed by the g\bge\bet\bto\bop\bpt\bts\bs
builtin command (see S\bSH\bHE\bEL\bLL\bL B\bBU\bUI\bIL\bLT\bTI\bIN\bN C\bCO\bOM\bMM\bMA\bAN\bND\bDS\bS below).
- O\bOS\bST\bTY\bYP\bPE\bE Automatically set to a string that describes the operating sys-
- tem on which b\bba\bas\bsh\bh is executing. The default is system-depen-
+ O\bOS\bST\bTY\bYP\bPE\bE Automatically set to a string that describes the operating sys-
+ tem on which b\bba\bas\bsh\bh is executing. The default is system-depen-
dent.
P\bPI\bIP\bPE\bES\bST\bTA\bAT\bTU\bUS\bS
- An array variable (see A\bAr\brr\bra\bay\bys\bs below) containing a list of exit
- status values from the processes in the most-recently-executed
- foreground pipeline, which may consist of only a simple command
+ An array variable (see A\bAr\brr\bra\bay\bys\bs below) containing a list of exit
+ status values from the processes in the most-recently-executed
+ foreground pipeline, which may consist of only a simple command
(see S\bSH\bHE\bEL\bLL\bL G\bGR\bRA\bAM\bMM\bMA\bAR\bR above).
- P\bPP\bPI\bID\bD The process ID of the shell's parent. This variable is read-
+ P\bPP\bPI\bID\bD The process ID of the shell's parent. This variable is read-
only.
P\bPW\bWD\bD The current working directory as set by the c\bcd\bd command.
- R\bRA\bAN\bND\bDO\bOM\bM Each time this parameter is referenced, it expands to a random
- integer between 0 and 32767. Assigning a value to R\bRA\bAN\bND\bDO\bOM\bM ini-
- tializes (seeds) the sequence of random numbers. Seeding the
- random number generator with the same constant value will pro-
- duce the same sequence of values. If R\bRA\bAN\bND\bDO\bOM\bM is unset, it loses
+ R\bRA\bAN\bND\bDO\bOM\bM Each time this parameter is referenced, it expands to a random
+ integer between 0 and 32767. Assigning a value to R\bRA\bAN\bND\bDO\bOM\bM ini-
+ tializes (seeds) the sequence of random numbers. Seeding the
+ random number generator with the same constant value will pro-
+ duce the same sequence of values. If R\bRA\bAN\bND\bDO\bOM\bM is unset, it loses
its special properties, even if it is subsequently reset.
R\bRE\bEA\bAD\bDL\bLI\bIN\bNE\bE_\b_A\bAR\bRG\bGU\bUM\bME\bEN\bNT\bT
- Any numeric argument given to a r\bre\bea\bad\bdl\bli\bin\bne\be command that was de-
+ Any numeric argument given to a r\bre\bea\bad\bdl\bli\bin\bne\be command that was de-
fined using "bind -x" (see S\bSH\bHE\bEL\bLL\bL B\bBU\bUI\bIL\bLT\bTI\bIN\bN C\bCO\bOM\bMM\bMA\bAN\bND\bDS\bS below) when it
was invoked.
R\bRE\bEA\bAD\bDL\bLI\bIN\bNE\bE_\b_L\bLI\bIN\bNE\bE
(see S\bSH\bHE\bEL\bLL\bL B\bBU\bUI\bIL\bLT\bTI\bIN\bN C\bCO\bOM\bMM\bMA\bAN\bND\bDS\bS below).
R\bRE\bEA\bAD\bDL\bLI\bIN\bNE\bE_\b_M\bMA\bAR\bRK\bK
The position of the mark (saved insertion point) in the r\bre\bea\bad\bdl\bli\bin\bne\be
- line buffer, for use with "bind -x" (see S\bSH\bHE\bEL\bLL\bL B\bBU\bUI\bIL\bLT\bTI\bIN\bN C\bCO\bOM\bMM\bMA\bAN\bND\bDS\bS
+ line buffer, for use with "bind -x" (see S\bSH\bHE\bEL\bLL\bL B\bBU\bUI\bIL\bLT\bTI\bIN\bN C\bCO\bOM\bMM\bMA\bAN\bND\bDS\bS
below). The characters between the insertion point and the mark
are often called the _\br_\be_\bg_\bi_\bo_\bn.
R\bRE\bEA\bAD\bDL\bLI\bIN\bNE\bE_\b_P\bPO\bOI\bIN\bNT\bT
The position of the insertion point in the r\bre\bea\bad\bdl\bli\bin\bne\be line buffer,
for use with "bind -x" (see S\bSH\bHE\bEL\bLL\bL B\bBU\bUI\bIL\bLT\bTI\bIN\bN C\bCO\bOM\bMM\bMA\bAN\bND\bDS\bS below).
- R\bRE\bEP\bPL\bLY\bY Set to the line of input read by the r\bre\bea\bad\bd builtin command when
+ R\bRE\bEP\bPL\bLY\bY Set to the line of input read by the r\bre\bea\bad\bd builtin command when
no arguments are supplied.
S\bSE\bEC\bCO\bON\bND\bDS\bS
Each time this parameter is referenced, it expands to the number
- of seconds since shell invocation. If a value is assigned to
- S\bSE\bEC\bCO\bON\bND\bDS\bS, the value returned upon subsequent references is the
- number of seconds since the assignment plus the value assigned.
- The number of seconds at shell invocation and the current time
+ of seconds since shell invocation. If a value is assigned to
+ S\bSE\bEC\bCO\bON\bND\bDS\bS, the value returned upon subsequent references is the
+ number of seconds since the assignment plus the value assigned.
+ The number of seconds at shell invocation and the current time
are always determined by querying the system clock at one-second
- resolution. If S\bSE\bEC\bCO\bON\bND\bDS\bS is unset, it loses its special proper-
+ resolution. If S\bSE\bEC\bCO\bON\bND\bDS\bS is unset, it loses its special proper-
ties, even if it is subsequently reset.
S\bSH\bHE\bEL\bLL\bLO\bOP\bPT\bTS\bS
- A colon-separated list of enabled shell options. Each word in
- the list is a valid argument for the -\b-o\bo option to the s\bse\bet\bt
+ A colon-separated list of enabled shell options. Each word in
+ the list is a valid argument for the -\b-o\bo option to the s\bse\bet\bt
builtin command (see S\bSH\bHE\bEL\bLL\bL B\bBU\bUI\bIL\bLT\bTI\bIN\bN C\bCO\bOM\bMM\bMA\bAN\bND\bDS\bS below). The options
- appearing in S\bSH\bHE\bEL\bLL\bLO\bOP\bPT\bTS\bS are those reported as _\bo_\bn by s\bse\bet\bt -\b-o\bo. If
- this variable is in the environment when b\bba\bas\bsh\bh starts up, the
+ appearing in S\bSH\bHE\bEL\bLL\bLO\bOP\bPT\bTS\bS are those reported as _\bo_\bn by s\bse\bet\bt -\b-o\bo. If
+ this variable is in the environment when b\bba\bas\bsh\bh starts up, the
shell enables each option in the list before reading any startup
files. This variable is read-only.
S\bSH\bHL\bLV\bVL\bL Incremented by one each time an instance of b\bba\bas\bsh\bh is started.
S\bSR\bRA\bAN\bND\bDO\bOM\bM
- Each time it is referenced, this variable expands to a 32-bit
+ Each time it is referenced, this variable expands to a 32-bit
pseudo-random number. The random number generator is not linear
- on systems that support _\b/_\bd_\be_\bv_\b/_\bu_\br_\ba_\bn_\bd_\bo_\bm or _\ba_\br_\bc_\b4_\br_\ba_\bn_\bd_\bo_\bm(3), so each
+ on systems that support _\b/_\bd_\be_\bv_\b/_\bu_\br_\ba_\bn_\bd_\bo_\bm or _\ba_\br_\bc_\b4_\br_\ba_\bn_\bd_\bo_\bm(3), so each
returned number has no relationship to the numbers preceding it.
- The random number generator cannot be seeded, so assignments to
+ The random number generator cannot be seeded, so assignments to
this variable have no effect. If S\bSR\bRA\bAN\bND\bDO\bOM\bM is unset, it loses its
special properties, even if it is subsequently reset.
U\bUI\bID\bD Expands to the user ID of the current user, initialized at shell
startup. This variable is readonly.
- The shell uses the following variables. In some cases, b\bba\bas\bsh\bh assigns a
+ The shell uses the following variables. In some cases, b\bba\bas\bsh\bh assigns a
default value to a variable; these cases are noted below.
B\bBA\bAS\bSH\bH_\b_C\bCO\bOM\bMP\bPA\bAT\bT
- The value is used to set the shell's compatibility level. 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 for a description of the various
+ The value is used to set the shell's compatibility level. 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 for a description of the various
compatibility levels and their effects. The value may be a dec-
- imal number (e.g., 4.2) or an integer (e.g., 42) corresponding
- to the desired compatibility level. If B\bBA\bAS\bSH\bH_\b_C\bCO\bOM\bMP\bPA\bAT\bT is unset or
- set to the empty string, the compatibility level is set to the
- default for the current version. If B\bBA\bAS\bSH\bH_\b_C\bCO\bOM\bMP\bPA\bAT\bT is set to a
- value that is not one of the valid compatibility levels, the
- shell prints an error message and sets the compatibility level
- to the default for the current version. A subset of the valid
- values correspond to the compatibility levels described below
- under 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. For example, 4.2 and 42 are
- valid values that correspond to the c\bco\bom\bmp\bpa\bat\bt4\b42\b2 s\bsh\bho\bop\bpt\bt option and
- set the compatibility level to 42. The current version is also
+ imal number (e.g., 4.2) or an integer (e.g., 42) corresponding
+ to the desired compatibility level. If B\bBA\bAS\bSH\bH_\b_C\bCO\bOM\bMP\bPA\bAT\bT is unset or
+ set to the empty string, the compatibility level is set to the
+ default for the current version. If B\bBA\bAS\bSH\bH_\b_C\bCO\bOM\bMP\bPA\bAT\bT is set to a
+ value that is not one of the valid compatibility levels, the
+ shell prints an error message and sets the compatibility level
+ to the default for the current version. A subset of the valid
+ values correspond to the compatibility levels described below
+ under 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. For example, 4.2 and 42 are
+ valid values that correspond to the c\bco\bom\bmp\bpa\bat\bt4\b42\b2 s\bsh\bho\bop\bpt\bt option and
+ set the compatibility level to 42. The current version is also
a valid value.
B\bBA\bAS\bSH\bH_\b_E\bEN\bNV\bV
- If this parameter is set when b\bba\bas\bsh\bh is executing a shell script,
- its expanded value is interpreted as a filename containing com-
- mands to initialize the shell before it reads and executes com-
- mands from the script. The value of B\bBA\bAS\bSH\bH_\b_E\bEN\bNV\bV is subjected to
+ If this parameter is set when b\bba\bas\bsh\bh is executing a shell script,
+ its expanded value is interpreted as a filename containing com-
+ mands to initialize the shell before it reads and executes com-
+ mands from the script. The value of B\bBA\bAS\bSH\bH_\b_E\bEN\bNV\bV is subjected to
parameter expansion, command substitution, and arithmetic expan-
- sion before being interpreted as a filename. P\bPA\bAT\bTH\bH is not used
+ sion before being interpreted as a filename. P\bPA\bAT\bTH\bH is not used
to search for the resultant filename.
B\bBA\bAS\bSH\bH_\b_X\bXT\bTR\bRA\bAC\bCE\bEF\bFD\bD
- If set to an integer corresponding to a valid file descriptor,
- b\bba\bas\bsh\bh will write the trace output generated when "set -x" is en-
- abled to that file descriptor. The file descriptor is closed
- when B\bBA\bAS\bSH\bH_\b_X\bXT\bTR\bRA\bAC\bCE\bEF\bFD\bD is unset or assigned a new value. Unsetting
- B\bBA\bAS\bSH\bH_\b_X\bXT\bTR\bRA\bAC\bCE\bEF\bFD\bD or assigning it the empty string causes the trace
- output to be sent to the standard error. Note that setting
+ If set to an integer corresponding to a valid file descriptor,
+ b\bba\bas\bsh\bh will write the trace output generated when "set -x" is en-
+ abled to that file descriptor. The file descriptor is closed
+ when B\bBA\bAS\bSH\bH_\b_X\bXT\bTR\bRA\bAC\bCE\bEF\bFD\bD is unset or assigned a new value. Unsetting
+ B\bBA\bAS\bSH\bH_\b_X\bXT\bTR\bRA\bAC\bCE\bEF\bFD\bD or assigning it the empty string causes the trace
+ output to be sent to the standard error. Note that setting
B\bBA\bAS\bSH\bH_\b_X\bXT\bTR\bRA\bAC\bCE\bEF\bFD\bD to 2 (the standard error file descriptor) and then
unsetting it will result in the standard error being closed.
- C\bCD\bDP\bPA\bAT\bTH\bH The search path for the c\bcd\bd command. This is a colon-separated
+ C\bCD\bDP\bPA\bAT\bTH\bH The search path for the c\bcd\bd command. This is a colon-separated
list of directories where the shell looks for directories speci-
- fied as arguments to the c\bcd\bd command. A sample value is
+ fied as arguments to the c\bcd\bd command. A sample value is
".:~:/usr".
C\bCH\bHI\bIL\bLD\bD_\b_M\bMA\bAX\bX
- Set the number of exited child status values for the shell to
- remember. B\bBa\bas\bsh\bh will not allow this value to be decreased below
- a POSIX-mandated minimum, and there is a maximum value (cur-
- rently 8192) that this may not exceed. The minimum value is
+ Set the number of exited child status values for the shell to
+ remember. B\bBa\bas\bsh\bh will not allow this value to be decreased below
+ a POSIX-mandated minimum, and there is a maximum value (cur-
+ rently 8192) that this may not exceed. The minimum value is
system-dependent.
C\bCO\bOL\bLU\bUM\bMN\bNS\bS
- Used by the s\bse\bel\ble\bec\bct\bt compound command to determine the terminal
- width when printing selection lists. Automatically set if the
- c\bch\bhe\bec\bck\bkw\bwi\bin\bns\bsi\biz\bze\be option is enabled or in an interactive shell upon
+ Used by the s\bse\bel\ble\bec\bct\bt compound command to determine the terminal
+ width when printing selection lists. Automatically set if the
+ c\bch\bhe\bec\bck\bkw\bwi\bin\bns\bsi\biz\bze\be option is enabled or in an interactive shell upon
receipt of a S\bSI\bIG\bGW\bWI\bIN\bNC\bCH\bH.
C\bCO\bOM\bMP\bPR\bRE\bEP\bPL\bLY\bY
An array variable from which b\bba\bas\bsh\bh reads the possible completions
- generated by a shell function invoked by the programmable com-
- pletion facility (see P\bPr\bro\bog\bgr\bra\bam\bmm\bma\bab\bbl\ble\be C\bCo\bom\bmp\bpl\ble\bet\bti\bio\bon\bn below). Each ar-
+ generated by a shell function invoked by the programmable com-
+ pletion facility (see P\bPr\bro\bog\bgr\bra\bam\bmm\bma\bab\bbl\ble\be C\bCo\bom\bmp\bpl\ble\bet\bti\bio\bon\bn below). Each ar-
ray element contains one possible completion.
- E\bEM\bMA\bAC\bCS\bS If b\bba\bas\bsh\bh finds this variable in the environment when the shell
- starts with value "t", it assumes that the shell is running in
+ E\bEM\bMA\bAC\bCS\bS If b\bba\bas\bsh\bh finds this variable in the environment when the shell
+ starts with value "t", it assumes that the shell is running in
an Emacs shell buffer and disables line editing.
- E\bEN\bNV\bV Expanded and executed similarly to B\bBA\bAS\bSH\bH_\b_E\bEN\bNV\bV (see I\bIN\bNV\bVO\bOC\bCA\bAT\bTI\bIO\bON\bN
+ E\bEN\bNV\bV Expanded and executed similarly to B\bBA\bAS\bSH\bH_\b_E\bEN\bNV\bV (see I\bIN\bNV\bVO\bOC\bCA\bAT\bTI\bIO\bON\bN
above) when an interactive shell is invoked in posix mode.
E\bEX\bXE\bEC\bCI\bIG\bGN\bNO\bOR\bRE\bE
- A colon-separated list of shell patterns (see P\bPa\bat\btt\bte\ber\brn\bn M\bMa\bat\btc\bch\bhi\bin\bng\bg)
- defining the set of filenames to be ignored by command search
- using P\bPA\bAT\bTH\bH. Files whose full pathnames match one of these pat-
- terns are not considered executable files for the purposes of
+ A colon-separated list of shell patterns (see P\bPa\bat\btt\bte\ber\brn\bn M\bMa\bat\btc\bch\bhi\bin\bng\bg)
+ defining the set of filenames to be ignored by command search
+ using P\bPA\bAT\bTH\bH. Files whose full pathnames match one of these pat-
+ terns are not considered executable files for the purposes of
completion and command execution via P\bPA\bAT\bTH\bH lookup. This does not
affect the behavior of the [\b[, t\bte\bes\bst\bt, and [\b[[\b[ commands. Full path-
- names in the command hash table are not subject to E\bEX\bXE\bEC\bCI\bIG\bGN\bNO\bOR\bRE\bE.
- Use this variable to ignore shared library files that have the
- executable bit set, but are not executable files. The pattern
+ names in the command hash table are not subject to E\bEX\bXE\bEC\bCI\bIG\bGN\bNO\bOR\bRE\bE.
+ Use this variable to ignore shared library files that have the
+ executable bit set, but are not executable files. The pattern
matching honors the setting of the e\bex\bxt\btg\bgl\blo\bob\bb shell option.
F\bFC\bCE\bED\bDI\bIT\bT The default editor for the f\bfc\bc builtin command.
F\bFI\bIG\bGN\bNO\bOR\bRE\bE
- A colon-separated list of suffixes to ignore when performing
+ A colon-separated list of suffixes to ignore when performing
filename completion (see R\bRE\bEA\bAD\bDL\bLI\bIN\bNE\bE below). A filename whose suf-
- fix matches one of the entries in F\bFI\bIG\bGN\bNO\bOR\bRE\bE is excluded from the
+ fix matches one of the entries in F\bFI\bIG\bGN\bNO\bOR\bRE\bE is excluded from the
list of matched filenames. A sample value is ".o:~".
F\bFU\bUN\bNC\bCN\bNE\bES\bST\bT
- If set to a numeric value greater than 0, defines a maximum
- function nesting level. Function invocations that exceed this
+ If set to a numeric value greater than 0, defines a maximum
+ function nesting level. Function invocations that exceed this
nesting level will cause the current command to abort.
G\bGL\bLO\bOB\bBI\bIG\bGN\bNO\bOR\bRE\bE
- A colon-separated list of patterns defining the set of file
- names to be ignored by pathname expansion. If a file name
- matched by a pathname expansion pattern also matches one of the
- patterns in G\bGL\bLO\bOB\bBI\bIG\bGN\bNO\bOR\bRE\bE, it is removed from the list of matches.
+ A colon-separated list of patterns defining the set of file
+ names to be ignored by pathname expansion. If a file name
+ matched by a pathname expansion pattern also matches one of the
+ patterns in G\bGL\bLO\bOB\bBI\bIG\bGN\bNO\bOR\bRE\bE, it is removed from the list of matches.
The pattern matching honors the setting of the e\bex\bxt\btg\bgl\blo\bob\bb shell op-
tion.
G\bGL\bLO\bOB\bBS\bSO\bOR\bRT\bT
- Controls how the results of pathname expansion are sorted. The
- value of this variable specifies the sort criteria and sort or-
- der for the results of pathname expansion. If this variable is
- unset or set to the null string, pathname expansion uses the
- historical behavior of sorting by name, in ascending lexico-
+ Controls how the results of pathname expansion are sorted. The
+ value of this variable specifies the sort criteria and sort or-
+ der for the results of pathname expansion. If this variable is
+ unset or set to the null string, pathname expansion uses the
+ historical behavior of sorting by name, in ascending lexico-
graphic order as determined by the L\bLC\bC_\b_C\bCO\bOL\bLL\bLA\bAT\bTE\bE shell variable.
- If set, a valid value begins with an optional _\b+, which is ig-
+ If set, a valid value begins with an optional _\b+, which is ig-
nored, or _\b-, which reverses the sort order from ascending to de-
- scending, followed by a sort specifier. The valid sort speci-
- fiers are _\bn_\ba_\bm_\be, _\bn_\bu_\bm_\be_\br_\bi_\bc, _\bs_\bi_\bz_\be, _\bm_\bt_\bi_\bm_\be, _\ba_\bt_\bi_\bm_\be, _\bc_\bt_\bi_\bm_\be, and _\bb_\bl_\bo_\bc_\bk_\bs,
+ scending, followed by a sort specifier. The valid sort speci-
+ fiers are _\bn_\ba_\bm_\be, _\bn_\bu_\bm_\be_\br_\bi_\bc, _\bs_\bi_\bz_\be, _\bm_\bt_\bi_\bm_\be, _\ba_\bt_\bi_\bm_\be, _\bc_\bt_\bi_\bm_\be, and _\bb_\bl_\bo_\bc_\bk_\bs,
which sort the files on name, names in numeric rather than lexi-
- cographic order, file size, modification time, access time, in-
- ode change time, and number of blocks, respectively. If any of
- the non-name keys compare as equal (e.g., if two files are the
+ cographic order, file size, modification time, access time, in-
+ ode change time, and number of blocks, respectively. If any of
+ the non-name keys compare as equal (e.g., if two files are the
same size), sorting uses the name as a secondary sort key.
- For example, a value of _\b-_\bm_\bt_\bi_\bm_\be sorts the results in descending
+ For example, a value of _\b-_\bm_\bt_\bi_\bm_\be sorts the results in descending
order by modification time (newest first).
- The _\bn_\bu_\bm_\be_\br_\bi_\bc specifier treats names consisting solely of digits
+ The _\bn_\bu_\bm_\be_\br_\bi_\bc specifier treats names consisting solely of digits
as numbers and sorts them using their numeric value (so "2" will
- sort before "10", for example). When using _\bn_\bu_\bm_\be_\br_\bi_\bc, names con-
- taining non-digits sort after all the all-digit names and are
+ sort before "10", for example). When using _\bn_\bu_\bm_\be_\br_\bi_\bc, names con-
+ taining non-digits sort after all the all-digit names and are
sorted by name using the traditional behavior.
A sort specifier of _\bn_\bo_\bs_\bo_\br_\bt disables sorting completely; b\bba\bas\bsh\bh re-
- turns the results in the order they are read from the file sys-
+ turns the results in the order they are read from the file sys-
tem, ignoring any leading _\b-.
- If the sort specifier is missing, it defaults to _\bn_\ba_\bm_\be, so a
- value of _\b+ is equivalent to the null string, and a value of _\b-
- sorts by name in descending order. Any invalid value restores
+ If the sort specifier is missing, it defaults to _\bn_\ba_\bm_\be, so a
+ value of _\b+ is equivalent to the null string, and a value of _\b-
+ sorts by name in descending order. Any invalid value restores
the historical sorting behavior.
H\bHI\bIS\bST\bTC\bCO\bON\bNT\bTR\bRO\bOL\bL
- A colon-separated list of values controlling how commands are
- saved on the history list. If the list of values includes
- _\bi_\bg_\bn_\bo_\br_\be_\bs_\bp_\ba_\bc_\be, lines which begin with a s\bsp\bpa\bac\bce\be character are not
- saved in the history list. A value of _\bi_\bg_\bn_\bo_\br_\be_\bd_\bu_\bp_\bs causes lines
+ A colon-separated list of values controlling how commands are
+ saved on the history list. If the list of values includes
+ _\bi_\bg_\bn_\bo_\br_\be_\bs_\bp_\ba_\bc_\be, lines which begin with a s\bsp\bpa\bac\bce\be character are not
+ saved in the history list. A value of _\bi_\bg_\bn_\bo_\br_\be_\bd_\bu_\bp_\bs causes lines
matching the previous history entry not to be saved. A value of
_\bi_\bg_\bn_\bo_\br_\be_\bb_\bo_\bt_\bh is shorthand for _\bi_\bg_\bn_\bo_\br_\be_\bs_\bp_\ba_\bc_\be and _\bi_\bg_\bn_\bo_\br_\be_\bd_\bu_\bp_\bs. A value
of _\be_\br_\ba_\bs_\be_\bd_\bu_\bp_\bs causes all previous lines matching the current line
- to be removed from the history list before that line is saved.
- Any value not in the above list is ignored. If H\bHI\bIS\bST\bTC\bCO\bON\bNT\bTR\bRO\bOL\bL is
- unset, or does not include a valid value, all lines read by the
+ to be removed from the history list before that line is saved.
+ Any value not in the above list is ignored. If H\bHI\bIS\bST\bTC\bCO\bON\bNT\bTR\bRO\bOL\bL is
+ unset, or does not include a valid value, all lines read by the
shell parser are saved on the history list, subject to the value
- of H\bHI\bIS\bST\bTI\bIG\bGN\bNO\bOR\bRE\bE. The second and subsequent lines of a multi-line
- compound command are not tested, and are added to the history
- regardless of the value of H\bHI\bIS\bST\bTC\bCO\bON\bNT\bTR\bRO\bOL\bL if the first line of the
- command was saved. If the first line was not saved, the second
+ of H\bHI\bIS\bST\bTI\bIG\bGN\bNO\bOR\bRE\bE. The second and subsequent lines of a multi-line
+ compound command are not tested, and are added to the history
+ regardless of the value of H\bHI\bIS\bST\bTC\bCO\bON\bNT\bTR\bRO\bOL\bL if the first line of the
+ command was saved. If the first line was not saved, the second
and subsequent lines of the command are not saved either.
H\bHI\bIS\bST\bTF\bFI\bIL\bLE\bE
The name of the file in which command history is saved (see H\bHI\bIS\bS-\b-
- T\bTO\bOR\bRY\bY below). B\bBa\bas\bsh\bh assigns a default value of _\b~_\b/_\b._\bb_\ba_\bs_\bh_\b__\bh_\bi_\bs_\bt_\bo_\br_\by.
- If H\bHI\bIS\bST\bTF\bFI\bIL\bLE\bE is unset or null, the shell does not save the com-
+ T\bTO\bOR\bRY\bY below). B\bBa\bas\bsh\bh assigns a default value of _\b~_\b/_\b._\bb_\ba_\bs_\bh_\b__\bh_\bi_\bs_\bt_\bo_\br_\by.
+ If H\bHI\bIS\bST\bTF\bFI\bIL\bLE\bE is unset or null, the shell does not save the com-
mand history when it exits.
H\bHI\bIS\bST\bTF\bFI\bIL\bLE\bES\bSI\bIZ\bZE\bE
The maximum number of lines contained in the history file. When
- this variable is assigned a value, the history file is trun-
- cated, if necessary, to contain no more than that number of
- lines by removing the oldest entries. The history file is also
+ this variable is assigned a value, the history file is trun-
+ cated, if necessary, to contain no more than that number of
+ lines by removing the oldest entries. The history file is also
truncated to this size after writing it when a shell exits or by
- the h\bhi\bis\bst\bto\bor\bry\by builtin. If the value is 0, the history file is
- truncated to zero size. Non-numeric values and numeric values
- less than zero inhibit truncation. The shell sets the default
+ the h\bhi\bis\bst\bto\bor\bry\by builtin. If the value is 0, the history file is
+ truncated to zero size. Non-numeric values and numeric values
+ less than zero inhibit truncation. The shell sets the default
value to the value of H\bHI\bIS\bST\bTS\bSI\bIZ\bZE\bE after reading any startup files.
H\bHI\bIS\bST\bTI\bIG\bGN\bNO\bOR\bRE\bE
- A colon-separated list of patterns used to decide which command
- lines should be saved on the history list. If a command line
- matches one of the patterns in the value of H\bHI\bIS\bST\bTI\bIG\bGN\bNO\bOR\bRE\bE, it is
- not saved on the history list. Each pattern is anchored at the
- beginning of the line and must match the complete line (b\bba\bas\bsh\bh
- will not implicitly append a "*\b*"). Each pattern is tested
- against the line after the checks specified by H\bHI\bIS\bST\bTC\bCO\bON\bNT\bTR\bRO\bOL\bL are
+ A colon-separated list of patterns used to decide which command
+ lines should be saved on the history list. If a command line
+ matches one of the patterns in the value of H\bHI\bIS\bST\bTI\bIG\bGN\bNO\bOR\bRE\bE, it is
+ not saved on the history list. Each pattern is anchored at the
+ beginning of the line and must match the complete line (b\bba\bas\bsh\bh
+ will not implicitly append a "*\b*"). Each pattern is tested
+ against the line after the checks specified by H\bHI\bIS\bST\bTC\bCO\bON\bNT\bTR\bRO\bOL\bL are
applied. In addition to the normal shell pattern matching char-
acters, "&\b&" matches the previous history line. A backslash will
- escape the "&\b&"; the backslash is removed before attempting a
+ escape the "&\b&"; the backslash is removed before attempting a
match. The second and subsequent lines of a multi-line compound
- command are not tested, and are added to the history regardless
- of the value of H\bHI\bIS\bST\bTI\bIG\bGN\bNO\bOR\bRE\bE. If the first line was not saved,
+ command are not tested, and are added to the history regardless
+ of the value of H\bHI\bIS\bST\bTI\bIG\bGN\bNO\bOR\bRE\bE. If the first line was not saved,
the second and subsequent lines of the command are not saved ei-
- ther. The pattern matching honors the setting of the e\bex\bxt\btg\bgl\blo\bob\bb
+ ther. The pattern matching honors the setting of the e\bex\bxt\btg\bgl\blo\bob\bb
shell option.
H\bHI\bIS\bST\bTS\bSI\bIZ\bZE\bE
- The number of commands to remember in the command history (see
- H\bHI\bIS\bST\bTO\bOR\bRY\bY below). If the value is 0, commands are not saved in
+ The number of commands to remember in the command history (see
+ H\bHI\bIS\bST\bTO\bOR\bRY\bY below). If the value is 0, commands are not saved in
the history list. Numeric values less than zero result in every
- command being saved on the history list (there is no limit).
- The shell sets the default value to 500 after reading any
+ command being saved on the history list (there is no limit).
+ The shell sets the default value to 500 after reading any
startup files.
H\bHI\bIS\bST\bTT\bTI\bIM\bME\bEF\bFO\bOR\bRM\bMA\bAT\bT
- If this variable is set and not null, its value is used as a
+ If this variable is set and not null, its value is used as a
format string for _\bs_\bt_\br_\bf_\bt_\bi_\bm_\be(3) to print the time stamp associated
- with each history entry displayed by the h\bhi\bis\bst\bto\bor\bry\by builtin. If
- this variable is set, the shell writes time stamps to the his-
- tory file so they may be preserved across shell sessions. This
- uses the history comment character to distinguish timestamps
+ with each history entry displayed by the h\bhi\bis\bst\bto\bor\bry\by builtin. If
+ this variable is set, the shell writes time stamps to the his-
+ tory file so they may be preserved across shell sessions. This
+ uses the history comment character to distinguish timestamps
from other history lines.
H\bHO\bOM\bME\bE The home directory of the current user; the default argument for
the c\bcd\bd builtin command. The value of this variable is also used
when performing tilde expansion.
H\bHO\bOS\bST\bTF\bFI\bIL\bLE\bE
- Contains the name of a file in the same format as _\b/_\be_\bt_\bc_\b/_\bh_\bo_\bs_\bt_\bs
+ Contains the name of a file in the same format as _\b/_\be_\bt_\bc_\b/_\bh_\bo_\bs_\bt_\bs
that should be read when the shell needs to complete a hostname.
- The list of possible hostname completions may be changed while
- the shell is running; the next time hostname completion is at-
- tempted after the value is changed, b\bba\bas\bsh\bh adds the contents of
- the new file to the existing list. If H\bHO\bOS\bST\bTF\bFI\bIL\bLE\bE is set, but has
- no value, or does not name a readable file, b\bba\bas\bsh\bh attempts to
- read _\b/_\be_\bt_\bc_\b/_\bh_\bo_\bs_\bt_\bs to obtain the list of possible hostname comple-
+ The list of possible hostname completions may be changed while
+ the shell is running; the next time hostname completion is at-
+ tempted after the value is changed, b\bba\bas\bsh\bh adds the contents of
+ the new file to the existing list. If H\bHO\bOS\bST\bTF\bFI\bIL\bLE\bE is set, but has
+ no value, or does not name a readable file, b\bba\bas\bsh\bh attempts to
+ read _\b/_\be_\bt_\bc_\b/_\bh_\bo_\bs_\bt_\bs to obtain the list of possible hostname comple-
tions. When H\bHO\bOS\bST\bTF\bFI\bIL\bLE\bE is unset, the hostname list is cleared.
I\bIF\bFS\bS The _\bI_\bn_\bt_\be_\br_\bn_\ba_\bl _\bF_\bi_\be_\bl_\bd _\bS_\be_\bp_\ba_\br_\ba_\bt_\bo_\br that is used for word splitting af-
- ter expansion and to split lines into words with the r\bre\bea\bad\bd
+ ter expansion and to split lines into words with the r\bre\bea\bad\bd
builtin command. Word splitting is described above under E\bEX\bXP\bPA\bAN\bN-\b-
S\bSI\bIO\bON\bN. The default value is "<space><tab><newline>".
I\bIG\bGN\bNO\bOR\bRE\bEE\bEO\bOF\bF
Controls the action of an interactive shell on receipt of an E\bEO\bOF\bF
character as the sole input. If set, the value is the number of
- consecutive E\bEO\bOF\bF characters which must be typed as the first
- characters on an input line before b\bba\bas\bsh\bh exits. If the variable
- is set but does not have a numeric value, or the value is null,
- the default value is 10. If it is unset, E\bEO\bOF\bF signifies the end
+ consecutive E\bEO\bOF\bF characters which must be typed as the first
+ characters on an input line before b\bba\bas\bsh\bh exits. If the variable
+ is set but does not have a numeric value, or the value is null,
+ the default value is 10. If it is unset, E\bEO\bOF\bF signifies the end
of input to the shell.
I\bIN\bNP\bPU\bUT\bTR\bRC\bC
- The filename for the r\bre\bea\bad\bdl\bli\bin\bne\be startup file, overriding the de-
+ The filename for the r\bre\bea\bad\bdl\bli\bin\bne\be startup file, overriding the de-
fault of _\b~_\b/_\b._\bi_\bn_\bp_\bu_\bt_\br_\bc (see R\bRE\bEA\bAD\bDL\bLI\bIN\bNE\bE below).
I\bIN\bNS\bSI\bID\bDE\bE_\b_E\bEM\bMA\bAC\bCS\bS
- If this variable appears in the environment when the shell
- starts, b\bba\bas\bsh\bh assumes that it is running inside an Emacs shell
- buffer and may disable line editing, depending on the value of
+ If this variable appears in the environment when the shell
+ starts, b\bba\bas\bsh\bh assumes that it is running inside an Emacs shell
+ buffer and may disable line editing, depending on the value of
T\bTE\bER\bRM\bM.
- L\bLA\bAN\bNG\bG Used to determine the locale category for any category not
+ L\bLA\bAN\bNG\bG Used to determine the locale category for any category not
specifically selected with a variable starting with L\bLC\bC_\b_.
- L\bLC\bC_\b_A\bAL\bLL\bL This variable overrides the value of L\bLA\bAN\bNG\bG and any other L\bLC\bC_\b_
+ L\bLC\bC_\b_A\bAL\bLL\bL This variable overrides the value of L\bLA\bAN\bNG\bG and any other L\bLC\bC_\b_
variable specifying a locale category.
L\bLC\bC_\b_C\bCO\bOL\bLL\bLA\bAT\bTE\bE
- This variable determines the collation order used when sorting
- the results of pathname expansion, and determines the behavior
- of range expressions, equivalence classes, and collating se-
+ This variable determines the collation order used when sorting
+ the results of pathname expansion, and determines the behavior
+ of range expressions, equivalence classes, and collating se-
quences within pathname expansion and pattern matching.
L\bLC\bC_\b_C\bCT\bTY\bYP\bPE\bE
- This variable determines the interpretation of characters and
- the behavior of character classes within pathname expansion and
+ This variable determines the interpretation of characters and
+ the behavior of character classes within pathname expansion and
pattern matching.
L\bLC\bC_\b_M\bME\bES\bSS\bSA\bAG\bGE\bES\bS
- This variable determines the locale used to translate double-
+ This variable determines the locale used to translate double-
quoted strings preceded by a $\b$.
L\bLC\bC_\b_N\bNU\bUM\bME\bER\bRI\bIC\bC
- This variable determines the locale category used for number
+ This variable determines the locale category used for number
formatting.
L\bLC\bC_\b_T\bTI\bIM\bME\bE
- This variable determines the locale category used for data and
+ This variable determines the locale category used for data and
time formatting.
- L\bLI\bIN\bNE\bES\bS Used by the s\bse\bel\ble\bec\bct\bt compound command to determine the column
- length for printing selection lists. Automatically set if the
- c\bch\bhe\bec\bck\bkw\bwi\bin\bns\bsi\biz\bze\be option is enabled or in an interactive shell upon
+ L\bLI\bIN\bNE\bES\bS Used by the s\bse\bel\ble\bec\bct\bt compound command to determine the column
+ length for printing selection lists. Automatically set if the
+ c\bch\bhe\bec\bck\bkw\bwi\bin\bns\bsi\biz\bze\be option is enabled or in an interactive shell upon
receipt of a S\bSI\bIG\bGW\bWI\bIN\bNC\bCH\bH.
M\bMA\bAI\bIL\bL If the value is set to a file or directory name and the M\bMA\bAI\bIL\bLP\bPA\bAT\bTH\bH
- variable is not set, b\bba\bas\bsh\bh informs the user of the arrival of
+ variable is not set, b\bba\bas\bsh\bh informs the user of the arrival of
mail in the specified file or Maildir-format directory.
M\bMA\bAI\bIL\bLC\bCH\bHE\bEC\bCK\bK
- Specifies how often (in seconds) b\bba\bas\bsh\bh checks for mail. The de-
- fault is 60 seconds. When it is time to check for mail, the
- shell does so before displaying the primary prompt. If this
- variable is unset, or set to a value that is not a number
+ Specifies how often (in seconds) b\bba\bas\bsh\bh checks for mail. The de-
+ fault is 60 seconds. When it is time to check for mail, the
+ shell does so before displaying the primary prompt. If this
+ variable is unset, or set to a value that is not a number
greater than or equal to zero, the shell disables mail checking.
M\bMA\bAI\bIL\bLP\bPA\bAT\bTH\bH
A colon-separated list of filenames to be checked for mail. The
message to be printed when mail arrives in a particular file may
- be specified by separating the filename from the message with a
- "?". When used in the text of the message, $\b$_\b_ expands to the
+ be specified by separating the filename from the message with a
+ "?". When used in the text of the message, $\b$_\b_ expands to the
name of the current mailfile. Example:
M\bMA\bAI\bIL\bLP\bPA\bAT\bTH\bH='/var/mail/bfox?"You have mail":~/shell-mail?"$_ has mail!"'
- B\bBa\bas\bsh\bh can be configured to supply a default value for this vari-
- able (there is no value by default), but the location of the
+ B\bBa\bas\bsh\bh can be configured to supply a default value for this vari-
+ able (there is no value by default), but the location of the
user mail files that it uses is system dependent (e.g.,
/var/mail/$\b$U\bUS\bSE\bER\bR).
O\bOP\bPT\bTE\bER\bRR\bR If set to the value 1, b\bba\bas\bsh\bh displays error messages generated by
- the g\bge\bet\bto\bop\bpt\bts\bs builtin command (see S\bSH\bHE\bEL\bLL\bL B\bBU\bUI\bIL\bLT\bTI\bIN\bN C\bCO\bOM\bMM\bMA\bAN\bND\bDS\bS below).
- O\bOP\bPT\bTE\bER\bRR\bR is initialized to 1 each time the shell is invoked or a
+ the g\bge\bet\bto\bop\bpt\bts\bs builtin command (see S\bSH\bHE\bEL\bLL\bL B\bBU\bUI\bIL\bLT\bTI\bIN\bN C\bCO\bOM\bMM\bMA\bAN\bND\bDS\bS below).
+ O\bOP\bPT\bTE\bER\bRR\bR is initialized to 1 each time the shell is invoked or a
shell script is executed.
- P\bPA\bAT\bTH\bH The search path for commands. It is a colon-separated list of
- directories in which the shell looks for commands (see C\bCO\bOM\bMM\bMA\bAN\bND\bD
- E\bEX\bXE\bEC\bCU\bUT\bTI\bIO\bON\bN below). A zero-length (null) directory name in the
+ P\bPA\bAT\bTH\bH The search path for commands. It is a colon-separated list of
+ directories in which the shell looks for commands (see C\bCO\bOM\bMM\bMA\bAN\bND\bD
+ E\bEX\bXE\bEC\bCU\bUT\bTI\bIO\bON\bN below). A zero-length (null) directory name in the
value of P\bPA\bAT\bTH\bH indicates the current directory. A null directory
- name may appear as two adjacent colons, or as an initial or
- trailing colon. The default path is system-dependent, and is
+ name may appear as two adjacent colons, or as an initial or
+ trailing colon. The default path is system-dependent, and is
set by the administrator who installs b\bba\bas\bsh\bh. A common value is
"/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/bin:/sbin".
P\bPO\bOS\bSI\bIX\bXL\bLY\bY_\b_C\bCO\bOR\bRR\bRE\bEC\bCT\bT
- If this variable is in the environment when b\bba\bas\bsh\bh starts, the
- shell enters posix mode before reading the startup files, as if
- the -\b--\b-p\bpo\bos\bsi\bix\bx invocation option had been supplied. If it is set
- while the shell is running, b\bba\bas\bsh\bh enables posix mode, as if the
+ If this variable is in the environment when b\bba\bas\bsh\bh starts, the
+ shell enters posix mode before reading the startup files, as if
+ the -\b--\b-p\bpo\bos\bsi\bix\bx invocation option had been supplied. If it is set
+ while the shell is running, b\bba\bas\bsh\bh enables posix mode, as if the
command "set -o posix" had been executed. When the shell enters
posix mode, it sets this variable if it was not already set.
P\bPR\bRO\bOM\bMP\bPT\bT_\b_C\bCO\bOM\bMM\bMA\bAN\bND\bD
- If this variable is set, and is an array, the value of each set
- element is executed as a command prior to issuing each primary
- prompt. If this is set but not an array variable, its value is
+ If this variable is set, and is an array, the value of each set
+ element is executed as a command prior to issuing each primary
+ prompt. If this is set but not an array variable, its value is
used as a command to execute instead.
P\bPR\bRO\bOM\bMP\bPT\bT_\b_D\bDI\bIR\bRT\bTR\bRI\bIM\bM
- If set to a number greater than zero, the value is used as the
+ If set to a number greater than zero, the value is used as the
number of trailing directory components to retain when expanding
- the \\b\w\bw and \\b\W\bW prompt string escapes (see P\bPR\bRO\bOM\bMP\bPT\bTI\bIN\bNG\bG below).
+ the \\b\w\bw and \\b\W\bW prompt string escapes (see P\bPR\bRO\bOM\bMP\bPT\bTI\bIN\bNG\bG below).
Characters removed are replaced with an ellipsis.
- P\bPS\bS0\b0 The value of this parameter is expanded (see P\bPR\bRO\bOM\bMP\bPT\bTI\bIN\bNG\bG below)
- and displayed by interactive shells after reading a command and
+ P\bPS\bS0\b0 The value of this parameter is expanded (see P\bPR\bRO\bOM\bMP\bPT\bTI\bIN\bNG\bG below)
+ and displayed by interactive shells after reading a command and
before the command is executed.
- P\bPS\bS1\b1 The value of this parameter is expanded (see P\bPR\bRO\bOM\bMP\bPT\bTI\bIN\bNG\bG below)
- and used as the primary prompt string. The default value is
+ P\bPS\bS1\b1 The value of this parameter is expanded (see P\bPR\bRO\bOM\bMP\bPT\bTI\bIN\bNG\bG below)
+ and used as the primary prompt string. The default value is
"\s-\v\$ ".
- P\bPS\bS2\b2 The value of this parameter is expanded as with P\bPS\bS1\b1 and used as
+ P\bPS\bS2\b2 The value of this parameter is expanded as with P\bPS\bS1\b1 and used as
the secondary prompt string. The default is "> ".
P\bPS\bS3\b3 The value of this parameter is used as the prompt for the s\bse\bel\ble\bec\bct\bt
command (see S\bSH\bHE\bEL\bLL\bL G\bGR\bRA\bAM\bMM\bMA\bAR\bR above).
- P\bPS\bS4\b4 The value of this parameter is expanded as with P\bPS\bS1\b1 and the
+ P\bPS\bS4\b4 The value of this parameter is expanded as with P\bPS\bS1\b1 and the
value is printed before each command b\bba\bas\bsh\bh displays during an ex-
ecution trace. The first character of the expanded value of P\bPS\bS4\b4
is replicated multiple times, as necessary, to indicate multiple
levels of indirection. The default is "+ ".
- S\bSH\bHE\bEL\bLL\bL This variable expands to the full pathname to the shell. If it
- is not set when the shell starts, b\bba\bas\bsh\bh assigns to it the full
+ S\bSH\bHE\bEL\bLL\bL This variable expands to the full pathname to the shell. If it
+ is not set when the shell starts, b\bba\bas\bsh\bh assigns to it the full
pathname of the current user's login shell.
T\bTI\bIM\bME\bEF\bFO\bOR\bRM\bMA\bAT\bT
- The value of this parameter is used as a format string specify-
- ing how the timing information for pipelines prefixed with the
- t\bti\bim\bme\be reserved word should be displayed. The %\b% character intro-
- duces an escape sequence that is expanded to a time value or
- other information. The escape sequences and their meanings are
+ The value of this parameter is used as a format string specify-
+ ing how the timing information for pipelines prefixed with the
+ t\bti\bim\bme\be reserved word should be displayed. The %\b% character intro-
+ duces an escape sequence that is expanded to a time value or
+ other information. The escape sequences and their meanings are
as follows; the brackets denote optional portions.
%\b%%\b% A literal %\b%.
%\b%[\b[_\bp]\b][\b[l\bl]\b]R\bR The elapsed time in seconds.
%\b%[\b[_\bp]\b][\b[l\bl]\b]S\bS The number of CPU seconds spent in system mode.
%\b%P\bP The CPU percentage, computed as (%U + %S) / %R.
- The optional _\bp is a digit specifying the _\bp_\br_\be_\bc_\bi_\bs_\bi_\bo_\bn, the number
+ The optional _\bp is a digit specifying the _\bp_\br_\be_\bc_\bi_\bs_\bi_\bo_\bn, the number
of fractional digits after a decimal point. A value of 0 causes
- no decimal point or fraction to be output. t\bti\bim\bme\be will print at
- most six digits after the decimal point; values of _\bp greater
- than 6 are changed to 6. If _\bp is not specified, t\bti\bim\bme\be prints
+ no decimal point or fraction to be output. t\bti\bim\bme\be will print at
+ most six digits after the decimal point; values of _\bp greater
+ than 6 are changed to 6. If _\bp is not specified, t\bti\bim\bme\be prints
three digits after the decimal point.
- The optional l\bl specifies a longer format, including minutes, of
- the form _\bM_\bMm_\bS_\bS._\bF_\bFs. The value of _\bp determines whether or not
+ The optional l\bl specifies a longer format, including minutes, of
+ the form _\bM_\bMm_\bS_\bS._\bF_\bFs. The value of _\bp determines whether or not
the fraction is included.
- If this variable is not set, b\bba\bas\bsh\bh acts as if it had the value
- $\b$'\b'\\b\n\bnr\bre\bea\bal\bl\\b\t\bt%\b%3\b3l\blR\bR\\b\n\bnu\bus\bse\ber\br\\b\t\bt%\b%3\b3l\blU\bU\\b\n\bns\bsy\bys\bs\\b\t\bt%\b%3\b3l\blS\bS'\b'. If the value is null,
- b\bba\bas\bsh\bh does not display any timing information. A trailing new-
+ If this variable is not set, b\bba\bas\bsh\bh acts as if it had the value
+ $\b$'\b'\\b\n\bnr\bre\bea\bal\bl\\b\t\bt%\b%3\b3l\blR\bR\\b\n\bnu\bus\bse\ber\br\\b\t\bt%\b%3\b3l\blU\bU\\b\n\bns\bsy\bys\bs\\b\t\bt%\b%3\b3l\blS\bS'\b'. If the value is null,
+ b\bba\bas\bsh\bh does not display any timing information. A trailing new-
line is added when the format string is displayed.
- T\bTM\bMO\bOU\bUT\bT If set to a value greater than zero, the r\bre\bea\bad\bd builtin uses the
- value as its default timeout. The s\bse\bel\ble\bec\bct\bt command terminates if
- input does not arrive after T\bTM\bMO\bOU\bUT\bT seconds when input is coming
- from a terminal. In an interactive shell, the value is inter-
- preted as the number of seconds to wait for a line of input af-
- ter issuing the primary prompt. B\bBa\bas\bsh\bh terminates after waiting
- for that number of seconds if a complete line of input does not
+ T\bTM\bMO\bOU\bUT\bT If set to a value greater than zero, the r\bre\bea\bad\bd builtin uses the
+ value as its default timeout. The s\bse\bel\ble\bec\bct\bt command terminates if
+ input does not arrive after T\bTM\bMO\bOU\bUT\bT seconds when input is coming
+ from a terminal. In an interactive shell, the value is inter-
+ preted as the number of seconds to wait for a line of input af-
+ ter issuing the primary prompt. B\bBa\bas\bsh\bh terminates after waiting
+ for that number of seconds if a complete line of input does not
arrive.
- T\bTM\bMP\bPD\bDI\bIR\bR If set, b\bba\bas\bsh\bh uses its value as the name of a directory in which
+ T\bTM\bMP\bPD\bDI\bIR\bR If set, b\bba\bas\bsh\bh uses its value as the name of a directory in which
b\bba\bas\bsh\bh creates temporary files for the shell's use.
a\bau\but\bto\bo_\b_r\bre\bes\bsu\bum\bme\be
This variable controls how the shell interacts with the user and
- job control. If this variable is set, simple commands consist-
- ing of only a single word, without redirections, are treated as
- candidates for resumption of an existing stopped job. There is
- no ambiguity allowed; if there is more than one job beginning
- with or containing the word, this selects the most recently ac-
- cessed job. The _\bn_\ba_\bm_\be of a stopped job, in this context, is the
- command line used to start it, as displayed by j\bjo\bob\bbs\bs. If set to
- the value _\be_\bx_\ba_\bc_\bt, the word must match the name of a stopped job
- exactly; if set to _\bs_\bu_\bb_\bs_\bt_\br_\bi_\bn_\bg, the word needs to match a sub-
- string of the name of a stopped job. The _\bs_\bu_\bb_\bs_\bt_\br_\bi_\bn_\bg value pro-
+ job control. If this variable is set, simple commands consist-
+ ing of only a single word, without redirections, are treated as
+ candidates for resumption of an existing stopped job. There is
+ no ambiguity allowed; if there is more than one job beginning
+ with or containing the word, this selects the most recently ac-
+ cessed job. The _\bn_\ba_\bm_\be of a stopped job, in this context, is the
+ command line used to start it, as displayed by j\bjo\bob\bbs\bs. If set to
+ the value _\be_\bx_\ba_\bc_\bt, the word must match the name of a stopped job
+ exactly; if set to _\bs_\bu_\bb_\bs_\bt_\br_\bi_\bn_\bg, the word needs to match a sub-
+ string of the name of a stopped job. The _\bs_\bu_\bb_\bs_\bt_\br_\bi_\bn_\bg value pro-
vides functionality analogous to the %\b%?\b? job identifier (see J\bJO\bOB\bB
- C\bCO\bON\bNT\bTR\bRO\bOL\bL below). If set to any other value (e.g., _\bp_\br_\be_\bf_\bi_\bx), the
- word must be a prefix of a stopped job's name; this provides
+ C\bCO\bON\bNT\bTR\bRO\bOL\bL below). If set to any other value (e.g., _\bp_\br_\be_\bf_\bi_\bx), the
+ word must be a prefix of a stopped job's name; this provides
functionality analogous to the %\b%_\bs_\bt_\br_\bi_\bn_\bg job identifier.
h\bhi\bis\bst\btc\bch\bha\bar\brs\bs
- The two or three characters which control history expansion and
+ The two or three characters which control history expansion and
tokenization (see H\bHI\bIS\bST\bTO\bOR\bRY\bY E\bEX\bXP\bPA\bAN\bNS\bSI\bIO\bON\bN below). The first character
is the _\bh_\bi_\bs_\bt_\bo_\br_\by _\be_\bx_\bp_\ba_\bn_\bs_\bi_\bo_\bn character, the character which begins a
- history expansion, normally "!\b!". The second character is the
- _\bq_\bu_\bi_\bc_\bk _\bs_\bu_\bb_\bs_\bt_\bi_\bt_\bu_\bt_\bi_\bo_\bn character, normally "^\b^". When it appears as
- the first character on the line, history substitution repeats
- the previous command, replacing one string with another. The
- optional third character is the character which indicates that
- the remainder of the line is a comment when found as the first
- character of a word, normally "#\b#". The history comment charac-
+ history expansion, normally "!\b!". The second character is the
+ _\bq_\bu_\bi_\bc_\bk _\bs_\bu_\bb_\bs_\bt_\bi_\bt_\bu_\bt_\bi_\bo_\bn character, normally "^\b^". When it appears as
+ the first character on the line, history substitution repeats
+ the previous command, replacing one string with another. The
+ optional third character is the character which indicates that
+ the remainder of the line is a comment when found as the first
+ character of a word, normally "#\b#". The history comment charac-
ter disables history substitution for the remaining words on the
- line. It does not necessarily cause the shell parser to treat
+ line. It does not necessarily cause the shell parser to treat
the rest of the line as a comment.
A\bAr\brr\bra\bay\bys\bs
- B\bBa\bas\bsh\bh provides one-dimensional indexed and associative array variables.
- Any variable may be used as an indexed array; the d\bde\bec\bcl\bla\bar\bre\be builtin will
- explicitly declare an array. There is no maximum limit on the size of
- an array, nor any requirement that members be indexed or assigned con-
- tiguously. Indexed arrays are referenced using integers (including
+ B\bBa\bas\bsh\bh provides one-dimensional indexed and associative array variables.
+ Any variable may be used as an indexed array; the d\bde\bec\bcl\bla\bar\bre\be builtin will
+ explicitly declare an array. There is no maximum limit on the size of
+ an array, nor any requirement that members be indexed or assigned con-
+ tiguously. Indexed arrays are referenced using integers (including
arithmetic expressions) and are zero-based; associative arrays are ref-
erenced using arbitrary strings. Unless otherwise noted, indexed array
indices must be non-negative integers.
- An indexed array is created automatically if any variable is assigned
+ An indexed array is created automatically if any variable is assigned
to using the syntax _\bn_\ba_\bm_\be[_\bs_\bu_\bb_\bs_\bc_\br_\bi_\bp_\bt]=_\bv_\ba_\bl_\bu_\be. The _\bs_\bu_\bb_\bs_\bc_\br_\bi_\bp_\bt is treated as
an arithmetic expression that must evaluate to a number greater than or
- equal to zero. To explicitly declare an indexed array, use d\bde\bec\bcl\bla\bar\bre\be -\b-a\ba
+ equal to zero. To explicitly declare an indexed array, use d\bde\bec\bcl\bla\bar\bre\be -\b-a\ba
_\bn_\ba_\bm_\be (see S\bSH\bHE\bEL\bLL\bL B\bBU\bUI\bIL\bLT\bTI\bIN\bN C\bCO\bOM\bMM\bMA\bAN\bND\bDS\bS below). d\bde\bec\bcl\bla\bar\bre\be -\b-a\ba _\bn_\ba_\bm_\be[\b[_\bs_\bu_\bb_\bs_\bc_\br_\bi_\bp_\bt]\b] is
also accepted; the _\bs_\bu_\bb_\bs_\bc_\br_\bi_\bp_\bt is ignored.
r\bre\bea\bad\bdo\bon\bnl\bly\by builtins. Each attribute applies to all members of an array.
Arrays are assigned using compound assignments of the form _\bn_\ba_\bm_\be=(\b(value_\b1
- ... value_\bn)\b), where each _\bv_\ba_\bl_\bu_\be may be of the form [_\bs_\bu_\bb_\bs_\bc_\br_\bi_\bp_\bt]=_\bs_\bt_\br_\bi_\bn_\bg.
- Indexed array assignments do not require anything but _\bs_\bt_\br_\bi_\bn_\bg. Each
- _\bv_\ba_\bl_\bu_\be in the list is expanded using the shell expansions described be-
+ ... value_\bn)\b), where each _\bv_\ba_\bl_\bu_\be may be of the form [_\bs_\bu_\bb_\bs_\bc_\br_\bi_\bp_\bt]=_\bs_\bt_\br_\bi_\bn_\bg.
+ Indexed array assignments do not require anything but _\bs_\bt_\br_\bi_\bn_\bg. Each
+ _\bv_\ba_\bl_\bu_\be in the list is expanded using the shell expansions described be-
low under E\bEX\bXP\bPA\bAN\bNS\bSI\bIO\bON\bN, but _\bv_\ba_\bl_\bu_\bes that are valid variable assignments in-
- cluding the brackets and subscript do not undergo brace expansion and
+ cluding the brackets and subscript do not undergo brace expansion and
word splitting, as with individual variable assignments.
- When assigning to indexed arrays, if the optional brackets and sub-
- script are supplied, that index is assigned to; otherwise the index of
- the element assigned is the last index assigned to by the statement
+ When assigning to indexed arrays, if the optional brackets and sub-
+ script are supplied, that index is assigned to; otherwise the index of
+ the element assigned is the last index assigned to by the statement
plus one. Indexing starts at zero.
When assigning to an associative array, the words in a compound assign-
- ment may be either assignment statements, for which the subscript is
- required, or a list of words that is interpreted as a sequence of al-
- ternating keys and values: _\bn_\ba_\bm_\be=(\b( _\bk_\be_\by_\b1 _\bv_\ba_\bl_\bu_\be_\b1 _\bk_\be_\by_\b2 _\bv_\ba_\bl_\bu_\be_\b2 ...)\b). These
- are treated identically to _\bn_\ba_\bm_\be=(\b( [_\bk_\be_\by_\b1]=_\bv_\ba_\bl_\bu_\be_\b1 [_\bk_\be_\by_\b2]=_\bv_\ba_\bl_\bu_\be_\b2 ...)\b).
- The first word in the list determines how the remaining words are in-
- terpreted; all assignments in a list must be of the same type. When
- using key/value pairs, the keys may not be missing or empty; a final
+ ment may be either assignment statements, for which the subscript is
+ required, or a list of words that is interpreted as a sequence of al-
+ ternating keys and values: _\bn_\ba_\bm_\be=(\b( _\bk_\be_\by_\b1 _\bv_\ba_\bl_\bu_\be_\b1 _\bk_\be_\by_\b2 _\bv_\ba_\bl_\bu_\be_\b2 ...)\b). These
+ are treated identically to _\bn_\ba_\bm_\be=(\b( [_\bk_\be_\by_\b1]=_\bv_\ba_\bl_\bu_\be_\b1 [_\bk_\be_\by_\b2]=_\bv_\ba_\bl_\bu_\be_\b2 ...)\b).
+ The first word in the list determines how the remaining words are in-
+ terpreted; all assignments in a list must be of the same type. When
+ using key/value pairs, the keys may not be missing or empty; a final
missing value is treated like the empty string.
- This syntax is also accepted by the d\bde\bec\bcl\bla\bar\bre\be builtin. Individual array
- elements may be assigned to using the _\bn_\ba_\bm_\be[_\bs_\bu_\bb_\bs_\bc_\br_\bi_\bp_\bt]=_\bv_\ba_\bl_\bu_\be syntax in-
+ This syntax is also accepted by the d\bde\bec\bcl\bla\bar\bre\be builtin. Individual array
+ elements may be assigned to using the _\bn_\ba_\bm_\be[_\bs_\bu_\bb_\bs_\bc_\br_\bi_\bp_\bt]=_\bv_\ba_\bl_\bu_\be syntax in-
troduced above.
- When assigning to an indexed array, if _\bn_\ba_\bm_\be is subscripted by a nega-
+ When assigning to an indexed array, if _\bn_\ba_\bm_\be is subscripted by a nega-
tive number, that number is interpreted as relative to one greater than
- the maximum index of _\bn_\ba_\bm_\be, so negative indices count back from the end
+ the maximum index of _\bn_\ba_\bm_\be, so negative indices count back from the end
of the array, and an index of -1 references the last element.
- The += operator will append to an array variable when assigning using
+ The += operator will append to an array variable when assigning using
the compound assignment syntax; see P\bPA\bAR\bRA\bAM\bME\bET\bTE\bER\bRS\bS above.
- An array element is referenced using ${_\bn_\ba_\bm_\be[_\bs_\bu_\bb_\bs_\bc_\br_\bi_\bp_\bt]}. The braces
- are required to avoid conflicts with pathname expansion. If _\bs_\bu_\bb_\bs_\bc_\br_\bi_\bp_\bt
+ An array element is referenced using ${_\bn_\ba_\bm_\be[_\bs_\bu_\bb_\bs_\bc_\br_\bi_\bp_\bt]}. The braces
+ are required to avoid conflicts with pathname expansion. If _\bs_\bu_\bb_\bs_\bc_\br_\bi_\bp_\bt
is @\b@ or *\b*, the word expands to all members of _\bn_\ba_\bm_\be, unless noted in the
- description of a builtin or word expansion. These subscripts differ
- only when the word appears within double quotes. If the word is dou-
- ble-quoted, ${_\bn_\ba_\bm_\be[*]} expands to a single word with the value of each
- array member separated by the first character of the I\bIF\bFS\bS special vari-
- able, and ${_\bn_\ba_\bm_\be[@]} expands each element of _\bn_\ba_\bm_\be to a separate word.
+ description of a builtin or word expansion. These subscripts differ
+ only when the word appears within double quotes. If the word is dou-
+ ble-quoted, ${_\bn_\ba_\bm_\be[*]} expands to a single word with the value of each
+ array member separated by the first character of the I\bIF\bFS\bS special vari-
+ able, and ${_\bn_\ba_\bm_\be[@]} expands each element of _\bn_\ba_\bm_\be to a separate word.
When there are no array members, ${_\bn_\ba_\bm_\be[@]} expands to nothing. If the
- double-quoted expansion occurs within a word, the expansion of the
- first parameter is joined with the beginning part of the expansion of
- the original word, and the expansion of the last parameter is joined
- with the last part of the expansion of the original word. This is
- analogous to the expansion of the special parameters *\b* and @\b@ (see S\bSp\bpe\be-\b-
+ double-quoted expansion occurs within a word, the expansion of the
+ first parameter is joined with the beginning part of the expansion of
+ the original word, and the expansion of the last parameter is joined
+ with the last part of the expansion of the original word. This is
+ analogous to the expansion of the special parameters *\b* and @\b@ (see S\bSp\bpe\be-\b-
c\bci\bia\bal\bl P\bPa\bar\bra\bam\bme\bet\bte\ber\brs\bs above).
- ${#_\bn_\ba_\bm_\be[_\bs_\bu_\bb_\bs_\bc_\br_\bi_\bp_\bt]} expands to the length of ${_\bn_\ba_\bm_\be[_\bs_\bu_\bb_\bs_\bc_\br_\bi_\bp_\bt]}. If
+ ${#_\bn_\ba_\bm_\be[_\bs_\bu_\bb_\bs_\bc_\br_\bi_\bp_\bt]} expands to the length of ${_\bn_\ba_\bm_\be[_\bs_\bu_\bb_\bs_\bc_\br_\bi_\bp_\bt]}. If
_\bs_\bu_\bb_\bs_\bc_\br_\bi_\bp_\bt is *\b* or @\b@, the expansion is the number of elements in the ar-
ray.
If the _\bs_\bu_\bb_\bs_\bc_\br_\bi_\bp_\bt used to reference an element of an indexed array eval-
- uates to a number less than zero, it is interpreted as relative to one
- greater than the maximum index of the array, so negative indices count
- back from the end of the array, and an index of -1 references the last
+ uates to a number less than zero, it is interpreted as relative to one
+ greater than the maximum index of the array, so negative indices count
+ back from the end of the array, and an index of -1 references the last
element.
Referencing an array variable without a subscript is equivalent to ref-
- erencing the array with a subscript of 0. Any reference to a variable
+ erencing the array with a subscript of 0. Any reference to a variable
using a valid subscript is valid, and b\bba\bas\bsh\bh will create an array if nec-
essary.
- An array variable is considered set if a subscript has been assigned a
+ An array variable is considered set if a subscript has been assigned a
value. The null string is a valid value.
- It is possible to obtain the keys (indices) of an array as well as the
- values. ${!\b!_\bn_\ba_\bm_\be[_\b@]} and ${!\b!_\bn_\ba_\bm_\be[_\b*]} expand to the indices assigned in
+ It is possible to obtain the keys (indices) of an array as well as the
+ values. ${!\b!_\bn_\ba_\bm_\be[_\b@]} and ${!\b!_\bn_\ba_\bm_\be[_\b*]} expand to the indices assigned in
array variable _\bn_\ba_\bm_\be. The treatment when in double quotes is similar to
the expansion of the special parameters _\b@ and _\b* within double quotes.
The u\bun\bns\bse\bet\bt builtin is used to destroy arrays. u\bun\bns\bse\bet\bt _\bn_\ba_\bm_\be[_\bs_\bu_\bb_\bs_\bc_\br_\bi_\bp_\bt] un-
- sets the array element at index _\bs_\bu_\bb_\bs_\bc_\br_\bi_\bp_\bt, for both indexed and asso-
- ciative arrays. Negative subscripts to indexed arrays are interpreted
- as described above. Unsetting the last element of an array variable
- does not unset the variable. u\bun\bns\bse\bet\bt _\bn_\ba_\bm_\be, where _\bn_\ba_\bm_\be is an array, re-
- moves the entire array. u\bun\bns\bse\bet\bt _\bn_\ba_\bm_\be[_\bs_\bu_\bb_\bs_\bc_\br_\bi_\bp_\bt] behaves differently de-
- pending on whether _\bn_\ba_\bm_\be is an indexed or associative array when _\bs_\bu_\bb_\b-
+ sets the array element at index _\bs_\bu_\bb_\bs_\bc_\br_\bi_\bp_\bt, for both indexed and asso-
+ ciative arrays. Negative subscripts to indexed arrays are interpreted
+ as described above. Unsetting the last element of an array variable
+ does not unset the variable. u\bun\bns\bse\bet\bt _\bn_\ba_\bm_\be, where _\bn_\ba_\bm_\be is an array, re-
+ moves the entire array. u\bun\bns\bse\bet\bt _\bn_\ba_\bm_\be[_\bs_\bu_\bb_\bs_\bc_\br_\bi_\bp_\bt] behaves differently de-
+ pending on whether _\bn_\ba_\bm_\be is an indexed or associative array when _\bs_\bu_\bb_\b-
_\bs_\bc_\br_\bi_\bp_\bt is *\b* or @\b@. If _\bn_\ba_\bm_\be is an associative array, this unsets the el-
- ement with subscript *\b* or @\b@. If _\bn_\ba_\bm_\be is an indexed array, unset re-
+ ement with subscript *\b* or @\b@. If _\bn_\ba_\bm_\be is an indexed array, unset re-
moves all of the elements but does not remove the array itself.
- When using a variable name with a subscript as an argument to a com-
- mand, such as with u\bun\bns\bse\bet\bt, without using the word expansion syntax de-
- scribed above, (e.g., unset a[4]), the argument is subject to pathname
- expansion. Quote the argument if pathname expansion is not desired
+ When using a variable name with a subscript as an argument to a com-
+ mand, such as with u\bun\bns\bse\bet\bt, without using the word expansion syntax de-
+ scribed above, (e.g., unset a[4]), the argument is subject to pathname
+ expansion. Quote the argument if pathname expansion is not desired
(e.g., unset 'a[4]').
- The d\bde\bec\bcl\bla\bar\bre\be, l\blo\boc\bca\bal\bl, and r\bre\bea\bad\bdo\bon\bnl\bly\by builtins each accept a -\b-a\ba option to
- specify an indexed array and a -\b-A\bA option to specify an associative ar-
- ray. If both options are supplied, -\b-A\bA takes precedence. The r\bre\bea\bad\bd
- builtin accepts a -\b-a\ba option to assign a list of words read from the
+ The d\bde\bec\bcl\bla\bar\bre\be, l\blo\boc\bca\bal\bl, and r\bre\bea\bad\bdo\bon\bnl\bly\by builtins each accept a -\b-a\ba option to
+ specify an indexed array and a -\b-A\bA option to specify an associative ar-
+ ray. If both options are supplied, -\b-A\bA takes precedence. The r\bre\bea\bad\bd
+ builtin accepts a -\b-a\ba option to assign a list of words read from the
standard input to an array. The s\bse\bet\bt and d\bde\bec\bcl\bla\bar\bre\be builtins display array
- values in a way that allows them to be reused as assignments. Other
- builtins accept array name arguments as well (e.g., m\bma\bap\bpf\bfi\bil\ble\be); see the
- descriptions of individual builtins below for details. The shell pro-
+ values in a way that allows them to be reused as assignments. Other
+ builtins accept array name arguments as well (e.g., m\bma\bap\bpf\bfi\bil\ble\be); see the
+ descriptions of individual builtins below for details. The shell pro-
vides a number of builtin array variables.
E\bEX\bXP\bPA\bAN\bNS\bSI\bIO\bON\bN
_\bm_\be_\bt_\bi_\bc _\be_\bx_\bp_\ba_\bn_\bs_\bi_\bo_\bn, _\bw_\bo_\br_\bd _\bs_\bp_\bl_\bi_\bt_\bt_\bi_\bn_\bg, _\bp_\ba_\bt_\bh_\bn_\ba_\bm_\be _\be_\bx_\bp_\ba_\bn_\bs_\bi_\bo_\bn, and _\bq_\bu_\bo_\bt_\be _\br_\be_\bm_\bo_\bv_\ba_\bl.
The order of expansions is: brace expansion; tilde expansion, parameter
- and variable expansion, arithmetic expansion, and command substitution
- (done in a left-to-right fashion); word splitting; pathname expansion;
+ and variable expansion, arithmetic expansion, and command substitution
+ (done in a left-to-right fashion); word splitting; pathname expansion;
and quote removal.
On systems that can support it, there is an additional expansion avail-
- able: _\bp_\br_\bo_\bc_\be_\bs_\bs _\bs_\bu_\bb_\bs_\bt_\bi_\bt_\bu_\bt_\bi_\bo_\bn. This is performed at the same time as
- tilde, parameter, variable, and arithmetic expansion and command sub-
+ able: _\bp_\br_\bo_\bc_\be_\bs_\bs _\bs_\bu_\bb_\bs_\bt_\bi_\bt_\bu_\bt_\bi_\bo_\bn. This is performed at the same time as
+ tilde, parameter, variable, and arithmetic expansion and command sub-
stitution.
- _\bQ_\bu_\bo_\bt_\be _\br_\be_\bm_\bo_\bv_\ba_\bl is always performed last. It removes quote characters
- present in the original word, not ones resulting from one of the other
+ _\bQ_\bu_\bo_\bt_\be _\br_\be_\bm_\bo_\bv_\ba_\bl is always performed last. It removes quote characters
+ present in the original word, not ones resulting from one of the other
expansions, unless they have been quoted themselves.
- Only brace expansion, word splitting, and pathname expansion can in-
- crease the number of words of the expansion; other expansions expand a
- single word to a single word. The only exceptions to this are the ex-
+ Only brace expansion, word splitting, and pathname expansion can in-
+ crease the number of words of the expansion; other expansions expand a
+ single word to a single word. The only exceptions to this are the ex-
pansions of "\b"$\b$@\b@"\b" and "\b"$\b${\b{_\bn_\ba_\bm_\be[\b[@\b@]\b]}\b}"\b", and, in most cases, $\b$*\b* and
$\b${\b{_\bn_\ba_\bm_\be[\b[*\b*]\b]}\b} as explained above (see P\bPA\bAR\bRA\bAM\bME\bET\bTE\bER\bRS\bS).
B\bBr\bra\bac\bce\be E\bEx\bxp\bpa\ban\bns\bsi\bio\bon\bn
- _\bB_\br_\ba_\bc_\be _\be_\bx_\bp_\ba_\bn_\bs_\bi_\bo_\bn is a mechanism to generate arbitrary strings sharing a
+ _\bB_\br_\ba_\bc_\be _\be_\bx_\bp_\ba_\bn_\bs_\bi_\bo_\bn is a mechanism to generate arbitrary strings sharing a
common prefix and suffix, either of which can be empty. This mechanism
- is similar to _\bp_\ba_\bt_\bh_\bn_\ba_\bm_\be _\be_\bx_\bp_\ba_\bn_\bs_\bi_\bo_\bn, but the filenames generated need not
- exist. Patterns to be brace expanded are formed from an optional _\bp_\br_\be_\b-
- _\ba_\bm_\bb_\bl_\be, followed by either a series of comma-separated strings or a se-
- quence expression between a pair of braces, followed by an optional
- _\bp_\bo_\bs_\bt_\bs_\bc_\br_\bi_\bp_\bt. The preamble is prefixed to each string contained within
- the braces, and the postscript is then appended to each resulting
+ is similar to _\bp_\ba_\bt_\bh_\bn_\ba_\bm_\be _\be_\bx_\bp_\ba_\bn_\bs_\bi_\bo_\bn, but the filenames generated need not
+ exist. Patterns to be brace expanded are formed from an optional _\bp_\br_\be_\b-
+ _\ba_\bm_\bb_\bl_\be, followed by either a series of comma-separated strings or a se-
+ quence expression between a pair of braces, followed by an optional
+ _\bp_\bo_\bs_\bt_\bs_\bc_\br_\bi_\bp_\bt. The preamble is prefixed to each string contained within
+ the braces, and the postscript is then appended to each resulting
string, expanding left to right.
- Brace expansions may be nested. The results of each expanded string
+ Brace expansions may be nested. The results of each expanded string
are not sorted; brace expansion preserves left to right order. For ex-
ample, a{\b{d,c,b}\b}e expands into "ade ace abe".
- A sequence expression takes the form {\b{_\bx.\b..\b._\by[\b[.\b..\b._\bi_\bn_\bc_\br]\b]}\b}, where _\bx and _\by are
- either integers or single letters, and _\bi_\bn_\bc_\br, an optional increment, is
+ A sequence expression takes the form {\b{_\bx.\b..\b._\by[\b[.\b..\b._\bi_\bn_\bc_\br]\b]}\b}, where _\bx and _\by are
+ either integers or single letters, and _\bi_\bn_\bc_\br, an optional increment, is
an integer. When integers are supplied, the expression expands to each
- number between _\bx and _\by, inclusive. If the supplied integers are pre-
- fixed with _\b0, each term will have the same width, zero-padding if nec-
- essary. When either _\bx or _\by begins with a zero, the shell attempts to
- force all generated terms to contain the same number of digits, zero-
+ number between _\bx and _\by, inclusive. If the supplied integers are pre-
+ fixed with _\b0, each term will have the same width, zero-padding if nec-
+ essary. When either _\bx or _\by begins with a zero, the shell attempts to
+ force all generated terms to contain the same number of digits, zero-
padding where necessary. When letters are supplied, the expression ex-
- pands to each character lexicographically between _\bx and _\by, inclusive,
+ pands to each character lexicographically between _\bx and _\by, inclusive,
using the default C locale. Note that both _\bx and _\by must be of the same
- type (integer or letter). When the increment is supplied, it is used
- as the difference between each term. The default increment is 1 or -1
+ type (integer or letter). When the increment is supplied, it is used
+ as the difference between each term. The default increment is 1 or -1
as appropriate.
Brace expansion is performed before any other expansions, and any char-
- acters special to other expansions are preserved in the result. It is
- strictly textual. B\bBa\bas\bsh\bh does not apply any syntactic interpretation to
+ acters special to other expansions are preserved in the result. It is
+ strictly textual. B\bBa\bas\bsh\bh does not apply any syntactic interpretation to
the context of the expansion or the text between the braces.
- A correctly-formed brace expansion must contain unquoted opening and
+ A correctly-formed brace expansion must contain unquoted opening and
closing braces, and at least one unquoted comma or a valid sequence ex-
pression. Any incorrectly formed brace expansion is left unchanged.
A {\b{ or ,\b, may be quoted with a backslash to prevent its being considered
- part of a brace expression. To avoid conflicts with parameter expan-
+ part of a brace expression. To avoid conflicts with parameter expan-
sion, the string $\b${\b{ is not considered eligible for brace expansion, and
inhibits brace expansion until the closing }\b}.
or
chown root /usr/{ucb/{ex,edit},lib/{ex?.?*,how_ex}}
- Brace expansion introduces a slight incompatibility with historical
- versions of s\bsh\bh. s\bsh\bh does not treat opening or closing braces specially
- when they appear as part of a word, and preserves them in the output.
- B\bBa\bas\bsh\bh removes braces from words as a consequence of brace expansion.
- For example, a word entered to s\bsh\bh as _\bf_\bi_\bl_\be_\b{_\b1_\b,_\b2_\b} appears identically in
- the output. B\bBa\bas\bsh\bh outputs that word as _\bf_\bi_\bl_\be_\b1 _\bf_\bi_\bl_\be_\b2 after brace expan-
- sion. Start b\bba\bas\bsh\bh with the +\b+B\bB option or disable brace expansion with
+ Brace expansion introduces a slight incompatibility with historical
+ versions of s\bsh\bh. s\bsh\bh does not treat opening or closing braces specially
+ when they appear as part of a word, and preserves them in the output.
+ B\bBa\bas\bsh\bh removes braces from words as a consequence of brace expansion.
+ For example, a word entered to s\bsh\bh as _\bf_\bi_\bl_\be_\b{_\b1_\b,_\b2_\b} appears identically in
+ the output. B\bBa\bas\bsh\bh outputs that word as _\bf_\bi_\bl_\be_\b1 _\bf_\bi_\bl_\be_\b2 after brace expan-
+ sion. Start b\bba\bas\bsh\bh with the +\b+B\bB option or disable brace expansion with
the +\b+B\bB option to the s\bse\bet\bt command (see S\bSH\bHE\bEL\bLL\bL B\bBU\bUI\bIL\bLT\bTI\bIN\bN C\bCO\bOM\bMM\bMA\bAN\bND\bDS\bS below) for
strict s\bsh\bh compatibility.
T\bTi\bil\bld\bde\be E\bEx\bxp\bpa\ban\bns\bsi\bio\bon\bn
- If a word begins with an unquoted tilde character ("~\b~"), all of the
- characters preceding the first unquoted slash (or all characters, if
- there is no unquoted slash) are considered a _\bt_\bi_\bl_\bd_\be_\b-_\bp_\br_\be_\bf_\bi_\bx. If none of
- the characters in the tilde-prefix are quoted, the characters in the
- tilde-prefix following the tilde are treated as a possible _\bl_\bo_\bg_\bi_\bn _\bn_\ba_\bm_\be.
- If this login name is the null string, the tilde is replaced with the
+ If a word begins with an unquoted tilde character ("~\b~"), all of the
+ characters preceding the first unquoted slash (or all characters, if
+ there is no unquoted slash) are considered a _\bt_\bi_\bl_\bd_\be_\b-_\bp_\br_\be_\bf_\bi_\bx. If none of
+ the characters in the tilde-prefix are quoted, the characters in the
+ tilde-prefix following the tilde are treated as a possible _\bl_\bo_\bg_\bi_\bn _\bn_\ba_\bm_\be.
+ If this login name is the null string, the tilde is replaced with the
value of the shell parameter H\bHO\bOM\bME\bE. If H\bHO\bOM\bME\bE is unset, the tilde expands
- to the home directory of the user executing the shell instead. Other-
- wise, the tilde-prefix is replaced with the home directory associated
+ to the home directory of the user executing the shell instead. Other-
+ wise, the tilde-prefix is replaced with the home directory associated
with the specified login name.
- If the tilde-prefix is a "~+", the value of the shell variable P\bPW\bWD\bD re-
+ If the tilde-prefix is a "~+", the value of the shell variable P\bPW\bWD\bD re-
places the tilde-prefix. If the tilde-prefix is a "~-", the shell sub-
- stitutes the value of the shell variable O\bOL\bLD\bDP\bPW\bWD\bD, if it is set. If the
- characters following the tilde in the tilde-prefix consist of a number
- _\bN, optionally prefixed by a "+" or a "-", the tilde-prefix is replaced
+ stitutes the value of the shell variable O\bOL\bLD\bDP\bPW\bWD\bD, if it is set. If the
+ characters following the tilde in the tilde-prefix consist of a number
+ _\bN, optionally prefixed by a "+" or a "-", the tilde-prefix is replaced
with the corresponding element from the directory stack, as it would be
displayed by the d\bdi\bir\brs\bs builtin invoked with the characters following the
- tilde in the tilde-prefix as an argument. If the characters following
+ tilde in the tilde-prefix as an argument. If the characters following
the tilde in the tilde-prefix consist of a number without a leading "+"
or "-", tilde expansion assumes "+".
- The results of tilde expansion are treated as if they were quoted, so
- the replacement is not subject to word splitting and pathname expan-
+ The results of tilde expansion are treated as if they were quoted, so
+ the replacement is not subject to word splitting and pathname expan-
sion.
- If the login name is invalid, or the tilde expansion fails, the tilde-
+ If the login name is invalid, or the tilde expansion fails, the tilde-
prefix is unchanged.
- B\bBa\bas\bsh\bh checks each variable assignment for unquoted tilde-prefixes imme-
- diately following a :\b: or the first =\b=, and performs tilde expansion in
- these cases. Consequently, one may use filenames with tildes in as-
- signments to P\bPA\bAT\bTH\bH, M\bMA\bAI\bIL\bLP\bPA\bAT\bTH\bH, and C\bCD\bDP\bPA\bAT\bTH\bH, and the shell assigns the ex-
+ B\bBa\bas\bsh\bh checks each variable assignment for unquoted tilde-prefixes imme-
+ diately following a :\b: or the first =\b=, and performs tilde expansion in
+ these cases. Consequently, one may use filenames with tildes in as-
+ signments to P\bPA\bAT\bTH\bH, M\bMA\bAI\bIL\bLP\bPA\bAT\bTH\bH, and C\bCD\bDP\bPA\bAT\bTH\bH, and the shell assigns the ex-
panded value.
- B\bBa\bas\bsh\bh also performs tilde expansion on words satisfying the conditions
+ B\bBa\bas\bsh\bh also performs tilde expansion on words satisfying the conditions
of variable assignments (as described above under P\bPA\bAR\bRA\bAM\bME\bET\bTE\bER\bRS\bS) when they
- appear as arguments to simple commands. B\bBa\bas\bsh\bh does not do this, except
+ appear as arguments to simple commands. B\bBa\bas\bsh\bh does not do this, except
for the _\bd_\be_\bc_\bl_\ba_\br_\ba_\bt_\bi_\bo_\bn commands listed above, when in posix mode.
P\bPa\bar\bra\bam\bme\bet\bte\ber\br E\bEx\bxp\bpa\ban\bns\bsi\bio\bon\bn
The "$\b$" character introduces parameter expansion, command substitution,
- or arithmetic expansion. The parameter name or symbol to be expanded
- may be enclosed in braces, which are optional but serve to protect the
- variable to be expanded from characters immediately following it which
+ or arithmetic expansion. The parameter name or symbol to be expanded
+ may be enclosed in braces, which are optional but serve to protect the
+ variable to be expanded from characters immediately following it which
could be interpreted as part of the name.
- When braces are used, the matching ending brace is the first "}\b}" not
+ When braces are used, the matching ending brace is the first "}\b}" not
escaped by a backslash or within a quoted string, and not within an em-
- bedded arithmetic expansion, command substitution, or parameter expan-
+ bedded arithmetic expansion, command substitution, or parameter expan-
sion.
The basic form of parameter expansion is
${_\bp_\ba_\br_\ba_\bm_\be_\bt_\be_\br}
which substitutes the value of _\bp_\ba_\br_\ba_\bm_\be_\bt_\be_\br. The braces are required when
- _\bp_\ba_\br_\ba_\bm_\be_\bt_\be_\br is a positional parameter with more than one digit, or when
- _\bp_\ba_\br_\ba_\bm_\be_\bt_\be_\br is followed by a character which is not to be interpreted as
- part of its name. The _\bp_\ba_\br_\ba_\bm_\be_\bt_\be_\br is a shell parameter as described
+ _\bp_\ba_\br_\ba_\bm_\be_\bt_\be_\br is a positional parameter with more than one digit, or when
+ _\bp_\ba_\br_\ba_\bm_\be_\bt_\be_\br is followed by a character which is not to be interpreted as
+ part of its name. The _\bp_\ba_\br_\ba_\bm_\be_\bt_\be_\br is a shell parameter as described
above P\bPA\bAR\bRA\bAM\bME\bET\bTE\bER\bRS\bS) or an array reference (A\bAr\brr\bra\bay\bys\bs).
- If the first character of _\bp_\ba_\br_\ba_\bm_\be_\bt_\be_\br is an exclamation point (!\b!), and
+ If the first character of _\bp_\ba_\br_\ba_\bm_\be_\bt_\be_\br is an exclamation point (!\b!), and
_\bp_\ba_\br_\ba_\bm_\be_\bt_\be_\br is not a _\bn_\ba_\bm_\be_\br_\be_\bf, it introduces a level of indirection. B\bBa\bas\bsh\bh
uses the value formed by expanding the rest of _\bp_\ba_\br_\ba_\bm_\be_\bt_\be_\br as the new _\bp_\ba_\b-
- _\br_\ba_\bm_\be_\bt_\be_\br; this new parameter is then expanded and that value is used in
- the rest of the expansion, rather than the expansion of the original
- _\bp_\ba_\br_\ba_\bm_\be_\bt_\be_\br. This is known as _\bi_\bn_\bd_\bi_\br_\be_\bc_\bt _\be_\bx_\bp_\ba_\bn_\bs_\bi_\bo_\bn. The value is subject
- to tilde expansion, parameter expansion, command substitution, and
- arithmetic expansion. If _\bp_\ba_\br_\ba_\bm_\be_\bt_\be_\br is a nameref, this expands to the
+ _\br_\ba_\bm_\be_\bt_\be_\br; this new parameter is then expanded and that value is used in
+ the rest of the expansion, rather than the expansion of the original
+ _\bp_\ba_\br_\ba_\bm_\be_\bt_\be_\br. This is known as _\bi_\bn_\bd_\bi_\br_\be_\bc_\bt _\be_\bx_\bp_\ba_\bn_\bs_\bi_\bo_\bn. The value is subject
+ to tilde expansion, parameter expansion, command substitution, and
+ arithmetic expansion. If _\bp_\ba_\br_\ba_\bm_\be_\bt_\be_\br is a nameref, this expands to the
name of the parameter referenced by _\bp_\ba_\br_\ba_\bm_\be_\bt_\be_\br instead of performing the
complete indirect expansion, for compatibility. The exceptions to this
are the expansions of ${!\b!_\bp_\br_\be_\bf_\bi_\bx*\b*} and ${!\b!_\bn_\ba_\bm_\be[_\b@]} described below. The
- exclamation point must immediately follow the left brace in order to
+ exclamation point must immediately follow the left brace in order to
introduce indirection.
In each of the cases below, _\bw_\bo_\br_\bd is subject to tilde expansion, parame-
ter expansion, command substitution, and arithmetic expansion.
When not performing substring expansion, using the forms documented be-
- low (e.g., :\b:-\b-), b\bba\bas\bsh\bh tests for a parameter that is unset or null.
+ low (e.g., :\b:-\b-), b\bba\bas\bsh\bh tests for a parameter that is unset or null.
Omitting the colon tests only for a parameter that is unset.
${_\bp_\ba_\br_\ba_\bm_\be_\bt_\be_\br:\b:-\b-_\bw_\bo_\br_\bd}
- U\bUs\bse\be D\bDe\bef\bfa\bau\bul\blt\bt V\bVa\bal\blu\bue\bes\bs. If _\bp_\ba_\br_\ba_\bm_\be_\bt_\be_\br is unset or null, the expan-
- sion of _\bw_\bo_\br_\bd is substituted. Otherwise, the value of _\bp_\ba_\br_\ba_\bm_\be_\bt_\be_\br
+ U\bUs\bse\be D\bDe\bef\bfa\bau\bul\blt\bt V\bVa\bal\blu\bue\bes\bs. If _\bp_\ba_\br_\ba_\bm_\be_\bt_\be_\br is unset or null, the expan-
+ sion of _\bw_\bo_\br_\bd is substituted. Otherwise, the value of _\bp_\ba_\br_\ba_\bm_\be_\bt_\be_\br
is substituted.
${_\bp_\ba_\br_\ba_\bm_\be_\bt_\be_\br:\b:=\b=_\bw_\bo_\br_\bd}
- A\bAs\bss\bsi\big\bgn\bn D\bDe\bef\bfa\bau\bul\blt\bt V\bVa\bal\blu\bue\bes\bs. If _\bp_\ba_\br_\ba_\bm_\be_\bt_\be_\br is unset or null, the ex-
- pansion of _\bw_\bo_\br_\bd is assigned to _\bp_\ba_\br_\ba_\bm_\be_\bt_\be_\br, and the expansion is
+ A\bAs\bss\bsi\big\bgn\bn D\bDe\bef\bfa\bau\bul\blt\bt V\bVa\bal\blu\bue\bes\bs. If _\bp_\ba_\br_\ba_\bm_\be_\bt_\be_\br is unset or null, the ex-
+ pansion of _\bw_\bo_\br_\bd is assigned to _\bp_\ba_\br_\ba_\bm_\be_\bt_\be_\br, and the expansion is
the final value of _\bp_\ba_\br_\ba_\bm_\be_\bt_\be_\br. Positional parameters and special
parameters may not be assigned in this way.
${_\bp_\ba_\br_\ba_\bm_\be_\bt_\be_\br:\b:?\b?_\bw_\bo_\br_\bd}
- D\bDi\bis\bsp\bpl\bla\bay\by E\bEr\brr\bro\bor\br i\bif\bf N\bNu\bul\bll\bl o\bor\br U\bUn\bns\bse\bet\bt. If _\bp_\ba_\br_\ba_\bm_\be_\bt_\be_\br is null or unset,
+ D\bDi\bis\bsp\bpl\bla\bay\by E\bEr\brr\bro\bor\br i\bif\bf N\bNu\bul\bll\bl o\bor\br U\bUn\bns\bse\bet\bt. If _\bp_\ba_\br_\ba_\bm_\be_\bt_\be_\br is null or unset,
the shell writes the expansion of _\bw_\bo_\br_\bd (or a message to that ef-
fect if _\bw_\bo_\br_\bd is not present) to the standard error and, if it is
- not interactive, exits with a non-zero status. An interactive
+ not interactive, exits with a non-zero status. An interactive
shell does not exit, but does not execute the command associated
- with the expansion. Otherwise, the value of _\bp_\ba_\br_\ba_\bm_\be_\bt_\be_\br is sub-
+ with the expansion. Otherwise, the value of _\bp_\ba_\br_\ba_\bm_\be_\bt_\be_\br is sub-
stituted.
${_\bp_\ba_\br_\ba_\bm_\be_\bt_\be_\br:\b:+\b+_\bw_\bo_\br_\bd}
- U\bUs\bse\be A\bAl\blt\bte\ber\brn\bna\bat\bte\be V\bVa\bal\blu\bue\be. If _\bp_\ba_\br_\ba_\bm_\be_\bt_\be_\br is null or unset, nothing is
- substituted, otherwise the expansion of _\bw_\bo_\br_\bd is substituted.
+ U\bUs\bse\be A\bAl\blt\bte\ber\brn\bna\bat\bte\be V\bVa\bal\blu\bue\be. If _\bp_\ba_\br_\ba_\bm_\be_\bt_\be_\br is null or unset, nothing is
+ substituted, otherwise the expansion of _\bw_\bo_\br_\bd is substituted.
The value of _\bp_\ba_\br_\ba_\bm_\be_\bt_\be_\br is not used.
${_\bp_\ba_\br_\ba_\bm_\be_\bt_\be_\br:\b:_\bo_\bf_\bf_\bs_\be_\bt}
${_\bp_\ba_\br_\ba_\bm_\be_\bt_\be_\br:\b:_\bo_\bf_\bf_\bs_\be_\bt:\b:_\bl_\be_\bn_\bg_\bt_\bh}
- S\bSu\bub\bbs\bst\btr\bri\bin\bng\bg E\bEx\bxp\bpa\ban\bns\bsi\bio\bon\bn. Expands to up to _\bl_\be_\bn_\bg_\bt_\bh characters of the
- value of _\bp_\ba_\br_\ba_\bm_\be_\bt_\be_\br starting at the character specified by _\bo_\bf_\bf_\b-
- _\bs_\be_\bt. If _\bp_\ba_\br_\ba_\bm_\be_\bt_\be_\br is @\b@ or *\b*, an indexed array subscripted by @\b@
- or *\b*, or an associative array name, the results differ as de-
- scribed below. If _\bl_\be_\bn_\bg_\bt_\bh is omitted, expands to the substring
+ S\bSu\bub\bbs\bst\btr\bri\bin\bng\bg E\bEx\bxp\bpa\ban\bns\bsi\bio\bon\bn. Expands to up to _\bl_\be_\bn_\bg_\bt_\bh characters of the
+ value of _\bp_\ba_\br_\ba_\bm_\be_\bt_\be_\br starting at the character specified by _\bo_\bf_\bf_\b-
+ _\bs_\be_\bt. If _\bp_\ba_\br_\ba_\bm_\be_\bt_\be_\br is @\b@ or *\b*, an indexed array subscripted by @\b@
+ or *\b*, or an associative array name, the results differ as de-
+ scribed below. If _\bl_\be_\bn_\bg_\bt_\bh is omitted, expands to the substring
of the value of _\bp_\ba_\br_\ba_\bm_\be_\bt_\be_\br starting at the character specified by
_\bo_\bf_\bf_\bs_\be_\bt and extending to the end of the value. _\bl_\be_\bn_\bg_\bt_\bh and _\bo_\bf_\bf_\bs_\be_\bt
are arithmetic expressions (see A\bAR\bRI\bIT\bTH\bHM\bME\bET\bTI\bIC\bC E\bEV\bVA\bAL\bLU\bUA\bAT\bTI\bIO\bON\bN below).
- If _\bo_\bf_\bf_\bs_\be_\bt evaluates to a number less than zero, the value is
+ If _\bo_\bf_\bf_\bs_\be_\bt evaluates to a number less than zero, the value is
used as an offset in characters from the end of the value of _\bp_\ba_\b-
- _\br_\ba_\bm_\be_\bt_\be_\br. If _\bl_\be_\bn_\bg_\bt_\bh evaluates to a number less than zero, it is
+ _\br_\ba_\bm_\be_\bt_\be_\br. If _\bl_\be_\bn_\bg_\bt_\bh evaluates to a number less than zero, it is
interpreted as an offset in characters from the end of the value
- of _\bp_\ba_\br_\ba_\bm_\be_\bt_\be_\br rather than a number of characters, and the expan-
- sion is the characters between _\bo_\bf_\bf_\bs_\be_\bt and that result. Note
- that a negative offset must be separated from the colon by at
+ of _\bp_\ba_\br_\ba_\bm_\be_\bt_\be_\br rather than a number of characters, and the expan-
+ sion is the characters between _\bo_\bf_\bf_\bs_\be_\bt and that result. Note
+ that a negative offset must be separated from the colon by at
least one space to avoid being confused with the :\b:-\b- expansion.
- If _\bp_\ba_\br_\ba_\bm_\be_\bt_\be_\br is @\b@ or *\b*, the result is _\bl_\be_\bn_\bg_\bt_\bh positional parame-
- ters beginning at _\bo_\bf_\bf_\bs_\be_\bt. A negative _\bo_\bf_\bf_\bs_\be_\bt is taken relative
- to one greater than the greatest positional parameter, so an
+ If _\bp_\ba_\br_\ba_\bm_\be_\bt_\be_\br is @\b@ or *\b*, the result is _\bl_\be_\bn_\bg_\bt_\bh positional parame-
+ ters beginning at _\bo_\bf_\bf_\bs_\be_\bt. A negative _\bo_\bf_\bf_\bs_\be_\bt is taken relative
+ to one greater than the greatest positional parameter, so an
offset of -1 evaluates to the last positional parameter (or 0 if
- there are no positional parameters). It is an expansion error
+ there are no positional parameters). It is an expansion error
if _\bl_\be_\bn_\bg_\bt_\bh evaluates to a number less than zero.
If _\bp_\ba_\br_\ba_\bm_\be_\bt_\be_\br is an indexed array name subscripted by @ or *, the
result is the _\bl_\be_\bn_\bg_\bt_\bh members of the array beginning with ${_\bp_\ba_\br_\ba_\b-
- _\bm_\be_\bt_\be_\br[_\bo_\bf_\bf_\bs_\be_\bt]}. A negative _\bo_\bf_\bf_\bs_\be_\bt is taken relative to one
+ _\bm_\be_\bt_\be_\br[_\bo_\bf_\bf_\bs_\be_\bt]}. A negative _\bo_\bf_\bf_\bs_\be_\bt is taken relative to one
greater than the maximum index of the specified array. It is an
expansion error if _\bl_\be_\bn_\bg_\bt_\bh evaluates to a number less than zero.
Substring expansion applied to an associative array produces un-
defined results.
- Substring indexing is zero-based unless the positional parame-
- ters are used, in which case the indexing starts at 1 by de-
- fault. If _\bo_\bf_\bf_\bs_\be_\bt is 0, and the positional parameters are used,
+ Substring indexing is zero-based unless the positional parame-
+ ters are used, in which case the indexing starts at 1 by de-
+ fault. If _\bo_\bf_\bf_\bs_\be_\bt is 0, and the positional parameters are used,
$\b$0\b0 is prefixed to the list.
${!\b!_\bp_\br_\be_\bf_\bi_\bx*\b*}
${!\b!_\bp_\br_\be_\bf_\bi_\bx@\b@}
- N\bNa\bam\bme\bes\bs m\bma\bat\btc\bch\bhi\bin\bng\bg p\bpr\bre\bef\bfi\bix\bx. Expands to the names of variables whose
+ N\bNa\bam\bme\bes\bs m\bma\bat\btc\bch\bhi\bin\bng\bg p\bpr\bre\bef\bfi\bix\bx. Expands to the names of variables whose
names begin with _\bp_\br_\be_\bf_\bi_\bx, separated by the first character of the
- I\bIF\bFS\bS special variable. When _\b@ is used and the expansion appears
- within double quotes, each variable name expands to a separate
+ I\bIF\bFS\bS special variable. When _\b@ is used and the expansion appears
+ within double quotes, each variable name expands to a separate
word.
${!\b!_\bn_\ba_\bm_\be[_\b@]}
${!\b!_\bn_\ba_\bm_\be[_\b*]}
- L\bLi\bis\bst\bt o\bof\bf a\bar\brr\bra\bay\by k\bke\bey\bys\bs. If _\bn_\ba_\bm_\be is an array variable, expands to
- the list of array indices (keys) assigned in _\bn_\ba_\bm_\be. If _\bn_\ba_\bm_\be is
- not an array, expands to 0 if _\bn_\ba_\bm_\be is set and null otherwise.
- When _\b@ is used and the expansion appears within double quotes,
+ L\bLi\bis\bst\bt o\bof\bf a\bar\brr\bra\bay\by k\bke\bey\bys\bs. If _\bn_\ba_\bm_\be is an array variable, expands to
+ the list of array indices (keys) assigned in _\bn_\ba_\bm_\be. If _\bn_\ba_\bm_\be is
+ not an array, expands to 0 if _\bn_\ba_\bm_\be is set and null otherwise.
+ When _\b@ is used and the expansion appears within double quotes,
each key expands to a separate word.
${#\b#_\bp_\ba_\br_\ba_\bm_\be_\bt_\be_\br}
- P\bPa\bar\bra\bam\bme\bet\bte\ber\br l\ble\ben\bng\bgt\bth\bh. Substitutes the length in characters of the
- expanded value of _\bp_\ba_\br_\ba_\bm_\be_\bt_\be_\br. If _\bp_\ba_\br_\ba_\bm_\be_\bt_\be_\br is *\b* or @\b@, the value
- substituted is the number of positional parameters. If _\bp_\ba_\br_\ba_\bm_\be_\b-
- _\bt_\be_\br is an array name subscripted by *\b* or @\b@, the value substi-
- tuted is the number of elements in the array. If _\bp_\ba_\br_\ba_\bm_\be_\bt_\be_\br is
- an indexed array name subscripted by a negative number, that
- number is interpreted as relative to one greater than the maxi-
- mum index of _\bp_\ba_\br_\ba_\bm_\be_\bt_\be_\br, so negative indices count back from the
- end of the array, and an index of -1 references the last ele-
+ P\bPa\bar\bra\bam\bme\bet\bte\ber\br l\ble\ben\bng\bgt\bth\bh. Substitutes the length in characters of the
+ expanded value of _\bp_\ba_\br_\ba_\bm_\be_\bt_\be_\br. If _\bp_\ba_\br_\ba_\bm_\be_\bt_\be_\br is *\b* or @\b@, the value
+ substituted is the number of positional parameters. If _\bp_\ba_\br_\ba_\bm_\be_\b-
+ _\bt_\be_\br is an array name subscripted by *\b* or @\b@, the value substi-
+ tuted is the number of elements in the array. If _\bp_\ba_\br_\ba_\bm_\be_\bt_\be_\br is
+ an indexed array name subscripted by a negative number, that
+ number is interpreted as relative to one greater than the maxi-
+ mum index of _\bp_\ba_\br_\ba_\bm_\be_\bt_\be_\br, so negative indices count back from the
+ end of the array, and an index of -1 references the last ele-
ment.
${_\bp_\ba_\br_\ba_\bm_\be_\bt_\be_\br#\b#_\bw_\bo_\br_\bd}
R\bRe\bem\bmo\bov\bve\be m\bma\bat\btc\bch\bhi\bin\bng\bg p\bpr\bre\bef\bfi\bix\bx p\bpa\bat\btt\bte\ber\brn\bn. The _\bw_\bo_\br_\bd is expanded to produce
a pattern just as in pathname expansion, and matched against the
expanded value of _\bp_\ba_\br_\ba_\bm_\be_\bt_\be_\br using the rules described under P\bPa\bat\bt-\b-
- t\bte\ber\brn\bn M\bMa\bat\btc\bch\bhi\bin\bng\bg below. If the pattern matches the beginning of
- the value of _\bp_\ba_\br_\ba_\bm_\be_\bt_\be_\br, then the result of the expansion is the
- expanded value of _\bp_\ba_\br_\ba_\bm_\be_\bt_\be_\br with the shortest matching pattern
- (the "#" case) or the longest matching pattern (the "##" case)
- deleted. If _\bp_\ba_\br_\ba_\bm_\be_\bt_\be_\br is @\b@ or *\b*, the pattern removal operation
- is applied to each positional parameter in turn, and the expan-
- sion is the resultant list. If _\bp_\ba_\br_\ba_\bm_\be_\bt_\be_\br is an array variable
- subscripted with @\b@ or *\b*, the pattern removal operation is ap-
- plied to each member of the array in turn, and the expansion is
+ t\bte\ber\brn\bn M\bMa\bat\btc\bch\bhi\bin\bng\bg below. If the pattern matches the beginning of
+ the value of _\bp_\ba_\br_\ba_\bm_\be_\bt_\be_\br, then the result of the expansion is the
+ expanded value of _\bp_\ba_\br_\ba_\bm_\be_\bt_\be_\br with the shortest matching pattern
+ (the "#" case) or the longest matching pattern (the "##" case)
+ deleted. If _\bp_\ba_\br_\ba_\bm_\be_\bt_\be_\br is @\b@ or *\b*, the pattern removal operation
+ is applied to each positional parameter in turn, and the expan-
+ sion is the resultant list. If _\bp_\ba_\br_\ba_\bm_\be_\bt_\be_\br is an array variable
+ subscripted with @\b@ or *\b*, the pattern removal operation is ap-
+ plied to each member of the array in turn, and the expansion is
the resultant list.
${_\bp_\ba_\br_\ba_\bm_\be_\bt_\be_\br%\b%_\bw_\bo_\br_\bd}
R\bRe\bem\bmo\bov\bve\be m\bma\bat\btc\bch\bhi\bin\bng\bg s\bsu\buf\bff\bfi\bix\bx p\bpa\bat\btt\bte\ber\brn\bn. The _\bw_\bo_\br_\bd is expanded to produce
a pattern just as in pathname expansion, and matched against the
expanded value of _\bp_\ba_\br_\ba_\bm_\be_\bt_\be_\br using the rules described under P\bPa\bat\bt-\b-
- t\bte\ber\brn\bn M\bMa\bat\btc\bch\bhi\bin\bng\bg below. If the pattern matches a trailing portion
- of the expanded value of _\bp_\ba_\br_\ba_\bm_\be_\bt_\be_\br, then the result of the ex-
- pansion is the expanded value of _\bp_\ba_\br_\ba_\bm_\be_\bt_\be_\br with the shortest
- matching pattern (the "%" case) or the longest matching pattern
- (the "%%" case) deleted. If _\bp_\ba_\br_\ba_\bm_\be_\bt_\be_\br is @\b@ or *\b*, the pattern
- removal operation is applied to each positional parameter in
- turn, and the expansion is the resultant list. If _\bp_\ba_\br_\ba_\bm_\be_\bt_\be_\br is
- an array variable subscripted with @\b@ or *\b*, the pattern removal
- operation is applied to each member of the array in turn, and
+ t\bte\ber\brn\bn M\bMa\bat\btc\bch\bhi\bin\bng\bg below. If the pattern matches a trailing portion
+ of the expanded value of _\bp_\ba_\br_\ba_\bm_\be_\bt_\be_\br, then the result of the ex-
+ pansion is the expanded value of _\bp_\ba_\br_\ba_\bm_\be_\bt_\be_\br with the shortest
+ matching pattern (the "%" case) or the longest matching pattern
+ (the "%%" case) deleted. If _\bp_\ba_\br_\ba_\bm_\be_\bt_\be_\br is @\b@ or *\b*, the pattern
+ removal operation is applied to each positional parameter in
+ turn, and the expansion is the resultant list. If _\bp_\ba_\br_\ba_\bm_\be_\bt_\be_\br is
+ an array variable subscripted with @\b@ or *\b*, the pattern removal
+ operation is applied to each member of the array in turn, and
the expansion is the resultant list.
${_\bp_\ba_\br_\ba_\bm_\be_\bt_\be_\br/\b/_\bp_\ba_\bt_\bt_\be_\br_\bn/\b/_\bs_\bt_\br_\bi_\bn_\bg}
${_\bp_\ba_\br_\ba_\bm_\be_\bt_\be_\br/\b/#\b#_\bp_\ba_\bt_\bt_\be_\br_\bn/\b/_\bs_\bt_\br_\bi_\bn_\bg}
${_\bp_\ba_\br_\ba_\bm_\be_\bt_\be_\br/\b/%\b%_\bp_\ba_\bt_\bt_\be_\br_\bn/\b/_\bs_\bt_\br_\bi_\bn_\bg}
P\bPa\bat\btt\bte\ber\brn\bn s\bsu\bub\bbs\bst\bti\bit\btu\but\bti\bio\bon\bn. The _\bp_\ba_\bt_\bt_\be_\br_\bn is expanded to produce a pat-
- tern just as in pathname expansion and matched against the ex-
- panded value of _\bp_\ba_\br_\ba_\bm_\be_\bt_\be_\br using the rules described under P\bPa\bat\bt-\b-
- t\bte\ber\brn\bn M\bMa\bat\btc\bch\bhi\bin\bng\bg below. The longest match of _\bp_\ba_\bt_\bt_\be_\br_\bn in the ex-
- panded value is replaced with _\bs_\bt_\br_\bi_\bn_\bg. _\bs_\bt_\br_\bi_\bn_\bg undergoes tilde
- expansion, parameter and variable expansion, arithmetic expan-
+ tern just as in pathname expansion and matched against the ex-
+ panded value of _\bp_\ba_\br_\ba_\bm_\be_\bt_\be_\br using the rules described under P\bPa\bat\bt-\b-
+ t\bte\ber\brn\bn M\bMa\bat\btc\bch\bhi\bin\bng\bg below. The longest match of _\bp_\ba_\bt_\bt_\be_\br_\bn in the ex-
+ panded value is replaced with _\bs_\bt_\br_\bi_\bn_\bg. _\bs_\bt_\br_\bi_\bn_\bg undergoes tilde
+ expansion, parameter and variable expansion, arithmetic expan-
sion, command and process substitution, and quote removal.
- In the first form above, only the first match is replaced. If
+ In the first form above, only the first match is replaced. If
there are two slashes separating _\bp_\ba_\br_\ba_\bm_\be_\bt_\be_\br and _\bp_\ba_\bt_\bt_\be_\br_\bn (the sec-
- ond form above), all matches of _\bp_\ba_\bt_\bt_\be_\br_\bn are replaced with
- _\bs_\bt_\br_\bi_\bn_\bg. If _\bp_\ba_\bt_\bt_\be_\br_\bn is preceded by #\b# (the third form above), it
- must match at the beginning of the expanded value of _\bp_\ba_\br_\ba_\bm_\be_\bt_\be_\br.
- If _\bp_\ba_\bt_\bt_\be_\br_\bn is preceded by %\b% (the fourth form above), it must
+ ond form above), all matches of _\bp_\ba_\bt_\bt_\be_\br_\bn are replaced with
+ _\bs_\bt_\br_\bi_\bn_\bg. If _\bp_\ba_\bt_\bt_\be_\br_\bn is preceded by #\b# (the third form above), it
+ must match at the beginning of the expanded value of _\bp_\ba_\br_\ba_\bm_\be_\bt_\be_\br.
+ If _\bp_\ba_\bt_\bt_\be_\br_\bn is preceded by %\b% (the fourth form above), it must
match at the end of the expanded value of _\bp_\ba_\br_\ba_\bm_\be_\bt_\be_\br.
- If the expansion of _\bs_\bt_\br_\bi_\bn_\bg is null, matches of _\bp_\ba_\bt_\bt_\be_\br_\bn are
+ If the expansion of _\bs_\bt_\br_\bi_\bn_\bg is null, matches of _\bp_\ba_\bt_\bt_\be_\br_\bn are
deleted and the /\b/ following _\bp_\ba_\bt_\bt_\be_\br_\bn may be omitted.
- If the p\bpa\bat\bts\bsu\bub\bb_\b_r\bre\bep\bpl\bla\bac\bce\bem\bme\ben\bnt\bt shell option is enabled using s\bsh\bho\bop\bpt\bt,
- any unquoted instances of &\b& in _\bs_\bt_\br_\bi_\bn_\bg are replaced with the
+ If the p\bpa\bat\bts\bsu\bub\bb_\b_r\bre\bep\bpl\bla\bac\bce\bem\bme\ben\bnt\bt shell option is enabled using s\bsh\bho\bop\bpt\bt,
+ any unquoted instances of &\b& in _\bs_\bt_\br_\bi_\bn_\bg are replaced with the
matching portion of _\bp_\ba_\bt_\bt_\be_\br_\bn.
Quoting any part of _\bs_\bt_\br_\bi_\bn_\bg inhibits replacement in the expansion
- of the quoted portion, including replacement strings stored in
- shell variables. Backslash will escape &\b& in _\bs_\bt_\br_\bi_\bn_\bg; the back-
- slash is removed in order to permit a literal &\b& in the replace-
- ment string. Backslash can also be used to escape a backslash;
- \\b\\\b\ results in a literal backslash in the replacement. Users
- should take care if _\bs_\bt_\br_\bi_\bn_\bg is double-quoted to avoid unwanted
- interactions between the backslash and double-quoting, since
- backslash has special meaning within double quotes. Pattern
- substitution performs the check for unquoted &\b& after expanding
+ of the quoted portion, including replacement strings stored in
+ shell variables. Backslash will escape &\b& in _\bs_\bt_\br_\bi_\bn_\bg; the back-
+ slash is removed in order to permit a literal &\b& in the replace-
+ ment string. Backslash can also be used to escape a backslash;
+ \\b\\\b\ results in a literal backslash in the replacement. Users
+ should take care if _\bs_\bt_\br_\bi_\bn_\bg is double-quoted to avoid unwanted
+ interactions between the backslash and double-quoting, since
+ backslash has special meaning within double quotes. Pattern
+ substitution performs the check for unquoted &\b& after expanding
_\bs_\bt_\br_\bi_\bn_\bg; shell programmers should quote any occurrences of &\b& they
want to be taken literally in the replacement and ensure any in-
stances of &\b& they want to be replaced are unquoted.
- Like the pattern removal operators, double quotes surrounding
+ Like the pattern removal operators, double quotes surrounding
the replacement string quote the expanded characters, while dou-
- ble quotes enclosing the entire parameter substitution do not,
- since the expansion is performed in a context that doesn't take
+ ble quotes enclosing the entire parameter substitution do not,
+ since the expansion is performed in a context that doesn't take
any enclosing double quotes into account.
- If the n\bno\boc\bca\bas\bse\bem\bma\bat\btc\bch\bh shell option is enabled, the match is per-
+ If the n\bno\boc\bca\bas\bse\bem\bma\bat\btc\bch\bh shell option is enabled, the match is per-
formed without regard to the case of alphabetic characters.
If _\bp_\ba_\br_\ba_\bm_\be_\bt_\be_\br is @\b@ or *\b*, the substitution operation is applied to
- each positional parameter in turn, and the expansion is the re-
- sultant list. If _\bp_\ba_\br_\ba_\bm_\be_\bt_\be_\br is an array variable subscripted
- with @\b@ or *\b*, the substitution operation is applied to each mem-
- ber of the array in turn, and the expansion is the resultant
+ each positional parameter in turn, and the expansion is the re-
+ sultant list. If _\bp_\ba_\br_\ba_\bm_\be_\bt_\be_\br is an array variable subscripted
+ with @\b@ or *\b*, the substitution operation is applied to each mem-
+ ber of the array in turn, and the expansion is the resultant
list.
${_\bp_\ba_\br_\ba_\bm_\be_\bt_\be_\br^\b^_\bp_\ba_\bt_\bt_\be_\br_\bn}
${_\bp_\ba_\br_\ba_\bm_\be_\bt_\be_\br^\b^^\b^_\bp_\ba_\bt_\bt_\be_\br_\bn}
${_\bp_\ba_\br_\ba_\bm_\be_\bt_\be_\br,\b,_\bp_\ba_\bt_\bt_\be_\br_\bn}
${_\bp_\ba_\br_\ba_\bm_\be_\bt_\be_\br,\b,,\b,_\bp_\ba_\bt_\bt_\be_\br_\bn}
- C\bCa\bas\bse\be m\bmo\bod\bdi\bif\bfi\bic\bca\bat\bti\bio\bon\bn. This expansion modifies the case of alpha-
- betic characters in _\bp_\ba_\br_\ba_\bm_\be_\bt_\be_\br. The _\bp_\ba_\bt_\bt_\be_\br_\bn is expanded to pro-
+ C\bCa\bas\bse\be m\bmo\bod\bdi\bif\bfi\bic\bca\bat\bti\bio\bon\bn. This expansion modifies the case of alpha-
+ betic characters in _\bp_\ba_\br_\ba_\bm_\be_\bt_\be_\br. The _\bp_\ba_\bt_\bt_\be_\br_\bn is expanded to pro-
duce a pattern just as in pathname expansion. Each character in
- the expanded value of _\bp_\ba_\br_\ba_\bm_\be_\bt_\be_\br is tested against _\bp_\ba_\bt_\bt_\be_\br_\bn, and,
- if it matches the pattern, its case is converted. The pattern
+ the expanded value of _\bp_\ba_\br_\ba_\bm_\be_\bt_\be_\br is tested against _\bp_\ba_\bt_\bt_\be_\br_\bn, and,
+ if it matches the pattern, its case is converted. The pattern
should not attempt to match more than one character.
- The ^\b^ operator converts lowercase letters matching _\bp_\ba_\bt_\bt_\be_\br_\bn to
+ The ^\b^ operator converts lowercase letters matching _\bp_\ba_\bt_\bt_\be_\br_\bn to
uppercase; the ,\b, operator converts matching uppercase letters to
- lowercase. The ^\b^^\b^ and ,\b,,\b, expansions convert each matched char-
- acter in the expanded value; the ^\b^ and ,\b, expansions match and
+ lowercase. The ^\b^^\b^ and ,\b,,\b, expansions convert each matched char-
+ acter in the expanded value; the ^\b^ and ,\b, expansions match and
convert only the first character in the expanded value. If _\bp_\ba_\bt_\b-
- _\bt_\be_\br_\bn is omitted, it is treated like a ?\b?, which matches every
+ _\bt_\be_\br_\bn is omitted, it is treated like a ?\b?, which matches every
character.
- If _\bp_\ba_\br_\ba_\bm_\be_\bt_\be_\br is @\b@ or *\b*, the case modification operation is ap-
+ If _\bp_\ba_\br_\ba_\bm_\be_\bt_\be_\br is @\b@ or *\b*, the case modification operation is ap-
plied to each positional parameter in turn, and the expansion is
- the resultant list. If _\bp_\ba_\br_\ba_\bm_\be_\bt_\be_\br is an array variable sub-
+ the resultant list. If _\bp_\ba_\br_\ba_\bm_\be_\bt_\be_\br is an array variable sub-
scripted with @\b@ or *\b*, the case modification operation is applied
- to each member of the array in turn, and the expansion is the
+ to each member of the array in turn, and the expansion is the
resultant list.
${_\bp_\ba_\br_\ba_\bm_\be_\bt_\be_\br@\b@_\bo_\bp_\be_\br_\ba_\bt_\bo_\br}
P\bPa\bar\bra\bam\bme\bet\bte\ber\br t\btr\bra\ban\bns\bsf\bfo\bor\brm\bma\bat\bti\bio\bon\bn. The expansion is either a transforma-
- tion of the value of _\bp_\ba_\br_\ba_\bm_\be_\bt_\be_\br or information about _\bp_\ba_\br_\ba_\bm_\be_\bt_\be_\br
- itself, depending on the value of _\bo_\bp_\be_\br_\ba_\bt_\bo_\br. Each _\bo_\bp_\be_\br_\ba_\bt_\bo_\br is a
+ tion of the value of _\bp_\ba_\br_\ba_\bm_\be_\bt_\be_\br or information about _\bp_\ba_\br_\ba_\bm_\be_\bt_\be_\br
+ itself, depending on the value of _\bo_\bp_\be_\br_\ba_\bt_\bo_\br. Each _\bo_\bp_\be_\br_\ba_\bt_\bo_\br is a
single letter:
- U\bU The expansion is a string that is the value of _\bp_\ba_\br_\ba_\bm_\be_\bt_\be_\br
- with lowercase alphabetic characters converted to upper-
+ U\bU The expansion is a string that is the value of _\bp_\ba_\br_\ba_\bm_\be_\bt_\be_\br
+ with lowercase alphabetic characters converted to upper-
case.
- u\bu The expansion is a string that is the value of _\bp_\ba_\br_\ba_\bm_\be_\bt_\be_\br
+ u\bu The expansion is a string that is the value of _\bp_\ba_\br_\ba_\bm_\be_\bt_\be_\br
with the first character converted to uppercase, if it is
alphabetic.
- L\bL The expansion is a string that is the value of _\bp_\ba_\br_\ba_\bm_\be_\bt_\be_\br
- with uppercase alphabetic characters converted to lower-
+ L\bL The expansion is a string that is the value of _\bp_\ba_\br_\ba_\bm_\be_\bt_\be_\br
+ with uppercase alphabetic characters converted to lower-
case.
- Q\bQ The expansion is a string that is the value of _\bp_\ba_\br_\ba_\bm_\be_\bt_\be_\br
+ Q\bQ The expansion is a string that is the value of _\bp_\ba_\br_\ba_\bm_\be_\bt_\be_\br
quoted in a format that can be reused as input.
- E\bE The expansion is a string that is the value of _\bp_\ba_\br_\ba_\bm_\be_\bt_\be_\br
- with backslash escape sequences expanded as with the
+ E\bE The expansion is a string that is the value of _\bp_\ba_\br_\ba_\bm_\be_\bt_\be_\br
+ with backslash escape sequences expanded as with the
$\b$'\b'...'\b' quoting mechanism.
P\bP The expansion is a string that is the result of expanding
the value of _\bp_\ba_\br_\ba_\bm_\be_\bt_\be_\br as if it were a prompt string (see
P\bPR\bRO\bOM\bMP\bPT\bTI\bIN\bNG\bG below).
- A\bA The expansion is a string in the form of an assignment
- statement or d\bde\bec\bcl\bla\bar\bre\be command that, if evaluated, will
+ A\bA The expansion is a string in the form of an assignment
+ statement or d\bde\bec\bcl\bla\bar\bre\be command that, if evaluated, will
recreate _\bp_\ba_\br_\ba_\bm_\be_\bt_\be_\br with its attributes and value.
- K\bK Produces a possibly-quoted version of the value of _\bp_\ba_\br_\ba_\b-
- _\bm_\be_\bt_\be_\br, except that it prints the values of indexed and
- associative arrays as a sequence of quoted key-value
+ K\bK Produces a possibly-quoted version of the value of _\bp_\ba_\br_\ba_\b-
+ _\bm_\be_\bt_\be_\br, except that it prints the values of indexed and
+ associative arrays as a sequence of quoted key-value
pairs (see A\bAr\brr\bra\bay\bys\bs above). The keys and values are quoted
in a format that can be reused as input.
- a\ba The expansion is a string consisting of flag values rep-
+ a\ba The expansion is a string consisting of flag values rep-
resenting _\bp_\ba_\br_\ba_\bm_\be_\bt_\be_\br's attributes.
- k\bk Like the K transformation, but expands the keys and val-
- ues of indexed and associative arrays to separate words
+ k\bk Like the K transformation, but expands the keys and val-
+ ues of indexed and associative arrays to separate words
after word splitting.
- If _\bp_\ba_\br_\ba_\bm_\be_\bt_\be_\br is @\b@ or *\b*, the operation is applied to each posi-
- tional parameter in turn, and the expansion is the resultant
- list. If _\bp_\ba_\br_\ba_\bm_\be_\bt_\be_\br is an array variable subscripted with @\b@ or
+ If _\bp_\ba_\br_\ba_\bm_\be_\bt_\be_\br is @\b@ or *\b*, the operation is applied to each posi-
+ tional parameter in turn, and the expansion is the resultant
+ list. If _\bp_\ba_\br_\ba_\bm_\be_\bt_\be_\br is an array variable subscripted with @\b@ or
*\b*, the operation is applied to each member of the array in turn,
and the expansion is the resultant list.
- The result of the expansion is subject to word splitting and
+ The result of the expansion is subject to word splitting and
pathname expansion as described below.
C\bCo\bom\bmm\bma\ban\bnd\bd S\bSu\bub\bbs\bst\bti\bit\btu\but\bti\bio\bon\bn
B\bBa\bas\bsh\bh performs the expansion by executing _\bc_\bo_\bm_\bm_\ba_\bn_\bd in a subshell environ-
ment and replacing the command substitution with the standard output of
the command, with any trailing newlines deleted. Embedded newlines are
- not deleted, but they may be removed during word splitting. The com-
- mand substitution $\b$(\b(c\bca\bat\bt _\bf_\bi_\bl_\be)\b) can be replaced by the equivalent but
+ not deleted, but they may be removed during word splitting. The com-
+ mand substitution $\b$(\b(c\bca\bat\bt _\bf_\bi_\bl_\be)\b) can be replaced by the equivalent but
faster $\b$(\b(<\b< _\bf_\bi_\bl_\be)\b).
- With the old-style backquote form of substitution, backslash retains
- its literal meaning except when followed by $\b$, `\b`, or \\b\. The first
- backquote not preceded by a backslash terminates the command substitu-
- tion. When using the $(_\bc_\bo_\bm_\bm_\ba_\bn_\bd) form, all characters between the
+ With the old-style backquote form of substitution, backslash retains
+ its literal meaning except when followed by $\b$, `\b`, or \\b\. The first
+ backquote not preceded by a backslash terminates the command substitu-
+ tion. When using the $(_\bc_\bo_\bm_\bm_\ba_\bn_\bd) form, all characters between the
parentheses make up the command; none are treated specially.
There is an alternate form of command substitution:
$\b${\b{_\bc _\bc_\bo_\bm_\bm_\ba_\bn_\bd;\b;}\b}
- which executes _\bc_\bo_\bm_\bm_\ba_\bn_\bd in the current execution environment and cap-
+ which executes _\bc_\bo_\bm_\bm_\ba_\bn_\bd in the current execution environment and cap-
tures its output, again with trailing newlines removed.
The character _\bc following the open brace must be a space, tab, newline,
- or |\b|, and the close brace must be in a position where a reserved word
- may appear (i.e., preceded by a command terminator such as semicolon).
+ or |\b|, and the close brace must be in a position where a reserved word
+ may appear (i.e., preceded by a command terminator such as semicolon).
B\bBa\bas\bsh\bh allows the close brace to be joined to the remaining characters in
- the word without being followed by a shell metacharacter as a reserved
+ the word without being followed by a shell metacharacter as a reserved
word would usually require.
Any side effects of _\bc_\bo_\bm_\bm_\ba_\bn_\bd take effect immediately in the current exe-
- cution environment and persist in the current environment after the
+ cution environment and persist in the current environment after the
command completes (e.g., the e\bex\bxi\bit\bt builtin will exit the shell).
- This type of command substitution superficially resembles executing an
- unnamed shell function: local variables are created as when a shell
- function is executing, and the r\bre\bet\btu\bur\brn\bn builtin forces _\bc_\bo_\bm_\bm_\ba_\bn_\bd to com-
- plete; however, the rest of the execution environment, including the
+ This type of command substitution superficially resembles executing an
+ unnamed shell function: local variables are created as when a shell
+ function is executing, and the r\bre\bet\btu\bur\brn\bn builtin forces _\bc_\bo_\bm_\bm_\ba_\bn_\bd to com-
+ plete; however, the rest of the execution environment, including the
positional parameters, is shared with the caller.
- If the first character following the open brace is a |\b|, the construct
- expands to the value of the R\bRE\bEP\bPL\bLY\bY shell variable after _\bc_\bo_\bm_\bm_\ba_\bn_\bd exe-
- cutes, without removing any trailing newlines, and the standard output
- of _\bc_\bo_\bm_\bm_\ba_\bn_\bd remains the same as in the calling shell. B\bBa\bas\bsh\bh creates R\bRE\bE-\b-
+ If the first character following the open brace is a |\b|, the construct
+ expands to the value of the R\bRE\bEP\bPL\bLY\bY shell variable after _\bc_\bo_\bm_\bm_\ba_\bn_\bd exe-
+ cutes, without removing any trailing newlines, and the standard output
+ of _\bc_\bo_\bm_\bm_\ba_\bn_\bd remains the same as in the calling shell. B\bBa\bas\bsh\bh creates R\bRE\bE-\b-
P\bPL\bLY\bY as an initially-unset local variable when _\bc_\bo_\bm_\bm_\ba_\bn_\bd executes, and re-
- stores R\bRE\bEP\bPL\bLY\bY to the value it had before the command substitution after
+ stores R\bRE\bEP\bPL\bLY\bY to the value it had before the command substitution after
_\bc_\bo_\bm_\bm_\ba_\bn_\bd completes, as with any local variable.
Command substitutions may be nested. To nest when using the backquoted
$\b$(\b((\b(_\be_\bx_\bp_\br_\be_\bs_\bs_\bi_\bo_\bn)\b))\b)
- The _\be_\bx_\bp_\br_\be_\bs_\bs_\bi_\bo_\bn undergoes the same expansions as if it were within dou-
- ble quotes, but double quote characters in _\be_\bx_\bp_\br_\be_\bs_\bs_\bi_\bo_\bn are not treated
- specially and are removed. All tokens in the expression undergo para-
- meter and variable expansion, command substitution, and quote removal.
- The result is treated as the arithmetic expression to be evaluated.
+ The _\be_\bx_\bp_\br_\be_\bs_\bs_\bi_\bo_\bn undergoes the same expansions as if it were within dou-
+ ble quotes, but double quote characters in _\be_\bx_\bp_\br_\be_\bs_\bs_\bi_\bo_\bn are not treated
+ specially and are removed. All tokens in the expression undergo para-
+ meter and variable expansion, command substitution, and quote removal.
+ The result is treated as the arithmetic expression to be evaluated.
Arithmetic expansions may be nested.
- The evaluation is performed according to the rules listed below under
+ The evaluation is performed according to the rules listed below under
A\bAR\bRI\bIT\bTH\bHM\bME\bET\bTI\bIC\bC E\bEV\bVA\bAL\bLU\bUA\bAT\bTI\bIO\bON\bN. If _\be_\bx_\bp_\br_\be_\bs_\bs_\bi_\bo_\bn is invalid, b\bba\bas\bsh\bh prints a message
- to standard error indicating failure, does not perform the substitu-
+ to standard error indicating failure, does not perform the substitu-
tion, and does not execute the command associated with the expansion.
P\bPr\bro\boc\bce\bes\bss\bs S\bSu\bub\bbs\bst\bti\bit\btu\but\bti\bio\bon\bn
- _\bP_\br_\bo_\bc_\be_\bs_\bs _\bs_\bu_\bb_\bs_\bt_\bi_\bt_\bu_\bt_\bi_\bo_\bn allows a process's input or output to be referred
- to using a filename. It takes the form of <\b<(\b(_\bl_\bi_\bs_\bt)\b) or >\b>(\b(_\bl_\bi_\bs_\bt)\b). The
- process _\bl_\bi_\bs_\bt is run asynchronously, and its input or output appears as
+ _\bP_\br_\bo_\bc_\be_\bs_\bs _\bs_\bu_\bb_\bs_\bt_\bi_\bt_\bu_\bt_\bi_\bo_\bn allows a process's input or output to be referred
+ to using a filename. It takes the form of <\b<(\b(_\bl_\bi_\bs_\bt)\b) or >\b>(\b(_\bl_\bi_\bs_\bt)\b). The
+ process _\bl_\bi_\bs_\bt is run asynchronously, and its input or output appears as
a filename. This filename is passed as an argument to the current com-
mand as the result of the expansion.
If the >\b>(\b(_\bl_\bi_\bs_\bt)\b) form is used, writing to the file will provide input for
- _\bl_\bi_\bs_\bt. If the <\b<(\b(_\bl_\bi_\bs_\bt)\b) form is used, reading the file will obtain the
- output of _\bl_\bi_\bs_\bt. No space may appear between the <\b< or >\b> and the left
+ _\bl_\bi_\bs_\bt. If the <\b<(\b(_\bl_\bi_\bs_\bt)\b) form is used, reading the file will obtain the
+ output of _\bl_\bi_\bs_\bt. No space may appear between the <\b< or >\b> and the left
parenthesis, otherwise the construct would be interpreted as a redirec-
tion.
- Process substitution is supported on systems that support named pipes
+ Process substitution is supported on systems that support named pipes
(_\bF_\bI_\bF_\bO_\bs) or the /\b/d\bde\bev\bv/\b/f\bfd\bd method of naming open files.
- When available, process substitution is performed simultaneously with
- parameter and variable expansion, command substitution, and arithmetic
+ When available, process substitution is performed simultaneously with
+ parameter and variable expansion, command substitution, and arithmetic
expansion.
W\bWo\bor\brd\bd S\bSp\bpl\bli\bit\btt\bti\bin\bng\bg
- The shell scans the results of parameter expansion, command substitu-
- tion, and arithmetic expansion that did not occur within double quotes
- for _\bw_\bo_\br_\bd _\bs_\bp_\bl_\bi_\bt_\bt_\bi_\bn_\bg.
+ The shell scans the results of parameter expansion, command substitu-
+ tion, and arithmetic expansion that did not occur within double quotes
+ for _\bw_\bo_\br_\bd _\bs_\bp_\bl_\bi_\bt_\bt_\bi_\bn_\bg. Words that were not expanded are not split.
- The shell treats each character of I\bIF\bFS\bS as a delimiter, and splits the
- results of the other expansions into words using these characters as
+ The shell treats each character of I\bIF\bFS\bS as a delimiter, and splits the
+ results of the other expansions into words using these characters as
field terminators.
- If I\bIF\bFS\bS is unset, or its value is exactly <\b<s\bsp\bpa\bac\bce\be>\b><\b<t\bta\bab\bb>\b><\b<n\bne\bew\bwl\bli\bin\bne\be>\b>, the de-
- fault, then sequences of s\bsp\bpa\bac\bce\be, t\bta\bab\bb, and n\bne\bew\bwl\bli\bin\bne\be at the beginning and
- end of the results of the previous expansions are ignored, and any se-
- quence of I\bIF\bFS\bS characters not at the beginning or end delimits words.
- If I\bIF\bFS\bS has a value other than the default, then sequences of the white-
- space characters s\bsp\bpa\bac\bce\be, t\bta\bab\bb, and n\bne\bew\bwl\bli\bin\bne\be present in the value of I\bIF\bFS\bS
- (an I\bIF\bFS\bS whitespace character) are ignored at the beginning and end of
- the word. Any character in I\bIF\bFS\bS that is not I\bIF\bFS\bS whitespace, along with
- any adjacent I\bIF\bFS\bS whitespace characters, delimits a field. A sequence
- of I\bIF\bFS\bS whitespace characters is also treated as a delimiter.
-
- If the value of I\bIF\bFS\bS is null, no word splitting occurs. If I\bIF\bFS\bS is un-
- set, word splitting behaves as if it contained the default value of
- <\b<s\bsp\bpa\bac\bce\be>\b><\b<t\bta\bab\bb>\b><\b<n\bne\bew\bwl\bli\bin\bne\be>\b>.
+ An _\bI_\bF_\bS _\bw_\bh_\bi_\bt_\be_\bs_\bp_\ba_\bc_\be character is whitespace as defined above (see D\bDe\bef\bfi\bin\bni\bi-\b-
+ t\bti\bio\bon\bns\bs) that appears in the value of I\bIF\bFS\bS. Space, tab, and newline are
+ always considered IFS whitespace, even if they don't appear in the lo-
+ cale's s\bsp\bpa\bac\bce\be category.
+
+ If I\bIF\bFS\bS is unset, field splitting acts as if its value were
+ <\b<s\bsp\bpa\bac\bce\be>\b><\b<t\bta\bab\bb>\b><\b<n\bne\bew\bwl\bli\bin\bne\be>\b>, and treats these characters as IFS whitespace.
+ If the value of I\bIF\bFS\bS is null, no word splitting occurs, but implicit
+ null arguments (see below) are still removed.
+
+ Word splitting begins by removing sequences of IFS whitespace charac-
+ ters from the beginning and end of the results of the previous expan-
+ sions, then splits the remaining words.
+
+ If the value of I\bIF\bFS\bS consists solely of IFS whitespace, any sequence of
+ IFS whitespace characters delimits a field, so a field consists of
+ characters that are not unquoted IFS whitespace, and null fields result
+ only from quoting.
+
+ If I\bIF\bFS\bS contains a non-whitespace character, then any character in the
+ value of I\bIF\bFS\bS that is not IFS whitespace, along with any adjacent IFS
+ whitespace characters, delimits a field. This means that adjacent non-
+ IFS-whitespace delimiters produce a null field. A sequence of IFS
+ whitespace characters also delimits a field.
Explicit null arguments ("\b""\b" or '\b''\b') are retained and passed to commands
as empty strings. Unquoted implicit null arguments, resulting from the
- expansion of parameters that have no values, are removed. If a parame-
- ter with no value is expanded within double quotes, a null argument re-
- sults and is retained and passed to a command as an empty string. When
- a quoted null argument appears as part of a word whose expansion is
- non-null, the null argument is removed. That is, the word "-d''" be-
- comes "-d" after word splitting and null argument removal.
+ expansion of parameters that have no values, are removed. Expanding a
+ parameter with no value within double quotes produces a null field,
+ which is retained and passed to a command as an empty string.
- Note that if no expansion occurs, no splitting is performed.
+ When a quoted null argument appears as part of a word whose expansion
+ is non-null, word splitting removes the null argument portion, leaving
+ the non-null expansion. That is, the word "-d''" becomes "-d" after
+ word splitting and null argument removal.
P\bPa\bat\bth\bhn\bna\bam\bme\be E\bEx\bxp\bpa\ban\bns\bsi\bio\bon\bn
- After word splitting, unless the -\b-f\bf option has been set, b\bba\bas\bsh\bh scans
- each word for the characters *\b*, ?\b?, and [\b[. If one of these characters
+ After word splitting, unless the -\b-f\bf option has been set, b\bba\bas\bsh\bh scans
+ each word for the characters *\b*, ?\b?, and [\b[. If one of these characters
appears, and is not quoted, then the word is regarded as a _\bp_\ba_\bt_\bt_\be_\br_\bn, and
replaced with a sorted list of filenames matching the pattern (see P\bPa\bat\bt-\b-
- t\bte\ber\brn\bn M\bMa\bat\btc\bch\bhi\bin\bng\bg below) subject to the value of the G\bGL\bLO\bOB\bBS\bSO\bOR\bRT\bT shell vari-
+ t\bte\ber\brn\bn M\bMa\bat\btc\bch\bhi\bin\bng\bg below) subject to the value of the G\bGL\bLO\bOB\bBS\bSO\bOR\bRT\bT shell vari-
able.
- If no matching filenames are found, and the shell option n\bnu\bul\bll\blg\bgl\blo\bob\bb is
- not enabled, the word is left unchanged. If the n\bnu\bul\bll\blg\bgl\blo\bob\bb option is
- set, and no matches are found, the word is removed. If the f\bfa\bai\bil\blg\bgl\blo\bob\bb
- shell option is set, and no matches are found, b\bba\bas\bsh\bh prints an error
- message and does not execute the command. If the shell option n\bno\boc\bca\bas\bse\be-\b-
- g\bgl\blo\bob\bb is enabled, the match is performed without regard to the case of
+ If no matching filenames are found, and the shell option n\bnu\bul\bll\blg\bgl\blo\bob\bb is
+ not enabled, the word is left unchanged. If the n\bnu\bul\bll\blg\bgl\blo\bob\bb option is
+ set, and no matches are found, the word is removed. If the f\bfa\bai\bil\blg\bgl\blo\bob\bb
+ shell option is set, and no matches are found, b\bba\bas\bsh\bh prints an error
+ message and does not execute the command. If the shell option n\bno\boc\bca\bas\bse\be-\b-
+ g\bgl\blo\bob\bb is enabled, the match is performed without regard to the case of
alphabetic characters.
When a pattern is used for pathname expansion, the character "." at the
- start of a name or immediately following a slash must be matched ex-
- plicitly, unless the shell option d\bdo\bot\btg\bgl\blo\bob\bb is set. In order to match
- the filenames _\b. and _\b._\b., the pattern must begin with "." (for example,
+ start of a name or immediately following a slash must be matched ex-
+ plicitly, unless the shell option d\bdo\bot\btg\bgl\blo\bob\bb is set. In order to match
+ the filenames _\b. and _\b._\b., the pattern must begin with "." (for example,
".?"), even if d\bdo\bot\btg\bgl\blo\bob\bb is set. If the g\bgl\blo\bob\bbs\bsk\bki\bip\bpd\bdo\bot\bts\bs shell option is en-
- abled, the filenames _\b. and _\b._\b. never match, even if the pattern begins
- with a ".". When not matching pathnames, the "." character is not
+ abled, the filenames _\b. and _\b._\b. never match, even if the pattern begins
+ with a ".". When not matching pathnames, the "." character is not
treated specially.
- When matching a pathname, the slash character must always be matched
+ When matching a pathname, the slash character must always be matched
explicitly by a slash in the pattern, but in other matching contexts it
- can be matched by a special pattern character as described below under
+ can be matched by a special pattern character as described below under
P\bPa\bat\btt\bte\ber\brn\bn M\bMa\bat\btc\bch\bhi\bin\bng\bg.
- See the description of s\bsh\bho\bop\bpt\bt below under S\bSH\bHE\bEL\bLL\bL B\bBU\bUI\bIL\bLT\bTI\bIN\bN C\bCO\bOM\bMM\bMA\bAN\bND\bDS\bS for a
- description of the n\bno\boc\bca\bas\bse\beg\bgl\blo\bob\bb, n\bnu\bul\bll\blg\bgl\blo\bob\bb, g\bgl\blo\bob\bbs\bsk\bki\bip\bpd\bdo\bot\bts\bs, f\bfa\bai\bil\blg\bgl\blo\bob\bb, and
+ See the description of s\bsh\bho\bop\bpt\bt below under S\bSH\bHE\bEL\bLL\bL B\bBU\bUI\bIL\bLT\bTI\bIN\bN C\bCO\bOM\bMM\bMA\bAN\bND\bDS\bS for a
+ description of the n\bno\boc\bca\bas\bse\beg\bgl\blo\bob\bb, n\bnu\bul\bll\blg\bgl\blo\bob\bb, g\bgl\blo\bob\bbs\bsk\bki\bip\bpd\bdo\bot\bts\bs, f\bfa\bai\bil\blg\bgl\blo\bob\bb, and
d\bdo\bot\btg\bgl\blo\bob\bb shell options.
- The G\bGL\bLO\bOB\bBI\bIG\bGN\bNO\bOR\bRE\bE shell variable may be used to restrict the set of file
- names matching a _\bp_\ba_\bt_\bt_\be_\br_\bn. If G\bGL\bLO\bOB\bBI\bIG\bGN\bNO\bOR\bRE\bE is set, each matching file
- name that also matches one of the patterns in G\bGL\bLO\bOB\bBI\bIG\bGN\bNO\bOR\bRE\bE is removed
- from the list of matches. If the n\bno\boc\bca\bas\bse\beg\bgl\blo\bob\bb option is set, the match-
- ing against the patterns in G\bGL\bLO\bOB\bBI\bIG\bGN\bNO\bOR\bRE\bE is performed without regard to
+ The G\bGL\bLO\bOB\bBI\bIG\bGN\bNO\bOR\bRE\bE shell variable may be used to restrict the set of file
+ names matching a _\bp_\ba_\bt_\bt_\be_\br_\bn. If G\bGL\bLO\bOB\bBI\bIG\bGN\bNO\bOR\bRE\bE is set, each matching file
+ name that also matches one of the patterns in G\bGL\bLO\bOB\bBI\bIG\bGN\bNO\bOR\bRE\bE is removed
+ from the list of matches. If the n\bno\boc\bca\bas\bse\beg\bgl\blo\bob\bb option is set, the match-
+ ing against the patterns in G\bGL\bLO\bOB\bBI\bIG\bGN\bNO\bOR\bRE\bE is performed without regard to
case. The filenames _\b. and _\b._\b. are always ignored when G\bGL\bLO\bOB\bBI\bIG\bGN\bNO\bOR\bRE\bE is set
- and not null. However, setting G\bGL\bLO\bOB\bBI\bIG\bGN\bNO\bOR\bRE\bE to a non-null value has the
+ and not null. However, setting G\bGL\bLO\bOB\bBI\bIG\bGN\bNO\bOR\bRE\bE to a non-null value has the
effect of enabling the d\bdo\bot\btg\bgl\blo\bob\bb shell option, so all other filenames be-
- ginning with a "." will match. To get the old behavior of ignoring
- filenames beginning with a ".", make ".*" one of the patterns in G\bGL\bLO\bO-\b-
+ ginning with a "." will match. To get the old behavior of ignoring
+ filenames beginning with a ".", make ".*" one of the patterns in G\bGL\bLO\bO-\b-
B\bBI\bIG\bGN\bNO\bOR\bRE\bE. The d\bdo\bot\btg\bgl\blo\bob\bb option is disabled when G\bGL\bLO\bOB\bBI\bIG\bGN\bNO\bOR\bRE\bE is unset. The
G\bGL\bLO\bOB\bBI\bIG\bGN\bNO\bOR\bRE\bE pattern matching honors the setting of the e\bex\bxt\btg\bgl\blo\bob\bb shell op-
tion.
P\bPa\bat\btt\bte\ber\brn\bn M\bMa\bat\btc\bch\bhi\bin\bng\bg
Any character that appears in a pattern, other than the special pattern
- characters described below, matches itself. The NUL character may not
- occur in a pattern. A backslash escapes the following character; the
- escaping backslash is discarded when matching. The special pattern
+ characters described below, matches itself. The NUL character may not
+ occur in a pattern. A backslash escapes the following character; the
+ escaping backslash is discarded when matching. The special pattern
characters must be quoted if they are to be matched literally.
The special pattern characters have the following meanings:
- *\b* Matches any string, including the null string. When the
- g\bgl\blo\bob\bbs\bst\bta\bar\br shell option is enabled, and *\b* is used in a
- pathname expansion context, two adjacent *\b*s used as a
- single pattern will match all files and zero or more di-
- rectories and subdirectories. If followed by a /\b/, two
- adjacent *\b*s will match only directories and subdirecto-
+ *\b* Matches any string, including the null string. When the
+ g\bgl\blo\bob\bbs\bst\bta\bar\br shell option is enabled, and *\b* is used in a
+ pathname expansion context, two adjacent *\b*s used as a
+ single pattern will match all files and zero or more di-
+ rectories and subdirectories. If followed by a /\b/, two
+ adjacent *\b*s will match only directories and subdirecto-
ries.
?\b? Matches any single character.
- [\b[...]\b] Matches any one of the enclosed characters. A pair of
- characters separated by a hyphen denotes a _\br_\ba_\bn_\bg_\be _\be_\bx_\bp_\br_\be_\bs_\b-
- _\bs_\bi_\bo_\bn; any character that falls between those two charac-
+ [\b[...]\b] Matches any one of the enclosed characters. A pair of
+ characters separated by a hyphen denotes a _\br_\ba_\bn_\bg_\be _\be_\bx_\bp_\br_\be_\bs_\b-
+ _\bs_\bi_\bo_\bn; any character that falls between those two charac-
ters, inclusive, using the current locale's collating se-
- quence and character set, matches. If the first charac-
+ quence and character set, matches. If the first charac-
ter following the [\b[ is a !\b! or a ^\b^ then any character not
- within the range matches. A -\b- may be matched by includ-
- ing it as the first or last character in the set. A ]\b]
- may be matched by including it as the first character in
+ within the range matches. A -\b- may be matched by includ-
+ ing it as the first or last character in the set. A ]\b]
+ may be matched by including it as the first character in
the set.
The sorting order of characters in range expressions, and
- the characters included in the range, are determined by
- the current locale and the values of the L\bLC\bC_\b_C\bCO\bOL\bLL\bLA\bAT\bTE\bE or
- L\bLC\bC_\b_A\bAL\bLL\bL shell variables, if set. To obtain the tradi-
- tional interpretation of range expressions, where [\b[a\ba-\b-d\bd]\b]
- is equivalent to [\b[a\bab\bbc\bcd\bd]\b], set the value of the L\bLC\bC_\b_C\bCO\bOL\bLL\bLA\bAT\bTE\bE
- or L\bLC\bC_\b_A\bAL\bLL\bL shell variables to C\bC, or enable the g\bgl\blo\bob\bba\bas\bsc\bci\bi-\b-
+ the characters included in the range, are determined by
+ the current locale and the values of the L\bLC\bC_\b_C\bCO\bOL\bLL\bLA\bAT\bTE\bE or
+ L\bLC\bC_\b_A\bAL\bLL\bL shell variables, if set. To obtain the tradi-
+ tional interpretation of range expressions, where [\b[a\ba-\b-d\bd]\b]
+ is equivalent to [\b[a\bab\bbc\bcd\bd]\b], set the value of the L\bLC\bC_\b_C\bCO\bOL\bLL\bLA\bAT\bTE\bE
+ or L\bLC\bC_\b_A\bAL\bLL\bL shell variables to C\bC, or enable the g\bgl\blo\bob\bba\bas\bsc\bci\bi-\b-
i\bir\bra\ban\bng\bge\bes\bs shell option.
- Within [\b[ and ]\b], _\bc_\bh_\ba_\br_\ba_\bc_\bt_\be_\br _\bc_\bl_\ba_\bs_\bs_\be_\bs can be specified using
+ Within [\b[ and ]\b], _\bc_\bh_\ba_\br_\ba_\bc_\bt_\be_\br _\bc_\bl_\ba_\bs_\bs_\be_\bs can be specified using
the syntax [\b[:\b:_\bc_\bl_\ba_\bs_\bs:\b:]\b], where _\bc_\bl_\ba_\bs_\bs is one of the following
classes defined in the POSIX standard:
- a\bal\bln\bnu\bum\bm a\bal\blp\bph\bha\ba a\bas\bsc\bci\bii\bi b\bbl\bla\ban\bnk\bk c\bcn\bnt\btr\brl\bl d\bdi\big\bgi\bit\bt g\bgr\bra\bap\bph\bh l\blo\bow\bwe\ber\br p\bpr\bri\bin\bnt\bt
+ a\bal\bln\bnu\bum\bm a\bal\blp\bph\bha\ba a\bas\bsc\bci\bii\bi b\bbl\bla\ban\bnk\bk c\bcn\bnt\btr\brl\bl d\bdi\big\bgi\bit\bt g\bgr\bra\bap\bph\bh l\blo\bow\bwe\ber\br p\bpr\bri\bin\bnt\bt
p\bpu\bun\bnc\bct\bt s\bsp\bpa\bac\bce\be u\bup\bpp\bpe\ber\br w\bwo\bor\brd\bd x\bxd\bdi\big\bgi\bit\bt
A character class matches any character belonging to that
and the character _.
Within [\b[ and ]\b], an _\be_\bq_\bu_\bi_\bv_\ba_\bl_\be_\bn_\bc_\be _\bc_\bl_\ba_\bs_\bs can be specified us-
- ing the syntax [\b[=\b=_\bc=\b=]\b], which matches all characters with
- the same collation weight (as defined by the current lo-
+ ing the syntax [\b[=\b=_\bc=\b=]\b], which matches all characters with
+ the same collation weight (as defined by the current lo-
cale) as the character _\bc.
Within [\b[ and ]\b], the syntax [\b[.\b._\bs_\by_\bm_\bb_\bo_\bl.\b.]\b] matches the collat-
ing symbol _\bs_\by_\bm_\bb_\bo_\bl.
- If the e\bex\bxt\btg\bgl\blo\bob\bb shell option is enabled using the s\bsh\bho\bop\bpt\bt builtin, the
- shell recognizes several extended pattern matching operators. In the
+ If the e\bex\bxt\btg\bgl\blo\bob\bb shell option is enabled using the s\bsh\bho\bop\bpt\bt builtin, the
+ shell recognizes several extended pattern matching operators. In the
following description, a _\bp_\ba_\bt_\bt_\be_\br_\bn_\b-_\bl_\bi_\bs_\bt is a list of one or more patterns
- separated by a |\b|. Composite patterns may be formed using one or more
+ separated by a |\b|. Composite patterns may be formed using one or more
of the following sub-patterns:
?\b?(\b(_\bp_\ba_\bt_\bt_\be_\br_\bn_\b-_\bl_\bi_\bs_\bt)\b)
Matches anything except one of the given patterns.
The e\bex\bxt\btg\bgl\blo\bob\bb option changes the behavior of the parser, since the paren-
- theses are normally treated as operators with syntactic meaning. To
- ensure that extended matching patterns are parsed correctly, make sure
- that e\bex\bxt\btg\bgl\blo\bob\bb is enabled before parsing constructs containing the pat-
+ theses are normally treated as operators with syntactic meaning. To
+ ensure that extended matching patterns are parsed correctly, make sure
+ that e\bex\bxt\btg\bgl\blo\bob\bb is enabled before parsing constructs containing the pat-
terns, including shell functions and command substitutions.
When matching filenames, the d\bdo\bot\btg\bgl\blo\bob\bb shell option determines the set of
- filenames that are tested: when d\bdo\bot\btg\bgl\blo\bob\bb is enabled, the set of file-
- names includes all files beginning with ".", but _\b. and _\b._\b. must be
- matched by a pattern or sub-pattern that begins with a dot; when it is
+ filenames that are tested: when d\bdo\bot\btg\bgl\blo\bob\bb is enabled, the set of file-
+ names includes all files beginning with ".", but _\b. and _\b._\b. must be
+ matched by a pattern or sub-pattern that begins with a dot; when it is
disabled, the set does not include any filenames beginning with "." un-
less the pattern or sub-pattern begins with a ".". If the g\bgl\blo\bob\bbs\bsk\bki\bip\bpd\bdo\bot\bts\bs
- shell option is enabled, the filenames _\b. and _\b._\b. never appear in the
+ shell option is enabled, the filenames _\b. and _\b._\b. never appear in the
set. As above, "." only has a special meaning when matching filenames.
Complicated extended pattern matching against long strings is slow, es-
pecially when the patterns contain alternations and the strings contain
- multiple matches. Using separate matches against shorter strings, or
+ multiple matches. Using separate matches against shorter strings, or
using arrays of strings instead of a single long string, may be faster.
Q\bQu\buo\bot\bte\be R\bRe\bem\bmo\bov\bva\bal\bl
After the preceding expansions, all unquoted occurrences of the charac-
- ters \\b\, '\b', and "\b" that did not result from one of the above expansions
+ ters \\b\, '\b', and "\b" that did not result from one of the above expansions
are removed.
R\bRE\bED\bDI\bIR\bRE\bEC\bCT\bTI\bIO\bON\bN
- Before a command is executed, its input and output may be _\br_\be_\bd_\bi_\br_\be_\bc_\bt_\be_\bd
- using a special notation interpreted by the shell. _\bR_\be_\bd_\bi_\br_\be_\bc_\bt_\bi_\bo_\bn allows
- commands' file handles to be duplicated, opened, closed, made to refer
+ Before a command is executed, its input and output may be _\br_\be_\bd_\bi_\br_\be_\bc_\bt_\be_\bd
+ using a special notation interpreted by the shell. _\bR_\be_\bd_\bi_\br_\be_\bc_\bt_\bi_\bo_\bn allows
+ commands' file handles to be duplicated, opened, closed, made to refer
to different files, and can change the files the command reads from and
- writes to. When used with the e\bex\bxe\bec\bc builtin, redirections modify file
- handles in the current shell execution environment. The following
- redirection operators may precede or appear anywhere within a _\bs_\bi_\bm_\bp_\bl_\be
+ writes to. When used with the e\bex\bxe\bec\bc builtin, redirections modify file
+ handles in the current shell execution environment. The following
+ redirection operators may precede or appear anywhere within a _\bs_\bi_\bm_\bp_\bl_\be
_\bc_\bo_\bm_\bm_\ba_\bn_\bd or may follow a _\bc_\bo_\bm_\bm_\ba_\bn_\bd. Redirections are processed in the or-
der they appear, from left to right.
- Each redirection that may be preceded by a file descriptor number may
+ Each redirection that may be preceded by a file descriptor number may
instead be preceded by a word of the form {_\bv_\ba_\br_\bn_\ba_\bm_\be}. In this case, for
each redirection operator except >&- and <&-, the shell will allocate a
- file descriptor greater than or equal to 10 and assign it to _\bv_\ba_\br_\bn_\ba_\bm_\be.
+ file descriptor greater than or equal to 10 and assign it to _\bv_\ba_\br_\bn_\ba_\bm_\be.
If {_\bv_\ba_\br_\bn_\ba_\bm_\be} precedes >&- or <&-, the value of _\bv_\ba_\br_\bn_\ba_\bm_\be defines the file
- descriptor to close. If {_\bv_\ba_\br_\bn_\ba_\bm_\be} is supplied, the redirection per-
- sists beyond the scope of the command, which allows the shell program-
+ descriptor to close. If {_\bv_\ba_\br_\bn_\ba_\bm_\be} is supplied, the redirection per-
+ sists beyond the scope of the command, which allows the shell program-
mer to manage the file descriptor's lifetime manually without using the
e\bex\bxe\bec\bc builtin. The v\bva\bar\brr\bre\bed\bdi\bir\br_\b_c\bcl\blo\bos\bse\be shell option manages this behavior.
- In the following descriptions, if the file descriptor number is omit-
- ted, and the first character of the redirection operator is <\b<, the
- redirection refers to the standard input (file descriptor 0). If the
- first character of the redirection operator is >\b>, the redirection
+ In the following descriptions, if the file descriptor number is omit-
+ ted, and the first character of the redirection operator is <\b<, the
+ redirection refers to the standard input (file descriptor 0). If the
+ first character of the redirection operator is >\b>, the redirection
refers to the standard output (file descriptor 1).
- The _\bw_\bo_\br_\bd following the redirection operator in the following descrip-
- tions, unless otherwise noted, is subjected to brace expansion, tilde
- expansion, parameter and variable expansion, command substitution,
- arithmetic expansion, quote removal, pathname expansion, and word
+ The _\bw_\bo_\br_\bd following the redirection operator in the following descrip-
+ tions, unless otherwise noted, is subjected to brace expansion, tilde
+ expansion, parameter and variable expansion, command substitution,
+ arithmetic expansion, quote removal, pathname expansion, and word
splitting. If it expands to more than one word, b\bba\bas\bsh\bh reports an error.
The order of redirections is significant. For example, the command
ls >\b> dirlist 2>\b>&\b&1
- directs both standard output and standard error to the file _\bd_\bi_\br_\bl_\bi_\bs_\bt,
+ directs both standard output and standard error to the file _\bd_\bi_\br_\bl_\bi_\bs_\bt,
while the command
ls 2>\b>&\b&1 >\b> dirlist
- directs only the standard output to file _\bd_\bi_\br_\bl_\bi_\bs_\bt, because the standard
- error was directed to the standard output before the standard output
+ directs only the standard output to file _\bd_\bi_\br_\bl_\bi_\bs_\bt, because the standard
+ error was directed to the standard output before the standard output
was redirected to _\bd_\bi_\br_\bl_\bi_\bs_\bt.
B\bBa\bas\bsh\bh handles several filenames specially when they are used in redirec-
tions, as described in the following table. If the operating system on
which b\bba\bas\bsh\bh is running provides these special files, b\bba\bas\bsh\bh will use them;
- otherwise it will emulate them internally with the behavior described
+ otherwise it will emulate them internally with the behavior described
below.
/\b/d\bde\bev\bv/\b/f\bfd\bd/\b/_\bf_\bd
File descriptor 2 is duplicated.
/\b/d\bde\bev\bv/\b/t\btc\bcp\bp/\b/_\bh_\bo_\bs_\bt/\b/_\bp_\bo_\br_\bt
If _\bh_\bo_\bs_\bt is a valid hostname or Internet address, and _\bp_\bo_\br_\bt
- is an integer port number or service name, b\bba\bas\bsh\bh attempts
+ is an integer port number or service name, b\bba\bas\bsh\bh attempts
to open the corresponding TCP socket.
/\b/d\bde\bev\bv/\b/u\bud\bdp\bp/\b/_\bh_\bo_\bs_\bt/\b/_\bp_\bo_\br_\bt
If _\bh_\bo_\bs_\bt is a valid hostname or Internet address, and _\bp_\bo_\br_\bt
- is an integer port number or service name, b\bba\bas\bsh\bh attempts
+ is an integer port number or service name, b\bba\bas\bsh\bh attempts
to open the corresponding UDP socket.
A failure to open or create a file causes the redirection to fail.
- Redirections using file descriptors greater than 9 should be used with
- care, as they may conflict with file descriptors the shell uses inter-
+ Redirections using file descriptors greater than 9 should be used with
+ care, as they may conflict with file descriptors the shell uses inter-
nally.
R\bRe\bed\bdi\bir\bre\bec\bct\bti\bin\bng\bg I\bIn\bnp\bpu\but\bt
- Redirecting input opens the file whose name results from the expansion
- of _\bw_\bo_\br_\bd for reading on file descriptor _\bn, or the standard input (file
+ Redirecting input opens the file whose name results from the expansion
+ of _\bw_\bo_\br_\bd for reading on file descriptor _\bn, or the standard input (file
descriptor 0) if _\bn is not specified.
The general format for redirecting input is:
R\bRe\bed\bdi\bir\bre\bec\bct\bti\bin\bng\bg O\bOu\but\btp\bpu\but\bt
Redirecting output opens the file whose name results from the expansion
- of _\bw_\bo_\br_\bd for writing on file descriptor _\bn, or the standard output (file
- descriptor 1) if _\bn is not specified. If the file does not exist it is
+ of _\bw_\bo_\br_\bd for writing on file descriptor _\bn, or the standard output (file
+ descriptor 1) if _\bn is not specified. If the file does not exist it is
created; if it does exist it is truncated to zero size.
The general format for redirecting output is:
[_\bn]>\b>_\bw_\bo_\br_\bd
- If the redirection operator is >\b>, and the n\bno\boc\bcl\blo\bob\bbb\bbe\ber\br option to the s\bse\bet\bt
- builtin has been enabled, the redirection will fail if the file whose
- name results from the expansion of _\bw_\bo_\br_\bd exists and is a regular file.
+ If the redirection operator is >\b>, and the n\bno\boc\bcl\blo\bob\bbb\bbe\ber\br option to the s\bse\bet\bt
+ builtin has been enabled, the redirection will fail if the file whose
+ name results from the expansion of _\bw_\bo_\br_\bd exists and is a regular file.
If the redirection operator is >\b>|\b|, or the redirection operator is >\b> and
- the n\bno\boc\bcl\blo\bob\bbb\bbe\ber\br option to the s\bse\bet\bt builtin command is not enabled, b\bba\bas\bsh\bh
+ the n\bno\boc\bcl\blo\bob\bbb\bbe\ber\br option to the s\bse\bet\bt builtin command is not enabled, b\bba\bas\bsh\bh
attempts the redirection even if the file named by _\bw_\bo_\br_\bd exists.
A\bAp\bpp\bpe\ben\bnd\bdi\bin\bng\bg R\bRe\bed\bdi\bir\bre\bec\bct\bte\bed\bd O\bOu\but\btp\bpu\but\bt
- Redirecting output in this fashion opens the file whose name results
- from the expansion of _\bw_\bo_\br_\bd for appending on file descriptor _\bn, or the
+ Redirecting output in this fashion opens the file whose name results
+ from the expansion of _\bw_\bo_\br_\bd for appending on file descriptor _\bn, or the
standard output (file descriptor 1) if _\bn is not specified. If the file
does not exist it is created.
[_\bn]>\b>>\b>_\bw_\bo_\br_\bd
R\bRe\bed\bdi\bir\bre\bec\bct\bti\bin\bng\bg S\bSt\bta\ban\bnd\bda\bar\brd\bd O\bOu\but\btp\bpu\but\bt a\ban\bnd\bd S\bSt\bta\ban\bnd\bda\bar\brd\bd E\bEr\brr\bro\bor\br
- This construct redirects both the standard output (file descriptor 1)
- and the standard error output (file descriptor 2) to the file whose
+ This construct redirects both the standard output (file descriptor 1)
+ and the standard error output (file descriptor 2) to the file whose
name is the expansion of _\bw_\bo_\br_\bd.
- There are two formats for redirecting standard output and standard er-
+ There are two formats for redirecting standard output and standard er-
ror:
&\b&>\b>_\bw_\bo_\br_\bd
>\b>_\bw_\bo_\br_\bd 2>\b>&\b&1
- When using the second form, _\bw_\bo_\br_\bd may not expand to a number or -\b-. If
- it does, other redirection operators apply (see D\bDu\bup\bpl\bli\bic\bca\bat\bti\bin\bng\bg F\bFi\bil\ble\be D\bDe\be-\b-
+ When using the second form, _\bw_\bo_\br_\bd may not expand to a number or -\b-. If
+ it does, other redirection operators apply (see D\bDu\bup\bpl\bli\bic\bca\bat\bti\bin\bng\bg F\bFi\bil\ble\be D\bDe\be-\b-
s\bsc\bcr\bri\bip\bpt\bto\bor\brs\bs below) for compatibility reasons.
A\bAp\bpp\bpe\ben\bnd\bdi\bin\bng\bg S\bSt\bta\ban\bnd\bda\bar\brd\bd O\bOu\but\btp\bpu\but\bt a\ban\bnd\bd S\bSt\bta\ban\bnd\bda\bar\brd\bd E\bEr\brr\bro\bor\br
(see D\bDu\bup\bpl\bli\bic\bca\bat\bti\bin\bng\bg F\bFi\bil\ble\be D\bDe\bes\bsc\bcr\bri\bip\bpt\bto\bor\brs\bs below).
H\bHe\ber\bre\be D\bDo\boc\bcu\bum\bme\ben\bnt\bts\bs
- This type of redirection instructs the shell to read input from the
+ This type of redirection instructs the shell to read input from the
current source until it reads a line containing only _\bd_\be_\bl_\bi_\bm_\bi_\bt_\be_\br (with no
- trailing blanks). All of the lines read up to that point then become
- the standard input (or file descriptor _\bn if _\bn is specified) for a com-
+ trailing blanks). All of the lines read up to that point then become
+ the standard input (or file descriptor _\bn if _\bn is specified) for a com-
mand.
The format of here-documents is:
_\bh_\be_\br_\be_\b-_\bd_\bo_\bc_\bu_\bm_\be_\bn_\bt
_\bd_\be_\bl_\bi_\bm_\bi_\bt_\be_\br
- The shell does not perform parameter and variable expansion, command
- substitution, arithmetic expansion, or pathname expansion is performed
+ The shell does not perform parameter and variable expansion, command
+ substitution, arithmetic expansion, or pathname expansion is performed
on _\bw_\bo_\br_\bd.
If any part of _\bw_\bo_\br_\bd is quoted, the _\bd_\be_\bl_\bi_\bm_\bi_\bt_\be_\br is the result of quote re-
moval on _\bw_\bo_\br_\bd, and the lines in the here-document are not expanded. If
- _\bw_\bo_\br_\bd is unquoted, the _\bd_\be_\bl_\bi_\bm_\bi_\bt_\be_\br is _\bw_\bo_\br_\bd itself, and the here-document
- text is treated similarly to a double-quoted string: all lines of the
- here-document are subjected to parameter expansion, command substitu-
- tion, and arithmetic expansion, the character sequence \\b\<\b<n\bne\bew\bwl\bli\bin\bne\be>\b> is
+ _\bw_\bo_\br_\bd is unquoted, the _\bd_\be_\bl_\bi_\bm_\bi_\bt_\be_\br is _\bw_\bo_\br_\bd itself, and the here-document
+ text is treated similarly to a double-quoted string: all lines of the
+ here-document are subjected to parameter expansion, command substitu-
+ tion, and arithmetic expansion, the character sequence \\b\<\b<n\bne\bew\bwl\bli\bin\bne\be>\b> is
treated literally, and \\b\ must be used to quote the characters \\b\, $\b$, and
`\b`; however, double quote characters have no special meaning.
- If the redirection operator is <\b<<\b<-\b-, then the shell strips all leading
- tab characters from input lines and the line containing _\bd_\be_\bl_\bi_\bm_\bi_\bt_\be_\br.
- This allows here-documents within shell scripts to be indented in a
+ If the redirection operator is <\b<<\b<-\b-, then the shell strips all leading
+ tab characters from input lines and the line containing _\bd_\be_\bl_\bi_\bm_\bi_\bt_\be_\br.
+ This allows here-documents within shell scripts to be indented in a
natural fashion.
If the delimiter is not quoted, the \\b\<\b<n\bne\bew\bwl\bli\bin\bne\be>\b> sequence is treated as a
- line continuation: the two lines are joined and the backslash-newline
- is removed. This happens while reading the here-document, before the
+ line continuation: the two lines are joined and the backslash-newline
+ is removed. This happens while reading the here-document, before the
check for the ending delimiter, so joined lines can form the end delim-
iter.
[_\bn]<\b<<\b<<\b<_\bw_\bo_\br_\bd
- The _\bw_\bo_\br_\bd undergoes tilde expansion, parameter and variable expansion,
- command substitution, arithmetic expansion, and quote removal. Path-
- name expansion and word splitting are not performed. The result is
+ The _\bw_\bo_\br_\bd undergoes tilde expansion, parameter and variable expansion,
+ command substitution, arithmetic expansion, and quote removal. Path-
+ name expansion and word splitting are not performed. The result is
supplied as a single string, with a newline appended, to the command on
its standard input (or file descriptor _\bn if _\bn is specified).
[_\bn]<\b<&\b&_\bw_\bo_\br_\bd
is used to duplicate input file descriptors. If _\bw_\bo_\br_\bd expands to one or
- more digits, file descriptor _\bn is made to be a copy of that file de-
+ more digits, file descriptor _\bn is made to be a copy of that file de-
scriptor. It is a redirection error if the digits in _\bw_\bo_\br_\bd do not spec-
ify a file descriptor open for input. If _\bw_\bo_\br_\bd evaluates to -\b-, file de-
- scriptor _\bn is closed. If _\bn is not specified, this uses the standard
+ scriptor _\bn is closed. If _\bn is not specified, this uses the standard
input (file descriptor 0).
The operator
[_\bn]>\b>&\b&_\bw_\bo_\br_\bd
- is used similarly to duplicate output file descriptors. If _\bn is not
- specified, this uses the standard output (file descriptor 1). It is a
- redirection error if the digits in _\bw_\bo_\br_\bd do not specify a file descrip-
- tor open for output. If _\bw_\bo_\br_\bd evaluates to -\b-, file descriptor _\bn is
- closed. As a special case, if _\bn is omitted, and _\bw_\bo_\br_\bd does not expand
- to one or more digits or -\b-, this redirects the standard output and
+ is used similarly to duplicate output file descriptors. If _\bn is not
+ specified, this uses the standard output (file descriptor 1). It is a
+ redirection error if the digits in _\bw_\bo_\br_\bd do not specify a file descrip-
+ tor open for output. If _\bw_\bo_\br_\bd evaluates to -\b-, file descriptor _\bn is
+ closed. As a special case, if _\bn is omitted, and _\bw_\bo_\br_\bd does not expand
+ to one or more digits or -\b-, this redirects the standard output and
standard error as described previously.
M\bMo\bov\bvi\bin\bng\bg F\bFi\bil\ble\be D\bDe\bes\bsc\bcr\bri\bip\bpt\bto\bor\brs\bs
[_\bn]<\b<&\b&_\bd_\bi_\bg_\bi_\bt-\b-
- moves the file descriptor _\bd_\bi_\bg_\bi_\bt to file descriptor _\bn, or the standard
+ moves the file descriptor _\bd_\bi_\bg_\bi_\bt to file descriptor _\bn, or the standard
input (file descriptor 0) if _\bn is not specified. _\bd_\bi_\bg_\bi_\bt is closed after
being duplicated to _\bn.
[_\bn]>\b>&\b&_\bd_\bi_\bg_\bi_\bt-\b-
- moves the file descriptor _\bd_\bi_\bg_\bi_\bt to file descriptor _\bn, or the standard
+ moves the file descriptor _\bd_\bi_\bg_\bi_\bt to file descriptor _\bn, or the standard
output (file descriptor 1) if _\bn is not specified.
O\bOp\bpe\ben\bni\bin\bng\bg F\bFi\bil\ble\be D\bDe\bes\bsc\bcr\bri\bip\bpt\bto\bor\brs\bs f\bfo\bor\br R\bRe\bea\bad\bdi\bin\bng\bg a\ban\bnd\bd W\bWr\bri\bit\bti\bin\bng\bg
ified. If the file does not exist, it is created.
A\bAL\bLI\bIA\bAS\bSE\bES\bS
- _\bA_\bl_\bi_\ba_\bs_\be_\bs allow a string to be substituted for a word that is in a posi-
- tion in the input where it can be the first word of a simple command.
- Aliases have names and corresponding values that are set and unset us-
- ing the a\bal\bli\bia\bas\bs and u\bun\bna\bal\bli\bia\bas\bs builtin commands (see S\bSH\bHE\bEL\bLL\bL B\bBU\bUI\bIL\bLT\bTI\bIN\bN C\bCO\bOM\bMM\bMA\bAN\bND\bDS\bS
+ _\bA_\bl_\bi_\ba_\bs_\be_\bs allow a string to be substituted for a word that is in a posi-
+ tion in the input where it can be the first word of a simple command.
+ Aliases have names and corresponding values that are set and unset us-
+ ing the a\bal\bli\bia\bas\bs and u\bun\bna\bal\bli\bia\bas\bs builtin commands (see S\bSH\bHE\bEL\bLL\bL B\bBU\bUI\bIL\bLT\bTI\bIN\bN C\bCO\bOM\bMM\bMA\bAN\bND\bDS\bS
below).
- If the shell reads an unquoted word in the right position, it checks
- the word to see if it matches an alias name. If it matches, the shell
- replaces the word with the alias value, and reads that value as if it
+ If the shell reads an unquoted word in the right position, it checks
+ the word to see if it matches an alias name. If it matches, the shell
+ replaces the word with the alias value, and reads that value as if it
had been read instead of the word. The shell doesn't look at any char-
acters following the word before attempting alias substitution.
- The characters /\b/, $\b$, `\b`, and =\b= and any of the shell _\bm_\be_\bt_\ba_\bc_\bh_\ba_\br_\ba_\bc_\bt_\be_\br_\bs or
- quoting characters listed above may not appear in an alias name. The
- replacement text may contain any valid shell input, including shell
- metacharacters. The first word of the replacement text is tested for
+ The characters /\b/, $\b$, `\b`, and =\b= and any of the shell _\bm_\be_\bt_\ba_\bc_\bh_\ba_\br_\ba_\bc_\bt_\be_\br_\bs or
+ quoting characters listed above may not appear in an alias name. The
+ replacement text may contain any valid shell input, including shell
+ metacharacters. The first word of the replacement text is tested for
aliases, but a word that is identical to an alias being expanded is not
expanded a second time. This means that one may alias l\bls\bs to l\bls\bs -\b-F\bF, for
- instance, and b\bba\bas\bsh\bh does not try to recursively expand the replacement
+ instance, and b\bba\bas\bsh\bh does not try to recursively expand the replacement
text.
- If the last character of the alias value is a _\bb_\bl_\ba_\bn_\bk, the shell checks
+ If the last character of the alias value is a _\bb_\bl_\ba_\bn_\bk, the shell checks
the next command word following the alias for alias expansion.
Aliases are created and listed with the a\bal\bli\bia\bas\bs command, and removed with
the u\bun\bna\bal\bli\bia\bas\bs command.
- There is no mechanism for using arguments in the replacement text. If
- arguments are needed, use a shell function (see F\bFU\bUN\bNC\bCT\bTI\bIO\bON\bNS\bS below) in-
+ There is no mechanism for using arguments in the replacement text. If
+ arguments are needed, use a shell function (see F\bFU\bUN\bNC\bCT\bTI\bIO\bON\bNS\bS below) in-
stead.
- Aliases are not expanded when the shell is not interactive, unless the
- e\bex\bxp\bpa\ban\bnd\bd_\b_a\bal\bli\bia\bas\bse\bes\bs shell option is set using s\bsh\bho\bop\bpt\bt (see the description of
+ Aliases are not expanded when the shell is not interactive, unless the
+ e\bex\bxp\bpa\ban\bnd\bd_\b_a\bal\bli\bia\bas\bse\bes\bs shell option is set using s\bsh\bho\bop\bpt\bt (see the description of
s\bsh\bho\bop\bpt\bt under S\bSH\bHE\bEL\bLL\bL B\bBU\bUI\bIL\bLT\bTI\bIN\bN C\bCO\bOM\bMM\bMA\bAN\bND\bDS\bS below).
- The rules concerning the definition and use of aliases are somewhat
- confusing. B\bBa\bas\bsh\bh always reads at least one complete line of input, and
- all lines that make up a compound command, before executing any of the
- commands on that line or the compound command. Aliases are expanded
- when a command is read, not when it is executed. Therefore, an alias
- definition appearing on the same line as another command does not take
+ The rules concerning the definition and use of aliases are somewhat
+ confusing. B\bBa\bas\bsh\bh always reads at least one complete line of input, and
+ all lines that make up a compound command, before executing any of the
+ commands on that line or the compound command. Aliases are expanded
+ when a command is read, not when it is executed. Therefore, an alias
+ definition appearing on the same line as another command does not take
effect until the shell reads the next line of input, and an alias defi-
- nition in a compound command does not take effect until the shell
- parses and executes the entire compound command. The commands follow-
- ing the alias definition on that line, or in the rest of a compound
- command, are not affected by the new alias. This behavior is also an
- issue when functions are executed. Aliases are expanded when a func-
- tion definition is read, not when the function is executed, because a
+ nition in a compound command does not take effect until the shell
+ parses and executes the entire compound command. The commands follow-
+ ing the alias definition on that line, or in the rest of a compound
+ command, are not affected by the new alias. This behavior is also an
+ issue when functions are executed. Aliases are expanded when a func-
+ tion definition is read, not when the function is executed, because a
function definition is itself a command. As a consequence, aliases de-
fined in a function are not available until after that function is exe-
- cuted. To be safe, always put alias definitions on a separate line,
+ cuted. To be safe, always put alias definitions on a separate line,
and do not use a\bal\bli\bia\bas\bs in compound commands.
For almost every purpose, shell functions are preferable to aliases.
F\bFU\bUN\bNC\bCT\bTI\bIO\bON\bNS\bS
- A shell function, defined as described above under S\bSH\bHE\bEL\bLL\bL G\bGR\bRA\bAM\bMM\bMA\bAR\bR,
- stores a series of commands for later execution. When the name of a
+ A shell function, defined as described above under S\bSH\bHE\bEL\bLL\bL G\bGR\bRA\bAM\bMM\bMA\bAR\bR,
+ stores a series of commands for later execution. When the name of a
shell function is used as a simple command name, the shell executes the
list of commands associated with that function name. Functions are ex-
- ecuted in the context of the calling shell; there is no new process
- created to interpret them (contrast this with the execution of a shell
+ ecuted in the context of the calling shell; there is no new process
+ created to interpret them (contrast this with the execution of a shell
script).
- When a function is executed, the arguments to the function become the
+ When a function is executed, the arguments to the function become the
positional parameters during its execution. The special parameter #\b# is
- updated to reflect the new positional parameters. Special parameter 0\b0
+ updated to reflect the new positional parameters. Special parameter 0\b0
is unchanged. The first element of the F\bFU\bUN\bNC\bCN\bNA\bAM\bME\bE variable is set to the
name of the function while the function is executing.
- All other aspects of the shell execution environment are identical be-
- tween a function and its caller with these exceptions: the D\bDE\bEB\bBU\bUG\bG and
- R\bRE\bET\bTU\bUR\bRN\bN traps (see the description of the t\btr\bra\bap\bp builtin under S\bSH\bHE\bEL\bLL\bL
- B\bBU\bUI\bIL\bLT\bTI\bIN\bN C\bCO\bOM\bMM\bMA\bAN\bND\bDS\bS below) are not inherited unless the function has been
- given the t\btr\bra\bac\bce\be attribute (see the description of the d\bde\bec\bcl\bla\bar\bre\be builtin
- below) or the -\b-o\bo f\bfu\bun\bnc\bct\btr\bra\bac\bce\be shell option has been enabled with the s\bse\bet\bt
- builtin (in which case all functions inherit the D\bDE\bEB\bBU\bUG\bG and R\bRE\bET\bTU\bUR\bRN\bN
- traps), and the E\bER\bRR\bR trap is not inherited unless the -\b-o\bo e\ber\brr\brt\btr\bra\bac\bce\be shell
+ All other aspects of the shell execution environment are identical be-
+ tween a function and its caller with these exceptions: the D\bDE\bEB\bBU\bUG\bG and
+ R\bRE\bET\bTU\bUR\bRN\bN traps (see the description of the t\btr\bra\bap\bp builtin under S\bSH\bHE\bEL\bLL\bL
+ B\bBU\bUI\bIL\bLT\bTI\bIN\bN C\bCO\bOM\bMM\bMA\bAN\bND\bDS\bS below) are not inherited unless the function has been
+ given the t\btr\bra\bac\bce\be attribute (see the description of the d\bde\bec\bcl\bla\bar\bre\be builtin
+ below) or the -\b-o\bo f\bfu\bun\bnc\bct\btr\bra\bac\bce\be shell option has been enabled with the s\bse\bet\bt
+ builtin (in which case all functions inherit the D\bDE\bEB\bBU\bUG\bG and R\bRE\bET\bTU\bUR\bRN\bN
+ traps), and the E\bER\bRR\bR trap is not inherited unless the -\b-o\bo e\ber\brr\brt\btr\bra\bac\bce\be shell
option has been enabled.
- Variables local to the function are declared with the l\blo\boc\bca\bal\bl builtin
- command (_\bl_\bo_\bc_\ba_\bl _\bv_\ba_\br_\bi_\ba_\bb_\bl_\be_\bs). Ordinarily, variables and their values are
- shared between the function and its caller. If a variable is declared
- l\blo\boc\bca\bal\bl, the variable's visible scope is restricted to that function and
+ Variables local to the function are declared with the l\blo\boc\bca\bal\bl builtin
+ command (_\bl_\bo_\bc_\ba_\bl _\bv_\ba_\br_\bi_\ba_\bb_\bl_\be_\bs). Ordinarily, variables and their values are
+ shared between the function and its caller. If a variable is declared
+ l\blo\boc\bca\bal\bl, the variable's visible scope is restricted to that function and
its children (including the functions it calls).
In the following description, the _\bc_\bu_\br_\br_\be_\bn_\bt _\bs_\bc_\bo_\bp_\be is a currently- execut-
ing function. Previous scopes consist of that function's caller and so
- on, back to the "global" scope, where the shell is not executing any
- shell function. A local variable at the current scope is a variable
- declared using the l\blo\boc\bca\bal\bl or d\bde\bec\bcl\bla\bar\bre\be builtins in the function that is
+ on, back to the "global" scope, where the shell is not executing any
+ shell function. A local variable at the current scope is a variable
+ declared using the l\blo\boc\bca\bal\bl or d\bde\bec\bcl\bla\bar\bre\be builtins in the function that is
currently executing.
- Local variables "shadow" variables with the same name declared at pre-
- vious scopes. For instance, a local variable declared in a function
+ Local variables "shadow" variables with the same name declared at pre-
+ vious scopes. For instance, a local variable declared in a function
hides variables with the same name declared at previous scopes, includ-
- ing global variables: references and assignments refer to the local
- variable, leaving the variables at previous scopes unmodified. When
+ ing global variables: references and assignments refer to the local
+ variable, leaving the variables at previous scopes unmodified. When
the function returns, the global variable is once again visible.
- The shell uses _\bd_\by_\bn_\ba_\bm_\bi_\bc _\bs_\bc_\bo_\bp_\bi_\bn_\bg to control a variable's visibility
- within functions. With dynamic scoping, visible variables and their
- values are a result of the sequence of function calls that caused exe-
- cution to reach the current function. The value of a variable that a
- function sees depends on its value within its caller, if any, whether
- that caller is the global scope or another shell function. This is
+ The shell uses _\bd_\by_\bn_\ba_\bm_\bi_\bc _\bs_\bc_\bo_\bp_\bi_\bn_\bg to control a variable's visibility
+ within functions. With dynamic scoping, visible variables and their
+ values are a result of the sequence of function calls that caused exe-
+ cution to reach the current function. The value of a variable that a
+ function sees depends on its value within its caller, if any, whether
+ that caller is the global scope or another shell function. This is
also the value that a local variable declaration shadows, and the value
that is restored when the function returns.
- For example, if a variable _\bv_\ba_\br is declared as local in function _\bf_\bu_\bn_\bc_\b1,
- and _\bf_\bu_\bn_\bc_\b1 calls another function _\bf_\bu_\bn_\bc_\b2, references to _\bv_\ba_\br made from
+ For example, if a variable _\bv_\ba_\br is declared as local in function _\bf_\bu_\bn_\bc_\b1,
+ and _\bf_\bu_\bn_\bc_\b1 calls another function _\bf_\bu_\bn_\bc_\b2, references to _\bv_\ba_\br made from
within _\bf_\bu_\bn_\bc_\b2 will resolve to the local variable _\bv_\ba_\br from _\bf_\bu_\bn_\bc_\b1, shadow-
ing any global variable named _\bv_\ba_\br.
The u\bun\bns\bse\bet\bt builtin also acts using the same dynamic scope: if a variable
is local to the current scope, u\bun\bns\bse\bet\bt will unset it; otherwise the unset
- will refer to the variable found in any calling scope as described
- above. If a variable at the current local scope is unset, it will re-
- main so (appearing as unset) until it is reset in that scope or until
- the function returns. Once the function returns, any instance of the
+ will refer to the variable found in any calling scope as described
+ above. If a variable at the current local scope is unset, it will re-
+ main so (appearing as unset) until it is reset in that scope or until
+ the function returns. Once the function returns, any instance of the
variable at a previous scope will become visible. If the unset acts on
- a variable at a previous scope, any instance of a variable with that
- name that had been shadowed will become visible (see below how the l\blo\bo-\b-
+ a variable at a previous scope, any instance of a variable with that
+ name that had been shadowed will become visible (see below how the l\blo\bo-\b-
c\bca\bal\blv\bva\bar\br_\b_u\bun\bns\bse\bet\bt shell option changes this behavior).
- The F\bFU\bUN\bNC\bCN\bNE\bES\bST\bT variable, if set to a numeric value greater than 0, de-
- fines a maximum function nesting level. Function invocations that ex-
+ The F\bFU\bUN\bNC\bCN\bNE\bES\bST\bT variable, if set to a numeric value greater than 0, de-
+ fines a maximum function nesting level. Function invocations that ex-
ceed the limit cause the entire command to abort.
- If the builtin command r\bre\bet\btu\bur\brn\bn is executed in a function, the function
- completes and execution resumes with the next command after the func-
+ If the builtin command r\bre\bet\btu\bur\brn\bn is executed in a function, the function
+ completes and execution resumes with the next command after the func-
tion call. If r\bre\bet\btu\bur\brn\bn is supplied a numeric argument, that is the func-
- tion's return status; otherwise the function's return status is the
- exit status of the last command executed before the r\bre\bet\btu\bur\brn\bn. Any com-
- mand associated with the R\bRE\bET\bTU\bUR\bRN\bN trap is executed before execution re-
+ tion's return status; otherwise the function's return status is the
+ exit status of the last command executed before the r\bre\bet\btu\bur\brn\bn. Any com-
+ mand associated with the R\bRE\bET\bTU\bUR\bRN\bN trap is executed before execution re-
sumes. When a function completes, the values of the positional parame-
- ters and the special parameter #\b# are restored to the values they had
+ ters and the special parameter #\b# are restored to the values they had
prior to the function's execution.
- The -\b-f\bf option to the d\bde\bec\bcl\bla\bar\bre\be or t\bty\byp\bpe\bes\bse\bet\bt builtin commands will list
- function names and definitions. The -\b-F\bF option to d\bde\bec\bcl\bla\bar\bre\be or t\bty\byp\bpe\bes\bse\bet\bt
- will list the function names only (and optionally the source file and
- line number, if the e\bex\bxt\btd\bde\beb\bbu\bug\bg shell option is enabled). Functions may
+ The -\b-f\bf option to the d\bde\bec\bcl\bla\bar\bre\be or t\bty\byp\bpe\bes\bse\bet\bt builtin commands will list
+ function names and definitions. The -\b-F\bF option to d\bde\bec\bcl\bla\bar\bre\be or t\bty\byp\bpe\bes\bse\bet\bt
+ will list the function names only (and optionally the source file and
+ line number, if the e\bex\bxt\btd\bde\beb\bbu\bug\bg shell option is enabled). Functions may
be exported so that child shell processes (those created when executing
- a separate shell invocation) automatically have them defined with the
- -\b-f\bf option to the e\bex\bxp\bpo\bor\brt\bt builtin. The -\b-f\bf option to the u\bun\bns\bse\bet\bt builtin
+ a separate shell invocation) automatically have them defined with the
+ -\b-f\bf option to the e\bex\bxp\bpo\bor\brt\bt builtin. The -\b-f\bf option to the u\bun\bns\bse\bet\bt builtin
will delete a function definition.
Functions may be recursive. The F\bFU\bUN\bNC\bCN\bNE\bES\bST\bT variable may be used to limit
- the depth of the function call stack and restrict the number of func-
- tion invocations. By default, b\bba\bas\bsh\bh imposes no limit on the number of
+ the depth of the function call stack and restrict the number of func-
+ tion invocations. By default, b\bba\bas\bsh\bh imposes no limit on the number of
recursive calls.
A\bAR\bRI\bIT\bTH\bHM\bME\bET\bTI\bIC\bC E\bEV\bVA\bAL\bLU\bUA\bAT\bTI\bIO\bON\bN
- The shell allows arithmetic expressions to be evaluated, under certain
- circumstances (see the l\ble\bet\bt and d\bde\bec\bcl\bla\bar\bre\be builtin commands, the (\b((\b( com-
- pound command, the arithmetic f\bfo\bor\br command, the [\b[[\b[ conditional command,
+ The shell allows arithmetic expressions to be evaluated, under certain
+ circumstances (see the l\ble\bet\bt and d\bde\bec\bcl\bla\bar\bre\be builtin commands, the (\b((\b( com-
+ pound command, the arithmetic f\bfo\bor\br command, the [\b[[\b[ conditional command,
and A\bAr\bri\bit\bth\bhm\bme\bet\bti\bic\bc E\bEx\bxp\bpa\ban\bns\bsi\bio\bon\bn).
- Evaluation is done in the largest fixed-width integers available, with
- no check for overflow, though division by 0 is trapped and flagged as
- an error. The operators and their precedence, associativity, and val-
+ Evaluation is done in the largest fixed-width integers available, with
+ no check for overflow, though division by 0 is trapped and flagged as
+ an error. The operators and their precedence, associativity, and val-
ues are the same as in the C language. The following list of operators
- is grouped into levels of equal-precedence operators. The levels are
+ is grouped into levels of equal-precedence operators. The levels are
listed in order of decreasing precedence.
_\bi_\bd+\b++\b+ _\bi_\bd-\b--\b-
_\be_\bx_\bp_\br_\b1 ,\b, _\be_\bx_\bp_\br_\b2
comma
- Shell variables are allowed as operands; parameter expansion is per-
+ Shell variables are allowed as operands; parameter expansion is per-
formed before the expression is evaluated. Within an expression, shell
- variables may also be referenced by name without using the parameter
+ variables may also be referenced by name without using the parameter
expansion syntax. This means you can use "x", where _\bx is a shell vari-
able name, in an arithmetic expression, and the shell will evaluate its
- value as an expression and use the result. A shell variable that is
+ value as an expression and use the result. A shell variable that is
null or unset evaluates to 0 when referenced by name in an expression.
- The value of a variable is evaluated as an arithmetic expression when
- it is referenced, or when a variable which has been given the _\bi_\bn_\bt_\be_\bg_\be_\br
+ The value of a variable is evaluated as an arithmetic expression when
+ it is referenced, or when a variable which has been given the _\bi_\bn_\bt_\be_\bg_\be_\br
attribute using d\bde\bec\bcl\bla\bar\bre\be -\b-i\bi is assigned a value. A null value evaluates
- to 0. A shell variable need not have its _\bi_\bn_\bt_\be_\bg_\be_\br attribute turned on
+ to 0. A shell variable need not have its _\bi_\bn_\bt_\be_\bg_\be_\br attribute turned on
to be used in an expression.
Integer constants follow the C language definition, without suffixes or
character constants. Constants with a leading 0 are interpreted as oc-
- tal numbers. A leading 0x or 0X denotes hexadecimal. Otherwise, num-
- bers take the form [_\bb_\ba_\bs_\be_\b#]n, where the optional _\bb_\ba_\bs_\be is a decimal num-
- ber between 2 and 64 representing the arithmetic base, and _\bn is a num-
- ber in that base. If _\bb_\ba_\bs_\be_\b# is omitted, then base 10 is used. When
+ tal numbers. A leading 0x or 0X denotes hexadecimal. Otherwise, num-
+ bers take the form [_\bb_\ba_\bs_\be_\b#]n, where the optional _\bb_\ba_\bs_\be is a decimal num-
+ ber between 2 and 64 representing the arithmetic base, and _\bn is a num-
+ ber in that base. If _\bb_\ba_\bs_\be_\b# is omitted, then base 10 is used. When
specifying _\bn, if a non-digit is required, the digits greater than 9 are
- represented by the lowercase letters, the uppercase letters, @, and _,
- in that order. If _\bb_\ba_\bs_\be is less than or equal to 36, lowercase and up-
- percase letters may be used interchangeably to represent numbers be-
+ represented by the lowercase letters, the uppercase letters, @, and _,
+ in that order. If _\bb_\ba_\bs_\be is less than or equal to 36, lowercase and up-
+ percase letters may be used interchangeably to represent numbers be-
tween 10 and 35.
Operators are evaluated in precedence order. Sub-expressions in paren-
theses are evaluated first and may override the precedence rules above.
C\bCO\bON\bND\bDI\bIT\bTI\bIO\bON\bNA\bAL\bL E\bEX\bXP\bPR\bRE\bES\bSS\bSI\bIO\bON\bNS\bS
- Conditional expressions are used by the [\b[[\b[ compound command and the
- t\bte\bes\bst\bt and [\b[ builtin commands to test file attributes and perform string
- and arithmetic comparisons. The t\bte\bes\bst\bt and [\b[ commands determine their
- behavior based on the number of arguments; see the descriptions of
+ Conditional expressions are used by the [\b[[\b[ compound command and the
+ t\bte\bes\bst\bt and [\b[ builtin commands to test file attributes and perform string
+ and arithmetic comparisons. The t\bte\bes\bst\bt and [\b[ commands determine their
+ behavior based on the number of arguments; see the descriptions of
those commands for any other command-specific actions.
Expressions are formed from the unary or binary primaries listed below.
- Unary expressions are often used to examine the status of a file or
- shell variable. Binary operators are used for string, numeric, and
+ Unary expressions are often used to examine the status of a file or
+ shell variable. Binary operators are used for string, numeric, and
file attribute comparisons.
- B\bBa\bas\bsh\bh handles several filenames specially when they are used in expres-
+ B\bBa\bas\bsh\bh handles several filenames specially when they are used in expres-
sions. If the operating system on which b\bba\bas\bsh\bh is running provides these
- special files, bash will use them; otherwise it will emulate them in-
- ternally with this behavior: If any _\bf_\bi_\bl_\be argument to one of the pri-
- maries is of the form _\b/_\bd_\be_\bv_\b/_\bf_\bd_\b/_\bn, then b\bba\bas\bsh\bh checks file descriptor _\bn.
- If the _\bf_\bi_\bl_\be argument to one of the primaries is one of _\bd_\be_\bv_\b/_\bs_\bt_\bd_\bi_\bn,
- _\bd_\be_\bv_\b/_\bs_\bt_\bd_\bo_\bu_\bt, or _\bd_\be_\bv_\b/_\bs_\bt_\bd_\be_\br_\br, b\bba\bas\bsh\bh checks file descriptor 0, 1, or 2, re-
+ special files, bash will use them; otherwise it will emulate them in-
+ ternally with this behavior: If any _\bf_\bi_\bl_\be argument to one of the pri-
+ maries is of the form _\b/_\bd_\be_\bv_\b/_\bf_\bd_\b/_\bn, then b\bba\bas\bsh\bh checks file descriptor _\bn.
+ If the _\bf_\bi_\bl_\be argument to one of the primaries is one of _\bd_\be_\bv_\b/_\bs_\bt_\bd_\bi_\bn,
+ _\bd_\be_\bv_\b/_\bs_\bt_\bd_\bo_\bu_\bt, or _\bd_\be_\bv_\b/_\bs_\bt_\bd_\be_\br_\br, b\bba\bas\bsh\bh checks file descriptor 0, 1, or 2, re-
spectively.
Unless otherwise specified, primaries that operate on files follow sym-
bolic links and operate on the target of the link, rather than the link
itself.
- When used with [\b[[\b[, or when the shell is in posix mode, the <\b< and >\b> op-
- erators sort lexicographically using the current locale. When the
- shell is not in posix mode, the t\bte\bes\bst\bt command sorts using ASCII order-
+ When used with [\b[[\b[, or when the shell is in posix mode, the <\b< and >\b> op-
+ erators sort lexicographically using the current locale. When the
+ shell is not in posix mode, the t\bte\bes\bst\bt command sorts using ASCII order-
ing.
-\b-a\ba _\bf_\bi_\bl_\be
-\b-L\bL _\bf_\bi_\bl_\be
True if _\bf_\bi_\bl_\be exists and is a symbolic link.
-\b-N\bN _\bf_\bi_\bl_\be
- True if _\bf_\bi_\bl_\be exists and has been modified since it was last ac-
+ True if _\bf_\bi_\bl_\be exists and has been modified since it was last ac-
cessed.
-\b-O\bO _\bf_\bi_\bl_\be
True if _\bf_\bi_\bl_\be exists and is owned by the effective user id.
-\b-S\bS _\bf_\bi_\bl_\be
True if _\bf_\bi_\bl_\be exists and is a socket.
-\b-o\bo _\bo_\bp_\bt_\bn_\ba_\bm_\be
- True if the shell option _\bo_\bp_\bt_\bn_\ba_\bm_\be is enabled. See the list of
- options under the description of the -\b-o\bo option to the s\bse\bet\bt
+ True if the shell option _\bo_\bp_\bt_\bn_\ba_\bm_\be is enabled. See the list of
+ options under the description of the -\b-o\bo option to the s\bse\bet\bt
builtin below.
-\b-v\bv _\bv_\ba_\br_\bn_\ba_\bm_\be
- True if the shell variable _\bv_\ba_\br_\bn_\ba_\bm_\be is set (has been assigned a
- value). If _\bv_\ba_\br_\bn_\ba_\bm_\be is an indexed array variable name sub-
- scripted by _\b@ or _\b*, this returns true if the array has any set
+ True if the shell variable _\bv_\ba_\br_\bn_\ba_\bm_\be is set (has been assigned a
+ value). If _\bv_\ba_\br_\bn_\ba_\bm_\be is an indexed array variable name sub-
+ scripted by _\b@ or _\b*, this returns true if the array has any set
elements. If _\bv_\ba_\br_\bn_\ba_\bm_\be is an associative array variable name sub-
- scripted by _\b@ or _\b*, this returns true if an element with that
+ scripted by _\b@ or _\b*, this returns true if an element with that
key is set.
-\b-R\bR _\bv_\ba_\br_\bn_\ba_\bm_\be
- True if the shell variable _\bv_\ba_\br_\bn_\ba_\bm_\be is set and is a name refer-
+ True if the shell variable _\bv_\ba_\br_\bn_\ba_\bm_\be is set and is a name refer-
ence.
-\b-z\bz _\bs_\bt_\br_\bi_\bn_\bg
True if the length of _\bs_\bt_\br_\bi_\bn_\bg is zero.
_\bs_\bt_\br_\bi_\bn_\bg_\b1 =\b==\b= _\bs_\bt_\br_\bi_\bn_\bg_\b2
_\bs_\bt_\br_\bi_\bn_\bg_\b1 =\b= _\bs_\bt_\br_\bi_\bn_\bg_\b2
- True if the strings are equal. =\b= should be used with the t\bte\bes\bst\bt
- command for POSIX conformance. When used with the [\b[[\b[ command,
+ True if the strings are equal. =\b= should be used with the t\bte\bes\bst\bt
+ command for POSIX conformance. When used with the [\b[[\b[ command,
this performs pattern matching as described above (C\bCo\bom\bmp\bpo\bou\bun\bnd\bd C\bCo\bom\bm-\b-
m\bma\ban\bnd\bds\bs).
_\bs_\bt_\br_\bi_\bn_\bg_\b1 !\b!=\b= _\bs_\bt_\br_\bi_\bn_\bg_\b2
True if _\bs_\bt_\br_\bi_\bn_\bg_\b1 sorts after _\bs_\bt_\br_\bi_\bn_\bg_\b2 lexicographically.
_\bf_\bi_\bl_\be_\b1 -\b-e\bef\bf _\bf_\bi_\bl_\be_\b2
- True if _\bf_\bi_\bl_\be_\b1 and _\bf_\bi_\bl_\be_\b2 refer to the same device and inode num-
+ True if _\bf_\bi_\bl_\be_\b1 and _\bf_\bi_\bl_\be_\b2 refer to the same device and inode num-
bers.
_\bf_\bi_\bl_\be_\b1 -n\bnt\bt _\bf_\bi_\bl_\be_\b2
- True if _\bf_\bi_\bl_\be_\b1 is newer (according to modification date) than
+ True if _\bf_\bi_\bl_\be_\b1 is newer (according to modification date) than
_\bf_\bi_\bl_\be_\b2, or if _\bf_\bi_\bl_\be_\b1 exists and _\bf_\bi_\bl_\be_\b2 does not.
_\bf_\bi_\bl_\be_\b1 -o\bot\bt _\bf_\bi_\bl_\be_\b2
- True if _\bf_\bi_\bl_\be_\b1 is older than _\bf_\bi_\bl_\be_\b2, or if _\bf_\bi_\bl_\be_\b2 exists and _\bf_\bi_\bl_\be_\b1
+ True if _\bf_\bi_\bl_\be_\b1 is older than _\bf_\bi_\bl_\be_\b2, or if _\bf_\bi_\bl_\be_\b2 exists and _\bf_\bi_\bl_\be_\b1
does not.
_\ba_\br_\bg_\b1 O\bOP\bP _\ba_\br_\bg_\b2
- O\bOP\bP is one of -\b-e\beq\bq, -\b-n\bne\be, -\b-l\blt\bt, -\b-l\ble\be, -\b-g\bgt\bt, or -\b-g\bge\be. These arithmetic
- binary operators return true if _\ba_\br_\bg_\b1 is equal to, not equal to,
- less than, less than or equal to, greater than, or greater than
- or equal to _\ba_\br_\bg_\b2, respectively. _\ba_\br_\bg_\b1 and _\ba_\br_\bg_\b2 may be positive
- or negative integers. When used with the [\b[[\b[ command, _\ba_\br_\bg_\b1 and
- _\ba_\br_\bg_\b2 are evaluated as arithmetic expressions (see A\bAR\bRI\bIT\bTH\bHM\bME\bET\bTI\bIC\bC
+ O\bOP\bP is one of -\b-e\beq\bq, -\b-n\bne\be, -\b-l\blt\bt, -\b-l\ble\be, -\b-g\bgt\bt, or -\b-g\bge\be. These arithmetic
+ binary operators return true if _\ba_\br_\bg_\b1 is equal to, not equal to,
+ less than, less than or equal to, greater than, or greater than
+ or equal to _\ba_\br_\bg_\b2, respectively. _\ba_\br_\bg_\b1 and _\ba_\br_\bg_\b2 may be positive
+ or negative integers. When used with the [\b[[\b[ command, _\ba_\br_\bg_\b1 and
+ _\ba_\br_\bg_\b2 are evaluated as arithmetic expressions (see A\bAR\bRI\bIT\bTH\bHM\bME\bET\bTI\bIC\bC
E\bEV\bVA\bAL\bLU\bUA\bAT\bTI\bIO\bON\bN above).
S\bSI\bIM\bMP\bPL\bLE\bE C\bCO\bOM\bMM\bMA\bAN\bND\bD E\bEX\bXP\bPA\bAN\bNS\bSI\bIO\bON\bN
When the shell executes a simple command, it performs the following ex-
- pansions, assignments, and redirections, from left to right, in the
+ pansions, assignments, and redirections, from left to right, in the
following order.
- 1. The words that the parser has marked as variable assignments
- (those preceding the command name) and redirections are saved
+ 1. The words that the parser has marked as variable assignments
+ (those preceding the command name) and redirections are saved
for later processing.
- 2. The words that are not variable assignments or redirections are
- expanded. If any words remain after expansion, the first word
- is taken to be the name of the command and the remaining words
+ 2. The words that are not variable assignments or redirections are
+ expanded. If any words remain after expansion, the first word
+ is taken to be the name of the command and the remaining words
are the arguments.
3. Redirections are performed as described above under R\bRE\bED\bDI\bIR\bRE\bEC\bCT\bTI\bIO\bON\bN.
4. The text after the =\b= in each variable assignment undergoes tilde
expansion, parameter expansion, command substitution, arithmetic
- expansion, and quote removal before being assigned to the vari-
+ expansion, and quote removal before being assigned to the vari-
able.
If no command name results, the variable assignments affect the current
- shell environment. In the case of such a command (one that consists
- only of assignment statements and redirections), assignment statements
- are performed before redirections. Otherwise, the variables are added
- to the environment of the executed command and do not affect the cur-
+ shell environment. In the case of such a command (one that consists
+ only of assignment statements and redirections), assignment statements
+ are performed before redirections. Otherwise, the variables are added
+ to the environment of the executed command and do not affect the cur-
rent shell environment. If any of the assignments attempts to assign a
- value to a readonly variable, an error occurs, and the command exits
+ value to a readonly variable, an error occurs, and the command exits
with a non-zero status.
- If no command name results, redirections are performed, but do not af-
- fect the current shell environment. A redirection error causes the
+ If no command name results, redirections are performed, but do not af-
+ fect the current shell environment. A redirection error causes the
command to exit with a non-zero status.
- If there is a command name left after expansion, execution proceeds as
- described below. Otherwise, the command exits. If one of the expan-
- sions contained a command substitution, the exit status of the command
- is the exit status of the last command substitution performed. If
+ If there is a command name left after expansion, execution proceeds as
+ described below. Otherwise, the command exits. If one of the expan-
+ sions contained a command substitution, the exit status of the command
+ is the exit status of the last command substitution performed. If
there were no command substitutions, the command exits with a zero sta-
tus.
C\bCO\bOM\bMM\bMA\bAN\bND\bD E\bEX\bXE\bEC\bCU\bUT\bTI\bIO\bON\bN
- After a command has been split into words, if it results in a simple
- command and an optional list of arguments, the shell performs the fol-
+ After a command has been split into words, if it results in a simple
+ command and an optional list of arguments, the shell performs the fol-
lowing actions.
- If the command name contains no slashes, the shell attempts to locate
- it. If there exists a shell function by that name, that function is
- invoked as described above in F\bFU\bUN\bNC\bCT\bTI\bIO\bON\bNS\bS. If the name does not match a
- function, the shell searches for it in the list of shell builtins. If
+ If the command name contains no slashes, the shell attempts to locate
+ it. If there exists a shell function by that name, that function is
+ invoked as described above in F\bFU\bUN\bNC\bCT\bTI\bIO\bON\bNS\bS. If the name does not match a
+ function, the shell searches for it in the list of shell builtins. If
a match is found, that builtin is invoked.
- If the name is neither a shell function nor a builtin, and contains no
- slashes, b\bba\bas\bsh\bh searches each element of the P\bPA\bAT\bTH\bH for a directory con-
+ If the name is neither a shell function nor a builtin, and contains no
+ slashes, b\bba\bas\bsh\bh searches each element of the P\bPA\bAT\bTH\bH for a directory con-
taining an executable file by that name. B\bBa\bas\bsh\bh uses a hash table to re-
- member the full pathnames of executable files (see h\bha\bas\bsh\bh under S\bSH\bHE\bEL\bLL\bL
- B\bBU\bUI\bIL\bLT\bTI\bIN\bN C\bCO\bOM\bMM\bMA\bAN\bND\bDS\bS below). Bash performs a full search of the directo-
- ries in P\bPA\bAT\bTH\bH only if the command is not found in the hash table. If
- the search is unsuccessful, the shell searches for a defined shell
- function named c\bco\bom\bmm\bma\ban\bnd\bd_\b_n\bno\bot\bt_\b_f\bfo\bou\bun\bnd\bd_\b_h\bha\ban\bnd\bdl\ble\be. If that function exists, it
- is invoked in a separate execution environment with the original com-
- mand and the original command's arguments as its arguments, and the
- function's exit status becomes the exit status of that subshell. If
+ member the full pathnames of executable files (see h\bha\bas\bsh\bh under S\bSH\bHE\bEL\bLL\bL
+ B\bBU\bUI\bIL\bLT\bTI\bIN\bN C\bCO\bOM\bMM\bMA\bAN\bND\bDS\bS below). Bash performs a full search of the directo-
+ ries in P\bPA\bAT\bTH\bH only if the command is not found in the hash table. If
+ the search is unsuccessful, the shell searches for a defined shell
+ function named c\bco\bom\bmm\bma\ban\bnd\bd_\b_n\bno\bot\bt_\b_f\bfo\bou\bun\bnd\bd_\b_h\bha\ban\bnd\bdl\ble\be. If that function exists, it
+ is invoked in a separate execution environment with the original com-
+ mand and the original command's arguments as its arguments, and the
+ function's exit status becomes the exit status of that subshell. If
that function is not defined, the shell prints an error message and re-
turns an exit status of 127.
- If the search is successful, or if the command name contains one or
+ If the search is successful, or if the command name contains one or
more slashes, the shell executes the named program in a separate execu-
tion environment. Argument 0 is set to the name given, and the remain-
ing arguments to the command are set to the arguments given, if any.
- If this execution fails because the file is not in executable format,
- and the file is not a directory, it is assumed to be a _\bs_\bh_\be_\bl_\bl _\bs_\bc_\br_\bi_\bp_\bt, a
+ If this execution fails because the file is not in executable format,
+ and the file is not a directory, it is assumed to be a _\bs_\bh_\be_\bl_\bl _\bs_\bc_\br_\bi_\bp_\bt, a
file containing shell commands, and the shell creates a new instance of
- itself to execute it. Bash tries to determine whether the file is a
- text file or a binary, and will not execute files it determines to be
+ itself to execute it. Bash tries to determine whether the file is a
+ text file or a binary, and will not execute files it determines to be
binaries. This subshell reinitializes itself, so that the effect is as
- if a new shell had been invoked to handle the script, with the excep-
- tion that the locations of commands remembered by the parent (see h\bha\bas\bsh\bh
+ if a new shell had been invoked to handle the script, with the excep-
+ tion that the locations of commands remembered by the parent (see h\bha\bas\bsh\bh
below under S\bSH\bHE\bEL\bLL\bL B\bBU\bUI\bIL\bLT\bTI\bIN\bN C\bCO\bOM\bMM\bMA\bAN\bND\bDS\bS are retained by the child.
- If the program is a file beginning with #\b#!\b!, the remainder of the first
- line specifies an interpreter for the program. The shell executes the
+ If the program is a file beginning with #\b#!\b!, the remainder of the first
+ line specifies an interpreter for the program. The shell executes the
specified interpreter on operating systems that do not handle this exe-
cutable format themselves. The arguments to the interpreter consist of
- a single optional argument following the interpreter name on the first
- line of the program, followed by the name of the program, followed by
+ a single optional argument following the interpreter name on the first
+ line of the program, followed by the name of the program, followed by
the command arguments, if any.
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
- The shell has an _\be_\bx_\be_\bc_\bu_\bt_\bi_\bo_\bn _\be_\bn_\bv_\bi_\br_\bo_\bn_\bm_\be_\bn_\bt, which consists of the follow-
+ The shell has an _\be_\bx_\be_\bc_\bu_\bt_\bi_\bo_\bn _\be_\bn_\bv_\bi_\br_\bo_\bn_\bm_\be_\bn_\bt, which consists of the follow-
ing:
- +\bo Open files inherited by the shell at invocation, as modified by
+ +\bo Open files inherited by the shell at invocation, as modified by
redirections supplied to the e\bex\bxe\bec\bc builtin.
- +\bo The current working directory as set by c\bcd\bd, p\bpu\bus\bsh\bhd\bd, or p\bpo\bop\bpd\bd, or
+ +\bo The current working directory as set by c\bcd\bd, p\bpu\bus\bsh\bhd\bd, or p\bpo\bop\bpd\bd, or
inherited by the shell at invocation.
- +\bo The file creation mode mask as set by u\bum\bma\bas\bsk\bk or inherited from
+ +\bo The file creation mode mask as set by u\bum\bma\bas\bsk\bk or inherited from
the shell's parent.
+\bo Current traps set by t\btr\bra\bap\bp.
+\bo Shell parameters that are set by variable assignment or with s\bse\bet\bt
or inherited from the shell's parent in the environment.
- +\bo Shell functions defined during execution or inherited from the
+ +\bo Shell functions defined during execution or inherited from the
shell's parent in the environment.
- +\bo Options enabled at invocation (either by default or with com-
+ +\bo Options enabled at invocation (either by default or with com-
mand-line arguments) or by s\bse\bet\bt.
+\bo Options enabled by s\bsh\bho\bop\bpt\bt.
+\bo Shell aliases defined with a\bal\bli\bia\bas\bs.
- +\bo Various process IDs, including those of background jobs, the
+ +\bo Various process IDs, including those of background jobs, the
value of $\b$$\b$, and the value of P\bPP\bPI\bID\bD.
- When a simple command other than a builtin or shell function is to be
- executed, it is invoked in a separate execution environment that con-
- sists of the following. Unless otherwise noted, the values are inher-
+ When a simple command other than a builtin or shell function is to be
+ executed, it is invoked in a separate execution environment that con-
+ sists of the following. Unless otherwise noted, the values are inher-
ited from the shell.
- +\bo The shell's open files, plus any modifications and additions
+ +\bo The shell's open files, plus any modifications and additions
specified by redirections to the command.
+\bo The current working directory.
+\bo The file creation mode mask.
- +\bo Shell variables and functions marked for export, along with
+ +\bo Shell variables and functions marked for export, along with
variables exported for the command, passed in the environment.
+\bo Traps caught by the shell are reset to the values inherited from
the shell's parent, and traps ignored by the shell are ignored.
- A command invoked in this separate environment cannot affect the
+ A command invoked in this separate environment cannot affect the
shell's execution environment.
A _\bs_\bu_\bb_\bs_\bh_\be_\bl_\bl is a copy of the shell process.
- Command substitution, commands grouped with parentheses, and asynchro-
+ Command substitution, commands grouped with parentheses, and asynchro-
nous commands are invoked in a subshell environment that is a duplicate
of the shell environment, except that traps caught by the shell are re-
- set to the values that the shell inherited from its parent at invoca-
- tion. Builtin commands that are invoked as part of a pipeline, except
- possibly in the last element depending on the value of the l\bla\bas\bst\btp\bpi\bip\bpe\be
- shell option, are also executed in a subshell environment. Changes
- made to the subshell environment cannot affect the shell's execution
+ set to the values that the shell inherited from its parent at invoca-
+ tion. Builtin commands that are invoked as part of a pipeline, except
+ possibly in the last element depending on the value of the l\bla\bas\bst\btp\bpi\bip\bpe\be
+ shell option, are also executed in a subshell environment. Changes
+ made to the subshell environment cannot affect the shell's execution
environment.
- When the shell is in posix mode, subshells spawned to execute command
- substitutions inherit the value of the -\b-e\be option from their parent
- shell. When not in posix mode, b\bba\bas\bsh\bh clears the -\b-e\be option in such sub-
- shells. See the description of the i\bin\bnh\bhe\ber\bri\bit\bt_\b_e\ber\brr\bre\bex\bxi\bit\bt shell option below
+ When the shell is in posix mode, subshells spawned to execute command
+ substitutions inherit the value of the -\b-e\be option from their parent
+ shell. When not in posix mode, b\bba\bas\bsh\bh clears the -\b-e\be option in such sub-
+ shells. See the description of the i\bin\bnh\bhe\ber\bri\bit\bt_\b_e\ber\brr\bre\bex\bxi\bit\bt shell option below
for how to control this behavior when not in posix mode.
- If a command is followed by a &\b& and job control is not active, the de-
+ If a command is followed by a &\b& and job control is not active, the de-
fault standard input for the command is the empty file _\b/_\bd_\be_\bv_\b/_\bn_\bu_\bl_\bl. Oth-
- erwise, the invoked command inherits the file descriptors of the call-
+ erwise, the invoked command inherits the file descriptors of the call-
ing shell as modified by redirections.
E\bEN\bNV\bVI\bIR\bRO\bON\bNM\bME\bEN\bNT\bT
- When a program is invoked it is given an array of strings called the
+ When a program is invoked it is given an array of strings called the
_\be_\bn_\bv_\bi_\br_\bo_\bn_\bm_\be_\bn_\bt. This is a list of _\bn_\ba_\bm_\be-_\bv_\ba_\bl_\bu_\be pairs, of the form
_\bn_\ba_\bm_\be=_\bv_\ba_\bl_\bu_\be.
- The shell provides several ways to manipulate the environment. On in-
- vocation, the shell scans its own environment and creates a parameter
- for each name found, automatically marking it for _\be_\bx_\bp_\bo_\br_\bt to child
+ The shell provides several ways to manipulate the environment. On in-
+ vocation, the shell scans its own environment and creates a parameter
+ for each name found, automatically marking it for _\be_\bx_\bp_\bo_\br_\bt to child
processes. Executed commands inherit the environment. The e\bex\bxp\bpo\bor\brt\bt, d\bde\be-\b-
- c\bcl\bla\bar\bre\be -\b-x\bx, and u\bun\bns\bse\bet\bt commands modify the environment by adding and
- deleting parameters and functions. If the value of a parameter in the
- environment is modified, the new value automatically becomes part of
- the environment, replacing the old. The environment inherited by any
- executed command consists of the shell's initial environment, whose
- values may be modified in the shell, less any pairs removed by the u\bun\bn-\b-
- s\bse\bet\bt or e\bex\bxp\bpo\bor\brt\bt -\b-n\bn commands, plus any additions via the e\bex\bxp\bpo\bor\brt\bt and d\bde\be-\b-
+ c\bcl\bla\bar\bre\be -\b-x\bx, and u\bun\bns\bse\bet\bt commands modify the environment by adding and
+ deleting parameters and functions. If the value of a parameter in the
+ environment is modified, the new value automatically becomes part of
+ the environment, replacing the old. The environment inherited by any
+ executed command consists of the shell's initial environment, whose
+ values may be modified in the shell, less any pairs removed by the u\bun\bn-\b-
+ s\bse\bet\bt or e\bex\bxp\bpo\bor\brt\bt -\b-n\bn commands, plus any additions via the e\bex\bxp\bpo\bor\brt\bt and d\bde\be-\b-
c\bcl\bla\bar\bre\be -\b-x\bx commands.
- If any parameter assignments, as described above in P\bPA\bAR\bRA\bAM\bME\bET\bTE\bER\bRS\bS, appear
+ If any parameter assignments, as described above in P\bPA\bAR\bRA\bAM\bME\bET\bTE\bER\bRS\bS, appear
before a _\bs_\bi_\bm_\bp_\bl_\be _\bc_\bo_\bm_\bm_\ba_\bn_\bd, the variable assignments are part of that com-
mand's environment for as long as it executes. These assignment state-
- ments affect only the environment seen by that command. If these as-
- signments precede a call to a shell function, the variables are local
+ ments affect only the environment seen by that command. If these as-
+ signments precede a call to a shell function, the variables are local
to the function and exported to that function's children.
- If the -\b-k\bk option is set (see the s\bse\bet\bt builtin command below), then _\ba_\bl_\bl
- parameter assignments are placed in the environment for a command, not
+ If the -\b-k\bk option is set (see the s\bse\bet\bt builtin command below), then _\ba_\bl_\bl
+ parameter assignments are placed in the environment for a command, not
just those that precede the command name.
- When b\bba\bas\bsh\bh invokes an external command, the variable _\b_ is set to the
+ When b\bba\bas\bsh\bh invokes an external command, the variable _\b_ is set to the
full pathname of the command and passed to that command in its environ-
ment.
E\bEX\bXI\bIT\bT S\bST\bTA\bAT\bTU\bUS\bS
- The exit status of an executed command is the value returned by the
+ The exit status of an executed command is the value returned by the
_\bw_\ba_\bi_\bt_\bp_\bi_\bd system call or equivalent function. Exit statuses fall between
- 0 and 255, though, as explained below, the shell may use values above
+ 0 and 255, though, as explained below, the shell may use values above
125 specially. Exit statuses from shell builtins and compound commands
are also limited to this range. Under certain circumstances, the shell
will use special values to indicate specific failure modes.
For the shell's purposes, a command which exits with a zero exit status
- has succeeded. So while an exit status of zero indicates success, a
+ has succeeded. So while an exit status of zero indicates success, a
non-zero exit status indicates failure.
- When a command terminates on a fatal signal _\bN, b\bba\bas\bsh\bh uses the value of
+ When a command terminates on a fatal signal _\bN, b\bba\bas\bsh\bh uses the value of
128+_\bN as the exit status.
- If a command is not found, the child process created to execute it re-
- turns a status of 127. If a command is found but is not executable,
+ If a command is not found, the child process created to execute it re-
+ turns a status of 127. If a command is found but is not executable,
the return status is 126.
If a command fails because of an error during expansion or redirection,
the exit status is greater than zero.
- Shell builtin commands return a status of 0 (_\bt_\br_\bu_\be) if successful, and
- non-zero (_\bf_\ba_\bl_\bs_\be) if an error occurs while they execute. All builtins
- return an exit status of 2 to indicate incorrect usage, generally in-
+ Shell builtin commands return a status of 0 (_\bt_\br_\bu_\be) if successful, and
+ non-zero (_\bf_\ba_\bl_\bs_\be) if an error occurs while they execute. All builtins
+ return an exit status of 2 to indicate incorrect usage, generally in-
valid options or missing arguments.
The exit status of the last command is available in the special parame-
ter $?.
- B\bBa\bas\bsh\bh itself returns the exit status of the last command executed, un-
- less a syntax error occurs, in which case it exits with a non-zero
+ B\bBa\bas\bsh\bh itself returns the exit status of the last command executed, un-
+ less a syntax error occurs, in which case it exits with a non-zero
value. See also the e\bex\bxi\bit\bt builtin command below.
S\bSI\bIG\bGN\bNA\bAL\bLS\bS
- When b\bba\bas\bsh\bh is interactive, in the absence of any traps, it ignores
- S\bSI\bIG\bGT\bTE\bER\bRM\bM (so that k\bki\bil\bll\bl 0\b0 does not kill an interactive shell), and
+ When b\bba\bas\bsh\bh is interactive, in the absence of any traps, it ignores
+ S\bSI\bIG\bGT\bTE\bER\bRM\bM (so that k\bki\bil\bll\bl 0\b0 does not kill an interactive shell), and
catches and handles S\bSI\bIG\bGI\bIN\bNT\bT (so that the w\bwa\bai\bit\bt builtin is interruptible).
- When b\bba\bas\bsh\bh receives S\bSI\bIG\bGI\bIN\bNT\bT, it breaks out of any executing loops. In
+ When b\bba\bas\bsh\bh receives S\bSI\bIG\bGI\bIN\bNT\bT, it breaks out of any executing loops. In
all cases, b\bba\bas\bsh\bh ignores S\bSI\bIG\bGQ\bQU\bUI\bIT\bT. If job control is in effect, b\bba\bas\bsh\bh ig-
nores S\bSI\bIG\bGT\bTT\bTI\bIN\bN, S\bSI\bIG\bGT\bTT\bTO\bOU\bU, and S\bSI\bIG\bGT\bTS\bST\bTP\bP.
Non-builtin commands b\bba\bas\bsh\bh executes have signal handlers set to the val-
ues inherited by the shell from its parent, unless t\btr\bra\bap\bp sets them to be
- ignored, in which case the child process will ignore them as well.
- When job control is not in effect, asynchronous commands ignore S\bSI\bIG\bGI\bIN\bNT\bT
+ ignored, in which case the child process will ignore them as well.
+ When job control is not in effect, asynchronous commands ignore S\bSI\bIG\bGI\bIN\bNT\bT
and S\bSI\bIG\bGQ\bQU\bUI\bIT\bT in addition to these inherited handlers. Commands run as a
- result of command substitution ignore the keyboard-generated job con-
+ result of command substitution ignore the keyboard-generated job con-
trol signals S\bSI\bIG\bGT\bTT\bTI\bIN\bN, S\bSI\bIG\bGT\bTT\bTO\bOU\bU, and S\bSI\bIG\bGT\bTS\bST\bTP\bP.
- The shell exits by default upon receipt of a S\bSI\bIG\bGH\bHU\bUP\bP. Before exiting,
- an interactive shell resends the S\bSI\bIG\bGH\bHU\bUP\bP to all jobs, running or
- stopped. The shell sends S\bSI\bIG\bGC\bCO\bON\bNT\bT to stopped jobs to ensure that they
- receive the S\bSI\bIG\bGH\bHU\bUP\bP (see J\bJO\bOB\bB C\bCO\bON\bNT\bTR\bRO\bOL\bL below for more information about
- running and stopped jobs). To prevent the shell from sending the sig-
- nal to a particular job, remove it from the jobs table with the d\bdi\bis\bso\bow\bwn\bn
- builtin (see S\bSH\bHE\bEL\bLL\bL B\bBU\bUI\bIL\bLT\bTI\bIN\bN C\bCO\bOM\bMM\bMA\bAN\bND\bDS\bS below) or mark it not to receive
+ The shell exits by default upon receipt of a S\bSI\bIG\bGH\bHU\bUP\bP. Before exiting,
+ an interactive shell resends the S\bSI\bIG\bGH\bHU\bUP\bP to all jobs, running or
+ stopped. The shell sends S\bSI\bIG\bGC\bCO\bON\bNT\bT to stopped jobs to ensure that they
+ receive the S\bSI\bIG\bGH\bHU\bUP\bP (see J\bJO\bOB\bB C\bCO\bON\bNT\bTR\bRO\bOL\bL below for more information about
+ running and stopped jobs). To prevent the shell from sending the sig-
+ nal to a particular job, remove it from the jobs table with the d\bdi\bis\bso\bow\bwn\bn
+ builtin (see S\bSH\bHE\bEL\bLL\bL B\bBU\bUI\bIL\bLT\bTI\bIN\bN C\bCO\bOM\bMM\bMA\bAN\bND\bDS\bS below) or mark it not to receive
S\bSI\bIG\bGH\bHU\bUP\bP using d\bdi\bis\bso\bow\bwn\bn -\b-h\bh.
- If the h\bhu\bup\bpo\bon\bne\bex\bxi\bit\bt shell option has been set using s\bsh\bho\bop\bpt\bt, b\bba\bas\bsh\bh sends a
+ If the h\bhu\bup\bpo\bon\bne\bex\bxi\bit\bt shell option has been set using s\bsh\bho\bop\bpt\bt, b\bba\bas\bsh\bh sends a
S\bSI\bIG\bGH\bHU\bUP\bP to all jobs when an interactive login shell exits.
- If b\bba\bas\bsh\bh is waiting for a command to complete and receives a signal for
+ If b\bba\bas\bsh\bh is waiting for a command to complete and receives a signal for
which a trap has been set, the trap will not be executed until the com-
mand completes. If b\bba\bas\bsh\bh is waiting for an asynchronous command via the
- w\bwa\bai\bit\bt builtin, and it receives a signal for which a trap has been set,
- the w\bwa\bai\bit\bt builtin will return immediately with an exit status greater
+ w\bwa\bai\bit\bt builtin, and it receives a signal for which a trap has been set,
+ the w\bwa\bai\bit\bt builtin will return immediately with an exit status greater
than 128, immediately after which the shell executes the trap.
- When job control is not enabled, and b\bba\bas\bsh\bh is waiting for a foreground
+ When job control is not enabled, and b\bba\bas\bsh\bh is waiting for a foreground
command to complete, the shell receives keyboard-generated signals such
- as S\bSI\bIG\bGI\bIN\bNT\bT (usually generated by ^\b^C\bC) that users commonly intend to send
+ as S\bSI\bIG\bGI\bIN\bNT\bT (usually generated by ^\b^C\bC) that users commonly intend to send
to that command. This happens because the shell and the command are in
- the same process group as the terminal, and ^\b^C\bC sends S\bSI\bIG\bGI\bIN\bNT\bT to all
+ the same process group as the terminal, and ^\b^C\bC sends S\bSI\bIG\bGI\bIN\bNT\bT to all
processes in that process group. See J\bJO\bOB\bB C\bCO\bON\bNT\bTR\bRO\bOL\bL below for more infor-
mation about process groups.
- When b\bba\bas\bsh\bh is running without job control enabled and receives S\bSI\bIG\bGI\bIN\bNT\bT
- while waiting for a foreground command, it waits until that foreground
+ When b\bba\bas\bsh\bh is running without job control enabled and receives S\bSI\bIG\bGI\bIN\bNT\bT
+ while waiting for a foreground command, it waits until that foreground
command terminates and then decides what to do about the S\bSI\bIG\bGI\bIN\bNT\bT:
1. If the command terminates due to the S\bSI\bIG\bGI\bIN\bNT\bT, b\bba\bas\bsh\bh concludes that
- the user meant to end the entire script, and acts on the S\bSI\bIG\bGI\bIN\bNT\bT
+ the user meant to end the entire script, and acts on the S\bSI\bIG\bGI\bIN\bNT\bT
(e.g., by running a S\bSI\bIG\bGI\bIN\bNT\bT trap or exiting itself);
- 2. If the command does not terminate due to S\bSI\bIG\bGI\bIN\bNT\bT, the program
- handled the S\bSI\bIG\bGI\bIN\bNT\bT itself and did not treat it as a fatal sig-
- nal. In that case, b\bba\bas\bsh\bh does not treat S\bSI\bIG\bGI\bIN\bNT\bT as a fatal sig-
- nal, either, instead assuming that the S\bSI\bIG\bGI\bIN\bNT\bT was used as part
- of the program's normal operation (e.g., emacs uses it to abort
+ 2. If the command does not terminate due to S\bSI\bIG\bGI\bIN\bNT\bT, the program
+ handled the S\bSI\bIG\bGI\bIN\bNT\bT itself and did not treat it as a fatal sig-
+ nal. In that case, b\bba\bas\bsh\bh does not treat S\bSI\bIG\bGI\bIN\bNT\bT as a fatal sig-
+ nal, either, instead assuming that the S\bSI\bIG\bGI\bIN\bNT\bT was used as part
+ of the program's normal operation (e.g., emacs uses it to abort
editing commands) or deliberately discarded. However, b\bba\bas\bsh\bh will
- run any trap set on S\bSI\bIG\bGI\bIN\bNT\bT, as it does with any other trapped
- signal it receives while it is waiting for the foreground com-
+ run any trap set on S\bSI\bIG\bGI\bIN\bNT\bT, as it does with any other trapped
+ signal it receives while it is waiting for the foreground com-
mand to complete, for compatibility.
J\bJO\bOB\bB C\bCO\bON\bNT\bTR\bRO\bOL\bL
_\bJ_\bo_\bb _\bc_\bo_\bn_\bt_\br_\bo_\bl refers to the ability to selectively stop (_\bs_\bu_\bs_\bp_\be_\bn_\bd) the ex-
- ecution of processes and continue (_\br_\be_\bs_\bu_\bm_\be) their execution at a later
- point. A user typically employs this facility via an interactive in-
+ ecution of processes and continue (_\br_\be_\bs_\bu_\bm_\be) their execution at a later
+ point. A user typically employs this facility via an interactive in-
terface supplied jointly by the operating system kernel's terminal dri-
ver and b\bba\bas\bsh\bh.
- The shell associates a _\bj_\bo_\bb with each pipeline. It keeps a table of
- currently executing jobs, which the j\bjo\bob\bbs\bs command will display. Each
- job has a _\bj_\bo_\bb _\bn_\bu_\bm_\bb_\be_\br, which j\bjo\bob\bbs\bs displays between brackets. Job num-
- bers start at 1. When b\bba\bas\bsh\bh starts a job asynchronously (in the _\bb_\ba_\bc_\bk_\b-
+ The shell associates a _\bj_\bo_\bb with each pipeline. It keeps a table of
+ currently executing jobs, which the j\bjo\bob\bbs\bs command will display. Each
+ job has a _\bj_\bo_\bb _\bn_\bu_\bm_\bb_\be_\br, which j\bjo\bob\bbs\bs displays between brackets. Job num-
+ bers start at 1. When b\bba\bas\bsh\bh starts a job asynchronously (in the _\bb_\ba_\bc_\bk_\b-
_\bg_\br_\bo_\bu_\bn_\bd), it prints a line that looks like:
[1] 25647
indicating that this job is job number 1 and that the process ID of the
last process in the pipeline associated with this job is 25647. All of
- the processes in a single pipeline are members of the same job. B\bBa\bas\bsh\bh
+ the processes in a single pipeline are members of the same job. B\bBa\bas\bsh\bh
uses the _\bj_\bo_\bb abstraction as the basis for job control.
- To facilitate the implementation of the user interface to job control,
+ To facilitate the implementation of the user interface to job control,
each process has a _\bp_\br_\bo_\bc_\be_\bs_\bs _\bg_\br_\bo_\bu_\bp _\bI_\bD, and the operating system maintains
the notion of a _\bc_\bu_\br_\br_\be_\bn_\bt _\bt_\be_\br_\bm_\bi_\bn_\ba_\bl _\bp_\br_\bo_\bc_\be_\bs_\bs _\bg_\br_\bo_\bu_\bp _\bI_\bD. Processes that have
- the same process group ID are said to be part of the same _\bp_\br_\bo_\bc_\be_\bs_\bs
- _\bg_\br_\bo_\bu_\bp. Members of the _\bf_\bo_\br_\be_\bg_\br_\bo_\bu_\bn_\bd process group (processes whose
+ the same process group ID are said to be part of the same _\bp_\br_\bo_\bc_\be_\bs_\bs
+ _\bg_\br_\bo_\bu_\bp. Members of the _\bf_\bo_\br_\be_\bg_\br_\bo_\bu_\bn_\bd process group (processes whose
process group ID is equal to the current terminal process group ID) re-
- ceive keyboard-generated signals such as S\bSI\bIG\bGI\bIN\bNT\bT. Processes in the
- foreground process group are said to be _\bf_\bo_\br_\be_\bg_\br_\bo_\bu_\bn_\bd processes. _\bB_\ba_\bc_\bk_\b-
+ ceive keyboard-generated signals such as S\bSI\bIG\bGI\bIN\bNT\bT. Processes in the
+ foreground process group are said to be _\bf_\bo_\br_\be_\bg_\br_\bo_\bu_\bn_\bd processes. _\bB_\ba_\bc_\bk_\b-
_\bg_\br_\bo_\bu_\bn_\bd processes are those whose process group ID differs from the ter-
minal's; such processes are immune to keyboard-generated signals. Only
foreground processes are allowed to read from or, if the user so speci-
- fies with "stty tostop", write to the terminal. Background processes
- which attempt to read from (write to when "tostop" is in effect) the
- terminal are sent a S\bSI\bIG\bGT\bTT\bTI\bIN\bN (\b(S\bSI\bIG\bGT\bTT\bTO\bOU\bU)\b) signal by the kernel's terminal
+ fies with "stty tostop", write to the terminal. Background processes
+ which attempt to read from (write to when "tostop" is in effect) the
+ terminal are sent a S\bSI\bIG\bGT\bTT\bTI\bIN\bN (\b(S\bSI\bIG\bGT\bTT\bTO\bOU\bU)\b) signal by the kernel's terminal
driver, which, unless caught, suspends the process.
- If the operating system on which b\bba\bas\bsh\bh is running supports job control,
+ If the operating system on which b\bba\bas\bsh\bh is running supports job control,
b\bba\bas\bsh\bh contains facilities to use it. Typing the _\bs_\bu_\bs_\bp_\be_\bn_\bd character (typ-
ically ^\b^Z\bZ, Control-Z) while a process is running stops that process and
- returns control to b\bba\bas\bsh\bh. Typing the _\bd_\be_\bl_\ba_\by_\be_\bd _\bs_\bu_\bs_\bp_\be_\bn_\bd character (typi-
- cally ^\b^Y\bY, Control-Y) causes the process stop when it attempts to read
- input from the terminal, and returns control to b\bba\bas\bsh\bh. The user then
- manipulates the state of this job, using the b\bbg\bg command to continue it
- in the background, the f\bfg\bg command to continue it in the foreground, or
- the k\bki\bil\bll\bl command to kill it. The suspend character takes effect imme-
- diately, and has the additional side effect of discarding any pending
+ returns control to b\bba\bas\bsh\bh. Typing the _\bd_\be_\bl_\ba_\by_\be_\bd _\bs_\bu_\bs_\bp_\be_\bn_\bd character (typi-
+ cally ^\b^Y\bY, Control-Y) causes the process stop when it attempts to read
+ input from the terminal, and returns control to b\bba\bas\bsh\bh. The user then
+ manipulates the state of this job, using the b\bbg\bg command to continue it
+ in the background, the f\bfg\bg command to continue it in the foreground, or
+ the k\bki\bil\bll\bl command to kill it. The suspend character takes effect imme-
+ diately, and has the additional side effect of discarding any pending
output and typeahead. To force a background process to stop, or stop a
- process that's not associated with the current terminal session, send
+ process that's not associated with the current terminal session, send
it the S\bSI\bIG\bGS\bST\bTO\bOP\bP signal using k\bki\bil\bll\bl.
There are a number of ways to refer to a job in the shell. The %\b% char-
acter introduces a job specification (jobspec).
- Job number _\bn may be referred to as %\b%n\bn. A job may also be referred to
- using a prefix of the name used to start it, or using a substring that
- appears in its command line. For example, %\b%c\bce\be refers to a job whose
- command name begins with c\bce\be. Using %\b%?\b?c\bce\be, on the other hand, refers to
+ Job number _\bn may be referred to as %\b%n\bn. A job may also be referred to
+ using a prefix of the name used to start it, or using a substring that
+ appears in its command line. For example, %\b%c\bce\be refers to a job whose
+ command name begins with c\bce\be. Using %\b%?\b?c\bce\be, on the other hand, refers to
any job containing the string c\bce\be in its command line. If the prefix or
substring matches more than one job, b\bba\bas\bsh\bh reports an error.
- The symbols %\b%%\b% and %\b%+\b+ refer to the shell's notion of the _\bc_\bu_\br_\br_\be_\bn_\bt _\bj_\bo_\bb.
- A single % (with no accompanying job specification) also refers to the
- current job. %\b%-\b- refers to the _\bp_\br_\be_\bv_\bi_\bo_\bu_\bs _\bj_\bo_\bb. When a job starts in the
+ The symbols %\b%%\b% and %\b%+\b+ refer to the shell's notion of the _\bc_\bu_\br_\br_\be_\bn_\bt _\bj_\bo_\bb.
+ A single % (with no accompanying job specification) also refers to the
+ current job. %\b%-\b- refers to the _\bp_\br_\be_\bv_\bi_\bo_\bu_\bs _\bj_\bo_\bb. When a job starts in the
background, a job stops while in the foreground, or a job is resumed in
- the background, it becomes the current job. The job that was the cur-
- rent job becomes the previous job. When the current job terminates,
- the previous job becomes the current job. If there is only a single
- job, %\b%+\b+ and %\b%-\b- can both be used to refer to that job. In output per-
+ the background, it becomes the current job. The job that was the cur-
+ rent job becomes the previous job. When the current job terminates,
+ the previous job becomes the current job. If there is only a single
+ job, %\b%+\b+ and %\b%-\b- can both be used to refer to that job. In output per-
taining to jobs (e.g., the output of the j\bjo\bob\bbs\bs command), the current job
is always marked with a +\b+, and the previous job with a -\b-.
- Simply naming a job can be used to bring it into the foreground: %\b%1\b1 is
- a synonym for "fg %1", bringing job 1 from the background into the
+ Simply naming a job can be used to bring it into the foreground: %\b%1\b1 is
+ a synonym for "fg %1", bringing job 1 from the background into the
foreground. Similarly, "%1 &" resumes job 1 in the background, equiva-
lent to "bg %1".
- The shell learns immediately whenever a job changes state. Normally,
- b\bba\bas\bsh\bh waits until it is about to print a prompt before notifying the
- user about changes in a job's status so as to not interrupt any other
- output, though it will notify of changes in a job's status after a
- foreground command in a list completes, before executing the next com-
- mand in the list. If the -\b-b\bb option to the s\bse\bet\bt builtin command is en-
+ The shell learns immediately whenever a job changes state. Normally,
+ b\bba\bas\bsh\bh waits until it is about to print a prompt before notifying the
+ user about changes in a job's status so as to not interrupt any other
+ output, though it will notify of changes in a job's status after a
+ foreground command in a list completes, before executing the next com-
+ mand in the list. If the -\b-b\bb option to the s\bse\bet\bt builtin command is en-
abled, b\bba\bas\bsh\bh reports status changes immediately. B\bBa\bas\bsh\bh executes any trap
on S\bSI\bIG\bGC\bCH\bHL\bLD\bD for each child that terminates.
When a job terminates and b\bba\bas\bsh\bh notifies the user about it, b\bba\bas\bsh\bh removes
- the job from the table. It will not appear in j\bjo\bob\bbs\bs output, but w\bwa\bai\bit\bt
- will report its exit status, as long as it's supplied the process ID
- associated with the job as an argument. When the table is empty, job
+ the job from the table. It will not appear in j\bjo\bob\bbs\bs output, but w\bwa\bai\bit\bt
+ will report its exit status, as long as it's supplied the process ID
+ associated with the job as an argument. When the table is empty, job
numbers start over at 1.
- If a user attempts to exit b\bba\bas\bsh\bh while jobs are stopped (or, if the
- c\bch\bhe\bec\bck\bkj\bjo\bob\bbs\bs shell option has been enabled using the s\bsh\bho\bop\bpt\bt builtin, run-
+ If a user attempts to exit b\bba\bas\bsh\bh while jobs are stopped (or, if the
+ c\bch\bhe\bec\bck\bkj\bjo\bob\bbs\bs shell option has been enabled using the s\bsh\bho\bop\bpt\bt builtin, run-
ning), the shell prints a warning message, and, if the c\bch\bhe\bec\bck\bkj\bjo\bob\bbs\bs option
- is enabled, lists the jobs and their statuses. The j\bjo\bob\bbs\bs command may
+ is enabled, lists the jobs and their statuses. The j\bjo\bob\bbs\bs command may
then be used to inspect their status. If the user immediately attempts
- to exit again, without an intervening command, b\bba\bas\bsh\bh does not print an-
+ to exit again, without an intervening command, b\bba\bas\bsh\bh does not print an-
other warning, and terminates any stopped jobs.
- When the shell is waiting for a job or process using the w\bwa\bai\bit\bt builtin,
- and job control is enabled, w\bwa\bai\bit\bt will return when the job changes
+ When the shell is waiting for a job or process using the w\bwa\bai\bit\bt builtin,
+ and job control is enabled, w\bwa\bai\bit\bt will return when the job changes
state. The -\b-f\bf option causes w\bwa\bai\bit\bt to wait until the job or process ter-
minates before returning.
P\bPR\bRO\bOM\bMP\bPT\bTI\bIN\bNG\bG
When executing interactively, b\bba\bas\bsh\bh displays the primary prompt P\bPS\bS1\b1 when
- it is ready to read a command, and the secondary prompt P\bPS\bS2\b2 when it
+ it is ready to read a command, and the secondary prompt P\bPS\bS2\b2 when it
needs more input to complete a command.
- B\bBa\bas\bsh\bh examines the value of the array variable P\bPR\bRO\bOM\bMP\bPT\bT_\b_C\bCO\bOM\bMM\bMA\bAN\bND\bD just be-
- fore printing each primary prompt. If any elements in P\bPR\bRO\bOM\bMP\bPT\bT_\b_C\bCO\bOM\bMM\bMA\bAN\bND\bD
- are set and non-null, Bash executes each value, in numeric order, just
- as if it had been typed on the command line. B\bBa\bas\bsh\bh displays P\bPS\bS0\b0 after
+ B\bBa\bas\bsh\bh examines the value of the array variable P\bPR\bRO\bOM\bMP\bPT\bT_\b_C\bCO\bOM\bMM\bMA\bAN\bND\bD just be-
+ fore printing each primary prompt. If any elements in P\bPR\bRO\bOM\bMP\bPT\bT_\b_C\bCO\bOM\bMM\bMA\bAN\bND\bD
+ are set and non-null, Bash executes each value, in numeric order, just
+ as if it had been typed on the command line. B\bBa\bas\bsh\bh displays P\bPS\bS0\b0 after
it reads a command but before executing it.
- B\bBa\bas\bsh\bh displays P\bPS\bS4\b4 as described above before tracing each command when
+ B\bBa\bas\bsh\bh displays P\bPS\bS4\b4 as described above before tracing each command when
the -\b-x\bx option is enabled.
B\bBa\bas\bsh\bh allows the prompt strings P\bPS\bS0\b0, P\bPS\bS1\b1, P\bPS\bS2\b2, and P\bPS\bS4\b4, to be customized
- by inserting a number of backslash-escaped special characters that are
+ by inserting a number of backslash-escaped special characters that are
decoded as follows:
\\b\a\ba An ASCII bell character (07).
- \\b\d\bd The date in "Weekday Month Date" format (e.g., "Tue May
+ \\b\d\bd The date in "Weekday Month Date" format (e.g., "Tue May
26").
\\b\D\bD{\b{_\bf_\bo_\br_\bm_\ba_\bt}\b}
The _\bf_\bo_\br_\bm_\ba_\bt is passed to _\bs_\bt_\br_\bf_\bt_\bi_\bm_\be(3) and the result is in-
serted into the prompt string; an empty _\bf_\bo_\br_\bm_\ba_\bt results in
- a locale-specific time representation. The braces are
+ a locale-specific time representation. The braces are
required.
\\b\e\be An ASCII escape character (033).
\\b\h\bh The hostname up to the first ".".
\\b\H\bH The hostname.
\\b\j\bj The number of jobs currently managed by the shell.
- \\b\l\bl The basename of the shell's terminal device name (e.g.,
+ \\b\l\bl The basename of the shell's terminal device name (e.g.,
"ttys0").
\\b\n\bn A newline.
\\b\r\br A carriage return.
- \\b\s\bs The name of the shell: the basename of $\b$0\b0 (the portion
+ \\b\s\bs The name of the shell: the basename of $\b$0\b0 (the portion
following the final slash).
\\b\t\bt The current time in 24-hour HH:MM:SS format.
\\b\T\bT The current time in 12-hour HH:MM:SS format.
\\b\u\bu The username of the current user.
\\b\v\bv The b\bba\bas\bsh\bh version (e.g., 2.00).
\\b\V\bV The b\bba\bas\bsh\bh release, version + patch level (e.g., 2.00.0)
- \\b\w\bw The value of the P\bPW\bWD\bD shell variable ($\b$P\bPW\bWD\bD), with $\b$H\bHO\bOM\bME\bE
- abbreviated with a tilde (uses the value of the
+ \\b\w\bw The value of the P\bPW\bWD\bD shell variable ($\b$P\bPW\bWD\bD), with $\b$H\bHO\bOM\bME\bE
+ abbreviated with a tilde (uses the value of the
P\bPR\bRO\bOM\bMP\bPT\bT_\b_D\bDI\bIR\bRT\bTR\bRI\bIM\bM variable).
- \\b\W\bW The basename of $\b$P\bPW\bWD\bD, with $\b$H\bHO\bOM\bME\bE abbreviated with a
+ \\b\W\bW The basename of $\b$P\bPW\bWD\bD, with $\b$H\bHO\bOM\bME\bE abbreviated with a
tilde.
\\b\!\b! The history number of this command.
\\b\#\b# The command number of this command.
\\b\$\b$ If the effective UID is 0, a #\b#, otherwise a $\b$.
\\b\_\bn_\bn_\bn The character corresponding to the octal number _\bn_\bn_\bn.
\\b\\\b\ A backslash.
- \\b\[\b[ Begin a sequence of non-printing characters, which could
- be used to embed a terminal control sequence into the
+ \\b\[\b[ Begin a sequence of non-printing characters, which could
+ be used to embed a terminal control sequence into the
prompt.
\\b\]\b] End a sequence of non-printing characters.
- The command number and the history number are usually different: the
- history number of a command is its position in the history list, which
- may include commands restored from the history file (see H\bHI\bIS\bST\bTO\bOR\bRY\bY be-
- low), while the command number is the position in the sequence of com-
- mands executed during the current shell session. After the string is
- decoded, it is expanded via parameter expansion, command substitution,
- arithmetic expansion, and quote removal, subject to the value of the
+ The command number and the history number are usually different: the
+ history number of a command is its position in the history list, which
+ may include commands restored from the history file (see H\bHI\bIS\bST\bTO\bOR\bRY\bY be-
+ low), while the command number is the position in the sequence of com-
+ mands executed during the current shell session. After the string is
+ decoded, it is expanded via parameter expansion, command substitution,
+ arithmetic expansion, and quote removal, subject to the value of the
p\bpr\bro\bom\bmp\bpt\btv\bva\bar\brs\bs shell option (see the description of the s\bsh\bho\bop\bpt\bt command under
- S\bSH\bHE\bEL\bLL\bL B\bBU\bUI\bIL\bLT\bTI\bIN\bN C\bCO\bOM\bMM\bMA\bAN\bND\bDS\bS below). This can have unwanted side effects if
- escaped portions of the string appear within command substitution or
+ S\bSH\bHE\bEL\bLL\bL B\bBU\bUI\bIL\bLT\bTI\bIN\bN C\bCO\bOM\bMM\bMA\bAN\bND\bDS\bS below). This can have unwanted side effects if
+ escaped portions of the string appear within command substitution or
contain characters special to word expansion.
R\bRE\bEA\bAD\bDL\bLI\bIN\bNE\bE
- This is the library that handles reading input when using an interac-
- tive shell, unless the -\b--\b-n\bno\boe\bed\bdi\bit\bti\bin\bng\bg option is supplied at shell invoca-
- tion. Line editing is also used when using the -\b-e\be option to the r\bre\bea\bad\bd
+ This is the library that handles reading input when using an interac-
+ tive shell, unless the -\b--\b-n\bno\boe\bed\bdi\bit\bti\bin\bng\bg option is supplied at shell invoca-
+ tion. Line editing is also used when using the -\b-e\be option to the r\bre\bea\bad\bd
builtin. By default, the line editing commands are similar to those of
emacs; a vi-style line editing interface is also available. Line edit-
- ing can be enabled at any time using the -\b-o\bo e\bem\bma\bac\bcs\bs or -\b-o\bo v\bvi\bi options to
- the s\bse\bet\bt builtin (see S\bSH\bHE\bEL\bLL\bL B\bBU\bUI\bIL\bLT\bTI\bIN\bN C\bCO\bOM\bMM\bMA\bAN\bND\bDS\bS below). To turn off line
- editing after the shell is running, use the +\b+o\bo e\bem\bma\bac\bcs\bs or +\b+o\bo v\bvi\bi options
+ ing can be enabled at any time using the -\b-o\bo e\bem\bma\bac\bcs\bs or -\b-o\bo v\bvi\bi options to
+ the s\bse\bet\bt builtin (see S\bSH\bHE\bEL\bLL\bL B\bBU\bUI\bIL\bLT\bTI\bIN\bN C\bCO\bOM\bMM\bMA\bAN\bND\bDS\bS below). To turn off line
+ editing after the shell is running, use the +\b+o\bo e\bem\bma\bac\bcs\bs or +\b+o\bo v\bvi\bi options
to the s\bse\bet\bt builtin.
R\bRe\bea\bad\bdl\bli\bin\bne\be N\bNo\bot\bta\bat\bti\bio\bon\bn
- This section uses Emacs-style editing concepts and uses its notation
- for keystrokes. Control keys are denoted by C-_\bk_\be_\by, e.g., C-n means
- Control-N. Similarly, _\bm_\be_\bt_\ba keys are denoted by M-_\bk_\be_\by, so M-x means
+ This section uses Emacs-style editing concepts and uses its notation
+ for keystrokes. Control keys are denoted by C-_\bk_\be_\by, e.g., C-n means
+ Control-N. Similarly, _\bm_\be_\bt_\ba keys are denoted by M-_\bk_\be_\by, so M-x means
Meta-X. The Meta key is often labeled "Alt" or "Option".
- On keyboards without a _\bM_\be_\bt_\ba key, M-_\bx means ESC _\bx, i.e., press and re-
- lease the Escape key, then press and release the _\bx key, in sequence.
- This makes ESC the _\bm_\be_\bt_\ba _\bp_\br_\be_\bf_\bi_\bx. The combination M-C-_\bx means ESC-Con-
- trol-_\bx: press and release the Escape key, then press and hold the Con-
+ On keyboards without a _\bM_\be_\bt_\ba key, M-_\bx means ESC _\bx, i.e., press and re-
+ lease the Escape key, then press and release the _\bx key, in sequence.
+ This makes ESC the _\bm_\be_\bt_\ba _\bp_\br_\be_\bf_\bi_\bx. The combination M-C-_\bx means ESC-Con-
+ trol-_\bx: press and release the Escape key, then press and hold the Con-
trol key while pressing the _\bx key, then release both.
- On some keyboards, the Meta key modifier produces characters with the
- eighth bit (0200) set. You can use the e\ben\bna\bab\bbl\ble\be-\b-m\bme\bet\bta\ba-\b-k\bke\bey\by variable to
- control whether or not it does this, if the keyboard allows it. On
- many others, the terminal or terminal emulator converts the metafied
- key to a key sequence beginning with ESC as described in the preceding
+ On some keyboards, the Meta key modifier produces characters with the
+ eighth bit (0200) set. You can use the e\ben\bna\bab\bbl\ble\be-\b-m\bme\bet\bta\ba-\b-k\bke\bey\by variable to
+ control whether or not it does this, if the keyboard allows it. On
+ many others, the terminal or terminal emulator converts the metafied
+ key to a key sequence beginning with ESC as described in the preceding
paragraph.
- If your _\bM_\be_\bt_\ba key produces a key sequence with the ESC meta prefix, you
- can make M-_\bk_\be_\by key bindings you specify (see R\bRe\bea\bad\bdl\bli\bin\bne\be K\bKe\bey\by B\bBi\bin\bnd\bdi\bin\bng\bgs\bs be-
+ If your _\bM_\be_\bt_\ba key produces a key sequence with the ESC meta prefix, you
+ can make M-_\bk_\be_\by key bindings you specify (see R\bRe\bea\bad\bdl\bli\bin\bne\be K\bKe\bey\by B\bBi\bin\bnd\bdi\bin\bng\bgs\bs be-
low) do the same thing by setting the f\bfo\bor\brc\bce\be-\b-m\bme\bet\bta\ba-\b-p\bpr\bre\bef\bfi\bix\bx variable.
R\bRe\bea\bad\bdl\bli\bin\bne\be commands may be given numeric _\ba_\br_\bg_\bu_\bm_\be_\bn_\bt_\bs, which normally act as
- a repeat count. Sometimes, however, it is the sign of the argument
- that is significant. Passing a negative argument to a command that
- acts in the forward direction (e.g., k\bki\bil\bll\bl-\b-l\bli\bin\bne\be) makes that command act
- in a backward direction. Commands whose behavior with arguments devi-
+ a repeat count. Sometimes, however, it is the sign of the argument
+ that is significant. Passing a negative argument to a command that
+ acts in the forward direction (e.g., k\bki\bil\bll\bl-\b-l\bli\bin\bne\be) makes that command act
+ in a backward direction. Commands whose behavior with arguments devi-
ates from this are noted below.
- The _\bp_\bo_\bi_\bn_\bt is the current cursor position, and _\bm_\ba_\br_\bk refers to a saved
+ The _\bp_\bo_\bi_\bn_\bt is the current cursor position, and _\bm_\ba_\br_\bk refers to a saved
cursor position. The text between the point and mark is referred to as
the _\br_\be_\bg_\bi_\bo_\bn. R\bRe\bea\bad\bdl\bli\bin\bne\be has the concept of an _\ba_\bc_\bt_\bi_\bv_\be _\br_\be_\bg_\bi_\bo_\bn: when the re-
- gion is active, r\bre\bea\bad\bdl\bli\bin\bne\be redisplay highlights the region using the
+ gion is active, r\bre\bea\bad\bdl\bli\bin\bne\be redisplay highlights the region using the
value of the a\bac\bct\bti\biv\bve\be-\b-r\bre\beg\bgi\bio\bon\bn-\b-s\bst\bta\bar\brt\bt-\b-c\bco\bol\blo\bor\br variable. The e\ben\bna\bab\bbl\ble\be-\b-a\bac\bct\bti\biv\bve\be-\b-r\bre\be-\b-
- g\bgi\bio\bon\bn variable turns this on and off. Several commands set the region
+ g\bgi\bio\bon\bn variable turns this on and off. Several commands set the region
to active; those are noted below.
- When a command is described as _\bk_\bi_\bl_\bl_\bi_\bn_\bg text, the text deleted is saved
+ When a command is described as _\bk_\bi_\bl_\bl_\bi_\bn_\bg text, the text deleted is saved
for possible future retrieval (_\by_\ba_\bn_\bk_\bi_\bn_\bg). The killed text is saved in a
- _\bk_\bi_\bl_\bl _\br_\bi_\bn_\bg. Consecutive kills accumulate the deleted text into one
+ _\bk_\bi_\bl_\bl _\br_\bi_\bn_\bg. Consecutive kills accumulate the deleted text into one
unit, which can be yanked all at once. Commands which do not kill text
separate the chunks of text on the kill ring.
R\bRe\bea\bad\bdl\bli\bin\bne\be I\bIn\bni\bit\bti\bia\bal\bli\biz\bza\bat\bti\bio\bon\bn
- R\bRe\bea\bad\bdl\bli\bin\bne\be is customized by putting commands in an initialization file
- (the _\bi_\bn_\bp_\bu_\bt_\br_\bc file). The name of this file is taken from the value of
- the I\bIN\bNP\bPU\bUT\bTR\bRC\bC shell variable. If that variable is unset, the default is
- _\b~_\b/_\b._\bi_\bn_\bp_\bu_\bt_\br_\bc. If that file does not exist or cannot be read, r\bre\bea\bad\bdl\bli\bin\bne\be
+ R\bRe\bea\bad\bdl\bli\bin\bne\be is customized by putting commands in an initialization file
+ (the _\bi_\bn_\bp_\bu_\bt_\br_\bc file). The name of this file is taken from the value of
+ the I\bIN\bNP\bPU\bUT\bTR\bRC\bC shell variable. If that variable is unset, the default is
+ _\b~_\b/_\b._\bi_\bn_\bp_\bu_\bt_\br_\bc. If that file does not exist or cannot be read, r\bre\bea\bad\bdl\bli\bin\bne\be
looks for _\b/_\be_\bt_\bc_\b/_\bi_\bn_\bp_\bu_\bt_\br_\bc. When a program which uses the r\bre\bea\bad\bdl\bli\bin\bne\be library
- starts up, r\bre\bea\bad\bdl\bli\bin\bne\be reads the initialization file and sets the key
+ starts up, r\bre\bea\bad\bdl\bli\bin\bne\be reads the initialization file and sets the key
bindings and variables found there, before reading any user input.
- There are only a few basic constructs allowed in the inputrc file.
+ There are only a few basic constructs allowed in the inputrc file.
Blank lines are ignored. Lines beginning with a #\b# are comments. Lines
beginning with a $\b$ indicate conditional constructs. Other lines denote
key bindings and variable settings.
The default key-bindings in this section may be changed using key bind-
- ing commands in the _\bi_\bn_\bp_\bu_\bt_\br_\bc file. Programs that use the r\bre\bea\bad\bdl\bli\bin\bne\be li-
+ ing commands in the _\bi_\bn_\bp_\bu_\bt_\br_\bc file. Programs that use the r\bre\bea\bad\bdl\bli\bin\bne\be li-
brary, including b\bba\bas\bsh\bh, may add their own commands and bindings.
For example, placing
or
C-Meta-u: universal-argument
- into the _\bi_\bn_\bp_\bu_\bt_\br_\bc would make M-C-u execute the r\bre\bea\bad\bdl\bli\bin\bne\be command _\bu_\bn_\bi_\bv_\be_\br_\b-
+ into the _\bi_\bn_\bp_\bu_\bt_\br_\bc would make M-C-u execute the r\bre\bea\bad\bdl\bli\bin\bne\be command _\bu_\bn_\bi_\bv_\be_\br_\b-
_\bs_\ba_\bl_\b-_\ba_\br_\bg_\bu_\bm_\be_\bn_\bt.
- Key bindings may contain the following symbolic character names: _\bD_\bE_\bL,
- _\bE_\bS_\bC, _\bE_\bS_\bC_\bA_\bP_\bE, _\bL_\bF_\bD, _\bN_\bE_\bW_\bL_\bI_\bN_\bE, _\bR_\bE_\bT, _\bR_\bE_\bT_\bU_\bR_\bN, _\bR_\bU_\bB_\bO_\bU_\bT(a_\bd_\be_\bs_\bt_\br_\bu_\bc_\bt_\bi_\bv_\bebackspace),
+ Key bindings may contain the following symbolic character names: _\bD_\bE_\bL,
+ _\bE_\bS_\bC, _\bE_\bS_\bC_\bA_\bP_\bE, _\bL_\bF_\bD, _\bN_\bE_\bW_\bL_\bI_\bN_\bE, _\bR_\bE_\bT, _\bR_\bE_\bT_\bU_\bR_\bN, _\bR_\bU_\bB_\bO_\bU_\bT(a_\bd_\be_\bs_\bt_\br_\bu_\bc_\bt_\bi_\bv_\bebackspace),
_\bS_\bP_\bA_\bC_\bE, _\bS_\bP_\bC, and _\bT_\bA_\bB.
- In addition to command names, r\bre\bea\bad\bdl\bli\bin\bne\be allows keys to be bound to a
+ In addition to command names, r\bre\bea\bad\bdl\bli\bin\bne\be allows keys to be bound to a
string that is inserted when the key is pressed (a _\bm_\ba_\bc_\br_\bo). The differ-
- ence between a macro and a command is that a macro is enclosed in sin-
+ ence between a macro and a command is that a macro is enclosed in sin-
gle or double quotes.
R\bRe\bea\bad\bdl\bli\bin\bne\be K\bKe\bey\by B\bBi\bin\bnd\bdi\bin\bng\bgs\bs
- The syntax for controlling key bindings in the _\bi_\bn_\bp_\bu_\bt_\br_\bc file is simple.
- All that is required is the name of the command or the text of a macro
- and a key sequence to which it should be bound. The key sequence may
- be specified in one of two ways: as a symbolic key name, possibly with
- _\bM_\be_\bt_\ba_\b- or _\bC_\bo_\bn_\bt_\br_\bo_\bl_\b- prefixes, or as a key sequence composed of one or
- more characters enclosed in double quotes. The key sequence and name
- are separated by a colon. There can be no whitespace between the name
+ The syntax for controlling key bindings in the _\bi_\bn_\bp_\bu_\bt_\br_\bc file is simple.
+ All that is required is the name of the command or the text of a macro
+ and a key sequence to which it should be bound. The key sequence may
+ be specified in one of two ways: as a symbolic key name, possibly with
+ _\bM_\be_\bt_\ba_\b- or _\bC_\bo_\bn_\bt_\br_\bo_\bl_\b- prefixes, or as a key sequence composed of one or
+ more characters enclosed in double quotes. The key sequence and name
+ are separated by a colon. There can be no whitespace between the name
and the colon.
When using the form k\bke\bey\byn\bna\bam\bme\be:_\bf_\bu_\bn_\bc_\bt_\bi_\bo_\bn_\b-_\bn_\ba_\bm_\be or _\bm_\ba_\bc_\br_\bo, _\bk_\be_\by_\bn_\ba_\bm_\be is the name
Meta-Rubout: backward-kill-word
Control-o: "> output"
- In the above example, _\bC_\b-_\bu is bound to the function u\bun\bni\biv\bve\ber\brs\bsa\bal\bl-\b-a\bar\brg\bgu\bum\bme\ben\bnt\bt,
- _\bM_\b-_\bD_\bE_\bL is bound to the function b\bba\bac\bck\bkw\bwa\bar\brd\bd-\b-k\bki\bil\bll\bl-\b-w\bwo\bor\brd\bd, and _\bC_\b-_\bo is bound to
- run the macro expressed on the right hand side (that is, to insert the
+ In the above example, _\bC_\b-_\bu is bound to the function u\bun\bni\biv\bve\ber\brs\bsa\bal\bl-\b-a\bar\brg\bgu\bum\bme\ben\bnt\bt,
+ _\bM_\b-_\bD_\bE_\bL is bound to the function b\bba\bac\bck\bkw\bwa\bar\brd\bd-\b-k\bki\bil\bll\bl-\b-w\bwo\bor\brd\bd, and _\bC_\b-_\bo is bound to
+ run the macro expressed on the right hand side (that is, to insert the
text "> output" into the line).
- In the second form, "\b"k\bke\bey\bys\bse\beq\bq"\b":_\bf_\bu_\bn_\bc_\bt_\bi_\bo_\bn_\b-_\bn_\ba_\bm_\be or _\bm_\ba_\bc_\br_\bo, k\bke\bey\bys\bse\beq\bq differs
- from k\bke\bey\byn\bna\bam\bme\be above in that strings denoting an entire key sequence may
- be specified by placing the sequence within double quotes. Some GNU
- Emacs style key escapes can be used, as in the following example, but
+ In the second form, "\b"k\bke\bey\bys\bse\beq\bq"\b":_\bf_\bu_\bn_\bc_\bt_\bi_\bo_\bn_\b-_\bn_\ba_\bm_\be or _\bm_\ba_\bc_\br_\bo, k\bke\bey\bys\bse\beq\bq differs
+ from k\bke\bey\byn\bna\bam\bme\be above in that strings denoting an entire key sequence may
+ be specified by placing the sequence within double quotes. Some GNU
+ Emacs style key escapes can be used, as in the following example, but
none of the symbolic character names are recognized.
"\C-u": universal-argument
"\e[11~": "Function Key 1"
In this example, _\bC_\b-_\bu is again bound to the function u\bun\bni\biv\bve\ber\brs\bsa\bal\bl-\b-a\bar\brg\bgu\bum\bme\ben\bnt\bt.
- _\bC_\b-_\bx _\bC_\b-_\br is bound to the function r\bre\be-\b-r\bre\bea\bad\bd-\b-i\bin\bni\bit\bt-\b-f\bfi\bil\ble\be, and _\bE_\bS_\bC _\b[ _\b1 _\b1 _\b~ is
+ _\bC_\b-_\bx _\bC_\b-_\br is bound to the function r\bre\be-\b-r\bre\bea\bad\bd-\b-i\bin\bni\bit\bt-\b-f\bfi\bil\ble\be, and _\bE_\bS_\bC _\b[ _\b1 _\b1 _\b~ is
bound to insert the text "Function Key 1".
- The full set of GNU Emacs style escape sequences available when speci-
+ The full set of GNU Emacs style escape sequences available when speci-
fying key sequences is
\\b\C\bC-\b- A control prefix.
- \\b\M\bM-\b- Adding the meta prefix or converting the following char-
- acter to a meta character, as described below under
+ \\b\M\bM-\b- Adding the meta prefix or converting the following char-
+ acter to a meta character, as described below under
f\bfo\bor\brc\bce\be-\b-m\bme\bet\bta\ba-\b-p\bpr\bre\bef\bfi\bix\bx.
\\b\e\be An escape character.
\\b\\\b\ Backslash.
\\b\"\b" Literal ", a double quote.
\\b\'\b' Literal ', a single quote.
- In addition to the GNU Emacs style escape sequences, a second set of
+ In addition to the GNU Emacs style escape sequences, a second set of
backslash escapes is available:
\\b\a\ba alert (bell)
\\b\b\bb backspace
\\b\r\br carriage return
\\b\t\bt horizontal tab
\\b\v\bv vertical tab
- \\b\_\bn_\bn_\bn The eight-bit character whose value is the octal value
+ \\b\_\bn_\bn_\bn The eight-bit character whose value is the octal value
_\bn_\bn_\bn (one to three 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).
When entering the text of a macro, single or double quotes must be used
to indicate a macro definition. Unquoted text is assumed to be a func-
- tion name. Tthe backslash escapes described above are expanded in the
- macro body. Backslash will quote any other character in the macro
+ tion name. Tthe backslash escapes described above are expanded in the
+ macro body. Backslash will quote any other character in the macro
text, including " and '.
- B\bBa\bas\bsh\bh will display or modify the current r\bre\bea\bad\bdl\bli\bin\bne\be key bindings with the
+ B\bBa\bas\bsh\bh will display or modify the current r\bre\bea\bad\bdl\bli\bin\bne\be key bindings with the
b\bbi\bin\bnd\bd builtin command. The -\b-o\bo e\bem\bma\bac\bcs\bs or -\b-o\bo v\bvi\bi options to the s\bse\bet\bt builtin
- (see S\bSH\bHE\bEL\bLL\bL B\bBU\bUI\bIL\bLT\bTI\bIN\bN C\bCO\bOM\bMM\bMA\bAN\bND\bDS\bS below) will change the editing mode during
+ (see S\bSH\bHE\bEL\bLL\bL B\bBU\bUI\bIL\bLT\bTI\bIN\bN C\bCO\bOM\bMM\bMA\bAN\bND\bDS\bS below) will change the editing mode during
interactive use.
R\bRe\bea\bad\bdl\bli\bin\bne\be V\bVa\bar\bri\bia\bab\bbl\ble\bes\bs
s\bse\bet\bt _\bv_\ba_\br_\bi_\ba_\bb_\bl_\be_\b-_\bn_\ba_\bm_\be _\bv_\ba_\bl_\bu_\be
or using the b\bbi\bin\bnd\bd builtin command (see S\bSH\bHE\bEL\bLL\bL B\bBU\bUI\bIL\bLT\bTI\bIN\bN C\bCO\bOM\bMM\bMA\bAN\bND\bDS\bS below).
- Except where noted, r\bre\bea\bad\bdl\bli\bin\bne\be variables can take the values O\bOn\bn or O\bOf\bff\bf
- (without regard to case). Unrecognized variable names are ignored.
+ Except where noted, r\bre\bea\bad\bdl\bli\bin\bne\be variables can take the values O\bOn\bn or O\bOf\bff\bf
+ (without regard to case). Unrecognized variable names are ignored.
When r\bre\bea\bad\bdl\bli\bin\bne\be reads a variable value, empty or null values, "on" (case-
- insensitive), and "1" are equivalent to O\bOn\bn. All other values are
+ insensitive), and "1" are equivalent to O\bOn\bn. All other values are
equivalent to O\bOf\bff\bf.
- The b\bbi\bin\bnd\bd -\b-V\bV command lists the current r\bre\bea\bad\bdl\bli\bin\bne\be variable names and val-
+ The b\bbi\bin\bnd\bd -\b-V\bV command lists the current r\bre\bea\bad\bdl\bli\bin\bne\be variable names and val-
ues (see S\bSH\bHE\bEL\bLL\bL B\bBU\bUI\bIL\bLT\bTI\bIN\bN C\bCO\bOM\bMM\bMA\bAN\bND\bDS\bS below).
The variables and their default values are:
a\bac\bct\bti\biv\bve\be-\b-r\bre\beg\bgi\bio\bon\bn-\b-s\bst\bta\bar\brt\bt-\b-c\bco\bol\blo\bor\br
- A string variable that controls the text color and background
- when displaying the text in the active region (see the descrip-
- tion of e\ben\bna\bab\bbl\ble\be-\b-a\bac\bct\bti\biv\bve\be-\b-r\bre\beg\bgi\bio\bon\bn below). This string must not take
+ A string variable that controls the text color and background
+ when displaying the text in the active region (see the descrip-
+ tion of e\ben\bna\bab\bbl\ble\be-\b-a\bac\bct\bti\biv\bve\be-\b-r\bre\beg\bgi\bio\bon\bn below). This string must not take
up any physical character positions on the display, so it should
- consist only of terminal escape sequences. It is output to the
- terminal before displaying the text in the active region. This
- variable is reset to the default value whenever the terminal
- type changes. The default value is the string that puts the
- terminal in standout mode, as obtained from the terminal's ter-
+ consist only of terminal escape sequences. It is output to the
+ terminal before displaying the text in the active region. This
+ variable is reset to the default value whenever the terminal
+ type changes. The default value is the string that puts the
+ terminal in standout mode, as obtained from the terminal's ter-
minfo description. A sample value might be "\e[01;33m".
a\bac\bct\bti\biv\bve\be-\b-r\bre\beg\bgi\bio\bon\bn-\b-e\ben\bnd\bd-\b-c\bco\bol\blo\bor\br
- A string variable that "undoes" the effects of a\bac\bct\bti\biv\bve\be-\b-r\bre\be-\b-
- g\bgi\bio\bon\bn-\b-s\bst\bta\bar\brt\bt-\b-c\bco\bol\blo\bor\br and restores "normal" terminal display appear-
- ance after displaying text in the active region. This string
- must not take up any physical character positions on the dis-
- play, so it should consist only of terminal escape sequences.
- It is output to the terminal after displaying the text in the
- active region. This variable is reset to the default value
- whenever the terminal type changes. The default value is the
- string that restores the terminal from standout mode, as ob-
+ A string variable that "undoes" the effects of a\bac\bct\bti\biv\bve\be-\b-r\bre\be-\b-
+ g\bgi\bio\bon\bn-\b-s\bst\bta\bar\brt\bt-\b-c\bco\bol\blo\bor\br and restores "normal" terminal display appear-
+ ance after displaying text in the active region. This string
+ must not take up any physical character positions on the dis-
+ play, so it should consist only of terminal escape sequences.
+ It is output to the terminal after displaying the text in the
+ active region. This variable is reset to the default value
+ whenever the terminal type changes. The default value is the
+ string that restores the terminal from standout mode, as ob-
tained from the terminal's terminfo description. A sample value
might be "\e[0m".
b\bbe\bel\bll\bl-\b-s\bst\bty\byl\ble\be (\b(a\bau\bud\bdi\bib\bbl\ble\be)\b)
- Controls what happens when r\bre\bea\bad\bdl\bli\bin\bne\be wants to ring the terminal
+ Controls what happens when r\bre\bea\bad\bdl\bli\bin\bne\be wants to ring the terminal
bell. If set to n\bno\bon\bne\be, r\bre\bea\bad\bdl\bli\bin\bne\be never rings the bell. If set to
- v\bvi\bis\bsi\bib\bbl\ble\be, r\bre\bea\bad\bdl\bli\bin\bne\be uses a visible bell if one is available. If
+ v\bvi\bis\bsi\bib\bbl\ble\be, r\bre\bea\bad\bdl\bli\bin\bne\be uses a visible bell if one is available. If
set to a\bau\bud\bdi\bib\bbl\ble\be, r\bre\bea\bad\bdl\bli\bin\bne\be attempts to ring the terminal's bell.
b\bbi\bin\bnd\bd-\b-t\btt\bty\by-\b-s\bsp\bpe\bec\bci\bia\bal\bl-\b-c\bch\bha\bar\brs\bs (\b(O\bOn\bn)\b)
- If set to O\bOn\bn, r\bre\bea\bad\bdl\bli\bin\bne\be attempts to bind the control characters
- that are treated specially by the kernel's terminal driver to
+ If set to O\bOn\bn, r\bre\bea\bad\bdl\bli\bin\bne\be attempts to bind the control characters
+ that are treated specially by the kernel's terminal driver to
their r\bre\bea\bad\bdl\bli\bin\bne\be equivalents. These override the default r\bre\bea\bad\bdl\bli\bin\bne\be
bindings described here. Type "stty -a" at a b\bba\bas\bsh\bh prompt to see
- your current terminal settings, including the special control
+ your current terminal settings, including the special control
characters (usually c\bcc\bch\bha\bar\brs\bs).
b\bbl\bli\bin\bnk\bk-\b-m\bma\bat\btc\bch\bhi\bin\bng\bg-\b-p\bpa\bar\bre\ben\bn (\b(O\bOf\bff\bf)\b)
If set to O\bOn\bn, r\bre\bea\bad\bdl\bli\bin\bne\be attempts to briefly move the cursor to an
opening parenthesis when a closing parenthesis is inserted.
c\bco\bol\blo\bor\bre\bed\bd-\b-c\bco\bom\bmp\bpl\ble\bet\bti\bio\bon\bn-\b-p\bpr\bre\bef\bfi\bix\bx (\b(O\bOf\bff\bf)\b)
- If set to O\bOn\bn, when listing completions, r\bre\bea\bad\bdl\bli\bin\bne\be displays the
+ If set to O\bOn\bn, when listing completions, r\bre\bea\bad\bdl\bli\bin\bne\be displays the
common prefix of the set of possible completions using a differ-
- ent color. The color definitions are taken from the value of
+ ent color. The color definitions are taken from the value of
the L\bLS\bS_\b_C\bCO\bOL\bLO\bOR\bRS\bS environment variable. If there is a color defini-
tion in $\b$L\bLS\bS_\b_C\bCO\bOL\bLO\bOR\bRS\bS for the custom suffix ".readline-colored-com-
- pletion-prefix", r\bre\bea\bad\bdl\bli\bin\bne\be uses this color for the common prefix
+ pletion-prefix", r\bre\bea\bad\bdl\bli\bin\bne\be uses this color for the common prefix
instead of its default.
c\bco\bol\blo\bor\bre\bed\bd-\b-s\bst\bta\bat\bts\bs (\b(O\bOf\bff\bf)\b)
- If set to O\bOn\bn, r\bre\bea\bad\bdl\bli\bin\bne\be displays possible completions using dif-
- ferent colors to indicate their file type. The color defini-
- tions are taken from the value of the L\bLS\bS_\b_C\bCO\bOL\bLO\bOR\bRS\bS environment
+ If set to O\bOn\bn, r\bre\bea\bad\bdl\bli\bin\bne\be displays possible completions using dif-
+ ferent colors to indicate their file type. The color defini-
+ tions are taken from the value of the L\bLS\bS_\b_C\bCO\bOL\bLO\bOR\bRS\bS environment
variable.
c\bco\bom\bmm\bme\ben\bnt\bt-\b-b\bbe\beg\bgi\bin\bn (\b("#\b#")\b)
- The string that the r\bre\bea\bad\bdl\bli\bin\bne\be i\bin\bns\bse\ber\brt\bt-\b-c\bco\bom\bmm\bme\ben\bnt\bt command inserts.
- This command is bound to M\bM-\b-#\b# in emacs mode and to #\b# in vi com-
+ The string that the r\bre\bea\bad\bdl\bli\bin\bne\be i\bin\bns\bse\ber\brt\bt-\b-c\bco\bom\bmm\bme\ben\bnt\bt command inserts.
+ This command is bound to M\bM-\b-#\b# in emacs mode and to #\b# in vi com-
mand mode.
c\bco\bom\bmp\bpl\ble\bet\bti\bio\bon\bn-\b-d\bdi\bis\bsp\bpl\bla\bay\by-\b-w\bwi\bid\bdt\bth\bh (\b(-\b-1\b1)\b)
- The number of screen columns used to display possible matches
- when performing completion. The value is ignored if it is less
- than 0 or greater than the terminal screen width. A value of 0
- will cause matches to be displayed one per line. The default
+ The number of screen columns used to display possible matches
+ when performing completion. The value is ignored if it is less
+ than 0 or greater than the terminal screen width. A value of 0
+ will cause matches to be displayed one per line. The default
value is -1.
c\bco\bom\bmp\bpl\ble\bet\bti\bio\bon\bn-\b-i\big\bgn\bno\bor\bre\be-\b-c\bca\bas\bse\be (\b(O\bOf\bff\bf)\b)
If set to O\bOn\bn, r\bre\bea\bad\bdl\bli\bin\bne\be performs filename matching and completion
in a case-insensitive fashion.
c\bco\bom\bmp\bpl\ble\bet\bti\bio\bon\bn-\b-m\bma\bap\bp-\b-c\bca\bas\bse\be (\b(O\bOf\bff\bf)\b)
- If set to O\bOn\bn, and c\bco\bom\bmp\bpl\ble\bet\bti\bio\bon\bn-\b-i\big\bgn\bno\bor\bre\be-\b-c\bca\bas\bse\be is enabled, r\bre\bea\bad\bdl\bli\bin\bne\be
- treats hyphens (_\b-) and underscores (_\b_) as equivalent when per-
+ If set to O\bOn\bn, and c\bco\bom\bmp\bpl\ble\bet\bti\bio\bon\bn-\b-i\big\bgn\bno\bor\bre\be-\b-c\bca\bas\bse\be is enabled, r\bre\bea\bad\bdl\bli\bin\bne\be
+ treats hyphens (_\b-) and underscores (_\b_) as equivalent when per-
forming case-insensitive filename matching and completion.
c\bco\bom\bmp\bpl\ble\bet\bti\bio\bon\bn-\b-p\bpr\bre\bef\bfi\bix\bx-\b-d\bdi\bis\bsp\bpl\bla\bay\by-\b-l\ble\ben\bng\bgt\bth\bh (\b(0\b0)\b)
- The maximum length in characters of the common prefix of a list
- of possible completions that is displayed without modification.
- When set to a value greater than zero, r\bre\bea\bad\bdl\bli\bin\bne\be replaces common
+ The maximum length in characters of the common prefix of a list
+ of possible completions that is displayed without modification.
+ When set to a value greater than zero, r\bre\bea\bad\bdl\bli\bin\bne\be replaces common
prefixes longer than this value with an ellipsis when displaying
possible completions.
c\bco\bom\bmp\bpl\ble\bet\bti\bio\bon\bn-\b-q\bqu\bue\ber\bry\by-\b-i\bit\bte\bem\bms\bs (\b(1\b10\b00\b0)\b)
- This determines when the user is queried about viewing the num-
- ber of possible completions generated by the p\bpo\bos\bss\bsi\bib\bbl\ble\be-\b-c\bco\bom\bmp\bpl\ble\be-\b-
- t\bti\bio\bon\bns\bs command. It may be set to any integer value greater than
- or equal to zero. If the number of possible completions is
- greater than or equal to the value of this variable, r\bre\bea\bad\bdl\bli\bin\bne\be
- will ask whether or not the user wishes to view them; otherwise
- r\bre\bea\bad\bdl\bli\bin\bne\be simply lists them on the terminal. A zero value means
+ This determines when the user is queried about viewing the num-
+ ber of possible completions generated by the p\bpo\bos\bss\bsi\bib\bbl\ble\be-\b-c\bco\bom\bmp\bpl\ble\be-\b-
+ t\bti\bio\bon\bns\bs command. It may be set to any integer value greater than
+ or equal to zero. If the number of possible completions is
+ greater than or equal to the value of this variable, r\bre\bea\bad\bdl\bli\bin\bne\be
+ will ask whether or not the user wishes to view them; otherwise
+ r\bre\bea\bad\bdl\bli\bin\bne\be simply lists them on the terminal. A zero value means
r\bre\bea\bad\bdl\bli\bin\bne\be should never ask; negative values are treated as zero.
c\bco\bon\bnv\bve\ber\brt\bt-\b-m\bme\bet\bta\ba (\b(O\bOn\bn)\b)
- If set to O\bOn\bn, r\bre\bea\bad\bdl\bli\bin\bne\be will convert characters it reads that
+ If set to O\bOn\bn, r\bre\bea\bad\bdl\bli\bin\bne\be will convert characters it reads that
have the eighth bit set to an ASCII key sequence by clearing the
eighth bit and prefixing it with an escape character (converting
- the character to have the meta prefix). The default is _\bO_\bn, but
- r\bre\bea\bad\bdl\bli\bin\bne\be will set it to _\bO_\bf_\bf if the locale contains characters
+ the character to have the meta prefix). The default is _\bO_\bn, but
+ r\bre\bea\bad\bdl\bli\bin\bne\be will set it to _\bO_\bf_\bf if the locale contains characters
whose encodings may include bytes with the eighth bit set. This
- variable is dependent on the L\bLC\bC_\b_C\bCT\bTY\bYP\bPE\bE locale category, and may
- change if the locale changes. This variable also affects key
+ variable is dependent on the L\bLC\bC_\b_C\bCT\bTY\bYP\bPE\bE locale category, and may
+ change if the locale changes. This variable also affects key
bindings; see the description of f\bfo\bor\brc\bce\be-\b-m\bme\bet\bta\ba-\b-p\bpr\bre\bef\bfi\bix\bx below.
d\bdi\bis\bsa\bab\bbl\ble\be-\b-c\bco\bom\bmp\bpl\ble\bet\bti\bio\bon\bn (\b(O\bOf\bff\bf)\b)
If set to O\bOn\bn, r\bre\bea\bad\bdl\bli\bin\bne\be will inhibit word completion. Completion
- characters will be inserted into the line as if they had been
+ characters will be inserted into the line as if they had been
mapped to s\bse\bel\blf\bf-\b-i\bin\bns\bse\ber\brt\bt.
e\bec\bch\bho\bo-\b-c\bco\bon\bnt\btr\bro\bol\bl-\b-c\bch\bha\bar\bra\bac\bct\bte\ber\brs\bs (\b(O\bOn\bn)\b)
- When set to O\bOn\bn, on operating systems that indicate they support
+ When set to O\bOn\bn, on operating systems that indicate they support
it, r\bre\bea\bad\bdl\bli\bin\bne\be echoes a character corresponding to a signal gener-
ated from the keyboard.
e\bed\bdi\bit\bti\bin\bng\bg-\b-m\bmo\bod\bde\be (\b(e\bem\bma\bac\bcs\bs)\b)
- Controls whether r\bre\bea\bad\bdl\bli\bin\bne\be uses a set of key bindings similar to
+ Controls whether r\bre\bea\bad\bdl\bli\bin\bne\be uses a set of key bindings similar to
_\bE_\bm_\ba_\bc_\bs or _\bv_\bi. e\bed\bdi\bit\bti\bin\bng\bg-\b-m\bmo\bod\bde\be can be set to either e\bem\bma\bac\bcs\bs or v\bvi\bi.
e\bem\bma\bac\bcs\bs-\b-m\bmo\bod\bde\be-\b-s\bst\btr\bri\bin\bng\bg (\b(@\b@)\b)
- If the _\bs_\bh_\bo_\bw_\b-_\bm_\bo_\bd_\be_\b-_\bi_\bn_\b-_\bp_\br_\bo_\bm_\bp_\bt variable is enabled, this string is
+ If the _\bs_\bh_\bo_\bw_\b-_\bm_\bo_\bd_\be_\b-_\bi_\bn_\b-_\bp_\br_\bo_\bm_\bp_\bt variable is enabled, this string is
displayed immediately before the last line of the primary prompt
when emacs editing mode is active. The value is expanded like a
- key binding, so the standard set of meta- and control- prefixes
- and backslash escape sequences is available. The \1 and \2 es-
- capes begin and end sequences of non-printing characters, which
- can be used to embed a terminal control sequence into the mode
+ key binding, so the standard set of meta- and control- prefixes
+ and backslash escape sequences is available. The \1 and \2 es-
+ capes begin and end sequences of non-printing characters, which
+ can be used to embed a terminal control sequence into the mode
string.
e\ben\bna\bab\bbl\ble\be-\b-a\bac\bct\bti\biv\bve\be-\b-r\bre\beg\bgi\bio\bon\bn (\b(O\bOn\bn)\b)
- When this variable is set to _\bO_\bn, r\bre\bea\bad\bdl\bli\bin\bne\be allows certain com-
+ When this variable is set to _\bO_\bn, r\bre\bea\bad\bdl\bli\bin\bne\be allows certain com-
mands to designate the region as _\ba_\bc_\bt_\bi_\bv_\be. When the region is ac-
tive, r\bre\bea\bad\bdl\bli\bin\bne\be highlights the text in the region using the value
- of the a\bac\bct\bti\biv\bve\be-\b-r\bre\beg\bgi\bio\bon\bn-\b-s\bst\bta\bar\brt\bt-\b-c\bco\bol\blo\bor\br, which defaults to the string
- that enables the terminal's standout mode. The active region
+ of the a\bac\bct\bti\biv\bve\be-\b-r\bre\beg\bgi\bio\bon\bn-\b-s\bst\bta\bar\brt\bt-\b-c\bco\bol\blo\bor\br, which defaults to the string
+ that enables the terminal's standout mode. The active region
shows the text inserted by bracketed-paste and any matching text
found by incremental and non-incremental history searches.
e\ben\bna\bab\bbl\ble\be-\b-b\bbr\bra\bac\bck\bke\bet\bte\bed\bd-\b-p\bpa\bas\bst\bte\be (\b(O\bOn\bn)\b)
- When set to O\bOn\bn, r\bre\bea\bad\bdl\bli\bin\bne\be configures the terminal to insert each
- paste into the editing buffer as a single string of characters,
- instead of treating each character as if it had been read from
- the keyboard. This is called _\bb_\br_\ba_\bc_\bk_\be_\bt_\be_\bd_\b-_\bp_\ba_\bs_\bt_\be _\bm_\bo_\bd_\be; it prevents
- r\bre\bea\bad\bdl\bli\bin\bne\be from executing any editing commands bound to key se-
+ When set to O\bOn\bn, r\bre\bea\bad\bdl\bli\bin\bne\be configures the terminal to insert each
+ paste into the editing buffer as a single string of characters,
+ instead of treating each character as if it had been read from
+ the keyboard. This is called _\bb_\br_\ba_\bc_\bk_\be_\bt_\be_\bd_\b-_\bp_\ba_\bs_\bt_\be _\bm_\bo_\bd_\be; it prevents
+ r\bre\bea\bad\bdl\bli\bin\bne\be from executing any editing commands bound to key se-
quences appearing in the pasted text.
e\ben\bna\bab\bbl\ble\be-\b-k\bke\bey\byp\bpa\bad\bd (\b(O\bOf\bff\bf)\b)
When set to O\bOn\bn, r\bre\bea\bad\bdl\bli\bin\bne\be will try to enable the application key-
pad when it is called. Some systems need this to enable the ar-
row keys.
e\ben\bna\bab\bbl\ble\be-\b-m\bme\bet\bta\ba-\b-k\bke\bey\by (\b(O\bOn\bn)\b)
- When set to O\bOn\bn, r\bre\bea\bad\bdl\bli\bin\bne\be will try to enable any meta modifier
+ When set to O\bOn\bn, r\bre\bea\bad\bdl\bli\bin\bne\be will try to enable any meta modifier
key the terminal claims to support. On many terminals, the Meta
- key is used to send eight-bit characters; this variable checks
- for the terminal capability that indicates the terminal can en-
- able and disable a mode that sets the eighth bit of a character
- (0200) if the Meta key is held down when the character is typed
+ key is used to send eight-bit characters; this variable checks
+ for the terminal capability that indicates the terminal can en-
+ able and disable a mode that sets the eighth bit of a character
+ (0200) if the Meta key is held down when the character is typed
(a meta character).
e\bex\bxp\bpa\ban\bnd\bd-\b-t\bti\bil\bld\bde\be (\b(O\bOf\bff\bf)\b)
If set to O\bOn\bn, r\bre\bea\bad\bdl\bli\bin\bne\be performs tilde expansion when it attempts
word completion.
f\bfo\bor\brc\bce\be-\b-m\bme\bet\bta\ba-\b-p\bpr\bre\bef\bfi\bix\bx (\b(O\bOf\bff\bf)\b)
- If set to O\bOn\bn, r\bre\bea\bad\bdl\bli\bin\bne\be modifies its behavior when binding key
- sequences containing \M- or Meta- (see K\bKe\bey\by B\bBi\bin\bnd\bdi\bin\bng\bgs\bs above) by
+ If set to O\bOn\bn, r\bre\bea\bad\bdl\bli\bin\bne\be modifies its behavior when binding key
+ sequences containing \M- or Meta- (see K\bKe\bey\by B\bBi\bin\bnd\bdi\bin\bng\bgs\bs above) by
converting a key sequence of the form \M-_\bC or Meta-_\bC to the two-
- character sequence E\bES\bSC\bC _\bC (adding the meta prefix). If
+ character sequence E\bES\bSC\bC _\bC (adding the meta prefix). If
f\bfo\bor\brc\bce\be-\b-m\bme\bet\bta\ba-\b-p\bpr\bre\bef\bfi\bix\bx is set to O\bOf\bff\bf (the default), r\bre\bea\bad\bdl\bli\bin\bne\be uses the
- value of the c\bco\bon\bnv\bve\ber\brt\bt-\b-m\bme\bet\bta\ba variable to determine whether to per-
- form this conversion: if c\bco\bon\bnv\bve\ber\brt\bt-\b-m\bme\bet\bta\ba is O\bOn\bn, r\bre\bea\bad\bdl\bli\bin\bne\be performs
- the conversion described above; if it is O\bOf\bff\bf, r\bre\bea\bad\bdl\bli\bin\bne\be converts
+ value of the c\bco\bon\bnv\bve\ber\brt\bt-\b-m\bme\bet\bta\ba variable to determine whether to per-
+ form this conversion: if c\bco\bon\bnv\bve\ber\brt\bt-\b-m\bme\bet\bta\ba is O\bOn\bn, r\bre\bea\bad\bdl\bli\bin\bne\be performs
+ the conversion described above; if it is O\bOf\bff\bf, r\bre\bea\bad\bdl\bli\bin\bne\be converts
_\bC to a meta character by setting the eighth bit (0200).
h\bhi\bis\bst\bto\bor\bry\by-\b-p\bpr\bre\bes\bse\ber\brv\bve\be-\b-p\bpo\boi\bin\bnt\bt (\b(O\bOf\bff\bf)\b)
- If set to O\bOn\bn, the history code attempts to place point at the
- same location on each history line retrieved with p\bpr\bre\bev\bvi\bio\bou\bus\bs-\b-h\bhi\bis\bs-\b-
+ If set to O\bOn\bn, the history code attempts to place point at the
+ same location on each history line retrieved with p\bpr\bre\bev\bvi\bio\bou\bus\bs-\b-h\bhi\bis\bs-\b-
t\bto\bor\bry\by or n\bne\bex\bxt\bt-\b-h\bhi\bis\bst\bto\bor\bry\by.
h\bhi\bis\bst\bto\bor\bry\by-\b-s\bsi\biz\bze\be (\b(u\bun\bns\bse\bet\bt)\b)
- Set the maximum number of history entries saved in the history
- list. If set to zero, any existing history entries are deleted
+ Set the maximum number of history entries saved in the history
+ list. If set to zero, any existing history entries are deleted
and no new entries are saved. If set to a value less than zero,
- the number of history entries is not limited. By default, b\bba\bas\bsh\bh
- sets the the maximum number of history entries to the value of
- the H\bHI\bIS\bST\bTS\bSI\bIZ\bZE\bE shell variable. Setting _\bh_\bi_\bs_\bt_\bo_\br_\by_\b-_\bs_\bi_\bz_\be to a non-nu-
- meric value will set the maximum number of history entries to
+ the number of history entries is not limited. By default, b\bba\bas\bsh\bh
+ sets the the maximum number of history entries to the value of
+ the H\bHI\bIS\bST\bTS\bSI\bIZ\bZE\bE shell variable. Setting _\bh_\bi_\bs_\bt_\bo_\br_\by_\b-_\bs_\bi_\bz_\be to a non-nu-
+ meric value will set the maximum number of history entries to
500.
h\bho\bor\bri\biz\bzo\bon\bnt\bta\bal\bl-\b-s\bsc\bcr\bro\bol\bll\bl-\b-m\bmo\bod\bde\be (\b(O\bOf\bff\bf)\b)
Setting this variable to O\bOn\bn makes r\bre\bea\bad\bdl\bli\bin\bne\be use a single line for
- display, scrolling the input horizontally on a single screen
- line when it becomes longer than the screen width rather than
- wrapping to a new line. This setting is automatically enabled
+ display, scrolling the input horizontally on a single screen
+ line when it becomes longer than the screen width rather than
+ wrapping to a new line. This setting is automatically enabled
for terminals of height 1.
i\bin\bnp\bpu\but\bt-\b-m\bme\bet\bta\ba (\b(O\bOf\bff\bf)\b)
- If set to O\bOn\bn, r\bre\bea\bad\bdl\bli\bin\bne\be will enable eight-bit input (that is, it
- will not clear the eighth bit in the characters it reads), re-
- gardless of what the terminal claims it can support. The de-
- fault is _\bO_\bf_\bf, but r\bre\bea\bad\bdl\bli\bin\bne\be will set it to _\bO_\bn if the locale con-
- tains characters whose encodings may include bytes with the
- eighth bit set. This variable is dependent on the L\bLC\bC_\b_C\bCT\bTY\bYP\bPE\bE lo-
- cale category, and its value may change if the locale changes.
+ If set to O\bOn\bn, r\bre\bea\bad\bdl\bli\bin\bne\be will enable eight-bit input (that is, it
+ will not clear the eighth bit in the characters it reads), re-
+ gardless of what the terminal claims it can support. The de-
+ fault is _\bO_\bf_\bf, but r\bre\bea\bad\bdl\bli\bin\bne\be will set it to _\bO_\bn if the locale con-
+ tains characters whose encodings may include bytes with the
+ eighth bit set. This variable is dependent on the L\bLC\bC_\b_C\bCT\bTY\bYP\bPE\bE lo-
+ cale category, and its value may change if the locale changes.
The name m\bme\bet\bta\ba-\b-f\bfl\bla\bag\bg is a synonym for i\bin\bnp\bpu\but\bt-\b-m\bme\bet\bta\ba.
i\bis\bse\bea\bar\brc\bch\bh-\b-t\bte\ber\brm\bmi\bin\bna\bat\bto\bor\brs\bs (\b("C\bC-\b-[\b[C\bC-\b-J\bJ")\b)
- The string of characters that should terminate an incremental
- search without subsequently executing the character as a com-
- mand. If this variable has not been given a value, the charac-
+ The string of characters that should terminate an incremental
+ search without subsequently executing the character as a com-
+ mand. If this variable has not been given a value, the charac-
ters _\bE_\bS_\bC and _\bC_\b-_\bJ will terminate an incremental search.
k\bke\bey\bym\bma\bap\bp (\b(e\bem\bma\bac\bcs\bs)\b)
- Set the current r\bre\bea\bad\bdl\bli\bin\bne\be keymap. The set of valid keymap names
- is _\be_\bm_\ba_\bc_\bs_\b, _\be_\bm_\ba_\bc_\bs_\b-_\bs_\bt_\ba_\bn_\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-_\bc_\bo_\bm_\b-
- _\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; _\be_\bm_\ba_\bc_\bs is
- equivalent to _\be_\bm_\ba_\bc_\bs_\b-_\bs_\bt_\ba_\bn_\bd_\ba_\br_\bd. The default value is _\be_\bm_\ba_\bc_\bs; the
+ Set the current r\bre\bea\bad\bdl\bli\bin\bne\be keymap. The set of valid keymap names
+ is _\be_\bm_\ba_\bc_\bs_\b, _\be_\bm_\ba_\bc_\bs_\b-_\bs_\bt_\ba_\bn_\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-_\bc_\bo_\bm_\b-
+ _\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; _\be_\bm_\ba_\bc_\bs is
+ equivalent to _\be_\bm_\ba_\bc_\bs_\b-_\bs_\bt_\ba_\bn_\bd_\ba_\br_\bd. The default value is _\be_\bm_\ba_\bc_\bs; the
value of e\bed\bdi\bit\bti\bin\bng\bg-\b-m\bmo\bod\bde\be also affects the default keymap.
k\bke\bey\bys\bse\beq\bq-\b-t\bti\bim\bme\beo\bou\but\bt (\b(5\b50\b00\b0)\b)
- Specifies the duration r\bre\bea\bad\bdl\bli\bin\bne\be will wait for a character when
- reading an ambiguous key sequence (one that can form a complete
+ Specifies the duration r\bre\bea\bad\bdl\bli\bin\bne\be will wait for a character when
+ reading an ambiguous key sequence (one that can form a complete
key sequence using the input read so far, or can take additional
- input to complete a longer key sequence). If r\bre\bea\bad\bdl\bli\bin\bne\be does not
- receive any input within the timeout, it will use the shorter
- but complete key sequence. The value is specified in millisec-
- onds, so a value of 1000 means that r\bre\bea\bad\bdl\bli\bin\bne\be will wait one sec-
- ond for additional input. If this variable is set to a value
- less than or equal to zero, or to a non-numeric value, r\bre\bea\bad\bdl\bli\bin\bne\be
- will wait until another key is pressed to decide which key se-
+ input to complete a longer key sequence). If r\bre\bea\bad\bdl\bli\bin\bne\be does not
+ receive any input within the timeout, it will use the shorter
+ but complete key sequence. The value is specified in millisec-
+ onds, so a value of 1000 means that r\bre\bea\bad\bdl\bli\bin\bne\be will wait one sec-
+ ond for additional input. If this variable is set to a value
+ less than or equal to zero, or to a non-numeric value, r\bre\bea\bad\bdl\bli\bin\bne\be
+ will wait until another key is pressed to decide which key se-
quence to complete.
m\bma\bar\brk\bk-\b-d\bdi\bir\bre\bec\bct\bto\bor\bri\bie\bes\bs (\b(O\bOn\bn)\b)
If set to O\bOn\bn, completed directory names have a slash appended.
m\bma\bar\brk\bk-\b-m\bmo\bod\bdi\bif\bfi\bie\bed\bd-\b-l\bli\bin\bne\bes\bs (\b(O\bOf\bff\bf)\b)
- If set to O\bOn\bn, r\bre\bea\bad\bdl\bli\bin\bne\be displays history lines that have been
+ If set to O\bOn\bn, r\bre\bea\bad\bdl\bli\bin\bne\be displays history lines that have been
modified with a preceding asterisk (*\b*).
m\bma\bar\brk\bk-\b-s\bsy\bym\bml\bli\bin\bnk\bke\bed\bd-\b-d\bdi\bir\bre\bec\bct\bto\bor\bri\bie\bes\bs (\b(O\bOf\bff\bf)\b)
If set to O\bOn\bn, completed names which are symbolic links to direc-
- tories have a slash appended, subject to the value of m\bma\bar\brk\bk-\b-d\bdi\bi-\b-
+ tories have a slash appended, subject to the value of m\bma\bar\brk\bk-\b-d\bdi\bi-\b-
r\bre\bec\bct\bto\bor\bri\bie\bes\bs.
m\bma\bat\btc\bch\bh-\b-h\bhi\bid\bdd\bde\ben\bn-\b-f\bfi\bil\ble\bes\bs (\b(O\bOn\bn)\b)
- This variable, when set to O\bOn\bn, forces r\bre\bea\bad\bdl\bli\bin\bne\be to match files
- whose names begin with a "." (hidden files) when performing
- filename completion. If set to O\bOf\bff\bf, the user must include the
+ This variable, when set to O\bOn\bn, forces r\bre\bea\bad\bdl\bli\bin\bne\be to match files
+ whose names begin with a "." (hidden files) when performing
+ filename completion. If set to O\bOf\bff\bf, the user must include the
leading "." in the filename to be completed.
m\bme\ben\bnu\bu-\b-c\bco\bom\bmp\bpl\ble\bet\bte\be-\b-d\bdi\bis\bsp\bpl\bla\bay\by-\b-p\bpr\bre\bef\bfi\bix\bx (\b(O\bOf\bff\bf)\b)
- If set to O\bOn\bn, menu completion displays the common prefix of the
+ If set to O\bOn\bn, menu completion displays the common prefix of the
list of possible completions (which may be empty) before cycling
through the list.
o\bou\but\btp\bpu\but\bt-\b-m\bme\bet\bta\ba (\b(O\bOf\bff\bf)\b)
- If set to O\bOn\bn, r\bre\bea\bad\bdl\bli\bin\bne\be will display characters with the eighth
+ If set to O\bOn\bn, r\bre\bea\bad\bdl\bli\bin\bne\be will display characters with the eighth
bit set directly rather than as a meta-prefixed escape sequence.
The default is _\bO_\bf_\bf, but r\bre\bea\bad\bdl\bli\bin\bne\be will set it to _\bO_\bn if the locale
- contains characters whose encodings may include bytes with the
- eighth bit set. This variable is dependent on the L\bLC\bC_\b_C\bCT\bTY\bYP\bPE\bE lo-
+ contains characters whose encodings may include bytes with the
+ eighth bit set. This variable is dependent on the L\bLC\bC_\b_C\bCT\bTY\bYP\bPE\bE lo-
cale category, and its value may change if the locale changes.
p\bpa\bag\bge\be-\b-c\bco\bom\bmp\bpl\ble\bet\bti\bio\bon\bns\bs (\b(O\bOn\bn)\b)
- If set to O\bOn\bn, r\bre\bea\bad\bdl\bli\bin\bne\be uses an internal _\bm_\bo_\br_\be-like pager to dis-
+ If set to O\bOn\bn, r\bre\bea\bad\bdl\bli\bin\bne\be uses an internal _\bm_\bo_\br_\be-like pager to dis-
play a screenful of possible completions at a time.
p\bpr\bre\bef\bfe\ber\br-\b-v\bvi\bis\bsi\bib\bbl\ble\be-\b-b\bbe\bel\bll\bl
See b\bbe\bel\bll\bl-\b-s\bst\bty\byl\ble\be.
p\bpr\bri\bin\bnt\bt-\b-c\bco\bom\bmp\bpl\ble\bet\bti\bio\bon\bns\bs-\b-h\bho\bor\bri\biz\bzo\bon\bnt\bta\bal\bll\bly\by (\b(O\bOf\bff\bf)\b)
- If set to O\bOn\bn, r\bre\bea\bad\bdl\bli\bin\bne\be will display completions with matches
- sorted horizontally in alphabetical order, rather than down the
+ If set to O\bOn\bn, r\bre\bea\bad\bdl\bli\bin\bne\be will display completions with matches
+ sorted horizontally in alphabetical order, rather than down the
screen.
r\bre\bev\bve\ber\brt\bt-\b-a\bal\bll\bl-\b-a\bat\bt-\b-n\bne\bew\bwl\bli\bin\bne\be (\b(O\bOf\bff\bf)\b)
- If set to O\bOn\bn, r\bre\bea\bad\bdl\bli\bin\bne\be will undo all changes to history lines
- before returning when executing a\bac\bcc\bce\bep\bpt\bt-\b-l\bli\bin\bne\be. By default, his-
- tory lines may be modified and retain individual undo lists
+ If set to O\bOn\bn, r\bre\bea\bad\bdl\bli\bin\bne\be will undo all changes to history lines
+ before returning when executing a\bac\bcc\bce\bep\bpt\bt-\b-l\bli\bin\bne\be. By default, his-
+ tory lines may be modified and retain individual undo lists
across calls to r\bre\bea\bad\bdl\bli\bin\bne\be.
s\bse\bea\bar\brc\bch\bh-\b-i\big\bgn\bno\bor\bre\be-\b-c\bca\bas\bse\be (\b(O\bOf\bff\bf)\b)
- If set to O\bOn\bn, r\bre\bea\bad\bdl\bli\bin\bne\be performs incremental and non-incremental
+ If set to O\bOn\bn, r\bre\bea\bad\bdl\bli\bin\bne\be performs incremental and non-incremental
history list searches in a case-insensitive fashion.
s\bsh\bho\bow\bw-\b-a\bal\bll\bl-\b-i\bif\bf-\b-a\bam\bmb\bbi\big\bgu\buo\bou\bus\bs (\b(O\bOf\bff\bf)\b)
- This alters the default behavior of the completion functions.
+ This alters the default behavior of the completion functions.
If set to O\bOn\bn, words which have more than one possible completion
- cause the matches to be listed immediately instead of ringing
+ cause the matches to be listed immediately instead of ringing
the bell.
s\bsh\bho\bow\bw-\b-a\bal\bll\bl-\b-i\bif\bf-\b-u\bun\bnm\bmo\bod\bdi\bif\bfi\bie\bed\bd (\b(O\bOf\bff\bf)\b)
- This alters the default behavior of the completion functions in
+ This alters the default behavior of the completion functions in
a fashion similar to s\bsh\bho\bow\bw-\b-a\bal\bll\bl-\b-i\bif\bf-\b-a\bam\bmb\bbi\big\bgu\buo\bou\bus\bs. If set to O\bOn\bn, words
- which have more than one possible completion without any possi-
- ble partial completion (the possible completions don't share a
- common prefix) cause the matches to be listed immediately in-
+ which have more than one possible completion without any possi-
+ ble partial completion (the possible completions don't share a
+ common prefix) cause the matches to be listed immediately in-
stead of ringing the bell.
s\bsh\bho\bow\bw-\b-m\bmo\bod\bde\be-\b-i\bin\bn-\b-p\bpr\bro\bom\bmp\bpt\bt (\b(O\bOf\bff\bf)\b)
- If set to O\bOn\bn, add a string to the beginning of the prompt indi-
- cating the editing mode: emacs, vi command, or vi insertion.
+ If set to O\bOn\bn, add a string to the beginning of the prompt indi-
+ cating the editing mode: emacs, vi command, or vi insertion.
The mode strings are user-settable (e.g., _\be_\bm_\ba_\bc_\bs_\b-_\bm_\bo_\bd_\be_\b-_\bs_\bt_\br_\bi_\bn_\bg).
s\bsk\bki\bip\bp-\b-c\bco\bom\bmp\bpl\ble\bet\bte\bed\bd-\b-t\bte\bex\bxt\bt (\b(O\bOf\bff\bf)\b)
- If set to O\bOn\bn, this alters the default completion behavior when
- inserting a single match into the line. It's only active when
- performing completion in the middle of a word. If enabled,
- r\bre\bea\bad\bdl\bli\bin\bne\be does not insert characters from the completion that
- match characters after point in the word being completed, so
+ If set to O\bOn\bn, this alters the default completion behavior when
+ inserting a single match into the line. It's only active when
+ performing completion in the middle of a word. If enabled,
+ r\bre\bea\bad\bdl\bli\bin\bne\be does not insert characters from the completion that
+ match characters after point in the word being completed, so
portions of the word following the cursor are not duplicated.
v\bvi\bi-\b-c\bcm\bmd\bd-\b-m\bmo\bod\bde\be-\b-s\bst\btr\bri\bin\bng\bg (\b((\b(c\bcm\bmd\bd)\b))\b)
- If the _\bs_\bh_\bo_\bw_\b-_\bm_\bo_\bd_\be_\b-_\bi_\bn_\b-_\bp_\br_\bo_\bm_\bp_\bt variable is enabled, this string is
+ If the _\bs_\bh_\bo_\bw_\b-_\bm_\bo_\bd_\be_\b-_\bi_\bn_\b-_\bp_\br_\bo_\bm_\bp_\bt variable is enabled, this string is
displayed immediately before the last line of the primary prompt
- when vi editing mode is active and in command mode. The value
+ when vi editing mode is active and in command mode. The value
is expanded like a key binding, so the standard set of meta- and
- control- prefixes and backslash escape sequences is available.
- The \1 and \2 escapes begin and end sequences of non-printing
- characters, which can be used to embed a terminal control se-
+ control- prefixes and backslash escape sequences is available.
+ The \1 and \2 escapes begin and end sequences of non-printing
+ characters, which can be used to embed a terminal control se-
quence into the mode string.
v\bvi\bi-\b-i\bin\bns\bs-\b-m\bmo\bod\bde\be-\b-s\bst\btr\bri\bin\bng\bg (\b((\b(i\bin\bns\bs)\b))\b)
- If the _\bs_\bh_\bo_\bw_\b-_\bm_\bo_\bd_\be_\b-_\bi_\bn_\b-_\bp_\br_\bo_\bm_\bp_\bt variable is enabled, this string is
+ If the _\bs_\bh_\bo_\bw_\b-_\bm_\bo_\bd_\be_\b-_\bi_\bn_\b-_\bp_\br_\bo_\bm_\bp_\bt variable is enabled, this string is
displayed immediately before the last line of the primary prompt
when vi editing mode is active and in insertion mode. The value
is expanded like a key binding, so the standard set of meta- and
- control- prefixes and backslash escape sequences is available.
- The \1 and \2 escapes begin and end sequences of non-printing
- characters, which can be used to embed a terminal control se-
+ control- prefixes and backslash escape sequences is available.
+ The \1 and \2 escapes begin and end sequences of non-printing
+ characters, which can be used to embed a terminal control se-
quence into the mode string.
v\bvi\bis\bsi\bib\bbl\ble\be-\b-s\bst\bta\bat\bts\bs (\b(O\bOf\bff\bf)\b)
- If set to O\bOn\bn, a character denoting a file's type as reported by
- _\bs_\bt_\ba_\bt(2) is appended to the filename when listing possible com-
+ If set to O\bOn\bn, a character denoting a file's type as reported by
+ _\bs_\bt_\ba_\bt(2) is appended to the filename when listing possible com-
pletions.
R\bRe\bea\bad\bdl\bli\bin\bne\be C\bCo\bon\bnd\bdi\bit\bti\bio\bon\bna\bal\bl C\bCo\bon\bns\bst\btr\bru\buc\bct\bts\bs
- R\bRe\bea\bad\bdl\bli\bin\bne\be implements a facility similar in spirit to the conditional
- compilation features of the C preprocessor which allows key bindings
- and variable settings to be performed as the result of tests. There
+ R\bRe\bea\bad\bdl\bli\bin\bne\be implements a facility similar in spirit to the conditional
+ compilation features of the C preprocessor which allows key bindings
+ and variable settings to be performed as the result of tests. There
are four parser directives available.
- $\b$i\bif\bf The $\b$i\bif\bf construct allows bindings to be made based on the edit-
- ing mode, the terminal being used, or the application using
- r\bre\bea\bad\bdl\bli\bin\bne\be. The text of the test, after any comparison operator,
+ $\b$i\bif\bf The $\b$i\bif\bf construct allows bindings to be made based on the edit-
+ ing mode, the terminal being used, or the application using
+ r\bre\bea\bad\bdl\bli\bin\bne\be. The text of the test, after any comparison operator,
extends to the end of the line; unless otherwise noted, no char-
acters are required to isolate it.
- m\bmo\bod\bde\be The m\bmo\bod\bde\be=\b= form of the $\b$i\bif\bf directive is used to test
- whether r\bre\bea\bad\bdl\bli\bin\bne\be is in emacs or vi mode. This may be
- used in conjunction with the s\bse\bet\bt k\bke\bey\bym\bma\bap\bp command, for in-
- stance, to set bindings in the _\be_\bm_\ba_\bc_\bs_\b-_\bs_\bt_\ba_\bn_\bd_\ba_\br_\bd and
- _\be_\bm_\ba_\bc_\bs_\b-_\bc_\bt_\bl_\bx keymaps only if r\bre\bea\bad\bdl\bli\bin\bne\be is starting out in
+ m\bmo\bod\bde\be The m\bmo\bod\bde\be=\b= form of the $\b$i\bif\bf directive is used to test
+ whether r\bre\bea\bad\bdl\bli\bin\bne\be is in emacs or vi mode. This may be
+ used in conjunction with the s\bse\bet\bt k\bke\bey\bym\bma\bap\bp command, for in-
+ stance, to set bindings in the _\be_\bm_\ba_\bc_\bs_\b-_\bs_\bt_\ba_\bn_\bd_\ba_\br_\bd and
+ _\be_\bm_\ba_\bc_\bs_\b-_\bc_\bt_\bl_\bx keymaps only if r\bre\bea\bad\bdl\bli\bin\bne\be is starting out in
emacs mode.
- t\bte\ber\brm\bm The t\bte\ber\brm\bm=\b= form may be used to include terminal-specific
+ t\bte\ber\brm\bm The t\bte\ber\brm\bm=\b= form may be used to include terminal-specific
key bindings, perhaps to bind the key sequences output by
the terminal's function keys. The word on the right side
of the =\b= is tested against both the full name of the ter-
- minal and the portion of the terminal name before the
- first -\b-. This allows _\bx_\bt_\be_\br_\bm to match both _\bx_\bt_\be_\br_\bm and
+ minal and the portion of the terminal name before the
+ first -\b-. This allows _\bx_\bt_\be_\br_\bm to match both _\bx_\bt_\be_\br_\bm and
_\bx_\bt_\be_\br_\bm_\b-_\b2_\b5_\b6_\bc_\bo_\bl_\bo_\br, for instance.
v\bve\ber\brs\bsi\bio\bon\bn
- The v\bve\ber\brs\bsi\bio\bon\bn test may be used to perform comparisons
- against specific r\bre\bea\bad\bdl\bli\bin\bne\be versions. The v\bve\ber\brs\bsi\bio\bon\bn expands
- to the current r\bre\bea\bad\bdl\bli\bin\bne\be version. The set of comparison
- operators includes =\b=, (and =\b==\b=), !\b!=\b=, <\b<=\b=, >\b>=\b=, <\b<, and >\b>.
- The version number supplied on the right side of the op-
- erator consists of a major version number, an optional
+ The v\bve\ber\brs\bsi\bio\bon\bn test may be used to perform comparisons
+ against specific r\bre\bea\bad\bdl\bli\bin\bne\be versions. The v\bve\ber\brs\bsi\bio\bon\bn expands
+ to the current r\bre\bea\bad\bdl\bli\bin\bne\be version. The set of comparison
+ operators includes =\b=, (and =\b==\b=), !\b!=\b=, <\b<=\b=, >\b>=\b=, <\b<, and >\b>.
+ The version number supplied on the right side of the op-
+ erator consists of a major version number, an optional
decimal point, and an optional minor version (e.g., 7\b7.\b.1\b1).
- If the minor version is omitted, it defaults to 0\b0. The
- operator may be separated from the string v\bve\ber\brs\bsi\bio\bon\bn and
+ If the minor version is omitted, it defaults to 0\b0. The
+ operator may be separated from the string v\bve\ber\brs\bsi\bio\bon\bn and
from the version number argument by whitespace.
_\ba_\bp_\bp_\bl_\bi_\bc_\ba_\bt_\bi_\bo_\bn
The _\ba_\bp_\bp_\bl_\bi_\bc_\ba_\bt_\bi_\bo_\bn construct is used to include application-
- specific settings. Each program using the r\bre\bea\bad\bdl\bli\bin\bne\be li-
- brary sets the _\ba_\bp_\bp_\bl_\bi_\bc_\ba_\bt_\bi_\bo_\bn _\bn_\ba_\bm_\be, and an initialization
+ specific settings. Each program using the r\bre\bea\bad\bdl\bli\bin\bne\be li-
+ brary sets the _\ba_\bp_\bp_\bl_\bi_\bc_\ba_\bt_\bi_\bo_\bn _\bn_\ba_\bm_\be, and an initialization
file can test for a particular value. This could be used
- to bind key sequences to functions useful for a specific
- program. For instance, the following command adds a key
- sequence that quotes the current or previous word in
+ to bind key sequences to functions useful for a specific
+ program. For instance, the following command adds a key
+ sequence that quotes the current or previous word in
b\bba\bas\bsh\bh:
$\b$i\bif\bf Bash
_\bv_\ba_\br_\bi_\ba_\bb_\bl_\be
The _\bv_\ba_\br_\bi_\ba_\bb_\bl_\be construct provides simple equality tests for
- r\bre\bea\bad\bdl\bli\bin\bne\be variables and values. The permitted comparison
- operators are _\b=, _\b=_\b=, and _\b!_\b=. The variable name must be
+ r\bre\bea\bad\bdl\bli\bin\bne\be variables and values. The permitted comparison
+ operators are _\b=, _\b=_\b=, and _\b!_\b=. The variable name must be
separated from the comparison operator by whitespace; the
- operator may be separated from the value on the right
- hand side by whitespace. String and boolean variables
- may be tested. Boolean variables must be tested against
+ operator may be separated from the value on the right
+ hand side by whitespace. String and boolean variables
+ may be tested. Boolean variables must be tested against
the values _\bo_\bn and _\bo_\bf_\bf.
$\b$e\bel\bls\bse\be Commands in this branch of the $\b$i\bif\bf directive are executed if the
command.
$\b$i\bin\bnc\bcl\blu\bud\bde\be
- This directive takes a single filename as an argument and reads
+ This directive takes a single filename as an argument and reads
commands and key bindings from that file. For example, the fol-
lowing directive would read _\b/_\be_\bt_\bc_\b/_\bi_\bn_\bp_\bu_\bt_\br_\bc:
$\b$i\bin\bnc\bcl\blu\bud\bde\be _\b/_\be_\bt_\bc_\b/_\bi_\bn_\bp_\bu_\bt_\br_\bc
S\bSe\bea\bar\brc\bch\bhi\bin\bng\bg
- R\bRe\bea\bad\bdl\bli\bin\bne\be provides commands for searching through the command history
+ R\bRe\bea\bad\bdl\bli\bin\bne\be provides commands for searching through the command history
(see H\bHI\bIS\bST\bTO\bOR\bRY\bY below) for lines containing a specified string. There are
two search modes: _\bi_\bn_\bc_\br_\be_\bm_\be_\bn_\bt_\ba_\bl and _\bn_\bo_\bn_\b-_\bi_\bn_\bc_\br_\be_\bm_\be_\bn_\bt_\ba_\bl.
- Incremental searches begin before the user has finished typing the
- search string. As each character of the search string is typed, r\bre\bea\bad\bd-\b-
+ Incremental searches begin before the user has finished typing the
+ search string. As each character of the search string is typed, r\bre\bea\bad\bd-\b-
l\bli\bin\bne\be displays the next entry from the history matching the string typed
- so far. An incremental search requires only as many characters as
- needed to find the desired history entry. When using emacs editing
- mode, type C\bC-\b-r\br to search backward in the history for a particular
- string. Typing C\bC-\b-s\bs searches forward through the history. The charac-
- ters present in the value of the i\bis\bse\bea\bar\brc\bch\bh-\b-t\bte\ber\brm\bmi\bin\bna\bat\bto\bor\brs\bs variable are used
- to terminate an incremental search. If that variable has not been as-
- signed a value, _\bE_\bS_\bC and _\bC_\b-_\bJ will terminate an incremental search. _\bC_\b-_\bg
- will abort an incremental search and restore the original line. When
- the search is terminated, the history entry containing the search
+ so far. An incremental search requires only as many characters as
+ needed to find the desired history entry. When using emacs editing
+ mode, type C\bC-\b-r\br to search backward in the history for a particular
+ string. Typing C\bC-\b-s\bs searches forward through the history. The charac-
+ ters present in the value of the i\bis\bse\bea\bar\brc\bch\bh-\b-t\bte\ber\brm\bmi\bin\bna\bat\bto\bor\brs\bs variable are used
+ to terminate an incremental search. If that variable has not been as-
+ signed a value, _\bE_\bS_\bC and _\bC_\b-_\bJ will terminate an incremental search. _\bC_\b-_\bg
+ will abort an incremental search and restore the original line. When
+ the search is terminated, the history entry containing the search
string becomes the current line.
- To find other matching entries in the history list, type C\bC-\b-r\br or C\bC-\b-s\bs as
- appropriate. This will search backward or forward in the history for
- the next entry matching the search string typed so far. Any other key
+ To find other matching entries in the history list, type C\bC-\b-r\br or C\bC-\b-s\bs as
+ appropriate. This will search backward or forward in the history for
+ the next entry matching the search string typed so far. Any other key
sequence bound to a r\bre\bea\bad\bdl\bli\bin\bne\be command will terminate the search and exe-
- cute that command. For instance, a newline will terminate the search
- and accept the line, thereby executing the command from the history
+ cute that command. For instance, a newline will terminate the search
+ and accept the line, thereby executing the command from the history
list. A movement command will terminate the search, make the last line
found the current line, and begin editing.
R\bRe\bea\bad\bdl\bli\bin\bne\be remembers the last incremental search string. If two C\bC-\b-r\brs are
- typed without any intervening characters defining a new search string,
+ typed without any intervening characters defining a new search string,
r\bre\bea\bad\bdl\bli\bin\bne\be uses any remembered search string.
- Non-incremental searches read the entire search string before starting
+ Non-incremental searches read the entire search string before starting
to search for matching history entries. The search string may be typed
by the user or be part of the contents of the current line.
R\bRe\bea\bad\bdl\bli\bin\bne\be C\bCo\bom\bmm\bma\ban\bnd\bd N\bNa\bam\bme\bes\bs
- The following is a list of the names of the commands and the default
+ The following is a list of the names of the commands and the default
key sequences to which they are bound. Command names without an accom-
panying key sequence are unbound by default.
In the following descriptions, _\bp_\bo_\bi_\bn_\bt refers to the current cursor posi-
- tion, and _\bm_\ba_\br_\bk refers to a cursor position saved by the s\bse\bet\bt-\b-m\bma\bar\brk\bk com-
- mand. The text between the point and mark is referred to as the _\br_\be_\b-
+ tion, and _\bm_\ba_\br_\bk refers to a cursor position saved by the s\bse\bet\bt-\b-m\bma\bar\brk\bk com-
+ mand. The text between the point and mark is referred to as the _\br_\be_\b-
_\bg_\bi_\bo_\bn. R\bRe\bea\bad\bdl\bli\bin\bne\be has the concept of an _\ba_\bc_\bt_\bi_\bv_\be _\br_\be_\bg_\bi_\bo_\bn: when the region is
- active, r\bre\bea\bad\bdl\bli\bin\bne\be redisplay uses the value of the a\bac\bct\bti\biv\bve\be-\b-r\bre\be-\b-
- g\bgi\bio\bon\bn-\b-s\bst\bta\bar\brt\bt-\b-c\bco\bol\blo\bor\br v\bva\bar\bri\bia\bab\bbl\ble\be t\bto\bo d\bde\ben\bno\bot\bte\be t\bth\bhe\be r\bre\beg\bgi\bio\bon\bn.\b. S\bSe\bev\bve\ber\bra\bal\bl c\bco\bom\bmm\bma\ban\bnd\bds\bs s\bse\bet\bt
+ active, r\bre\bea\bad\bdl\bli\bin\bne\be redisplay uses the value of the a\bac\bct\bti\biv\bve\be-\b-r\bre\be-\b-
+ g\bgi\bio\bon\bn-\b-s\bst\bta\bar\brt\bt-\b-c\bco\bol\blo\bor\br v\bva\bar\bri\bia\bab\bbl\ble\be t\bto\bo d\bde\ben\bno\bot\bte\be t\bth\bhe\be r\bre\beg\bgi\bio\bon\bn.\b. S\bSe\bev\bve\ber\bra\bal\bl c\bco\bom\bmm\bma\ban\bnd\bds\bs s\bse\bet\bt
t\bth\bhe\be r\bre\beg\bgi\bio\bon\bn t\bto\bo a\bac\bct\bti\biv\bve\be;\b; t\bth\bho\bos\bse\be a\bar\bre\be n\bno\bot\bte\bed\bd b\bbe\bel\blo\bow\bw.\b.
C\bCo\bom\bmm\bma\ban\bnd\bds\bs f\bfo\bor\br M\bMo\bov\bvi\bin\bng\bg
b\bbe\beg\bgi\bin\bnn\bni\bin\bng\bg-\b-o\bof\bf-\b-l\bli\bin\bne\be (\b(C\bC-\b-a\ba)\b)
- Move to the start of the current line. This may also be bound
+ Move to the start of the current line. This may also be bound
to the Home key on some keyboards.
e\ben\bnd\bd-\b-o\bof\bf-\b-l\bli\bin\bne\be (\b(C\bC-\b-e\be)\b)
- Move to the end of the line. This may also be bound to the End
+ Move to the end of the line. This may also be bound to the End
key on some keyboards.
f\bfo\bor\brw\bwa\bar\brd\bd-\b-c\bch\bha\bar\br (\b(C\bC-\b-f\bf)\b)
Move forward a character.
Move forward to the end of the next word. Words are composed of
alphanumeric characters (letters and digits).
b\bba\bac\bck\bkw\bwa\bar\brd\bd-\b-w\bwo\bor\brd\bd (\b(M\bM-\b-b\bb)\b)
- Move back to the start of the current or previous word. Words
+ Move back to the start of the current or previous word. Words
are composed of alphanumeric characters (letters and digits).
s\bsh\bhe\bel\bll\bl-\b-f\bfo\bor\brw\bwa\bar\brd\bd-\b-w\bwo\bor\brd\bd
- Move forward to the end of the next word. Words are delimited
+ Move forward to the end of the next word. Words are delimited
by non-quoted shell metacharacters.
s\bsh\bhe\bel\bll\bl-\b-b\bba\bac\bck\bkw\bwa\bar\brd\bd-\b-w\bwo\bor\brd\bd
- Move back to the start of the current or previous word. Words
+ Move back to the start of the current or previous word. Words
are delimited by non-quoted shell metacharacters.
p\bpr\bre\bev\bvi\bio\bou\bus\bs-\b-s\bsc\bcr\bre\bee\ben\bn-\b-l\bli\bin\bne\be
- Attempt to move point to the same physical screen column on the
- previous physical screen line. This will not have the desired
- effect if the current r\bre\bea\bad\bdl\bli\bin\bne\be line does not take up more than
- one physical line or if point is not greater than the length of
+ Attempt to move point to the same physical screen column on the
+ previous physical screen line. This will not have the desired
+ effect if the current r\bre\bea\bad\bdl\bli\bin\bne\be line does not take up more than
+ one physical line or if point is not greater than the length of
the prompt plus the screen width.
n\bne\bex\bxt\bt-\b-s\bsc\bcr\bre\bee\ben\bn-\b-l\bli\bin\bne\be
- Attempt to move point to the same physical screen column on the
- next physical screen line. This will not have the desired ef-
+ Attempt to move point to the same physical screen column on the
+ next physical screen line. This will not have the desired ef-
fect if the current r\bre\bea\bad\bdl\bli\bin\bne\be line does not take up more than one
- physical line or if the length of the current r\bre\bea\bad\bdl\bli\bin\bne\be line is
+ physical line or if the length of the current r\bre\bea\bad\bdl\bli\bin\bne\be line is
not greater than the length of the prompt plus the screen width.
c\bcl\ble\bea\bar\br-\b-d\bdi\bis\bsp\bpl\bla\bay\by (\b(M\bM-\b-C\bC-\b-l\bl)\b)
- Clear the screen and, if possible, the terminal's scrollback
- buffer, then redraw the current line, leaving the current line
+ Clear the screen and, if possible, the terminal's scrollback
+ buffer, then redraw the current line, leaving the current line
at the top of the screen.
c\bcl\ble\bea\bar\br-\b-s\bsc\bcr\bre\bee\ben\bn (\b(C\bC-\b-l\bl)\b)
Clear the screen, then redraw the current line, leaving the cur-
- rent line at the top of the screen. With an argument, refresh
+ rent line at the top of the screen. With an argument, refresh
the current line without clearing the screen.
r\bre\bed\bdr\bra\baw\bw-\b-c\bcu\bur\brr\bre\ben\bnt\bt-\b-l\bli\bin\bne\be
Refresh the current line.
C\bCo\bom\bmm\bma\ban\bnd\bds\bs f\bfo\bor\br M\bMa\ban\bni\bip\bpu\bul\bla\bat\bti\bin\bng\bg t\bth\bhe\be H\bHi\bis\bst\bto\bor\bry\by
a\bac\bcc\bce\bep\bpt\bt-\b-l\bli\bin\bne\be (\b(N\bNe\bew\bwl\bli\bin\bne\be,\b, R\bRe\bet\btu\bur\brn\bn)\b)
Accept the line regardless of where the cursor is. If this line
- is non-empty, add it to the history list according to the state
- of the H\bHI\bIS\bST\bTC\bCO\bON\bNT\bTR\bRO\bOL\bL and H\bHI\bIS\bST\bTI\bIG\bGN\bNO\bOR\bRE\bE variables. If the line is a
- modified history line, restore the history line to its original
+ is non-empty, add it to the history list according to the state
+ of the H\bHI\bIS\bST\bTC\bCO\bON\bNT\bTR\bRO\bOL\bL and H\bHI\bIS\bST\bTI\bIG\bGN\bNO\bOR\bRE\bE variables. If the line is a
+ modified history line, restore the history line to its original
state.
p\bpr\bre\bev\bvi\bio\bou\bus\bs-\b-h\bhi\bis\bst\bto\bor\bry\by (\b(C\bC-\b-p\bp)\b)
Fetch the previous command from the history list, moving back in
the list.
n\bne\bex\bxt\bt-\b-h\bhi\bis\bst\bto\bor\bry\by (\b(C\bC-\b-n\bn)\b)
- Fetch the next command from the history list, moving forward in
+ Fetch the next command from the history list, moving forward in
the list.
b\bbe\beg\bgi\bin\bnn\bni\bin\bng\bg-\b-o\bof\bf-\b-h\bhi\bis\bst\bto\bor\bry\by (\b(M\bM-\b-<\b<)\b)
Move to the first line in the history.
e\ben\bnd\bd-\b-o\bof\bf-\b-h\bhi\bis\bst\bto\bor\bry\by (\b(M\bM-\b->\b>)\b)
- Move to the end of the input history, i.e., the line currently
+ Move to the end of the input history, i.e., the line currently
being entered.
o\bop\bpe\ber\bra\bat\bte\be-\b-a\ban\bnd\bd-\b-g\bge\bet\bt-\b-n\bne\bex\bxt\bt (\b(C\bC-\b-o\bo)\b)
- Accept the current line for execution as if a newline had been
- entered, and fetch the next line relative to the current line
- from the history for editing. A numeric argument, if supplied,
+ Accept the current line for execution as if a newline had been
+ entered, and fetch the next line relative to the current line
+ from the history for editing. A numeric argument, if supplied,
specifies the history entry to use instead of the current line.
f\bfe\bet\btc\bch\bh-\b-h\bhi\bis\bst\bto\bor\bry\by
- With a numeric argument, fetch that entry from the history list
+ With a numeric argument, fetch that entry from the history list
and make it the current line. Without an argument, move back to
the first entry in the history list.
r\bre\bev\bve\ber\brs\bse\be-\b-s\bse\bea\bar\brc\bch\bh-\b-h\bhi\bis\bst\bto\bor\bry\by (\b(C\bC-\b-r\br)\b)
- Search backward starting at the current line and moving "up"
- through the history as necessary. This is an incremental
- search. This command sets the region to the matched text and
- activates the region.
- f\bfo\bor\brw\bwa\bar\brd\bd-\b-s\bse\bea\bar\brc\bch\bh-\b-h\bhi\bis\bst\bto\bor\bry\by (\b(C\bC-\b-s\bs)\b)
- Search forward starting at the current line and moving "down"
+ Search backward starting at the current line and moving "up"
through the history as necessary. This is an incremental
search. This command sets the region to the matched text and
activates the region.
+ f\bfo\bor\brw\bwa\bar\brd\bd-\b-s\bse\bea\bar\brc\bch\bh-\b-h\bhi\bis\bst\bto\bor\bry\by (\b(C\bC-\b-s\bs)\b)
+ Search forward starting at the current line and moving "down"
+ through the history as necessary. This is an incremental
+ search. This command sets the region to the matched text and
+ activates the region.
n\bno\bon\bn-\b-i\bin\bnc\bcr\bre\bem\bme\ben\bnt\bta\bal\bl-\b-r\bre\bev\bve\ber\brs\bse\be-\b-s\bse\bea\bar\brc\bch\bh-\b-h\bhi\bis\bst\bto\bor\bry\by (\b(M\bM-\b-p\bp)\b)
Search backward through the history starting at the current line
- using a non-incremental search for a string supplied by the
+ using a non-incremental search for a string supplied by the
user. The search string may match anywhere in a history line.
n\bno\bon\bn-\b-i\bin\bnc\bcr\bre\bem\bme\ben\bnt\bta\bal\bl-\b-f\bfo\bor\brw\bwa\bar\brd\bd-\b-s\bse\bea\bar\brc\bch\bh-\b-h\bhi\bis\bst\bto\bor\bry\by (\b(M\bM-\b-n\bn)\b)
- Search forward through the history using a non-incremental
+ Search forward through the history using a non-incremental
search for a string supplied by the user. The search string may
match anywhere in a history line.
h\bhi\bis\bst\bto\bor\bry\by-\b-s\bse\bea\bar\brc\bch\bh-\b-b\bba\bac\bck\bkw\bwa\bar\brd\bd
non-incremental search. This may be bound to the Page Up key on
some keyboards.
h\bhi\bis\bst\bto\bor\bry\by-\b-s\bse\bea\bar\brc\bch\bh-\b-f\bfo\bor\brw\bwa\bar\brd\bd
- Search forward through the history for the string of characters
+ Search forward through the history for the string of characters
between the start of the current line and the point. The search
string must match at the beginning of a history line. This is a
- non-incremental search. This may be bound to the Page Down key
+ non-incremental search. This may be bound to the Page Down key
on some keyboards.
h\bhi\bis\bst\bto\bor\bry\by-\b-s\bsu\bub\bbs\bst\btr\bri\bin\bng\bg-\b-s\bse\bea\bar\brc\bch\bh-\b-b\bba\bac\bck\bkw\bwa\bar\brd\bd
Search backward through the history for the string of characters
between the start of the current line and the point. The search
- string may match anywhere in a history line. This is a non-in-
+ string may match anywhere in a history line. This is a non-in-
cremental search.
h\bhi\bis\bst\bto\bor\bry\by-\b-s\bsu\bub\bbs\bst\btr\bri\bin\bng\bg-\b-s\bse\bea\bar\brc\bch\bh-\b-f\bfo\bor\brw\bwa\bar\brd\bd
- Search forward through the history for the string of characters
+ Search forward through the history for the string of characters
between the start of the current line and the point. The search
- string may match anywhere in a history line. This is a non-in-
+ string may match anywhere in a history line. This is a non-in-
cremental search.
y\bya\ban\bnk\bk-\b-n\bnt\bth\bh-\b-a\bar\brg\bg (\b(M\bM-\b-C\bC-\b-y\by)\b)
- Insert the first argument to the previous command (usually the
+ Insert the first argument to the previous command (usually the
second word on the previous line) at point. With an argument _\bn,
- insert the _\bnth word from the previous command (the words in the
- previous command begin with word 0). A negative argument in-
- serts the _\bnth word from the end of the previous command. Once
- the argument _\bn is computed, this uses the history expansion fa-
- cilities to extract the _\bnth word, as if the "!_\bn" history expan-
+ insert the _\bnth word from the previous command (the words in the
+ previous command begin with word 0). A negative argument in-
+ serts the _\bnth word from the end of the previous command. Once
+ the argument _\bn is computed, this uses the history expansion fa-
+ cilities to extract the _\bnth word, as if the "!_\bn" history expan-
sion had been specified.
y\bya\ban\bnk\bk-\b-l\bla\bas\bst\bt-\b-a\bar\brg\bg (\b(M\bM-\b-.\b.,\b, M\bM-\b-_\b_)\b)
- Insert the last argument to the previous command (the last word
+ Insert the last argument to the previous command (the last word
of the previous history entry). With a numeric argument, behave
- exactly like y\bya\ban\bnk\bk-\b-n\bnt\bth\bh-\b-a\bar\brg\bg. Successive calls to y\bya\ban\bnk\bk-\b-l\bla\bas\bst\bt-\b-a\bar\brg\bg
- move back through the history list, inserting the last word (or
- the word specified by the argument to the first call) of each
+ exactly like y\bya\ban\bnk\bk-\b-n\bnt\bth\bh-\b-a\bar\brg\bg. Successive calls to y\bya\ban\bnk\bk-\b-l\bla\bas\bst\bt-\b-a\bar\brg\bg
+ move back through the history list, inserting the last word (or
+ the word specified by the argument to the first call) of each
line in turn. Any numeric argument supplied to these successive
- calls determines the direction to move through the history. A
- negative argument switches the direction through the history
- (back or forward). This uses the history expansion facilities
- to extract the last word, as if the "!$" history expansion had
+ calls determines the direction to move through the history. A
+ negative argument switches the direction through the history
+ (back or forward). This uses the history expansion facilities
+ to extract the last word, as if the "!$" history expansion had
been specified.
s\bsh\bhe\bel\bll\bl-\b-e\bex\bxp\bpa\ban\bnd\bd-\b-l\bli\bin\bne\be (\b(M\bM-\b-C\bC-\b-e\be)\b)
- Expand the line by performing shell word expansions. This per-
+ Expand the line by performing shell word expansions. This per-
forms alias and history expansion, $\b$'_\bs_\bt_\br_\bi_\bn_\bg' and $\b$"_\bs_\bt_\br_\bi_\bn_\bg" quot-
- ing, tilde expansion, parameter and variable expansion, arith-
- metic expansion, command and process substitution, word split-
- ting, and quote removal. An explicit argument suppresses com-
- mand and process substitution. See H\bHI\bIS\bST\bTO\bOR\bRY\bY E\bEX\bXP\bPA\bAN\bNS\bSI\bIO\bON\bN below for
+ ing, tilde expansion, parameter and variable expansion, arith-
+ metic expansion, command and process substitution, word split-
+ ting, and quote removal. An explicit argument suppresses com-
+ mand and process substitution. See H\bHI\bIS\bST\bTO\bOR\bRY\bY E\bEX\bXP\bPA\bAN\bNS\bSI\bIO\bON\bN below for
a description of history expansion.
h\bhi\bis\bst\bto\bor\bry\by-\b-e\bex\bxp\bpa\ban\bnd\bd-\b-l\bli\bin\bne\be (\b(M\bM-\b-^\b^)\b)
- Perform history expansion on the current line. See H\bHI\bIS\bST\bTO\bOR\bRY\bY E\bEX\bX-\b-
+ Perform history expansion on the current line. See H\bHI\bIS\bST\bTO\bOR\bRY\bY E\bEX\bX-\b-
P\bPA\bAN\bNS\bSI\bIO\bON\bN below for a description of history expansion.
m\bma\bag\bgi\bic\bc-\b-s\bsp\bpa\bac\bce\be
- Perform history expansion on the current line and insert a
+ Perform history expansion on the current line and insert a
space. See H\bHI\bIS\bST\bTO\bOR\bRY\bY E\bEX\bXP\bPA\bAN\bNS\bSI\bIO\bON\bN below for a description of history
expansion.
a\bal\bli\bia\bas\bs-\b-e\bex\bxp\bpa\ban\bnd\bd-\b-l\bli\bin\bne\be
- Perform alias expansion on the current line. See A\bAL\bLI\bIA\bAS\bSE\bES\bS above
+ Perform alias expansion on the current line. See A\bAL\bLI\bIA\bAS\bSE\bES\bS above
for a description of alias expansion.
h\bhi\bis\bst\bto\bor\bry\by-\b-a\ban\bnd\bd-\b-a\bal\bli\bia\bas\bs-\b-e\bex\bxp\bpa\ban\bnd\bd-\b-l\bli\bin\bne\be
Perform history and alias expansion on the current line.
i\bin\bns\bse\ber\brt\bt-\b-l\bla\bas\bst\bt-\b-a\bar\brg\bgu\bum\bme\ben\bnt\bt (\b(M\bM-\b-.\b.,\b, M\bM-\b-_\b_)\b)
A synonym for y\bya\ban\bnk\bk-\b-l\bla\bas\bst\bt-\b-a\bar\brg\bg.
e\bed\bdi\bit\bt-\b-a\ban\bnd\bd-\b-e\bex\bxe\bec\bcu\but\bte\be-\b-c\bco\bom\bmm\bma\ban\bnd\bd (\b(C\bC-\b-x\bx C\bC-\b-e\be)\b)
- Invoke an editor on the current command line, and execute the
+ Invoke an editor on the current command line, and execute the
result as shell commands. B\bBa\bas\bsh\bh attempts to invoke $\b$V\bVI\bIS\bSU\bUA\bAL\bL, $\b$E\bED\bD-\b-
I\bIT\bTO\bOR\bR, and _\be_\bm_\ba_\bc_\bs as the editor, in that order.
C\bCo\bom\bmm\bma\ban\bnd\bds\bs f\bfo\bor\br C\bCh\bha\ban\bng\bgi\bin\bng\bg T\bTe\bex\bxt\bt
_\be_\bn_\bd_\b-_\bo_\bf_\b-_\bf_\bi_\bl_\be (\b(u\bus\bsu\bua\bal\bll\bly\by C\bC-\b-d\bd)\b)
- The character indicating end-of-file as set, for example, by
+ The character indicating end-of-file as set, for example, by
_\bs_\bt_\bt_\by(1). If this character is read when there are no characters
on the line, and point is at the beginning of the line, r\bre\bea\bad\bdl\bli\bin\bne\be
interprets it as the end of input and returns E\bEO\bOF\bF.
above for the effects. This may also be bound to the Delete key
on some keyboards.
b\bba\bac\bck\bkw\bwa\bar\brd\bd-\b-d\bde\bel\ble\bet\bte\be-\b-c\bch\bha\bar\br (\b(R\bRu\bub\bbo\bou\but\bt)\b)
- Delete the character behind the cursor. When given a numeric
+ Delete the character behind the cursor. When given a numeric
argument, save the deleted text on the kill ring.
f\bfo\bor\brw\bwa\bar\brd\bd-\b-b\bba\bac\bck\bkw\bwa\bar\brd\bd-\b-d\bde\bel\ble\bet\bte\be-\b-c\bch\bha\bar\br
- Delete the character under the cursor, unless the cursor is at
+ Delete the character under the cursor, unless the cursor is at
the end of the line, in which case the character behind the cur-
sor is deleted.
q\bqu\buo\bot\bte\bed\bd-\b-i\bin\bns\bse\ber\brt\bt (\b(C\bC-\b-q\bq,\b, C\bC-\b-v\bv)\b)
- Add the next character typed to the line verbatim. This is how
+ Add the next character typed to the line verbatim. This is how
to insert characters like C\bC-\b-q\bq, for example.
t\bta\bab\bb-\b-i\bin\bns\bse\ber\brt\bt (\b(C\bC-\b-v\bv T\bTA\bAB\bB)\b)
Insert a tab character.
s\bse\bel\blf\bf-\b-i\bin\bns\bse\ber\brt\bt (\b(a\ba,\b, b\bb,\b, A\bA,\b, 1\b1,\b, !\b!,\b, ...)\b)
Insert the character typed.
b\bbr\bra\bac\bck\bke\bet\bte\bed\bd-\b-p\bpa\bas\bst\bte\be-\b-b\bbe\beg\bgi\bin\bn
- This function is intended to be bound to the "bracketed paste"
- escape sequence sent by some terminals, and such a binding is
- assigned by default. It allows r\bre\bea\bad\bdl\bli\bin\bne\be to insert the pasted
- text as a single unit without treating each character as if it
- had been read from the keyboard. The pasted characters are in-
- serted as if each one was bound to s\bse\bel\blf\bf-\b-i\bin\bns\bse\ber\brt\bt instead of exe-
+ This function is intended to be bound to the "bracketed paste"
+ escape sequence sent by some terminals, and such a binding is
+ assigned by default. It allows r\bre\bea\bad\bdl\bli\bin\bne\be to insert the pasted
+ text as a single unit without treating each character as if it
+ had been read from the keyboard. The pasted characters are in-
+ serted as if each one was bound to s\bse\bel\blf\bf-\b-i\bin\bns\bse\ber\brt\bt instead of exe-
cuting any editing commands.
- Bracketed paste sets the region to the inserted text and acti-
+ Bracketed paste sets the region to the inserted text and acti-
vates the region.
t\btr\bra\ban\bns\bsp\bpo\bos\bse\be-\b-c\bch\bha\bar\brs\bs (\b(C\bC-\b-t\bt)\b)
- Drag the character before point forward over the character at
- point, moving point forward as well. If point is at the end of
- the line, then this transposes the two characters before point.
+ Drag the character before point forward over the character at
+ point, moving point forward as well. If point is at the end of
+ the line, then this transposes the two characters before point.
Negative arguments have no effect.
t\btr\bra\ban\bns\bsp\bpo\bos\bse\be-\b-w\bwo\bor\brd\bds\bs (\b(M\bM-\b-t\bt)\b)
- Drag the word before point past the word after point, moving
- point over that word as well. If point is at the end of the
+ Drag the word before point past the word after point, moving
+ point over that word as well. If point is at the end of the
line, this transposes the last two words on the line.
s\bsh\bhe\bel\bll\bl-\b-t\btr\bra\ban\bns\bsp\bpo\bos\bse\be-\b-w\bwo\bor\brd\bds\bs (\b(M\bM-\b-C\bC-\b-t\bt)\b)
- Drag the word before point past the word after point, moving
- point past that word as well. If the insertion point is at the
+ Drag the word before point past the word after point, moving
+ point past that word as well. If the insertion point is at the
end of the line, this transposes the last two words on the line.
- Word boundaries are the same as s\bsh\bhe\bel\bll\bl-\b-f\bfo\bor\brw\bwa\bar\brd\bd-\b-w\bwo\bor\brd\bd and
+ Word boundaries are the same as s\bsh\bhe\bel\bll\bl-\b-f\bfo\bor\brw\bwa\bar\brd\bd-\b-w\bwo\bor\brd\bd and
s\bsh\bhe\bel\bll\bl-\b-b\bba\bac\bck\bkw\bwa\bar\brd\bd-\b-w\bwo\bor\brd\bd.
u\bup\bpc\bca\bas\bse\be-\b-w\bwo\bor\brd\bd (\b(M\bM-\b-u\bu)\b)
- Uppercase the current (or following) word. With a negative ar-
+ Uppercase the current (or following) word. With a negative ar-
gument, uppercase the previous word, but do not move point.
d\bdo\bow\bwn\bnc\bca\bas\bse\be-\b-w\bwo\bor\brd\bd (\b(M\bM-\b-l\bl)\b)
- Lowercase the current (or following) word. With a negative ar-
+ Lowercase the current (or following) word. With a negative ar-
gument, lowercase the previous word, but do not move point.
c\bca\bap\bpi\bit\bta\bal\bli\biz\bze\be-\b-w\bwo\bor\brd\bd (\b(M\bM-\b-c\bc)\b)
Capitalize the current (or following) word. With a negative ar-
gument, capitalize the previous word, but do not move point.
o\bov\bve\ber\brw\bwr\bri\bit\bte\be-\b-m\bmo\bod\bde\be
- Toggle overwrite mode. With an explicit positive numeric argu-
+ Toggle overwrite mode. With an explicit positive numeric argu-
ment, switches to overwrite mode. With an explicit non-positive
numeric argument, switches to insert mode. This command affects
- only e\bem\bma\bac\bcs\bs mode; v\bvi\bi mode does overwrite differently. Each call
+ only e\bem\bma\bac\bcs\bs mode; v\bvi\bi mode does overwrite differently. Each call
to _\br_\be_\ba_\bd_\bl_\bi_\bn_\be_\b(_\b) starts in insert mode.
- In overwrite mode, characters bound to s\bse\bel\blf\bf-\b-i\bin\bns\bse\ber\brt\bt replace the
- text at point rather than pushing the text to the right. Char-
- acters bound to b\bba\bac\bck\bkw\bwa\bar\brd\bd-\b-d\bde\bel\ble\bet\bte\be-\b-c\bch\bha\bar\br replace the character be-
- fore point with a space. By default, this command is unbound,
+ In overwrite mode, characters bound to s\bse\bel\blf\bf-\b-i\bin\bns\bse\ber\brt\bt replace the
+ text at point rather than pushing the text to the right. Char-
+ acters bound to b\bba\bac\bck\bkw\bwa\bar\brd\bd-\b-d\bde\bel\ble\bet\bte\be-\b-c\bch\bha\bar\br replace the character be-
+ fore point with a space. By default, this command is unbound,
but may be bound to the Insert key on some keyboards.
K\bKi\bil\bll\bli\bin\bng\bg a\ban\bnd\bd Y\bYa\ban\bnk\bki\bin\bng\bg
k\bki\bil\bll\bl-\b-l\bli\bin\bne\be (\b(C\bC-\b-k\bk)\b)
Kill the text from point to the end of the current line. With a
- negative numeric argument, kill backward from the cursor to the
+ negative numeric argument, kill backward from the cursor to the
beginning of the line.
b\bba\bac\bck\bkw\bwa\bar\brd\bd-\b-k\bki\bil\bll\bl-\b-l\bli\bin\bne\be (\b(C\bC-\b-x\bx R\bRu\bub\bbo\bou\but\bt)\b)
Kill backward to the beginning of the current line. With a neg-
- ative numeric argument, kill forward from the cursor to the end
+ ative numeric argument, kill forward from the cursor to the end
of the line.
u\bun\bni\bix\bx-\b-l\bli\bin\bne\be-\b-d\bdi\bis\bsc\bca\bar\brd\bd (\b(C\bC-\b-u\bu)\b)
- Kill backward from point to the beginning of the line, saving
+ Kill backward from point to the beginning of the line, saving
the killed text on the kill-ring.
k\bki\bil\bll\bl-\b-w\bwh\bho\bol\ble\be-\b-l\bli\bin\bne\be
- Kill all characters on the current line, no matter where point
+ Kill all characters on the current line, no matter where point
is.
k\bki\bil\bll\bl-\b-w\bwo\bor\brd\bd (\b(M\bM-\b-d\bd)\b)
- Kill from point to the end of the current word, or if between
- words, to the end of the next word. Word boundaries are the
+ Kill from point to the end of the current word, or if between
+ words, to the end of the next word. Word boundaries are the
same as those used by f\bfo\bor\brw\bwa\bar\brd\bd-\b-w\bwo\bor\brd\bd.
b\bba\bac\bck\bkw\bwa\bar\brd\bd-\b-k\bki\bil\bll\bl-\b-w\bwo\bor\brd\bd (\b(M\bM-\b-R\bRu\bub\bbo\bou\but\bt)\b)
- Kill the word behind point. Word boundaries are the same as
+ Kill the word behind point. Word boundaries are the same as
those used by b\bba\bac\bck\bkw\bwa\bar\brd\bd-\b-w\bwo\bor\brd\bd.
s\bsh\bhe\bel\bll\bl-\b-k\bki\bil\bll\bl-\b-w\bwo\bor\brd\bd (\b(M\bM-\b-C\bC-\b-d\bd)\b)
- Kill from point to the end of the current word, or if between
- words, to the end of the next word. Word boundaries are the
+ Kill from point to the end of the current word, or if between
+ words, to the end of the next word. Word boundaries are the
same as those used by s\bsh\bhe\bel\bll\bl-\b-f\bfo\bor\brw\bwa\bar\brd\bd-\b-w\bwo\bor\brd\bd.
s\bsh\bhe\bel\bll\bl-\b-b\bba\bac\bck\bkw\bwa\bar\brd\bd-\b-k\bki\bil\bll\bl-\b-w\bwo\bor\brd\bd
- Kill the word behind point. Word boundaries are the same as
+ Kill the word behind point. Word boundaries are the same as
those used by s\bsh\bhe\bel\bll\bl-\b-b\bba\bac\bck\bkw\bwa\bar\brd\bd-\b-w\bwo\bor\brd\bd.
u\bun\bni\bix\bx-\b-w\bwo\bor\brd\bd-\b-r\bru\bub\bbo\bou\but\bt (\b(C\bC-\b-w\bw)\b)
- Kill the word behind point, using white space as a word bound-
+ Kill the word behind point, using white space as a word bound-
ary, saving the killed text on the kill-ring.
u\bun\bni\bix\bx-\b-f\bfi\bil\ble\ben\bna\bam\bme\be-\b-r\bru\bub\bbo\bou\but\bt
- Kill the word behind point, using white space and the slash
- character as the word boundaries, saving the killed text on the
+ Kill the word behind point, using white space and the slash
+ character as the word boundaries, saving the killed text on the
kill-ring.
d\bde\bel\ble\bet\bte\be-\b-h\bho\bor\bri\biz\bzo\bon\bnt\bta\bal\bl-\b-s\bsp\bpa\bac\bce\be (\b(M\bM-\b-\\b\)\b)
Delete all spaces and tabs around point.
k\bki\bil\bll\bl-\b-r\bre\beg\bgi\bio\bon\bn
Kill the text in the current region.
c\bco\bop\bpy\by-\b-r\bre\beg\bgi\bio\bon\bn-\b-a\bas\bs-\b-k\bki\bil\bll\bl
- Copy the text in the region to the kill buffer, so it can be
+ Copy the text in the region to the kill buffer, so it can be
yanked immediately.
c\bco\bop\bpy\by-\b-b\bba\bac\bck\bkw\bwa\bar\brd\bd-\b-w\bwo\bor\brd\bd
- Copy the word before point to the kill buffer. The word bound-
+ Copy the word before point to the kill buffer. The word bound-
aries are the same as b\bba\bac\bck\bkw\bwa\bar\brd\bd-\b-w\bwo\bor\brd\bd.
c\bco\bop\bpy\by-\b-f\bfo\bor\brw\bwa\bar\brd\bd-\b-w\bwo\bor\brd\bd
- Copy the word following point to the kill buffer. The word
+ Copy the word following point to the kill buffer. The word
boundaries are the same as f\bfo\bor\brw\bwa\bar\brd\bd-\b-w\bwo\bor\brd\bd.
y\bya\ban\bnk\bk (\b(C\bC-\b-y\by)\b)
Yank the top of the kill ring into the buffer at point.
y\bya\ban\bnk\bk-\b-p\bpo\bop\bp (\b(M\bM-\b-y\by)\b)
- Rotate the kill ring, and yank the new top. Only works follow-
+ Rotate the kill ring, and yank the new top. Only works follow-
ing y\bya\ban\bnk\bk or y\bya\ban\bnk\bk-\b-p\bpo\bop\bp.
N\bNu\bum\bme\ber\bri\bic\bc A\bAr\brg\bgu\bum\bme\ben\bnt\bts\bs
d\bdi\big\bgi\bit\bt-\b-a\bar\brg\bgu\bum\bme\ben\bnt\bt (\b(M\bM-\b-0\b0,\b, M\bM-\b-1\b1,\b, ...,\b, M\bM-\b--\b-)\b)
- Add this digit to the argument already accumulating, or start a
+ Add this digit to the argument already accumulating, or start a
new argument. M-- starts a negative argument.
u\bun\bni\biv\bve\ber\brs\bsa\bal\bl-\b-a\bar\brg\bgu\bum\bme\ben\bnt\bt
- This is another way to specify an argument. If this command is
- followed by one or more digits, optionally with a leading minus
- sign, those digits define the argument. If the command is fol-
+ This is another way to specify an argument. If this command is
+ followed by one or more digits, optionally with a leading minus
+ sign, those digits define the argument. If the command is fol-
lowed by digits, executing u\bun\bni\biv\bve\ber\brs\bsa\bal\bl-\b-a\bar\brg\bgu\bum\bme\ben\bnt\bt again ends the nu-
meric argument, but is otherwise ignored. As a special case, if
this command is immediately followed by a character that is nei-
- ther a digit nor minus sign, the argument count for the next
- command is multiplied by four. The argument count is initially
- one, so executing this function the first time makes the argu-
+ ther a digit nor minus sign, the argument count for the next
+ command is multiplied by four. The argument count is initially
+ one, so executing this function the first time makes the argu-
ment count four, a second time makes the argument count sixteen,
and so on.
C\bCo\bom\bmp\bpl\ble\bet\bti\bin\bng\bg
c\bco\bom\bmp\bpl\ble\bet\bte\be (\b(T\bTA\bAB\bB)\b)
- Attempt to perform completion on the text before point. B\bBa\bas\bsh\bh
- attempts completion by first checking for any programmable com-
- pletions for the command word (see P\bPr\bro\bog\bgr\bra\bam\bmm\bma\bab\bbl\ble\be C\bCo\bom\bmp\bpl\ble\bet\bti\bio\bon\bn be-
+ Attempt to perform completion on the text before point. B\bBa\bas\bsh\bh
+ attempts completion by first checking for any programmable com-
+ pletions for the command word (see P\bPr\bro\bog\bgr\bra\bam\bmm\bma\bab\bbl\ble\be C\bCo\bom\bmp\bpl\ble\bet\bti\bio\bon\bn be-
low), otherwise treating the text as a variable (if the text be-
gins with $\b$), username (if the text begins with ~\b~), hostname (if
- the text begins with @\b@), or command (including aliases, func-
- tions, and builtins) in turn. If none of these produces a
+ the text begins with @\b@), or command (including aliases, func-
+ tions, and builtins) in turn. If none of these produces a
match, it falls back to filename completion.
p\bpo\bos\bss\bsi\bib\bbl\ble\be-\b-c\bco\bom\bmp\bpl\ble\bet\bti\bio\bon\bns\bs (\b(M\bM-\b-?\b?)\b)
- List the possible completions of the text before point. When
+ List the possible completions of the text before point. When
displaying completions, r\bre\bea\bad\bdl\bli\bin\bne\be sets the number of columns used
- for display to the value of c\bco\bom\bmp\bpl\ble\bet\bti\bio\bon\bn-\b-d\bdi\bis\bsp\bpl\bla\bay\by-\b-w\bwi\bid\bdt\bth\bh, the value
- of the shell variable C\bCO\bOL\bLU\bUM\bMN\bNS\bS, or the screen width, in that or-
+ for display to the value of c\bco\bom\bmp\bpl\ble\bet\bti\bio\bon\bn-\b-d\bdi\bis\bsp\bpl\bla\bay\by-\b-w\bwi\bid\bdt\bth\bh, the value
+ of the shell variable C\bCO\bOL\bLU\bUM\bMN\bNS\bS, or the screen width, in that or-
der.
i\bin\bns\bse\ber\brt\bt-\b-c\bco\bom\bmp\bpl\ble\bet\bti\bio\bon\bns\bs (\b(M\bM-\b-*\b*)\b)
- Insert all completions of the text before point that would have
+ Insert all completions of the text before point that would have
been generated by p\bpo\bos\bss\bsi\bib\bbl\ble\be-\b-c\bco\bom\bmp\bpl\ble\bet\bti\bio\bon\bns\bs, separated by a space.
m\bme\ben\bnu\bu-\b-c\bco\bom\bmp\bpl\ble\bet\bte\be
- Similar to c\bco\bom\bmp\bpl\ble\bet\bte\be, but replaces the word to be completed with
- a single match from the list of possible completions. Repeat-
- edly executing m\bme\ben\bnu\bu-\b-c\bco\bom\bmp\bpl\ble\bet\bte\be steps through the list of possible
- completions, inserting each match in turn. At the end of the
- list of completions, m\bme\ben\bnu\bu-\b-c\bco\bom\bmp\bpl\ble\bet\bte\be rings the bell (subject to
- the setting of b\bbe\bel\bll\bl-\b-s\bst\bty\byl\ble\be) and restores the original text. An
- argument of _\bn moves _\bn positions forward in the list of matches;
- a negative argument moves backward through the list. This com-
+ Similar to c\bco\bom\bmp\bpl\ble\bet\bte\be, but replaces the word to be completed with
+ a single match from the list of possible completions. Repeat-
+ edly executing m\bme\ben\bnu\bu-\b-c\bco\bom\bmp\bpl\ble\bet\bte\be steps through the list of possible
+ completions, inserting each match in turn. At the end of the
+ list of completions, m\bme\ben\bnu\bu-\b-c\bco\bom\bmp\bpl\ble\bet\bte\be rings the bell (subject to
+ the setting of b\bbe\bel\bll\bl-\b-s\bst\bty\byl\ble\be) and restores the original text. An
+ argument of _\bn moves _\bn positions forward in the list of matches;
+ a negative argument moves backward through the list. This com-
mand is intended to be bound to T\bTA\bAB\bB, but is unbound by default.
m\bme\ben\bnu\bu-\b-c\bco\bom\bmp\bpl\ble\bet\bte\be-\b-b\bba\bac\bck\bkw\bwa\bar\brd\bd
- Identical to m\bme\ben\bnu\bu-\b-c\bco\bom\bmp\bpl\ble\bet\bte\be, but moves backward through the list
- of possible completions, as if m\bme\ben\bnu\bu-\b-c\bco\bom\bmp\bpl\ble\bet\bte\be had been given a
+ Identical to m\bme\ben\bnu\bu-\b-c\bco\bom\bmp\bpl\ble\bet\bte\be, but moves backward through the list
+ of possible completions, as if m\bme\ben\bnu\bu-\b-c\bco\bom\bmp\bpl\ble\bet\bte\be had been given a
negative argument. This command is unbound by default.
d\bde\bel\ble\bet\bte\be-\b-c\bch\bha\bar\br-\b-o\bor\br-\b-l\bli\bis\bst\bt
- Deletes the character under the cursor if not at the beginning
- or end of the line (like d\bde\bel\ble\bet\bte\be-\b-c\bch\bha\bar\br). At the end of the line,
+ Deletes the character under the cursor if not at the beginning
+ or end of the line (like d\bde\bel\ble\bet\bte\be-\b-c\bch\bha\bar\br). At the end of the line,
it behaves identically to p\bpo\bos\bss\bsi\bib\bbl\ble\be-\b-c\bco\bom\bmp\bpl\ble\bet\bti\bio\bon\bns\bs. This command is
unbound by default.
c\bco\bom\bmp\bpl\ble\bet\bte\be-\b-f\bfi\bil\ble\ben\bna\bam\bme\be (\b(M\bM-\b-/\b/)\b)
List the possible completions of the text before point, treating
it as a filename.
c\bco\bom\bmp\bpl\ble\bet\bte\be-\b-u\bus\bse\ber\brn\bna\bam\bme\be (\b(M\bM-\b-~\b~)\b)
- Attempt completion on the text before point, treating it as a
+ Attempt completion on the text before point, treating it as a
username.
p\bpo\bos\bss\bsi\bib\bbl\ble\be-\b-u\bus\bse\ber\brn\bna\bam\bme\be-\b-c\bco\bom\bmp\bpl\ble\bet\bti\bio\bon\bns\bs (\b(C\bC-\b-x\bx ~\b~)\b)
List the possible completions of the text before point, treating
it as a username.
c\bco\bom\bmp\bpl\ble\bet\bte\be-\b-v\bva\bar\bri\bia\bab\bbl\ble\be (\b(M\bM-\b-$\b$)\b)
- Attempt completion on the text before point, treating it as a
+ Attempt completion on the text before point, treating it as a
shell variable.
p\bpo\bos\bss\bsi\bib\bbl\ble\be-\b-v\bva\bar\bri\bia\bab\bbl\ble\be-\b-c\bco\bom\bmp\bpl\ble\bet\bti\bio\bon\bns\bs (\b(C\bC-\b-x\bx $\b$)\b)
List the possible completions of the text before point, treating
it as a shell variable.
c\bco\bom\bmp\bpl\ble\bet\bte\be-\b-h\bho\bos\bst\btn\bna\bam\bme\be (\b(M\bM-\b-@\b@)\b)
- Attempt completion on the text before point, treating it as a
+ Attempt completion on the text before point, treating it as a
hostname.
p\bpo\bos\bss\bsi\bib\bbl\ble\be-\b-h\bho\bos\bst\btn\bna\bam\bme\be-\b-c\bco\bom\bmp\bpl\ble\bet\bti\bio\bon\bns\bs (\b(C\bC-\b-x\bx @\b@)\b)
List the possible completions of the text before point, treating
it as a hostname.
c\bco\bom\bmp\bpl\ble\bet\bte\be-\b-c\bco\bom\bmm\bma\ban\bnd\bd (\b(M\bM-\b-!\b!)\b)
- Attempt completion on the text before point, treating it as a
- command name. Command completion attempts to match the text
- against aliases, reserved words, shell functions, shell
+ Attempt completion on the text before point, treating it as a
+ command name. Command completion attempts to match the text
+ against aliases, reserved words, shell functions, shell
builtins, and finally executable filenames, in that order.
p\bpo\bos\bss\bsi\bib\bbl\ble\be-\b-c\bco\bom\bmm\bma\ban\bnd\bd-\b-c\bco\bom\bmp\bpl\ble\bet\bti\bio\bon\bns\bs (\b(C\bC-\b-x\bx !\b!)\b)
List the possible completions of the text before point, treating
it as a command name.
d\bdy\byn\bna\bam\bmi\bic\bc-\b-c\bco\bom\bmp\bpl\ble\bet\bte\be-\b-h\bhi\bis\bst\bto\bor\bry\by (\b(M\bM-\b-T\bTA\bAB\bB)\b)
- Attempt completion on the text before point, comparing the text
+ Attempt completion on the text before point, comparing the text
against history list entries for possible completion matches.
d\bda\bab\bbb\bbr\bre\bev\bv-\b-e\bex\bxp\bpa\ban\bnd\bd
- Attempt menu completion on the text before point, comparing the
+ Attempt menu completion on the text before point, comparing the
text against lines from the history list for possible completion
matches.
c\bco\bom\bmp\bpl\ble\bet\bte\be-\b-i\bin\bnt\bto\bo-\b-b\bbr\bra\bac\bce\bes\bs (\b(M\bM-\b-{\b{)\b)
Perform filename completion and insert the list of possible com-
- pletions enclosed within braces so the list is available to the
+ pletions enclosed within braces so the list is available to the
shell (see B\bBr\bra\bac\bce\be E\bEx\bxp\bpa\ban\bns\bsi\bio\bon\bn above).
K\bKe\bey\byb\bbo\boa\bar\brd\bd M\bMa\bac\bcr\bro\bos\bs
s\bst\bta\bar\brt\bt-\b-k\bkb\bbd\bd-\b-m\bma\bac\bcr\bro\bo (\b(C\bC-\b-x\bx (\b()\b)
- Begin saving the characters typed into the current keyboard
+ Begin saving the characters typed into the current keyboard
macro.
e\ben\bnd\bd-\b-k\bkb\bbd\bd-\b-m\bma\bac\bcr\bro\bo (\b(C\bC-\b-x\bx )\b))\b)
Stop saving the characters typed into the current keyboard macro
and store the definition.
c\bca\bal\bll\bl-\b-l\bla\bas\bst\bt-\b-k\bkb\bbd\bd-\b-m\bma\bac\bcr\bro\bo (\b(C\bC-\b-x\bx e\be)\b)
- Re-execute the last keyboard macro defined, by making the char-
+ Re-execute the last keyboard macro defined, by making the char-
acters in the macro appear as if typed at the keyboard.
p\bpr\bri\bin\bnt\bt-\b-l\bla\bas\bst\bt-\b-k\bkb\bbd\bd-\b-m\bma\bac\bcr\bro\bo (\b()\b)
- Print the last keyboard macro defined in a format suitable for
+ Print the last keyboard macro defined in a format suitable for
the _\bi_\bn_\bp_\bu_\bt_\br_\bc file.
M\bMi\bis\bsc\bce\bel\bll\bla\ban\bne\beo\bou\bus\bs
r\bre\be-\b-r\bre\bea\bad\bd-\b-i\bin\bni\bit\bt-\b-f\bfi\bil\ble\be (\b(C\bC-\b-x\bx C\bC-\b-r\br)\b)
- Read in the contents of the _\bi_\bn_\bp_\bu_\bt_\br_\bc file, and incorporate any
+ Read in the contents of the _\bi_\bn_\bp_\bu_\bt_\br_\bc file, and incorporate any
bindings or variable assignments found there.
a\bab\bbo\bor\brt\bt (\b(C\bC-\b-g\bg)\b)
- Abort the current editing command and ring the terminal's bell
+ Abort the current editing command and ring the terminal's bell
(subject to the setting of b\bbe\bel\bll\bl-\b-s\bst\bty\byl\ble\be).
d\bdo\bo-\b-l\blo\bow\bwe\ber\brc\bca\bas\bse\be-\b-v\bve\ber\brs\bsi\bio\bon\bn (\b(M\bM-\b-A\bA,\b, M\bM-\b-B\bB,\b, M\bM-\b-_\bx,\b, ...)\b)
- If the metafied character _\bx is uppercase, run the command that
+ If the metafied character _\bx is uppercase, run the command that
is bound to the corresponding metafied lowercase character. The
behavior is undefined if _\bx is already lowercase.
p\bpr\bre\bef\bfi\bix\bx-\b-m\bme\bet\bta\ba (\b(E\bES\bSC\bC)\b)
u\bun\bnd\bdo\bo (\b(C\bC-\b-_\b_,\b, C\bC-\b-x\bx C\bC-\b-u\bu)\b)
Incremental undo, separately remembered for each line.
r\bre\bev\bve\ber\brt\bt-\b-l\bli\bin\bne\be (\b(M\bM-\b-r\br)\b)
- Undo all changes made to this line. This is like executing the
- u\bun\bnd\bdo\bo command enough times to return the line to its initial
+ Undo all changes made to this line. This is like executing the
+ u\bun\bnd\bdo\bo command enough times to return the line to its initial
state.
t\bti\bil\bld\bde\be-\b-e\bex\bxp\bpa\ban\bnd\bd (\b(M\bM-\b-&\b&)\b)
Perform tilde expansion on the current word.
s\bse\bet\bt-\b-m\bma\bar\brk\bk (\b(C\bC-\b-@\b@,\b, M\bM-\b-<\b<s\bsp\bpa\bac\bce\be>\b>)\b)
- Set the mark to the point. If a numeric argument is supplied,
+ Set the mark to the point. If a numeric argument is supplied,
set the mark to that position.
e\bex\bxc\bch\bha\ban\bng\bge\be-\b-p\bpo\boi\bin\bnt\bt-\b-a\ban\bnd\bd-\b-m\bma\bar\brk\bk (\b(C\bC-\b-x\bx C\bC-\b-x\bx)\b)
- Swap the point with the mark. Set the current cursor position
+ Swap the point with the mark. Set the current cursor position
to the saved position, then set the mark to the old cursor posi-
tion.
c\bch\bha\bar\bra\bac\bct\bte\ber\br-\b-s\bse\bea\bar\brc\bch\bh (\b(C\bC-\b-]\b])\b)
- Read a character and move point to the next occurrence of that
- character. A negative argument searches for previous occur-
+ Read a character and move point to the next occurrence of that
+ character. A negative argument searches for previous occur-
rences.
c\bch\bha\bar\bra\bac\bct\bte\ber\br-\b-s\bse\bea\bar\brc\bch\bh-\b-b\bba\bac\bck\bkw\bwa\bar\brd\bd (\b(M\bM-\b-C\bC-\b-]\b])\b)
- Read a character and move point to the previous occurrence of
+ Read a character and move point to the previous occurrence of
that character. A negative argument searches for subsequent oc-
currences.
s\bsk\bki\bip\bp-\b-c\bcs\bsi\bi-\b-s\bse\beq\bqu\bue\ben\bnc\bce\be
- Read enough characters to consume a multi-key sequence such as
- those defined for keys like Home and End. CSI sequences begin
+ Read enough characters to consume a multi-key sequence such as
+ those defined for keys like Home and End. CSI sequences begin
with a Control Sequence Indicator (CSI), usually ESC-[. If this
- sequence is bound to "\e[", keys producing CSI sequences will
- have no effect unless explicitly bound to a r\bre\bea\bad\bdl\bli\bin\bne\be command,
- instead of inserting stray characters into the editing buffer.
+ sequence is bound to "\e[", keys producing CSI sequences will
+ have no effect unless explicitly bound to a r\bre\bea\bad\bdl\bli\bin\bne\be command,
+ instead of inserting stray characters into the editing buffer.
This is unbound by default, but usually bound to ESC-[.
i\bin\bns\bse\ber\brt\bt-\b-c\bco\bom\bmm\bme\ben\bnt\bt (\b(M\bM-\b-#\b#)\b)
- Without a numeric argument, insert the value of the r\bre\bea\bad\bdl\bli\bin\bne\be
+ Without a numeric argument, insert the value of the r\bre\bea\bad\bdl\bli\bin\bne\be
c\bco\bom\bmm\bme\ben\bnt\bt-\b-b\bbe\beg\bgi\bin\bn variable at the beginning of the current line. If
- a numeric argument is supplied, this command acts as a toggle:
- if the characters at the beginning of the line do not match the
- value of c\bco\bom\bmm\bme\ben\bnt\bt-\b-b\bbe\beg\bgi\bin\bn, insert the value; otherwise delete the
- characters in c\bco\bom\bmm\bme\ben\bnt\bt-\b-b\bbe\beg\bgi\bin\bn from the beginning of the line. In
- either case, the line is accepted as if a newline had been
- typed. The default value of c\bco\bom\bmm\bme\ben\bnt\bt-\b-b\bbe\beg\bgi\bin\bn causes this command
+ a numeric argument is supplied, this command acts as a toggle:
+ if the characters at the beginning of the line do not match the
+ value of c\bco\bom\bmm\bme\ben\bnt\bt-\b-b\bbe\beg\bgi\bin\bn, insert the value; otherwise delete the
+ characters in c\bco\bom\bmm\bme\ben\bnt\bt-\b-b\bbe\beg\bgi\bin\bn from the beginning of the line. In
+ either case, the line is accepted as if a newline had been
+ typed. The default value of c\bco\bom\bmm\bme\ben\bnt\bt-\b-b\bbe\beg\bgi\bin\bn causes this command
to make the current line a shell comment. If a numeric argument
causes the comment character to be removed, the line will be ex-
ecuted by the shell.
s\bsp\bpe\bel\bll\bl-\b-c\bco\bor\brr\bre\bec\bct\bt-\b-w\bwo\bor\brd\bd (\b(C\bC-\b-x\bx s\bs)\b)
- Perform spelling correction on the current word, treating it as
- a directory or filename, in the same way as the c\bcd\bds\bsp\bpe\bel\bll\bl shell
- option. Word boundaries are the same as those used by
+ Perform spelling correction on the current word, treating it as
+ a directory or filename, in the same way as the c\bcd\bds\bsp\bpe\bel\bll\bl shell
+ option. Word boundaries are the same as those used by
s\bsh\bhe\bel\bll\bl-\b-f\bfo\bor\brw\bwa\bar\brd\bd-\b-w\bwo\bor\brd\bd.
g\bgl\blo\bob\bb-\b-c\bco\bom\bmp\bpl\ble\bet\bte\be-\b-w\bwo\bor\brd\bd (\b(M\bM-\b-g\bg)\b)
Treat the word before point as a pattern for pathname expansion,
- with an asterisk implicitly appended, then use the pattern to
+ with an asterisk implicitly appended, then use the pattern to
generate a list of matching file names for possible completions.
g\bgl\blo\bob\bb-\b-e\bex\bxp\bpa\ban\bnd\bd-\b-w\bwo\bor\brd\bd (\b(C\bC-\b-x\bx *\b*)\b)
Treat the word before point as a pattern for pathname expansion,
- and insert the list of matching file names, replacing the word.
- If a numeric argument is supplied, append a *\b* before pathname
+ and insert the list of matching file names, replacing the word.
+ If a numeric argument is supplied, append a *\b* before pathname
expansion.
g\bgl\blo\bob\bb-\b-l\bli\bis\bst\bt-\b-e\bex\bxp\bpa\ban\bns\bsi\bio\bon\bns\bs (\b(C\bC-\b-x\bx g\bg)\b)
Display the list of expansions that would have been generated by
- g\bgl\blo\bob\bb-\b-e\bex\bxp\bpa\ban\bnd\bd-\b-w\bwo\bor\brd\bd and redisplay the line. If a numeric argument
+ g\bgl\blo\bob\bb-\b-e\bex\bxp\bpa\ban\bnd\bd-\b-w\bwo\bor\brd\bd and redisplay the line. If a numeric argument
is supplied, append a *\b* before pathname expansion.
d\bdu\bum\bmp\bp-\b-f\bfu\bun\bnc\bct\bti\bio\bon\bns\bs
- Print all of the functions and their key bindings to the r\bre\bea\bad\bd-\b-
+ Print all of the functions and their key bindings to the r\bre\bea\bad\bd-\b-
l\bli\bin\bne\be output stream. If a numeric argument is supplied, the out-
- put is formatted in such a way that it can be made part of an
+ put is formatted in such a way that it can be made part of an
_\bi_\bn_\bp_\bu_\bt_\br_\bc file.
d\bdu\bum\bmp\bp-\b-v\bva\bar\bri\bia\bab\bbl\ble\bes\bs
Print all of the settable r\bre\bea\bad\bdl\bli\bin\bne\be variables and their values to
- the r\bre\bea\bad\bdl\bli\bin\bne\be output stream. If a numeric argument is supplied,
- the output is formatted in such a way that it can be made part
+ the r\bre\bea\bad\bdl\bli\bin\bne\be output stream. If a numeric argument is supplied,
+ the output is formatted in such a way that it can be made part
of an _\bi_\bn_\bp_\bu_\bt_\br_\bc file.
d\bdu\bum\bmp\bp-\b-m\bma\bac\bcr\bro\bos\bs
- Print all of the r\bre\bea\bad\bdl\bli\bin\bne\be key sequences bound to macros and the
+ Print all of the r\bre\bea\bad\bdl\bli\bin\bne\be key sequences bound to macros and the
strings they output to the r\bre\bea\bad\bdl\bli\bin\bne\be output stream. If a numeric
argument is supplied, the output is formatted in such a way that
it can be made part of an _\bi_\bn_\bp_\bu_\bt_\br_\bc file.
e\bex\bxe\bec\bcu\but\bte\be-\b-n\bna\bam\bme\bed\bd-\b-c\bco\bom\bmm\bma\ban\bnd\bd (\b(M\bM-\b-x\bx)\b)
Read a bindable r\bre\bea\bad\bdl\bli\bin\bne\be command name from the input and execute
- the function to which it's bound, as if the key sequence to
- which it was bound appeared in the input. If this function is
+ the function to which it's bound, as if the key sequence to
+ which it was bound appeared in the input. If this function is
supplied with a numeric argument, it passes that argument to the
function it executes.
d\bdi\bis\bsp\bpl\bla\bay\by-\b-s\bsh\bhe\bel\bll\bl-\b-v\bve\ber\brs\bsi\bio\bon\bn (\b(C\bC-\b-x\bx C\bC-\b-v\bv)\b)
Display version information about the current instance of b\bba\bas\bsh\bh.
P\bPr\bro\bog\bgr\bra\bam\bmm\bma\bab\bbl\ble\be C\bCo\bom\bmp\bpl\ble\bet\bti\bio\bon\bn
- When a user attempts word completion for an argument to a command for
- which a completion specification (a _\bc_\bo_\bm_\bp_\bs_\bp_\be_\bc) has been defined using
- the c\bco\bom\bmp\bpl\ble\bet\bte\be builtin (see S\bSH\bHE\bEL\bLL\bL B\bBU\bUI\bIL\bLT\bTI\bIN\bN C\bCO\bOM\bMM\bMA\bAN\bND\bDS\bS below), r\bre\bea\bad\bdl\bli\bin\bne\be in-
+ When a user attempts word completion for an argument to a command for
+ which a completion specification (a _\bc_\bo_\bm_\bp_\bs_\bp_\be_\bc) has been defined using
+ the c\bco\bom\bmp\bpl\ble\bet\bte\be builtin (see S\bSH\bHE\bEL\bLL\bL B\bBU\bUI\bIL\bLT\bTI\bIN\bN C\bCO\bOM\bMM\bMA\bAN\bND\bDS\bS below), r\bre\bea\bad\bdl\bli\bin\bne\be in-
vokes the programmable completion facilities.
- First, b\bba\bas\bsh\bh identifies the command name. If a compspec has been de-
- fined for that command, the compspec is used to generate the list of
- possible completions for the word. If the command word is the empty
- string (completion attempted at the beginning of an empty line), b\bba\bas\bsh\bh
- uses any compspec defined with the -\b-E\bE option to c\bco\bom\bmp\bpl\ble\bet\bte\be. If the com-
+ First, b\bba\bas\bsh\bh identifies the command name. If a compspec has been de-
+ fined for that command, the compspec is used to generate the list of
+ possible completions for the word. If the command word is the empty
+ string (completion attempted at the beginning of an empty line), b\bba\bas\bsh\bh
+ uses any compspec defined with the -\b-E\bE option to c\bco\bom\bmp\bpl\ble\bet\bte\be. If the com-
mand word is a full pathname, b\bba\bas\bsh\bh searches for a compspec for the full
- pathname first. If there is no compspec for the full pathname, b\bba\bas\bsh\bh
- attempts to find a compspec for the portion following the final slash.
- If those searches do not result in a compspec, any compspec defined
- with the -\b-D\bD option to c\bco\bom\bmp\bpl\ble\bet\bte\be is used as the default. If there is no
- default compspec, b\bba\bas\bsh\bh attempts alias expansion on the command word as
- a final resort, and attempts to find a compspec for the command word
+ pathname first. If there is no compspec for the full pathname, b\bba\bas\bsh\bh
+ attempts to find a compspec for the portion following the final slash.
+ If those searches do not result in a compspec, any compspec defined
+ with the -\b-D\bD option to c\bco\bom\bmp\bpl\ble\bet\bte\be is used as the default. If there is no
+ default compspec, b\bba\bas\bsh\bh attempts alias expansion on the command word as
+ a final resort, and attempts to find a compspec for the command word
from any successful expansion.
If a compspec is not found, b\bba\bas\bsh\bh performs its default completion as de-
- scribed above under C\bCo\bom\bmp\bpl\ble\bet\bti\bin\bng\bg. Otherwise, once a compspec has been
+ scribed above under C\bCo\bom\bmp\bpl\ble\bet\bti\bin\bng\bg. Otherwise, once a compspec has been
found, b\bba\bas\bsh\bh uses it to generate the list of matching words.
- First, b\bba\bas\bsh\bh performs the _\ba_\bc_\bt_\bi_\bo_\bn_\bs specified by the compspec. Only
- matches which are prefixed by the word being completed are returned.
+ First, b\bba\bas\bsh\bh performs the _\ba_\bc_\bt_\bi_\bo_\bn_\bs specified by the compspec. Only
+ matches which are prefixed by the word being completed are returned.
When the -\b-f\bf or -\b-d\bd option is used for filename or directory name comple-
tion, b\bba\bas\bsh\bh uses the shell variable F\bFI\bIG\bGN\bNO\bOR\bRE\bE to filter the matches.
Any completions specified by a pathname expansion pattern to the -\b-G\bG op-
- tion are generated next. The words generated by the pattern need not
+ tion are generated next. The words generated by the pattern need not
match the word being completed. B\bBa\bas\bsh\bh uses the F\bFI\bIG\bGN\bNO\bOR\bRE\bE variable to fil-
ter the matches, but does not use the G\bGL\bLO\bOB\bBI\bIG\bGN\bNO\bOR\bRE\bE shell variable.
- Next, completion considers the string specified as the argument to the
- -\b-W\bW option. The string is first split using the characters in the I\bIF\bFS\bS
- special variable as delimiters. Shell quoting is honored. Each word
- is then expanded using brace expansion, tilde expansion, parameter and
- variable expansion, command substitution, and arithmetic expansion, as
+ Next, completion considers the string specified as the argument to the
+ -\b-W\bW option. The string is first split using the characters in the I\bIF\bFS\bS
+ special variable as delimiters. Shell quoting is honored. Each word
+ is then expanded using brace expansion, tilde expansion, parameter and
+ variable expansion, command substitution, and arithmetic expansion, as
described above under E\bEX\bXP\bPA\bAN\bNS\bSI\bIO\bON\bN. The results are split using the rules
described above under W\bWo\bor\brd\bd S\bSp\bpl\bli\bit\btt\bti\bin\bng\bg. The results of the expansion are
prefix-matched against the word being completed, and the matching words
become possible completions.
- After these matches have been generated, b\bba\bas\bsh\bh executes any shell func-
+ After these matches have been generated, b\bba\bas\bsh\bh executes any shell func-
tion or command specified with the -\b-F\bF and -\b-C\bC options. When the command
- or function is invoked, the C\bCO\bOM\bMP\bP_\b_L\bLI\bIN\bNE\bE, C\bCO\bOM\bMP\bP_\b_P\bPO\bOI\bIN\bNT\bT, C\bCO\bOM\bMP\bP_\b_K\bKE\bEY\bY, and
- C\bCO\bOM\bMP\bP_\b_T\bTY\bYP\bPE\bE variables are assigned values as described above under S\bSh\bhe\bel\bll\bl
- V\bVa\bar\bri\bia\bab\bbl\ble\bes\bs. If a shell function is being invoked, the C\bCO\bOM\bMP\bP_\b_W\bWO\bOR\bRD\bDS\bS and
+ or function is invoked, the C\bCO\bOM\bMP\bP_\b_L\bLI\bIN\bNE\bE, C\bCO\bOM\bMP\bP_\b_P\bPO\bOI\bIN\bNT\bT, C\bCO\bOM\bMP\bP_\b_K\bKE\bEY\bY, and
+ C\bCO\bOM\bMP\bP_\b_T\bTY\bYP\bPE\bE variables are assigned values as described above under S\bSh\bhe\bel\bll\bl
+ V\bVa\bar\bri\bia\bab\bbl\ble\bes\bs. If a shell function is being invoked, the C\bCO\bOM\bMP\bP_\b_W\bWO\bOR\bRD\bDS\bS and
C\bCO\bOM\bMP\bP_\b_C\bCW\bWO\bOR\bRD\bD variables are also set. When the function or command is in-
- voked, the first argument ($\b$1\b1) is the name of the command whose argu-
- ments 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 current command line. There is no filtering of
- the generated completions against the word being completed; the func-
+ voked, the first argument ($\b$1\b1) is the name of the command whose argu-
+ ments 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 current command line. There is no filtering of
+ the generated completions against the word being completed; the func-
tion or command has complete freedom in generating the matches.
- Any function specified with -\b-F\bF is invoked first. The function may use
+ Any function specified with -\b-F\bF is invoked first. The function may use
any of the shell facilities, including the c\bco\bom\bmp\bpg\bge\ben\bn and c\bco\bom\bmp\bpo\bop\bpt\bt builtins
- described below, to generate the matches. It must put the possible
+ described below, to generate the matches. It must put the possible
completions in the C\bCO\bOM\bMP\bPR\bRE\bEP\bPL\bLY\bY array variable, one per array element.
- Next, any command specified with the -\b-C\bC option is invoked in an envi-
- ronment equivalent to command substitution. It should print a list of
- completions, one per line, to the standard output. Backslash may be
- used to escape a newline, if necessary. These are added to the set of
+ Next, any command specified with the -\b-C\bC option is invoked in an envi-
+ ronment equivalent to command substitution. It should print a list of
+ completions, one per line, to the standard output. Backslash may be
+ used to escape a newline, if necessary. These are added to the set of
possible completions.
- After all of the possible completions are generated, any filter speci-
- fied with the -\b-X\bX option is applied to the list. The filter is a pat-
- tern as used for pathname expansion; a &\b& in the pattern is replaced
- with the text of the word being completed. A literal &\b& may be escaped
- with a backslash; the backslash is removed before attempting a match.
- Any completion that matches the pattern will be removed from the list.
+ After all of the possible completions are generated, any filter speci-
+ fied with the -\b-X\bX option is applied to the list. The filter is a pat-
+ tern as used for pathname expansion; a &\b& in the pattern is replaced
+ with the text of the word being completed. A literal &\b& may be escaped
+ with a backslash; the backslash is removed before attempting a match.
+ Any completion that matches the pattern will be removed from the list.
A leading !\b! negates the pattern; in this case any completion not match-
- ing the pattern will be removed. If the n\bno\boc\bca\bas\bse\bem\bma\bat\btc\bch\bh shell option is
- enabled, the match is performed without regard to the case of alpha-
+ ing the pattern will be removed. If the n\bno\boc\bca\bas\bse\bem\bma\bat\btc\bch\bh shell option is
+ enabled, the match is performed without regard to the case of alpha-
betic characters.
Finally, any prefix and suffix specified with the -\b-P\bP and -\b-S\bS options are
added to each member of the completion list, and the result is returned
to r\bre\bea\bad\bdl\bli\bin\bne\be as the list of possible completions.
- If the previously-applied actions do not generate any matches, and the
- -\b-o\bo d\bdi\bir\brn\bna\bam\bme\bes\bs option was supplied to c\bco\bom\bmp\bpl\ble\bet\bte\be when the compspec was de-
+ If the previously-applied actions do not generate any matches, and the
+ -\b-o\bo d\bdi\bir\brn\bna\bam\bme\bes\bs option was supplied to c\bco\bom\bmp\bpl\ble\bet\bte\be when the compspec was de-
fined, b\bba\bas\bsh\bh attempts directory name completion.
- If the -\b-o\bo p\bpl\blu\bus\bsd\bdi\bir\brs\bs option was supplied to c\bco\bom\bmp\bpl\ble\bet\bte\be when the compspec
- was defined, b\bba\bas\bsh\bh attempts directory name completion and adds any
+ If the -\b-o\bo p\bpl\blu\bus\bsd\bdi\bir\brs\bs option was supplied to c\bco\bom\bmp\bpl\ble\bet\bte\be when the compspec
+ was defined, b\bba\bas\bsh\bh attempts directory name completion and adds any
matches to the set of possible completions.
- By default, if a compspec is found, whatever it generates is returned
- to the completion code as the full set of possible completions. The
- default b\bba\bas\bsh\bh completions and the r\bre\bea\bad\bdl\bli\bin\bne\be default of filename comple-
- tion are disabled. If the -\b-o\bo b\bba\bas\bsh\bhd\bde\bef\bfa\bau\bul\blt\bt option was supplied to c\bco\bom\bm-\b-
- p\bpl\ble\bet\bte\be when the compspec was defined, if the compspec generates no
- matches, b\bba\bas\bsh\bh attempts its default completions. If the -\b-o\bo d\bde\bef\bfa\bau\bul\blt\bt op-
+ By default, if a compspec is found, whatever it generates is returned
+ to the completion code as the full set of possible completions. The
+ default b\bba\bas\bsh\bh completions and the r\bre\bea\bad\bdl\bli\bin\bne\be default of filename comple-
+ tion are disabled. If the -\b-o\bo b\bba\bas\bsh\bhd\bde\bef\bfa\bau\bul\blt\bt option was supplied to c\bco\bom\bm-\b-
+ p\bpl\ble\bet\bte\be when the compspec was defined, if the compspec generates no
+ matches, b\bba\bas\bsh\bh attempts its default completions. If the -\b-o\bo d\bde\bef\bfa\bau\bul\blt\bt op-
tion was supplied to c\bco\bom\bmp\bpl\ble\bet\bte\be when the compspec was defined, programma-
- ble completion will perform r\bre\bea\bad\bdl\bli\bin\bne\be's default completion if the comp-
- spec (and, if attempted, the default b\bba\bas\bsh\bh completions) generate no
+ ble completion will perform r\bre\bea\bad\bdl\bli\bin\bne\be's default completion if the comp-
+ spec (and, if attempted, the default b\bba\bas\bsh\bh completions) generate no
matches.
- When a compspec indicates that directory name completion is desired,
- the programmable completion functions force r\bre\bea\bad\bdl\bli\bin\bne\be to append a slash
- to completed names which are symbolic links to directories, subject to
- the value of the m\bma\bar\brk\bk-\b-d\bdi\bir\bre\bec\bct\bto\bor\bri\bie\bes\bs r\bre\bea\bad\bdl\bli\bin\bne\be variable, regardless of the
+ When a compspec indicates that directory name completion is desired,
+ the programmable completion functions force r\bre\bea\bad\bdl\bli\bin\bne\be to append a slash
+ to completed names which are symbolic links to directories, subject to
+ the value of the m\bma\bar\brk\bk-\b-d\bdi\bir\bre\bec\bct\bto\bor\bri\bie\bes\bs r\bre\bea\bad\bdl\bli\bin\bne\be variable, regardless of the
setting of the m\bma\bar\brk\bk-\b-s\bsy\bym\bml\bli\bin\bnk\bke\bed\bd-\b-d\bdi\bir\bre\bec\bct\bto\bor\bri\bie\bes\bs r\bre\bea\bad\bdl\bli\bin\bne\be variable.
- There is some support for dynamically modifying completions. This is
- most useful when used in combination with a default completion speci-
- fied with c\bco\bom\bmp\bpl\ble\bet\bte\be -\b-D\bD. It's possible for shell functions executed as
- completion functions to indicate that completion should be retried by
- returning an exit status of 124. If a shell function returns 124, and
+ There is some support for dynamically modifying completions. This is
+ most useful when used in combination with a default completion speci-
+ fied with c\bco\bom\bmp\bpl\ble\bet\bte\be -\b-D\bD. It's possible for shell functions executed as
+ completion functions to indicate that completion should be retried by
+ returning an exit status of 124. If a shell function returns 124, and
changes the compspec associated with the command on which completion is
- being attempted (supplied as the first argument when the function is
+ being attempted (supplied as the first argument when the function is
executed), programmable completion restarts from the beginning, with an
- attempt to find a new compspec for that command. This allows a set of
- completions to be built dynamically as completion is attempted, rather
+ attempt to find a new compspec for that command. This allows a set of
+ completions to be built dynamically as completion is attempted, rather
than being loaded all at once.
- For instance, assuming that there is a library of compspecs, each kept
- in a file corresponding to the name of the command, the following de-
+ For instance, assuming that there is a library of compspecs, each kept
+ in a file corresponding to the name of the command, the following de-
fault completion function would load completions dynamically:
_completion_loader()
{
-o bashdefault -o default
H\bHI\bIS\bST\bTO\bOR\bRY\bY
- When the -\b-o\bo h\bhi\bis\bst\bto\bor\bry\by option to the s\bse\bet\bt builtin is enabled, the shell
+ When the -\b-o\bo h\bhi\bis\bst\bto\bor\bry\by option to the s\bse\bet\bt builtin is enabled, the shell
provides access to the _\bc_\bo_\bm_\bm_\ba_\bn_\bd _\bh_\bi_\bs_\bt_\bo_\br_\by, the list of commands previously
- typed. The value of the H\bHI\bIS\bST\bTS\bSI\bIZ\bZE\bE variable is used as the number of
- commands to save in a history list: the shell saves the text of the
+ typed. The value of the H\bHI\bIS\bST\bTS\bSI\bIZ\bZE\bE variable is used as the number of
+ commands to save in a history list: the shell saves the text of the
last H\bHI\bIS\bST\bTS\bSI\bIZ\bZE\bE commands (default 500). The shell stores each command in
- the history list prior to parameter and variable expansion (see E\bEX\bXP\bPA\bAN\bN-\b-
- S\bSI\bIO\bON\bN above) but after history expansion is performed, subject to the
+ the history list prior to parameter and variable expansion (see E\bEX\bXP\bPA\bAN\bN-\b-
+ S\bSI\bIO\bON\bN above) but after history expansion is performed, subject to the
values of the shell variables H\bHI\bIS\bST\bTI\bIG\bGN\bNO\bOR\bRE\bE and H\bHI\bIS\bST\bTC\bCO\bON\bNT\bTR\bRO\bOL\bL.
- On startup, b\bba\bas\bsh\bh initializes the history list by reading history en-
- tries from the the file named by the H\bHI\bIS\bST\bTF\bFI\bIL\bLE\bE variable (default
- _\b~_\b/_\b._\bb_\ba_\bs_\bh_\b__\bh_\bi_\bs_\bt_\bo_\br_\by). That file is referred to as the _\bh_\bi_\bs_\bt_\bo_\br_\by _\bf_\bi_\bl_\be. The
- history file is truncated, if necessary, to contain no more than the
- number of history entries specified by the value of the H\bHI\bIS\bST\bTF\bFI\bIL\bLE\bES\bSI\bIZ\bZE\bE
- variable. If H\bHI\bIS\bST\bTF\bFI\bIL\bLE\bES\bSI\bIZ\bZE\bE is unset, or set to null, a non-numeric
+ On startup, b\bba\bas\bsh\bh initializes the history list by reading history en-
+ tries from the the file named by the H\bHI\bIS\bST\bTF\bFI\bIL\bLE\bE variable (default
+ _\b~_\b/_\b._\bb_\ba_\bs_\bh_\b__\bh_\bi_\bs_\bt_\bo_\br_\by). That file is referred to as the _\bh_\bi_\bs_\bt_\bo_\br_\by _\bf_\bi_\bl_\be. The
+ history file is truncated, if necessary, to contain no more than the
+ number of history entries specified by the value of the H\bHI\bIS\bST\bTF\bFI\bIL\bLE\bES\bSI\bIZ\bZE\bE
+ variable. If H\bHI\bIS\bST\bTF\bFI\bIL\bLE\bES\bSI\bIZ\bZE\bE is unset, or set to null, a non-numeric
value, or a numeric value less than zero, the history file is not trun-
cated.
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 line. These timestamps are optionally dis-
- played depending on the value of the H\bHI\bIS\bST\bTT\bTI\bIM\bME\bEF\bFO\bOR\bRM\bMA\bAT\bT variable. When
- present, history timestamps delimit history entries, making multi-line
+ for the following history line. These timestamps are optionally dis-
+ played depending on the value of the H\bHI\bIS\bST\bTT\bTI\bIM\bME\bEF\bFO\bOR\bRM\bMA\bAT\bT variable. When
+ present, history timestamps delimit history entries, making multi-line
entries possible.
When a shell with history enabled exits, b\bba\bas\bsh\bh copies the last $\b$H\bHI\bIS\bST\bTS\bSI\bIZ\bZE\bE
- entries from the history list to $\b$H\bHI\bIS\bST\bTF\bFI\bIL\bLE\bE. If the h\bhi\bis\bst\bta\bap\bpp\bpe\ben\bnd\bd shell
- option is enabled (see the description of s\bsh\bho\bop\bpt\bt under S\bSH\bHE\bEL\bLL\bL B\bBU\bUI\bIL\bLT\bTI\bIN\bN
- C\bCO\bOM\bMM\bMA\bAN\bND\bDS\bS below), b\bba\bas\bsh\bh appends the entries to the history file, other-
- wise it overwrites the history file. If H\bHI\bIS\bST\bTF\bFI\bIL\bLE\bE is unset or null, or
- if the history file is unwritable, the history is not saved. After
- saving the history, b\bba\bas\bsh\bh truncates the history file to contain no more
+ entries from the history list to $\b$H\bHI\bIS\bST\bTF\bFI\bIL\bLE\bE. If the h\bhi\bis\bst\bta\bap\bpp\bpe\ben\bnd\bd shell
+ option is enabled (see the description of s\bsh\bho\bop\bpt\bt under S\bSH\bHE\bEL\bLL\bL B\bBU\bUI\bIL\bLT\bTI\bIN\bN
+ C\bCO\bOM\bMM\bMA\bAN\bND\bDS\bS below), b\bba\bas\bsh\bh appends the entries to the history file, other-
+ wise it overwrites the history file. If H\bHI\bIS\bST\bTF\bFI\bIL\bLE\bE is unset or null, or
+ if the history file is unwritable, the history is not saved. After
+ saving the history, b\bba\bas\bsh\bh truncates the history file to contain no more
than H\bHI\bIS\bST\bTF\bFI\bIL\bLE\bES\bSI\bIZ\bZE\bE lines as described above.
- If the H\bHI\bIS\bST\bTT\bTI\bIM\bME\bEF\bFO\bOR\bRM\bMA\bAT\bT variable is set, the shell writes the timestamp
- information associated with each history entry to the history file,
- marked with the history comment character, so timestamps are preserved
+ If the H\bHI\bIS\bST\bTT\bTI\bIM\bME\bEF\bFO\bOR\bRM\bMA\bAT\bT variable is set, the shell writes the timestamp
+ information associated with each history entry to the history file,
+ marked with the history comment character, so timestamps are preserved
across shell sessions. This uses the history comment character to dis-
- tinguish timestamps from other history lines. As above, when using
+ tinguish timestamps from other history lines. As above, when using
H\bHI\bIS\bST\bTT\bTI\bIM\bME\bEF\bFO\bOR\bRM\bMA\bAT\bT, the timestamps delimit multi-line history entries.
- The f\bfc\bc builtin command (see S\bSH\bHE\bEL\bLL\bL B\bBU\bUI\bIL\bLT\bTI\bIN\bN C\bCO\bOM\bMM\bMA\bAN\bND\bDS\bS below) will list or
+ The f\bfc\bc builtin command (see S\bSH\bHE\bEL\bLL\bL B\bBU\bUI\bIL\bLT\bTI\bIN\bN C\bCO\bOM\bMM\bMA\bAN\bND\bDS\bS below) will list or
edit and re-execute a portion of the history list. The h\bhi\bis\bst\bto\bor\bry\by builtin
can display or modify the history list and manipulate the history file.
- When using command-line editing, search commands are available in each
+ When using command-line editing, search commands are available in each
editing mode that provide access to the history list.
- The shell allows control over which commands are saved on the history
+ The shell allows control over which commands are saved on the history
list. The H\bHI\bIS\bST\bTC\bCO\bON\bNT\bTR\bRO\bOL\bL and H\bHI\bIS\bST\bTI\bIG\bGN\bNO\bOR\bRE\bE variables are used to save only a
- subset of the commands entered. If the c\bcm\bmd\bdh\bhi\bis\bst\bt shell option is en-
- abled, the shell attempts to save each line of a multi-line command in
- the same history entry, adding semicolons where necessary to preserve
- syntactic correctness. The l\bli\bit\bth\bhi\bis\bst\bt shell option modifies c\bcm\bmd\bdh\bhi\bis\bst\bt by
- saving the command with embedded newlines instead of semicolons. See
+ subset of the commands entered. If the c\bcm\bmd\bdh\bhi\bis\bst\bt shell option is en-
+ abled, the shell attempts to save each line of a multi-line command in
+ the same history entry, adding semicolons where necessary to preserve
+ syntactic correctness. The l\bli\bit\bth\bhi\bis\bst\bt shell option modifies c\bcm\bmd\bdh\bhi\bis\bst\bt by
+ saving the command with embedded newlines instead of semicolons. See
the description of the s\bsh\bho\bop\bpt\bt builtin below under S\bSH\bHE\bEL\bLL\bL B\bBU\bUI\bIL\bLT\bTI\bIN\bN C\bCO\bOM\bMM\bMA\bAN\bND\bDS\bS
for information on setting and unsetting shell options.
H\bHI\bIS\bST\bTO\bOR\bRY\bY E\bEX\bXP\bPA\bAN\bNS\bSI\bIO\bON\bN
- The shell supports a history expansion feature that is similar to the
- history expansion in c\bcs\bsh\bh. This section describes what syntax features
+ The shell supports a history expansion feature that is similar to the
+ history expansion in c\bcs\bsh\bh. This section describes what syntax features
are available.
History expansion is enabled by default for interactive shells, and can
- be disabled using the +\b+H\bH option to the s\bse\bet\bt builtin command (see S\bSH\bHE\bEL\bLL\bL
+ be disabled using the +\b+H\bH option to the s\bse\bet\bt builtin command (see S\bSH\bHE\bEL\bLL\bL
B\bBU\bUI\bIL\bLT\bTI\bIN\bN C\bCO\bOM\bMM\bMA\bAN\bND\bDS\bS below). Non-interactive shells do not perform history
expansion by default, but it can be enabled with "set -H".
History expansions introduce words from the history list into the input
- stream, making it easy to repeat commands, insert the arguments to a
+ stream, making it easy to repeat commands, insert the arguments to a
previous command into the current input line, or fix errors in previous
commands quickly.
- History expansion is performed immediately after a complete line is
- read, before the shell breaks it into words, and is performed on each
- line individually. The shell attempts to inform the history expansion
+ History expansion is performed immediately after a complete line is
+ read, before the shell breaks it into words, and is performed on each
+ line individually. The shell attempts to inform the history expansion
functions about quoting still in effect from previous lines.
- It takes place in two parts. The first is to determine which history
- list entry to use during substitution. The second is to select por-
+ It takes place in two parts. The first is to determine which history
+ list entry to use during substitution. The second is to select por-
tions of that entry to include into the current one.
- The entry selected from the history is the _\be_\bv_\be_\bn_\bt, and the portions of
+ The entry selected from the history is the _\be_\bv_\be_\bn_\bt, and the portions of
that entry that are acted upon are _\bw_\bo_\br_\bd_\bs. Various _\bm_\bo_\bd_\bi_\bf_\bi_\be_\br_\bs are avail-
- able to manipulate the selected words. The entry is split into words
- in the same fashion as when reading input, so that several _\bm_\be_\bt_\ba_\bc_\bh_\ba_\br_\ba_\bc_\b-
- _\bt_\be_\br-separated words surrounded by quotes are considered one word. The
- _\be_\bv_\be_\bn_\bt _\bd_\be_\bs_\bi_\bg_\bn_\ba_\bt_\bo_\br selects the event, the optional _\bw_\bo_\br_\bd _\bd_\be_\bs_\bi_\bg_\bn_\ba_\bt_\bo_\br se-
- lects words from the event, and various optional _\bm_\bo_\bd_\bi_\bf_\bi_\be_\br_\bs are avail-
+ able to manipulate the selected words. The entry is split into words
+ in the same fashion as when reading input, so that several _\bm_\be_\bt_\ba_\bc_\bh_\ba_\br_\ba_\bc_\b-
+ _\bt_\be_\br-separated words surrounded by quotes are considered one word. The
+ _\be_\bv_\be_\bn_\bt _\bd_\be_\bs_\bi_\bg_\bn_\ba_\bt_\bo_\br selects the event, the optional _\bw_\bo_\br_\bd _\bd_\be_\bs_\bi_\bg_\bn_\ba_\bt_\bo_\br se-
+ lects words from the event, and various optional _\bm_\bo_\bd_\bi_\bf_\bi_\be_\br_\bs are avail-
able to manipulate the selected words.
- History expansions are introduced by the appearance of the history ex-
- pansion character, which is !\b! by default. History expansions may ap-
+ History expansions are introduced by the appearance of the history ex-
+ pansion character, which is !\b! by default. History expansions may ap-
pear anywhere in the input, but do not nest.
- Only backslash (\\b\) and single quotes can quote the history expansion
- character, but the history expansion character is also treated as
+ Only backslash (\\b\) and single quotes can quote the history expansion
+ character, but the history expansion character is also treated as
quoted if it immediately precedes the closing double quote in a double-
quoted string.
- Several characters inhibit history expansion if found immediately fol-
- lowing the history expansion character, even if it is unquoted: space,
- tab, newline, carriage return, =\b=, and the other shell metacharacters
+ Several characters inhibit history expansion if found immediately fol-
+ lowing the history expansion character, even if it is unquoted: space,
+ tab, newline, carriage return, =\b=, and the other shell metacharacters
defined above.
There is a special abbreviation for substitution, active when the _\bq_\bu_\bi_\bc_\bk
- _\bs_\bu_\bb_\bs_\bt_\bi_\bt_\bu_\bt_\bi_\bo_\bn character (described above under h\bhi\bis\bst\btc\bch\bha\bar\brs\bs) is the first
+ _\bs_\bu_\bb_\bs_\bt_\bi_\bt_\bu_\bt_\bi_\bo_\bn character (described above under h\bhi\bis\bst\btc\bch\bha\bar\brs\bs) is the first
character on the line. It selects the previous history list entry, us-
- ing an event designator equivalent to !\b!!\b!, and substitutes one string
- for another in that entry. It is described below under E\bEv\bve\ben\bnt\bt D\bDe\bes\bsi\big\bgn\bna\ba-\b-
- t\bto\bor\brs\bs. This is the only history expansion that does not begin with the
+ ing an event designator equivalent to !\b!!\b!, and substitutes one string
+ for another in that entry. It is described below under E\bEv\bve\ben\bnt\bt D\bDe\bes\bsi\big\bgn\bna\ba-\b-
+ t\bto\bor\brs\bs. This is the only history expansion that does not begin with the
history expansion character.
- Several shell options settable with the s\bsh\bho\bop\bpt\bt builtin will modify his-
- tory expansion behavior (see the description of the s\bsh\bho\bop\bpt\bt builtin be-
+ Several shell options settable with the s\bsh\bho\bop\bpt\bt builtin will modify his-
+ tory expansion behavior (see the description of the s\bsh\bho\bop\bpt\bt builtin be-
low).and If the h\bhi\bis\bst\btv\bve\ber\bri\bif\bfy\by shell option is enabled, and r\bre\bea\bad\bdl\bli\bin\bne\be is be-
ing used, history substitutions are not immediately passed to the shell
parser. Instead, the expanded line is reloaded into the r\bre\bea\bad\bdl\bli\bin\bne\be edit-
- ing buffer for further modification. If r\bre\bea\bad\bdl\bli\bin\bne\be is being used, and
- the h\bhi\bis\bst\btr\bre\bee\bed\bdi\bit\bt shell option is enabled, a failed history substitution
+ ing buffer for further modification. If r\bre\bea\bad\bdl\bli\bin\bne\be is being used, and
+ the h\bhi\bis\bst\btr\bre\bee\bed\bdi\bit\bt shell option is enabled, a failed history substitution
is reloaded into the r\bre\bea\bad\bdl\bli\bin\bne\be editing buffer for correction.
- The -\b-p\bp option to the h\bhi\bis\bst\bto\bor\bry\by builtin command shows what a history ex-
- pansion will do before using it. The -\b-s\bs option to the h\bhi\bis\bst\bto\bor\bry\by builtin
- will add commands to the end of the history list without actually exe-
+ The -\b-p\bp option to the h\bhi\bis\bst\bto\bor\bry\by builtin command shows what a history ex-
+ pansion will do before using it. The -\b-s\bs option to the h\bhi\bis\bst\bto\bor\bry\by builtin
+ will add commands to the end of the history list without actually exe-
cuting them, so that they are available for subsequent recall.
- The shell allows control of the various characters used by the history
+ The shell allows control of the various characters used by the history
expansion mechanism (see the description of h\bhi\bis\bst\btc\bch\bha\bar\brs\bs above under S\bSh\bhe\bel\bll\bl
- V\bVa\bar\bri\bia\bab\bbl\ble\bes\bs). The shell uses the history comment character to mark his-
+ V\bVa\bar\bri\bia\bab\bbl\ble\bes\bs). The shell uses the history comment character to mark his-
tory timestamps when writing the history file.
E\bEv\bve\ben\bnt\bt D\bDe\bes\bsi\big\bgn\bna\bat\bto\bor\brs\bs
- An event designator is a reference to an entry in the history list.
+ An event designator is a reference to an entry in the history list.
The event designator consists of the portion of the word beginning with
- the history expansion character and ending with the word designator if
- present, or the end of the word. Unless the reference is absolute,
+ the history expansion character and ending with the word designator if
+ present, or the end of the word. Unless the reference is absolute,
events are relative to the current position in the history list.
- !\b! Start a history substitution, except when followed by a b\bbl\bla\ban\bnk\bk,
- newline, carriage return, =, or, when the e\bex\bxt\btg\bgl\blo\bob\bb shell option
+ !\b! Start a history substitution, except when followed by a b\bbl\bla\ban\bnk\bk,
+ newline, carriage return, =, or, when the e\bex\bxt\btg\bgl\blo\bob\bb shell option
is enabled using the s\bsh\bho\bop\bpt\bt builtin, (.
!\b!_\bn Refer to history list entry _\bn.
!\b!-\b-_\bn Refer to the current entry minus _\bn.
!\b!!\b! Refer to the previous entry. This is a synonym for "!-1".
!\b!_\bs_\bt_\br_\bi_\bn_\bg
- Refer to the most recent command preceding the current position
+ Refer to the most recent command preceding the current position
in the history list starting with _\bs_\bt_\br_\bi_\bn_\bg.
!\b!?\b?_\bs_\bt_\br_\bi_\bn_\bg[\b[?\b?]\b]
- Refer to the most recent command preceding the current position
- in the history list containing _\bs_\bt_\br_\bi_\bn_\bg. The trailing ?\b? may be
- omitted if _\bs_\bt_\br_\bi_\bn_\bg is followed immediately by a newline. If
- _\bs_\bt_\br_\bi_\bn_\bg is missing, this uses the string from the most recent
+ Refer to the most recent command preceding the current position
+ in the history list containing _\bs_\bt_\br_\bi_\bn_\bg. The trailing ?\b? may be
+ omitted if _\bs_\bt_\br_\bi_\bn_\bg is followed immediately by a newline. If
+ _\bs_\bt_\br_\bi_\bn_\bg is missing, this uses the string from the most recent
search; it is an error if there is no previous search string.
^\b^_\bs_\bt_\br_\bi_\bn_\bg_\b1^\b^_\bs_\bt_\br_\bi_\bn_\bg_\b2^\b^
- Quick substitution. Repeat the previous command, replacing
- _\bs_\bt_\br_\bi_\bn_\bg_\b1 with _\bs_\bt_\br_\bi_\bn_\bg_\b2. Equivalent to "!!:s^_\bs_\bt_\br_\bi_\bn_\bg_\b1^_\bs_\bt_\br_\bi_\bn_\bg_\b2^"
+ Quick substitution. Repeat the previous command, replacing
+ _\bs_\bt_\br_\bi_\bn_\bg_\b1 with _\bs_\bt_\br_\bi_\bn_\bg_\b2. Equivalent to "!!:s^_\bs_\bt_\br_\bi_\bn_\bg_\b1^_\bs_\bt_\br_\bi_\bn_\bg_\b2^"
(see M\bMo\bod\bdi\bif\bfi\bie\ber\brs\bs below).
!\b!#\b# The entire command line typed so far.
Word designators are used to select desired words from the event. They
are optional; if the word designator isn't supplied, the history expan-
sion uses the entire event. A :\b: separates the event specification from
- the word designator. It may be omitted if the word designator begins
- with a ^\b^, $\b$, *\b*, -\b-, or %\b%. Words are numbered from the beginning of the
- line, with the first word being denoted by 0 (zero). Words are in-
+ the word designator. It may be omitted if the word designator begins
+ with a ^\b^, $\b$, *\b*, -\b-, or %\b%. Words are numbered from the beginning of the
+ line, with the first word being denoted by 0 (zero). Words are in-
serted into the current line separated by single spaces.
0\b0 (\b(z\bze\ber\bro\bo)\b)
The zeroth word. For the shell, this is the command word.
_\bn The _\bnth word.
^\b^ The first argument: word 1.
- $\b$ The last word. This is usually the last argument, but will ex-
+ $\b$ The last word. This is usually the last argument, but will ex-
pand to the zeroth word if there is only one word in the line.
%\b% The first word matched by the most recent "?_\bs_\bt_\br_\bi_\bn_\bg?" search, if
- the search string begins with a character that is part of a
- word. By default, searches begin at the end of each line and
- proceed to the beginning, so the first word matched is the one
+ the search string begins with a character that is part of a
+ word. By default, searches begin at the end of each line and
+ proceed to the beginning, so the first word matched is the one
closest to the end of the line.
_\bx-\b-_\by A range of words; "-_\by" abbreviates "0-_\by".
- *\b* All of the words but the zeroth. This is a synonym for "_\b1_\b-_\b$".
- It is not an error to use *\b* if there is just one word in the
+ *\b* All of the words but the zeroth. This is a synonym for "_\b1_\b-_\b$".
+ It is not an error to use *\b* if there is just one word in the
event; it expands to the empty string in that case.
x\bx*\b* Abbreviates _\bx_\b-_\b$.
x\bx-\b- Abbreviates _\bx_\b-_\b$ like x\bx*\b*, but omits the last word. If x\bx is miss-
ing, it defaults to 0.
- If a word designator is supplied without an event specification, the
+ If a word designator is supplied without an event specification, the
previous command is used as the event, equivalent to !\b!!\b!.
M\bMo\bod\bdi\bif\bfi\bie\ber\brs\bs
- After the optional word designator, the expansion may include a se-
- quence of one or more of the following modifiers, each preceded by a
- ":". These modify, or edit, the word or words selected from the his-
+ After the optional word designator, the expansion may include a se-
+ quence of one or more of the following modifiers, each preceded by a
+ ":". These modify, or edit, the word or words selected from the his-
tory event.
h\bh Remove a trailing pathname component, leaving only the head.
e\be Remove all but the trailing suffix.
p\bp Print the new command but do not execute it.
q\bq Quote the substituted words, escaping further substitutions.
- x\bx Quote the substituted words as with q\bq, but break into words at
- b\bbl\bla\ban\bnk\bks\bs and newlines. The q\bq and x\bx modifiers are mutually exclu-
+ x\bx Quote the substituted words as with q\bq, but break into words at
+ b\bbl\bla\ban\bnk\bks\bs and newlines. The q\bq and x\bx modifiers are mutually exclu-
sive; expansion uses the last one supplied.
s\bs/\b/_\bo_\bl_\bd/\b/_\bn_\be_\bw/\b/
- Substitute _\bn_\be_\bw for the first occurrence of _\bo_\bl_\bd in the event
+ Substitute _\bn_\be_\bw for the first occurrence of _\bo_\bl_\bd in the event
line. Any character may be used as the delimiter in place of /.
- The final delimiter is optional if it is the last character of
- the event line. A single backslash will quote the delimiter in
- _\bo_\bl_\bd and _\bn_\be_\bw. If & appears in _\bn_\be_\bw, it is replaced with _\bo_\bl_\bd. A
+ The final delimiter is optional if it is the last character of
+ the event line. A single backslash will quote the delimiter in
+ _\bo_\bl_\bd and _\bn_\be_\bw. If & appears in _\bn_\be_\bw, it is replaced with _\bo_\bl_\bd. A
single backslash will quote the &. If _\bo_\bl_\bd is null, it is set to
- the last _\bo_\bl_\bd substituted, or, if no previous history substitu-
- tions took place, the last _\bs_\bt_\br_\bi_\bn_\bg in a !\b!?\b?_\bs_\bt_\br_\bi_\bn_\bg[\b[?\b?]\b] search. If
+ the last _\bo_\bl_\bd substituted, or, if no previous history substitu-
+ tions took place, the last _\bs_\bt_\br_\bi_\bn_\bg in a !\b!?\b?_\bs_\bt_\br_\bi_\bn_\bg[\b[?\b?]\b] search. If
_\bn_\be_\bw is null, each matching _\bo_\bl_\bd is deleted.
&\b& Repeat the previous substitution.
g\bg Cause changes to be applied over the entire event line. This is
- used in conjunction with ":\b:s\bs" (e.g., ":\b:g\bgs\bs/\b/_\bo_\bl_\bd/\b/_\bn_\be_\bw/\b/") or ":\b:&\b&".
- If used with ":\b:s\bs", any delimiter can be used in place of /, and
- the final delimiter is optional if it is the last character of
+ used in conjunction with ":\b:s\bs" (e.g., ":\b:g\bgs\bs/\b/_\bo_\bl_\bd/\b/_\bn_\be_\bw/\b/") or ":\b:&\b&".
+ If used with ":\b:s\bs", any delimiter can be used in place of /, and
+ the final delimiter is optional if it is the last character of
the event line. An a\ba may be used as a synonym for g\bg.
G\bG Apply the following "s\bs" or "&\b&" modifier once to each word in the
event line.
Unless otherwise noted, each builtin command documented in this section
as accepting options preceded by -\b- accepts -\b--\b- to signify the end of the
options. The :\b:, t\btr\bru\bue\be, f\bfa\bal\bls\bse\be, and t\bte\bes\bst\bt/[\b[ builtins do not accept options
- and do not treat -\b--\b- specially. The e\bex\bxi\bit\bt, l\blo\bog\bgo\bou\but\bt, r\bre\bet\btu\bur\brn\bn, b\bbr\bre\bea\bak\bk, c\bco\bon\bn-\b-
- t\bti\bin\bnu\bue\be, l\ble\bet\bt, and s\bsh\bhi\bif\bft\bt builtins accept and process arguments beginning
- with -\b- without requiring -\b--\b-. Other builtins that accept arguments but
- are not specified as accepting options interpret arguments beginning
- with -\b- as invalid options and require -\b--\b- to prevent this interpreta-
+ and do not treat -\b--\b- specially. The e\bex\bxi\bit\bt, l\blo\bog\bgo\bou\but\bt, r\bre\bet\btu\bur\brn\bn, b\bbr\bre\bea\bak\bk, c\bco\bon\bn-\b-
+ t\bti\bin\bnu\bue\be, l\ble\bet\bt, and s\bsh\bhi\bif\bft\bt builtins accept and process arguments beginning
+ with -\b- without requiring -\b--\b-. Other builtins that accept arguments but
+ are not specified as accepting options interpret arguments beginning
+ with -\b- as invalid options and require -\b--\b- to prevent this interpreta-
tion.
:\b: [_\ba_\br_\bg_\bu_\bm_\be_\bn_\bt_\bs]
- No effect; the command does nothing beyond expanding _\ba_\br_\bg_\bu_\bm_\be_\bn_\bt_\bs
+ No effect; the command does nothing beyond expanding _\ba_\br_\bg_\bu_\bm_\be_\bn_\bt_\bs
and performing any specified redirections. The return status is
zero.
.\b. [-\b-p\bp _\bp_\ba_\bt_\bh] _\bf_\bi_\bl_\be_\bn_\ba_\bm_\be [_\ba_\br_\bg_\bu_\bm_\be_\bn_\bt_\bs]
s\bso\bou\bur\brc\bce\be [-\b-p\bp _\bp_\ba_\bt_\bh] _\bf_\bi_\bl_\be_\bn_\ba_\bm_\be [_\ba_\br_\bg_\bu_\bm_\be_\bn_\bt_\bs]
- The .\b. command (s\bso\bou\bur\brc\bce\be) reads and execute commands from _\bf_\bi_\bl_\be_\bn_\ba_\bm_\be
- in the current shell environment and returns the exit status of
+ The .\b. command (s\bso\bou\bur\brc\bce\be) reads and execute commands from _\bf_\bi_\bl_\be_\bn_\ba_\bm_\be
+ in the current shell environment and returns the exit status of
the last command executed from _\bf_\bi_\bl_\be_\bn_\ba_\bm_\be.
If _\bf_\bi_\bl_\be_\bn_\ba_\bm_\be does not contain a slash, .\b. searches for it. If the
- -\b-p\bp option is supplied, .\b. treats _\bp_\ba_\bt_\bh as a colon-separated list
- of directories in which to find _\bf_\bi_\bl_\be_\bn_\ba_\bm_\be; otherwise, .\b. uses the
- entries in P\bPA\bAT\bTH\bH to find the directory containing _\bf_\bi_\bl_\be_\bn_\ba_\bm_\be.
- _\bf_\bi_\bl_\be_\bn_\ba_\bm_\be does not need to be executable. When b\bba\bas\bsh\bh is not in
+ -\b-p\bp option is supplied, .\b. treats _\bp_\ba_\bt_\bh as a colon-separated list
+ of directories in which to find _\bf_\bi_\bl_\be_\bn_\ba_\bm_\be; otherwise, .\b. uses the
+ entries in P\bPA\bAT\bTH\bH to find the directory containing _\bf_\bi_\bl_\be_\bn_\ba_\bm_\be.
+ _\bf_\bi_\bl_\be_\bn_\ba_\bm_\be does not need to be executable. When b\bba\bas\bsh\bh is not in
posix mode, it searches the current directory if _\bf_\bi_\bl_\be_\bn_\ba_\bm_\be is not
- found in P\bPA\bAT\bTH\bH, but does not search the current directory if -\b-p\bp
+ found in P\bPA\bAT\bTH\bH, but does not search the current directory if -\b-p\bp
is supplied. If the s\bso\bou\bur\brc\bce\bep\bpa\bat\bth\bh option to the s\bsh\bho\bop\bpt\bt builtin com-
mand is turned off, .\b. does not search P\bPA\bAT\bTH\bH.
- If any _\ba_\br_\bg_\bu_\bm_\be_\bn_\bt_\bs are supplied, they become the positional para-
- meters when _\bf_\bi_\bl_\be_\bn_\ba_\bm_\be is executed. Otherwise the positional pa-
+ If any _\ba_\br_\bg_\bu_\bm_\be_\bn_\bt_\bs are supplied, they become the positional para-
+ meters when _\bf_\bi_\bl_\be_\bn_\ba_\bm_\be is executed. Otherwise the positional pa-
rameters 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
+ 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 executes. If -\b-T\bT
is not set, and the sourced file changes the D\bDE\bEB\bBU\bUG\bG trap, the new
value persists after .\b. completes. The return status is the sta-
tus of the last command executed from _\bf_\bi_\bl_\be_\bn_\ba_\bm_\be (0 if no commands
- are executed), and non-zero if _\bf_\bi_\bl_\be_\bn_\ba_\bm_\be is not found or cannot
+ are executed), and non-zero 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] ...]
- With no arguments or with the -\b-p\bp option, a\bal\bli\bia\bas\bs prints the list
- of aliases in the form a\bal\bli\bia\bas\bs _\bn_\ba_\bm_\be=_\bv_\ba_\bl_\bu_\be on standard output.
+ With no arguments or with the -\b-p\bp option, a\bal\bli\bia\bas\bs prints the list
+ of aliases in the form a\bal\bli\bia\bas\bs _\bn_\ba_\bm_\be=_\bv_\ba_\bl_\bu_\be on standard output.
When arguments are supplied, define an alias for each _\bn_\ba_\bm_\be whose
- _\bv_\ba_\bl_\bu_\be is given. A trailing space in _\bv_\ba_\bl_\bu_\be causes the next word
- to be checked for alias substitution when the alias is expanded
- during command parsing. For each _\bn_\ba_\bm_\be in the argument list for
- which no _\bv_\ba_\bl_\bu_\be is supplied, print the name and value of the
- alias _\bn_\ba_\bm_\be. a\bal\bli\bia\bas\bs returns true unless a _\bn_\ba_\bm_\be is given (without
+ _\bv_\ba_\bl_\bu_\be is given. A trailing space in _\bv_\ba_\bl_\bu_\be causes the next word
+ to be checked for alias substitution when the alias is expanded
+ during command parsing. For each _\bn_\ba_\bm_\be in the argument list for
+ which no _\bv_\ba_\bl_\bu_\be is supplied, print the name and value of the
+ alias _\bn_\ba_\bm_\be. a\bal\bli\bia\bas\bs returns true unless a _\bn_\ba_\bm_\be is given (without
a corresponding =_\bv_\ba_\bl_\bu_\be) for which no alias has been defined.
b\bbg\bg [_\bj_\bo_\bb_\bs_\bp_\be_\bc ...]
- Resume each suspended job _\bj_\bo_\bb_\bs_\bp_\be_\bc in the background, as if it
- had been started with &\b&. If _\bj_\bo_\bb_\bs_\bp_\be_\bc is not present, the shell
+ Resume each suspended job _\bj_\bo_\bb_\bs_\bp_\be_\bc in the background, as if it
+ had been started with &\b&. If _\bj_\bo_\bb_\bs_\bp_\be_\bc is not present, the shell
uses its notion of the _\bc_\bu_\br_\br_\be_\bn_\bt _\bj_\bo_\bb. b\bbg\bg _\bj_\bo_\bb_\bs_\bp_\be_\bc returns 0 unless
- run when job control is disabled or, when run with job control
- enabled, any specified _\bj_\bo_\bb_\bs_\bp_\be_\bc was not found or was started
+ run when job control is disabled or, when run with job control
+ enabled, any specified _\bj_\bo_\bb_\bs_\bp_\be_\bc was not found or was started
without job control.
b\bbi\bin\bnd\bd [-\b-m\bm _\bk_\be_\by_\bm_\ba_\bp] [-\b-l\bls\bsv\bvS\bSV\bVX\bX]
b\bbi\bin\bnd\bd [-\b-m\bm _\bk_\be_\by_\bm_\ba_\bp] -\b-p\bp|-\b-P\bP [_\br_\be_\ba_\bd_\bl_\bi_\bn_\be_\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:_\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 to a shell command,
- or set a r\bre\bea\bad\bdl\bli\bin\bne\be variable. Each non-option argument is a key
- binding or command as it would appear in a r\bre\bea\bad\bdl\bli\bin\bne\be initializa-
- tion 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'. In the following descriptions, output
- available to be re-read is formatted as commands that would ap-
+ 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 to a shell command,
+ or set a r\bre\bea\bad\bdl\bli\bin\bne\be variable. Each non-option argument is a key
+ binding or command as it would appear in a r\bre\bea\bad\bdl\bli\bin\bne\be initializa-
+ tion 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'. In the following descriptions, output
+ available to be re-read is formatted as commands that would ap-
pear in a r\bre\bea\bad\bdl\bli\bin\bne\be initialization file or that would be supplied
- as individual arguments to a b\bbi\bin\bnd\bd command. Options, if sup-
+ as individual arguments to a b\bbi\bin\bnd\bd command. Options, if sup-
plied, 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
- way that they can be used as an argument to a subsequent
- b\bbi\bin\bnd\bd command or in a r\bre\bea\bad\bdl\bli\bin\bne\be initialization file. If
- arguments remain after option processing, b\bbi\bin\bnd\bd treats
- them as r\bre\bea\bad\bdl\bli\bin\bne\be command names and restricts output to
- those names.
- -\b-P\bP List current r\bre\bea\bad\bdl\bli\bin\bne\be function names and bindings. If
+ -\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 used as an argument to a subsequent
+ b\bbi\bin\bnd\bd command or in a r\bre\bea\bad\bdl\bli\bin\bne\be initialization file. If
arguments remain after option processing, b\bbi\bin\bnd\bd treats
them as r\bre\bea\bad\bdl\bli\bin\bne\be command names and restricts output to
those names.
- -\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 used
+ -\b-P\bP List current r\bre\bea\bad\bdl\bli\bin\bne\be function names and bindings. If
+ arguments remain after option processing, b\bbi\bin\bnd\bd treats
+ them as r\bre\bea\bad\bdl\bli\bin\bne\be command names and restricts output to
+ those names.
+ -\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 used
as an argument to a subsequent b\bbi\bin\bnd\bd command or in a r\bre\bea\bad\bd-\b-
l\bli\bin\bne\be initialization file.
- -\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 used as an argument to a subsequent b\bbi\bin\bnd\bd
command or in a r\bre\bea\bad\bdl\bli\bin\bne\be initialization file.
-\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
Read key bindings from _\bf_\bi_\bl_\be_\bn_\ba_\bm_\be.
-\b-q\bq _\bf_\bu_\bn_\bc_\bt_\bi_\bo_\bn
- Display key sequences that invoke the named r\bre\bea\bad\bdl\bli\bin\bne\be
+ Display key sequences that invoke the named r\bre\bea\bad\bdl\bli\bin\bne\be
_\bf_\bu_\bn_\bc_\bt_\bi_\bo_\bn.
-\b-u\bu _\bf_\bu_\bn_\bc_\bt_\bi_\bo_\bn
- Unbind all key sequences bound to the named r\bre\bea\bad\bdl\bli\bin\bne\be
+ Unbind all key sequences bound to the named r\bre\bea\bad\bdl\bli\bin\bne\be
_\bf_\bu_\bn_\bc_\bt_\bi_\bo_\bn.
-\b-r\br _\bk_\be_\by_\bs_\be_\bq
Remove any current binding for _\bk_\be_\by_\bs_\be_\bq.
-\b-x\bx _\bk_\be_\by_\bs_\be_\bq[\b[:\b: ]\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. The separator between _\bk_\be_\by_\bs_\be_\bq and _\bs_\bh_\be_\bl_\bl_\b-_\bc_\bo_\bm_\bm_\ba_\bn_\bd is
- either whitespace or a colon optionally followed by
- whitespace. If the separator is whitespace, _\bs_\bh_\be_\bl_\bl_\b-_\bc_\bo_\bm_\b-
- _\bm_\ba_\bn_\bd must be enclosed in double quotes and r\bre\bea\bad\bdl\bli\bin\bne\be ex-
- pands any of its special backslash-escapes in _\bs_\bh_\be_\bl_\bl_\b-_\bc_\bo_\bm_\b-
- _\bm_\ba_\bn_\bd before saving it. If the separator is a colon, any
- enclosing double quotes are optional, and r\bre\bea\bad\bdl\bli\bin\bne\be does
- not expand the command string before saving it. Since
- the entire key binding expression must be a single argu-
- ment, it should be enclosed in single quotes. When
- _\bs_\bh_\be_\bl_\bl_\b-_\bc_\bo_\bm_\bm_\ba_\bn_\bd is executed, the shell sets the R\bRE\bEA\bAD\bD-\b-
- L\bLI\bIN\bNE\bE_\b_L\bLI\bIN\bNE\bE variable to the contents of the r\bre\bea\bad\bdl\bli\bin\bne\be line
+ either whitespace or a colon optionally followed by
+ whitespace. If the separator is whitespace, _\bs_\bh_\be_\bl_\bl_\b-_\bc_\bo_\bm_\b-
+ _\bm_\ba_\bn_\bd must be enclosed in double quotes and r\bre\bea\bad\bdl\bli\bin\bne\be ex-
+ pands any of its special backslash-escapes in _\bs_\bh_\be_\bl_\bl_\b-_\bc_\bo_\bm_\b-
+ _\bm_\ba_\bn_\bd before saving it. If the separator is a colon, any
+ enclosing double quotes are optional, and r\bre\bea\bad\bdl\bli\bin\bne\be does
+ not expand the command string before saving it. Since
+ the entire key binding expression must be a single argu-
+ ment, it should be enclosed in single quotes. When
+ _\bs_\bh_\be_\bl_\bl_\b-_\bc_\bo_\bm_\bm_\ba_\bn_\bd is executed, the shell sets the R\bRE\bEA\bAD\bD-\b-
+ L\bLI\bIN\bNE\bE_\b_L\bLI\bIN\bNE\bE variable to the contents of the r\bre\bea\bad\bdl\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. 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
+ 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 an
+ -\b-X\bX List all key sequences bound to shell commands and the
+ associated commands in a format that can be reused as an
argument to a subsequent b\bbi\bin\bnd\bd command.
- The return value is 0 unless an unrecognized option is supplied
+ The return value is 0 unless an unrecognized option is supplied
or an error occurred.
b\bbr\bre\bea\bak\bk [_\bn]
- Exit from within a 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
+ Exit from within a 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, b\bbr\bre\bea\bak\bk exits _\bn enclosing loops. _\bn must be >= 1. If _\bn
- is greater than the number of enclosing loops, all enclosing
+ is greater than the number of enclosing loops, all enclosing
loops are exited. The return value is 0 unless _\bn is not greater
than or equal to 1.
b\bbu\bui\bil\blt\bti\bin\bn _\bs_\bh_\be_\bl_\bl_\b-_\bb_\bu_\bi_\bl_\bt_\bi_\bn [_\ba_\br_\bg_\bu_\bm_\be_\bn_\bt_\bs]
- Execute the specified shell builtin _\bs_\bh_\be_\bl_\bl_\b-_\bb_\bu_\bi_\bl_\bt_\bi_\bn, passing it
- _\ba_\br_\bg_\bu_\bm_\be_\bn_\bt_\bs, and return its exit status. This is useful when
- defining a function whose name is the same as a shell builtin,
- retaining the functionality of the builtin within the function.
- The c\bcd\bd builtin is commonly redefined this way. The return sta-
+ Execute the specified shell builtin _\bs_\bh_\be_\bl_\bl_\b-_\bb_\bu_\bi_\bl_\bt_\bi_\bn, passing it
+ _\ba_\br_\bg_\bu_\bm_\be_\bn_\bt_\bs, and return its exit status. This is useful when
+ defining a function whose name is the same as a shell builtin,
+ retaining the functionality of the builtin within the function.
+ The c\bcd\bd builtin is commonly redefined this way. The return sta-
tus is false if _\bs_\bh_\be_\bl_\bl_\b-_\bb_\bu_\bi_\bl_\bt_\bi_\bn is not a shell builtin command.
c\bca\bal\bll\ble\ber\br [_\be_\bx_\bp_\br]
Returns the context of any active subroutine call (a shell func-
tion or a script executed with the .\b. or s\bso\bou\bur\brc\bce\be builtins).
- Without _\be_\bx_\bp_\br, c\bca\bal\bll\ble\ber\br displays the line number and source file-
- name of the current subroutine call. If a non-negative integer
+ Without _\be_\bx_\bp_\br, c\bca\bal\bll\ble\ber\br displays the line number and source file-
+ name of the current subroutine call. If a non-negative integer
is supplied as _\be_\bx_\bp_\br, c\bca\bal\bll\ble\ber\br displays the line number, subroutine
name, and source file corresponding to that position in the cur-
- rent execution call stack. This extra information may be used,
+ rent execution call stack. This extra information may be used,
for example, to print a stack trace. The current frame is frame
0.
- The return value is 0 unless the shell is not executing a sub-
- routine call or _\be_\bx_\bp_\br does not correspond to a valid position in
+ The return value is 0 unless the shell is not executing a sub-
+ routine call or _\be_\bx_\bp_\br does not correspond to a valid position in
the call stack.
c\bcd\bd [-\b-L\bL] [-@] [_\bd_\bi_\br]
c\bcd\bd -\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 used as _\bd_\bi_\br. The vari-
- able C\bCD\bDP\bPA\bAT\bTH\bH exists, and _\bd_\bi_\br does not begin with a slash (/), c\bcd\bd
+ 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 used as _\bd_\bi_\br. The vari-
+ able C\bCD\bDP\bPA\bAT\bTH\bH exists, and _\bd_\bi_\br does not begin with a slash (/), c\bcd\bd
uses it as a search path: the shell searches each directory name
- in C\bCD\bDP\bPA\bAT\bTH\bH for _\bd_\bi_\br. Alternative 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
+ in C\bCD\bDP\bPA\bAT\bTH\bH for _\bd_\bi_\br. Alternative 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 directory, i.e., ".".
- The -\b-P\bP option causes c\bcd\bd to use the physical directory structure
+ 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 pro-
- cessing instances of _\b._\b. in _\bd_\bi_\br (see also the -\b-P\bP option to the
+ cessing 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 c\bcd\bd to follow symbolic links by resolving
+ The -\b-L\bL option forces c\bcd\bd to follow symbolic links by resolving
the link after processing instances of _\b._\b. in _\bd_\bi_\br. If _\b._\b. appears
- in _\bd_\bi_\br, c\bcd\bd processes it by removing the immediately previous
+ in _\bd_\bi_\br, c\bcd\bd processes it by removing the immediately previous
pathname component from _\bd_\bi_\br, back to a slash or the beginning of
- _\bd_\bi_\br, and verifying that the portion of _\bd_\bi_\br it has processed to
- that point is still a valid directory name after removing the
+ _\bd_\bi_\br, and verifying that the portion of _\bd_\bi_\br it has processed to
+ that point is still a valid directory name after removing the
pathname component. If it is not a valid directory name, c\bcd\bd re-
- turns a non-zero status. If neither -\b-L\bL nor -\b-P\bP is supplied, c\bcd\bd
+ turns a non-zero status. If neither -\b-L\bL nor -\b-P\bP is supplied, c\bcd\bd
behaves as if -\b-L\bL had been supplied.
If the -\b-e\be option is supplied with -\b-P\bP, and c\bcd\bd cannot successfully
- determine the current working directory after a successful di-
+ determine the current working directory after a successful di-
rectory change, it will return a non-zero status.
- On systems that support it, the -\b-@\b@ option presents the extended
+ 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 attempting the
+ An argument of -\b- is converted to $\b$O\bOL\bLD\bDP\bPW\bWD\bD before attempting the
directory change.
- If c\bcd\bd uses a non-empty directory name from C\bCD\bDP\bPA\bAT\bTH\bH,\b, or if -\b- is
- the first argument, and the directory change is successful, c\bcd\bd
+ If c\bcd\bd uses a non-empty directory name from C\bCD\bDP\bPA\bAT\bTH\bH,\b, or if -\b- is
+ the first argument, and the directory change is successful, c\bcd\bd
writes the absolute pathname of the new working directory to the
standard output.
- If the directory change is successful, c\bcd\bd sets the value of the
+ 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
+ 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
+ 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 ...]
- The c\bco\bom\bmm\bma\ban\bnd\bd builtin runs _\bc_\bo_\bm_\bm_\ba_\bn_\bd with _\ba_\br_\bg_\bs suppressing the nor-
+ The c\bco\bom\bmm\bma\ban\bnd\bd builtin runs _\bc_\bo_\bm_\bm_\ba_\bn_\bd with _\ba_\br_\bg_\bs suppressing the nor-
mal shell function lookup for _\bc_\bo_\bm_\bm_\ba_\bn_\bd. Only builtin commands or
- commands found in the P\bPA\bAT\bTH\bH named _\bc_\bo_\bm_\bm_\ba_\bn_\bd are executed. If the
+ commands found in the P\bPA\bAT\bTH\bH named _\bc_\bo_\bm_\bm_\ba_\bn_\bd are executed. If the
-\b-p\bp option is supplied, 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
+ 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 option is supplied, c\bco\bom\bmm\bma\ban\bnd\bd prints a de-
- scription of _\bc_\bo_\bm_\bm_\ba_\bn_\bd. The -\b-v\bv option displays a single word in-
- dicating the command or filename used to invoke _\bc_\bo_\bm_\bm_\ba_\bn_\bd; the -\b-V\bV
+ If either the -\b-V\bV or -\b-v\bv option is supplied, c\bco\bom\bmm\bma\ban\bnd\bd prints a de-
+ scription of _\bc_\bo_\bm_\bm_\ba_\bn_\bd. The -\b-v\bv option displays a single word in-
+ dicating the command or filename used to invoke _\bc_\bo_\bm_\bm_\ba_\bn_\bd; 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 zero if
- _\bc_\bo_\bm_\bm_\ba_\bn_\bd was found, and non-zero if not. If neither option is
- supplied and an error occurred or _\bc_\bo_\bm_\bm_\ba_\bn_\bd cannot be found, the
- exit status is 127. Otherwise, the exit status of the c\bco\bom\bmm\bma\ban\bnd\bd
+ If the -\b-V\bV or -\b-v\bv option is supplied, the exit status is zero if
+ _\bc_\bo_\bm_\bm_\ba_\bn_\bd was found, and non-zero if not. If neither option is
+ supplied and an error occurred or _\bc_\bo_\bm_\bm_\ba_\bn_\bd cannot be found, the
+ exit status is 127. Otherwise, the exit status 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 [-\b-V\bV _\bv_\ba_\br_\bn_\ba_\bm_\be] [_\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
+ 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 exceptions of -\b-p\bp, -\b-r\br, -\b-D\bD, -\b-E\bE, and -\b-I\bI, and write
the matches to the standard output.
- If the -\b-V\bV option is supplied, c\bco\bom\bmp\bpg\bge\ben\bn stores the generated com-
- pletions into the indexed array variable _\bv_\ba_\br_\bn_\ba_\bm_\be instead of
+ If the -\b-V\bV option is supplied, c\bco\bom\bmp\bpg\bge\ben\bn stores the generated com-
+ pletions into the indexed array variable _\bv_\ba_\br_\bn_\ba_\bm_\be instead of
writing them to the standard output.
When using the -\b-F\bF or -\b-C\bC options, the various shell variables set
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,
- only those completions matching _\bw_\bo_\br_\bd will be displayed or
+ tion specification with the same flags. If _\bw_\bo_\br_\bd is specified,
+ only those completions matching _\bw_\bo_\br_\bd will be displayed or
stored.
- 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]
Specify how arguments to each _\bn_\ba_\bm_\be should be completed.
If the -\b-p\bp option is supplied, or if no options or _\bn_\ba_\bm_\bes are sup-
- plied, print existing completion specifications in a way that
+ plied, print existing completion specifications in a way that
allows them to be reused as input. The -\b-r\br option removes a com-
- pletion specification for each _\bn_\ba_\bm_\be, or, if no _\bn_\ba_\bm_\bes are sup-
+ pletion specification for each _\bn_\ba_\bm_\be, or, if no _\bn_\ba_\bm_\bes are sup-
plied, all completion specifications.
- The -\b-D\bD option indicates that other supplied options and actions
- should apply to the "default" command completion; that is, com-
- pletion attempted on a command for which no completion has pre-
- viously been defined. The -\b-E\bE option indicates that other sup-
- plied options and actions should apply to "empty" command com-
- pletion; 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
+ The -\b-D\bD option indicates that other supplied options and actions
+ should apply to the "default" command completion; that is, com-
+ pletion attempted on a command for which no completion has pre-
+ viously been defined. The -\b-E\bE option indicates that other sup-
+ plied options and actions should apply to "empty" command com-
+ pletion; 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 usu-
ally 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 completions only apply to the case
+ 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 completions only apply to the case
specified by the option.
The process of applying these completion specifications when at-
- tempting word completion is described above under P\bPr\bro\bog\bgr\bra\bam\bmm\bma\bab\bbl\ble\be
+ tempting word completion is described above under P\bPr\bro\bog\bgr\bra\bam\bmm\bma\bab\bbl\ble\be
C\bCo\bom\bmp\bpl\ble\bet\bti\bio\bon\bn.
- 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
- -\b-P\bP and -\b-S\bS options) should be quoted to protect them from expan-
+ 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
+ -\b-P\bP and -\b-S\bS options) should be quoted to protect them from expan-
sion before the c\bco\bom\bmp\bpl\ble\bet\bte\be builtin is invoked.
-\b-o\bo _\bc_\bo_\bm_\bp_\b-_\bo_\bp_\bt_\bi_\bo_\bn
- The _\bc_\bo_\bm_\bp_\b-_\bo_\bp_\bt_\bi_\bo_\bn controls several aspects of the comp-
- spec's behavior beyond the simple generation of comple-
+ The _\bc_\bo_\bm_\bp_\b-_\bo_\bp_\bt_\bi_\bo_\bn controls several aspects of the comp-
+ spec's behavior beyond the simple generation of comple-
tions. _\bc_\bo_\bm_\bp_\b-_\bo_\bp_\bt_\bi_\bo_\bn may be one of:
b\bba\bas\bsh\bhd\bde\bef\bfa\bau\bul\blt\bt
Perform the rest of the default b\bba\bas\bsh\bh completions
if the compspec generates no matches.
- d\bde\bef\bfa\bau\bul\blt\bt Use r\bre\bea\bad\bdl\bli\bin\bne\be's default filename completion if
+ d\bde\bef\bfa\bau\bul\blt\bt Use r\bre\bea\bad\bdl\bli\bin\bne\be's default filename completion if
the compspec generates no matches.
d\bdi\bir\brn\bna\bam\bme\bes\bs
- Perform directory name completion if the comp-
+ Perform directory name completion if the comp-
spec generates no matches.
f\bfi\bil\ble\ben\bna\bam\bme\bes\bs
- Tell r\bre\bea\bad\bdl\bli\bin\bne\be that the compspec generates file-
- names, so it can perform any filename-specific
- processing (such as adding a slash to directory
- names, quoting special characters, or suppress-
- ing trailing spaces). This is intended to be
+ Tell r\bre\bea\bad\bdl\bli\bin\bne\be that the compspec generates file-
+ names, so it can perform any filename-specific
+ processing (such as adding a slash to directory
+ names, quoting special characters, or suppress-
+ ing trailing spaces). This is intended to be
used with shell functions.
f\bfu\bul\bll\blq\bqu\buo\bot\bte\be
- Tell r\bre\bea\bad\bdl\bli\bin\bne\be to quote all the completed words
+ Tell r\bre\bea\bad\bdl\bli\bin\bne\be to quote all the completed words
even if they are not filenames.
- n\bno\boq\bqu\buo\bot\bte\be Tell r\bre\bea\bad\bdl\bli\bin\bne\be not to quote the completed words
- if they are filenames (quoting filenames is the
+ n\bno\boq\bqu\buo\bot\bte\be Tell r\bre\bea\bad\bdl\bli\bin\bne\be not to quote the completed words
+ if they are filenames (quoting filenames is the
default).
- n\bno\bos\bso\bor\brt\bt Tell r\bre\bea\bad\bdl\bli\bin\bne\be not to sort the list of possible
+ n\bno\bos\bso\bor\brt\bt Tell r\bre\bea\bad\bdl\bli\bin\bne\be not to sort the list of possible
completions alphabetically.
- n\bno\bos\bsp\bpa\bac\bce\be Tell r\bre\bea\bad\bdl\bli\bin\bne\be not to append a space (the de-
- fault) to words completed at the end of the
+ n\bno\bos\bsp\bpa\bac\bce\be Tell r\bre\bea\bad\bdl\bli\bin\bne\be not to append a space (the de-
+ fault) to words completed at the end of the
line.
p\bpl\blu\bus\bsd\bdi\bir\brs\bs
- After generating any matches defined by the
- compspec, attempt directory name completion and
- add any matches to the results of the other ac-
+ After generating any matches defined by the
+ compspec, attempt directory name completion and
+ add any matches to the results of the other ac-
tions.
-\b-A\bA _\ba_\bc_\bt_\bi_\bo_\bn
- The _\ba_\bc_\bt_\bi_\bo_\bn may be one of the following to generate a
+ The _\ba_\bc_\bt_\bi_\bo_\bn may be one of the following to generate a
list of possible completions:
a\bal\bli\bia\bas\bs Alias names. May also be specified as -\b-a\ba.
a\bar\brr\bra\bay\byv\bva\bar\br
Array variable names.
b\bbi\bin\bnd\bdi\bin\bng\bg R\bRe\bea\bad\bdl\bli\bin\bne\be key binding names.
- b\bbu\bui\bil\blt\bti\bin\bn Names of shell builtin commands. May also be
+ b\bbu\bui\bil\blt\bti\bin\bn Names of shell builtin commands. May also be
specified as -\b-b\bb.
c\bco\bom\bmm\bma\ban\bnd\bd Command names. May also be specified as -\b-c\bc.
d\bdi\bir\bre\bec\bct\bto\bor\bry\by
d\bdi\bis\bsa\bab\bbl\ble\bed\bd
Names of disabled shell builtins.
e\ben\bna\bab\bbl\ble\bed\bd Names of enabled shell builtins.
- e\bex\bxp\bpo\bor\brt\bt Names of exported shell variables. May also be
+ e\bex\bxp\bpo\bor\brt\bt Names of exported shell variables. May also be
specified as -\b-e\be.
f\bfi\bil\ble\be File names. May also be specified as -\b-f\bf.
f\bfu\bun\bnc\bct\bti\bio\bon\bn
h\bhe\bel\blp\bpt\bto\bop\bpi\bic\bc
Help topics as accepted by the h\bhe\bel\blp\bp builtin.
h\bho\bos\bst\btn\bna\bam\bme\be
- Hostnames, as taken from the file specified by
+ Hostnames, as taken from the file specified by
the H\bHO\bOS\bST\bTF\bFI\bIL\bLE\bE shell variable.
- j\bjo\bob\bb Job names, if job control is active. May also
+ j\bjo\bob\bb Job names, if job control is active. May also
be specified as -\b-j\bj.
- k\bke\bey\byw\bwo\bor\brd\bd Shell reserved words. May also be specified as
+ k\bke\bey\byw\bwo\bor\brd\bd Shell reserved words. May also be specified as
-\b-k\bk.
r\bru\bun\bnn\bni\bin\bng\bg Names of running jobs, if job control is active.
s\bse\ber\brv\bvi\bic\bce\be Service names. May also be specified as -\b-s\bs.
- s\bse\bet\bto\bop\bpt\bt Valid arguments for the -\b-o\bo option to the s\bse\bet\bt
+ s\bse\bet\bto\bop\bpt\bt Valid arguments for the -\b-o\bo option to the s\bse\bet\bt
builtin.
- s\bsh\bho\bop\bpt\bt Shell option names as accepted by the s\bsh\bho\bop\bpt\bt
+ s\bsh\bho\bop\bpt\bt Shell option names as accepted by the s\bsh\bho\bop\bpt\bt
builtin.
s\bsi\big\bgn\bna\bal\bl Signal names.
s\bst\bto\bop\bpp\bpe\bed\bd Names of stopped jobs, if job control is active.
Names of all shell variables. May also be spec-
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. Arguments
+ _\bc_\bo_\bm_\bm_\ba_\bn_\bd is executed in a subshell environment, and its
+ 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-
+ the word preceding the word being completed on the cur-
rent command line. When _\bf_\bu_\bn_\bc_\bt_\bi_\bo_\bn finishes, programmable
- completion retrieves the possible completions from the
+ completion retrieves the possible completions 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
- Expand the pathname expansion pattern _\bg_\bl_\bo_\bb_\bp_\ba_\bt to gener-
+ Expand the pathname expansion pattern _\bg_\bl_\bo_\bb_\bp_\ba_\bt to gener-
ate the possible completions.
-\b-P\bP _\bp_\br_\be_\bf_\bi_\bx
- Add _\bp_\br_\be_\bf_\bi_\bx to the beginning of each possible completion
+ Add _\bp_\br_\be_\bf_\bi_\bx to the beginning of each possible completion
after all other options have been applied.
-\b-S\bS _\bs_\bu_\bf_\bf_\bi_\bx
- Append _\bs_\bu_\bf_\bf_\bi_\bx to each possible completion after all
+ Append _\bs_\bu_\bf_\bf_\bi_\bx to each possible completion after all
other options have been applied.
-\b-W\bW _\bw_\bo_\br_\bd_\bl_\bi_\bs_\bt
- Split the _\bw_\bo_\br_\bd_\bl_\bi_\bs_\bt using the characters in the I\bIF\bFS\bS spe-
- cial variable as delimiters, and expand each resulting
- word. Shell quoting is honored within _\bw_\bo_\br_\bd_\bl_\bi_\bs_\bt, in or-
- der 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-
- tant list which match a prefix of the word being com-
+ Split the _\bw_\bo_\br_\bd_\bl_\bi_\bs_\bt using the characters in the I\bIF\bFS\bS spe-
+ cial variable as delimiters, and expand each resulting
+ word. Shell quoting is honored within _\bw_\bo_\br_\bd_\bl_\bi_\bs_\bt, in or-
+ der 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-
+ tant list which match a prefix of the word being com-
pleted.
-\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,
+ The return value is true unless an invalid option is supplied,
an option other than -\b-p\bp, -\b-r\br, -\b-D\bD, -\b-E\bE, or -\b-I\bI is supplied without a
- _\bn_\ba_\bm_\be argument, an attempt is made to remove a completion speci-
+ _\bn_\ba_\bm_\be argument, an attempt is made to remove a completion speci-
fication for a _\bn_\ba_\bm_\be for which no specification exists, or an er-
ror 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 supplied, display the completion
- options 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-
+ supplied. If no _\bo_\bp_\bt_\bi_\bo_\bns are supplied, display the completion
+ options 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 options should apply
- to the "default" command completion; the -\b-E\bE option indicates
+ to the "default" command completion; the -\b-E\bE option indicates
that other supplied options should apply to "empty" command com-
pletion; and the -\b-I\bI option indicates that other supplied options
- should apply to completion on the initial word on the line.
+ should apply to completion on the initial word on the line.
These are determined in the same way as the c\bco\bom\bmp\bpl\ble\bet\bte\be builtin.
If multiple options are supplied, the -\b-D\bD option takes precedence
over -\b-E\bE, and both take precedence over -\b-I\bI.
- 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]
c\bco\bon\bnt\bti\bin\bnu\bue\be resumes 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, b\bba\bas\bsh\bh resumes the _\bnth
- enclosing loop. _\bn must be >= 1. If _\bn is greater than the num-
- ber of enclosing loops, the shell resumes the last enclosing
- loop (the "top-level" loop). The return value is 0 unless _\bn is
+ u\bun\bnt\bti\bil\bl, or s\bse\bel\ble\bec\bct\bt loop. If _\bn is specified, b\bba\bas\bsh\bh resumes the _\bnth
+ enclosing loop. _\bn must be >= 1. If _\bn is greater than the num-
+ ber of enclosing loops, the shell resumes the last enclosing
+ loop (the "top-level" loop). 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
+ Declare variables and/or give them attributes. If no _\bn_\ba_\bm_\bes are
given then display the values of variables or functions. 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
+ 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, d\bde\bec\bcl\bla\bar\bre\be will display
the attributes and values of all variables having the attributes
- specified by the additional options. If no other options are
+ 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 attributes and values
- of all shell variables. The -\b-f\bf option restricts the display to
+ of all shell variables. The -\b-f\bf option restricts the display to
shell functions.
The -\b-F\bF option inhibits 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 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 -\b-f\bf.
- The -\b-g\bg option forces variables to be created or modified at the
+ 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 function.
It is ignored when d\bde\bec\bcl\bla\bar\bre\be is not executed in a shell function.
- 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 vari-
- able with the same _\bn_\ba_\bm_\be at a surrounding scope. If there is no
+ 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 vari-
+ able with the same _\bn_\ba_\bm_\be 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 vari-
- ables with the specified attribute or to give variables attrib-
+ The following options can be used to restrict output to vari-
+ ables with the specified attribute or to give variables attrib-
utes:
- -\b-a\ba Each _\bn_\ba_\bm_\be is an indexed array variable (see A\bAr\brr\bra\bay\bys\bs
+ -\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
+ -\b-A\bA Each _\bn_\ba_\bm_\be is an associative array variable (see A\bAr\brr\bra\bay\bys\bs
above).
-\b-f\bf Each _\bn_\ba_\bm_\be refers to a shell function.
-\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
+ 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
+ -\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 each _\bn_\ba_\bm_\be for export to subsequent commands via the
+ -\b-x\bx Mark each _\bn_\ba_\bm_\be for export to subsequent commands via the
environment.
- Using "+" instead of "-" turns off the specified attribute in-
+ Using "+" instead of "-" turns off the specified attribute in-
stead, with the exceptions that +\b+a\ba and +\b+A\bA may not be used to de-
- stroy array variables and +\b+r\br will not remove the readonly at-
+ stroy array variables and +\b+r\br will not remove the readonly at-
tribute.
- 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 lo-
- cal, as with the l\blo\boc\bca\bal\bl command, unless the -\b-g\bg option is sup-
- plied. 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 com-
- pound assignment syntax to create array variables, additional
+ 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 lo-
+ cal, as with the l\blo\boc\bca\bal\bl command, unless the -\b-g\bg option is sup-
+ plied. 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 com-
+ pound assignment syntax to create array variables, additional
attributes do not take effect until subsequent assignments.
- The return value is 0 unless an invalid option is encountered,
- an attempt is made to define a function using "-f foo=bar". an
+ 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 at-
tempt is made to assign a value to an array variable without us-
- ing the compound assignment syntax (see A\bAr\brr\bra\bay\bys\bs above), one of
+ ing the compound assignment 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 readonly status for a readonly variable, an attempt
- is made to turn off array status for an array variable, or an
+ 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, display the list of currently remembered direc-
- tories. The default display is on a single line with directory
- 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 directory
+ tories. The default display is on a single line with directory
+ 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 directory
in the stack.
Options, if supplied, have the following meanings:
- -\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] [_\bi_\bd ...]
- Without options, remove each _\bi_\bd from the table of active jobs.
- Each _\bi_\bd may be a job specification _\bj_\bo_\bb_\bs_\bp_\be_\bc or a process ID _\bp_\bi_\bd;
+ Without options, remove each _\bi_\bd from the table of active jobs.
+ Each _\bi_\bd may be a job specification _\bj_\bo_\bb_\bs_\bp_\be_\bc or a process ID _\bp_\bi_\bd;
if _\bi_\bd is a _\bp_\bi_\bd, d\bdi\bis\bso\bow\bwn\bn uses the job containing _\bp_\bi_\bd as _\bj_\bo_\bb_\bs_\bp_\be_\bc.
- If the -\b-h\bh option is supplied, d\bdi\bis\bso\bow\bwn\bn does not remove the jobs
- corresponding to each _\bi_\bd from the jobs table, but rather marks
- them so the shell does not send S\bSI\bIG\bGH\bHU\bUP\bP to the job if the shell
+ If the -\b-h\bh option is supplied, d\bdi\bis\bso\bow\bwn\bn does not remove the jobs
+ corresponding to each _\bi_\bd from the jobs table, but rather marks
+ them so the shell does not send S\bSI\bIG\bGH\bHU\bUP\bP to the job if the shell
receives a S\bSI\bIG\bGH\bHU\bUP\bP.
- If no _\bi_\bd is supplied, the -\b-a\ba option means to remove or mark all
+ If no _\bi_\bd is supplied, the -\b-a\ba option means to remove or mark all
jobs; the -\b-r\br option without an _\bi_\bd argument removes or marks run-
- ning jobs. If no _\bi_\bd is supplied, and neither the -\b-a\ba nor the -\b-r\br
+ ning jobs. If no _\bi_\bd is supplied, and neither the -\b-a\ba nor the -\b-r\br
option is supplied, d\bdi\bis\bso\bow\bwn\bn removes or marks the current job.
The return value is 0 unless an _\bi_\bd 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 not printed.
- If the -\b-e\be option is given, e\bec\bch\bho\bo interprets the following back-
+ If the -\b-e\be option is given, e\bec\bch\bho\bo interprets the following back-
slash-escaped characters. The -\b-E\bE option disables interpretation
- of these escape characters, even on systems where they are in-
- terpreted by default. The x\bxp\bpg\bg_\b_e\bec\bch\bho\bo shell option determines
+ of these escape characters, even on systems where they are in-
+ terpreted by default. The x\bxp\bpg\bg_\b_e\bec\bch\bho\bo shell option determines
whether or not e\bec\bch\bho\bo interprets any options and expands these es-
- cape characters. e\bec\bch\bho\bo does not interpret -\b--\b- to mean the end of
+ cape characters. 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 sequences:
\\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\bec\bch\bho\bo writes any unrecognized backslash-escaped characters un-
+ e\bec\bch\bho\bo writes any unrecognized backslash-escaped characters un-
changed.
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
- allows an executable file which has the same name as a shell
- builtin to be executed without specifying a full pathname, even
+ Enable and disable builtin shell commands. Disabling a builtin
+ allows an executable file 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 files.
- If -\b-n\bn is supplied, each _\bn_\ba_\bm_\be is disabled; otherwise, _\bn_\ba_\bm_\bes are
- enabled. For example, to use the t\bte\bes\bst\bt binary found usin g P\bPA\bAT\bTH\bH
+ If -\b-n\bn is supplied, each _\bn_\ba_\bm_\be is disabled; otherwise, _\bn_\ba_\bm_\bes are
+ enabled. For example, to use the t\bte\bes\bst\bt binary found usin g P\bPA\bAT\bTH\bH
instead of the shell builtin version, run "enable -n test".
- If no _\bn_\ba_\bm_\be arguments are supplied, or if the -\b-p\bp option is sup-
+ If no _\bn_\ba_\bm_\be arguments are supplied, or if the -\b-p\bp option is sup-
plied, print a list of shell builtins. With no other option ar-
guments, the list consists of all enabled shell builtins. If -\b-n\bn
- is supplied, print only disabled builtins. If -\b-a\ba is supplied,
- the list printed includes all builtins, with an indication of
+ is supplied, print only disabled builtins. If -\b-a\ba is supplied,
+ the list printed includes all builtins, with an indication of
whether or not each is enabled. The -\b-s\bs option means to restrict
the output to the POSIX _\bs_\bp_\be_\bc_\bi_\ba_\bl builtins.
- The -\b-f\bf option means to load the new builtin command _\bn_\ba_\bm_\be from
+ 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.
If _\bf_\bi_\bl_\be_\bn_\ba_\bm_\be does not contain a slash, B\bBa\bas\bsh\bh 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_\bn_\ba_\bm_\be. The default for
- B\bBA\bAS\bSH\bH_\b_L\bLO\bOA\bAD\bDA\bAB\bBL\bLE\bES\bS_\b_P\bPA\bAT\bTH\bH is system-dependent, and may include "." to
- force a search of the current directory. The -\b-d\bd option will
- delete a builtin previously loaded with -\b-f\bf. If _\b-_\bs is used with
+ 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_\bn_\ba_\bm_\be. The default for
+ B\bBA\bAS\bSH\bH_\b_L\bLO\bOA\bAD\bDA\bAB\bBL\bLE\bES\bS_\b_P\bPA\bAT\bTH\bH is system-dependent, and may include "." to
+ force a search of the current directory. The -\b-d\bd option will
+ delete a builtin previously loaded with -\b-f\bf. If _\b-_\bs is used with
_\b-_\bf, the new builtin becomes a POSIX special builtin.
- If no options are supplied 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
+ If no options are supplied 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
+ 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 ...]
- Concatenate the _\ba_\br_\bgs together into a single command, separating
+ Concatenate the _\ba_\br_\bgs together into a single command, separating
them with spaces. B\bBa\bas\bsh\bh then reads and execute this command, and
- returns its exit status as the return status of e\bev\bva\bal\bl. If there
+ returns its exit status as the return status 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 without creating
- a new process. _\bc_\bo_\bm_\bm_\ba_\bn_\bd cannot be a shell builtin or function.
+ If _\bc_\bo_\bm_\bm_\ba_\bn_\bd is specified, it replaces the shell without creating
+ a new process. _\bc_\bo_\bm_\bm_\ba_\bn_\bd cannot be a shell builtin or function.
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 beginning of the ze-
- roth argument passed to _\bc_\bo_\bm_\bm_\ba_\bn_\bd. This is what _\bl_\bo_\bg_\bi_\bn(1) does.
- The -\b-c\bc option causes _\bc_\bo_\bm_\bm_\ba_\bn_\bd to be executed with an empty envi-
+ roth argument passed to _\bc_\bo_\bm_\bm_\ba_\bn_\bd. This is what _\bl_\bo_\bg_\bi_\bn(1) does.
+ The -\b-c\bc option causes _\bc_\bo_\bm_\bm_\ba_\bn_\bd to be executed with an empty envi-
ronment. 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 cannot 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 a non-zero status. An interactive shell
- returns a non-zero status if the file cannot be executed. A
+ shell exits, unless the e\bex\bxe\bec\bcf\bfa\bai\bil\bl shell option is enabled. In
+ that case, it returns a non-zero status. An interactive shell
+ returns a non-zero status 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 redi-
+ current shell, and the return status is 0. If there is a redi-
rection 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,
- the exit status is that of the last command executed. Any trap
+ Cause the shell to exit with a status of _\bn. If _\bn is omitted,
+ the exit status is that of the last command executed. Any 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[=_\bv_\ba_\bl_\bu_\be]] ...
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
+ 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.
- The -\b-n\bn option unexports, or removes the export attribute, from
- each _\bn_\ba_\bm_\be. If no _\bn_\ba_\bm_\be_\bs are given, or if the -\b-p\bp option is sup-
- plied, e\bex\bxp\bpo\bor\brt\bt prints a list of names of all exported variables
+ The -\b-n\bn option unexports, or removes the export attribute, from
+ each _\bn_\ba_\bm_\be. If no _\bn_\ba_\bm_\be_\bs are given, or if the -\b-p\bp option is sup-
+ plied, e\bex\bxp\bpo\bor\brt\bt prints a list of names of all exported variables
on the standard output.
- e\bex\bxp\bpo\bor\brt\bt allows the value of a variable to be set when it is ex-
+ e\bex\bxp\bpo\bor\brt\bt allows the value of a variable to be set when it is ex-
ported or unexported by following the variable name with =_\bv_\ba_\bl_\bu_\be.
This sets the value of the variable to _\bv_\ba_\bl_\bu_\be while modifying the
- export attribute. 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
+ export attribute. 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 supplied 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
+ 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); oth-
- erwise 0 is equivalent to -1 and -0 is invalid. If _\bl_\ba_\bs_\bt is not
+ erwise 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.
- If the -\b-l\bl option is supplied, the commands are listed on the
- standard output. The -\b-n\bn option suppresses the command numbers
+ If the -\b-l\bl option is supplied, the commands are listed on the
+ standard output. The -\b-n\bn option suppresses the command numbers
when listing. The -\b-r\br option reverses the order of the commands.
- Otherwise, f\bfc\bc invokes the editor named by _\be_\bn_\ba_\bm_\be on a file con-
- taining those commands. If _\be_\bn_\ba_\bm_\be is not supplied, f\bfc\bc uses the
- value of the F\bFC\bCE\bED\bDI\bIT\bT variable, 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, f\bfc\bc uses _\bv_\bi_\b. When edit-
- ing is complete, f\bfc\bc reads the file containing the edited com-
+ Otherwise, f\bfc\bc invokes the editor named by _\be_\bn_\ba_\bm_\be on a file con-
+ taining those commands. If _\be_\bn_\ba_\bm_\be is not supplied, f\bfc\bc uses the
+ value of the F\bFC\bCE\bED\bDI\bIT\bT variable, 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, f\bfc\bc uses _\bv_\bi_\b. When edit-
+ ing is complete, f\bfc\bc reads the file containing the edited com-
mands and echoes and executes them.
- In the second form, f\bfc\bc re-executes _\bc_\bo_\bm_\bm_\ba_\bn_\bd after replacing each
- instance of _\bp_\ba_\bt with _\br_\be_\bp. _\bC_\bo_\bm_\bm_\ba_\bn_\bd is interpreted the same as
+ In the second form, f\bfc\bc re-executes _\bc_\bo_\bm_\bm_\ba_\bn_\bd after replacing each
+ instance of _\bp_\ba_\bt with _\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 f\bfc\bc is "r="fc -s"", so that typing "r
+ A useful alias to use with f\bfc\bc 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 zero unless an
- invalid option is encountered or _\bf_\bi_\br_\bs_\bt or _\bl_\ba_\bs_\bt specify history
- lines out of range. When editing and re-executing a file of
+ If the first form is used, the return value is zero unless an
+ invalid option is encountered or _\bf_\bi_\br_\bs_\bt or _\bl_\ba_\bs_\bt specify history
+ lines out of range. When editing and re-executing a file of
commands, the return value is the value of the last command exe-
cuted or failure if an error occurs with the temporary file. If
the second form is used, the return status is that of the re-ex-
- ecuted command, unless _\bc_\bm_\bd does not specify a valid history en-
+ ecuted command, unless _\bc_\bm_\bd does not specify a valid history en-
try, in which case f\bfc\bc returns a non-zero status.
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.
- If _\bj_\bo_\bb_\bs_\bp_\be_\bc is not present, f\bfg\bg uses the shell's notion of the
- _\bc_\bu_\br_\br_\be_\bn_\bt _\bj_\bo_\bb. The return value is that of the command placed
- into the foreground, or failure if run when job control is dis-
+ 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, f\bfg\bg uses the shell's notion of the
+ _\bc_\bu_\br_\br_\be_\bn_\bt _\bj_\bo_\bb. The return value is that of the command placed
+ into the foreground, or failure if run when job control is dis-
abled or, when run with job control enabled, if _\bj_\bo_\bb_\bs_\bp_\be_\bc does not
- specify a valid job or _\bj_\bo_\bb_\bs_\bp_\be_\bc specifies a job that was started
+ specify 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 ...]
- g\bge\bet\bto\bop\bpt\bts\bs is used by shell scripts and functions to parse posi-
- tional parameters and obtain options and their arguments. _\bo_\bp_\bt_\b-
- _\bs_\bt_\br_\bi_\bn_\bg contains the option characters to be recognized; if a
+ g\bge\bet\bto\bop\bpt\bts\bs is used by shell scripts and functions to parse posi-
+ tional parameters and obtain options and their arguments. _\bo_\bp_\bt_\b-
+ _\bs_\bt_\br_\bi_\bn_\bg contains the option characters to be recognized; if a
character is followed by a colon, the option is expected to have
- an argument, which should be separated from it by white space.
+ 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
+ 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 option requires an argument,
+ 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 option 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 manu-
- ally reset between multiple calls to g\bge\bet\bto\bop\bpt\bts\bs within the same
+ The shell does not reset O\bOP\bPT\bTI\bIN\bND\bD automatically; it must be manu-
+ ally reset between multiple calls to g\bge\bet\bto\bop\bpt\bts\bs within the same
shell invocation to use a new set of parameters.
- When it reaches the end of options, g\bge\bet\bto\bop\bpt\bts\bs exits with a return
- value greater than zero. O\bOP\bPT\bTI\bIN\bND\bD is set to the index of the
+ When it reaches the end of options, g\bge\bet\bto\bop\bpt\bts\bs exits with a return
+ 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, g\bge\bet\bto\bop\bpt\bts\bs uses _\bs_\bi_\bl_\be_\bn_\bt error reporting.
- In normal operation, g\bge\bet\bto\bop\bpt\bts\bs prints diagnostic messages when it
- encounters invalid options or missing option arguments. 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, g\bge\bet\bto\bop\bpt\bts\bs uses _\bs_\bi_\bl_\be_\bn_\bt error reporting.
+ In normal operation, g\bge\bet\bto\bop\bpt\bts\bs prints diagnostic messages when it
+ encounters invalid options or missing option arguments. 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 g\bge\bet\bto\bop\bpt\bts\bs detects an invalid option, it 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, it assigns the option character found to O\bOP\bP-\b-
+ 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, it assigns the option character found to O\bOP\bP-\b-
T\bTA\bAR\bRG\bG and does not print a diagnostic message.
- If a required argument is not found, and g\bge\bet\bto\bop\bpt\bts\bs is not silent,
+ If a required argument is not found, and g\bge\bet\bto\bop\bpt\bts\bs is not silent,
it sets the value of _\bn_\ba_\bm_\be to a question mark (?\b?), unsets O\bOP\bPT\bTA\bAR\bRG\bG,
- and prints a diagnostic message. If g\bge\bet\bto\bop\bpt\bts\bs is silent, it sets
- the value of _\bn_\ba_\bm_\be to a colon (:\b:) and sets O\bOP\bPT\bTA\bAR\bRG\bG to the option
+ and prints a diagnostic message. If g\bge\bet\bto\bop\bpt\bts\bs is silent, it sets
+ the value of _\bn_\ba_\bm_\be to a colon (:\b:) and sets O\bOP\bPT\bTA\bAR\bRG\bG 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, it remembers the full pathname of the
- command _\bn_\ba_\bm_\be as determined by searching the directories in
- $\b$P\bPA\bAT\bTH\bH. Any previously-remembered pathname associated with _\bn_\ba_\bm_\be
- is discarded. If the -\b-p\bp option is supplied, h\bha\bas\bsh\bh uses _\bf_\bi_\bl_\be_\bn_\ba_\bm_\be
+ command _\bn_\ba_\bm_\be as determined by searching the directories in
+ $\b$P\bPA\bAT\bTH\bH. Any previously-remembered pathname associated with _\bn_\ba_\bm_\be
+ is discarded. If the -\b-p\bp option is supplied, h\bha\bas\bsh\bh uses _\bf_\bi_\bl_\be_\bn_\ba_\bm_\be
as the full pathname of the command.
- The -\b-r\br option causes the shell to forget all remembered loca-
- tions. Assigning to the P\bPA\bAT\bTH\bH variable also clears all hashed
- filenames. The -\b-d\bd option causes the shell to forget the remem-
+ The -\b-r\br option causes the shell to forget all remembered loca-
+ tions. Assigning to the P\bPA\bAT\bTH\bH variable also clears all hashed
+ filenames. The -\b-d\bd option causes the shell to forget the remem-
bered location of each _\bn_\ba_\bm_\be.
If the -\b-t\bt option is supplied, h\bha\bas\bsh\bh prints the full pathname cor-
- responding to each _\bn_\ba_\bm_\be. If multiple _\bn_\ba_\bm_\be arguments are sup-
- plied with -\b-t\bt, h\bha\bas\bsh\bh prints the _\bn_\ba_\bm_\be before the corresponding
+ responding to each _\bn_\ba_\bm_\be. If multiple _\bn_\ba_\bm_\be arguments are sup-
+ plied with -\b-t\bt, h\bha\bas\bsh\bh prints the _\bn_\ba_\bm_\be before the corresponding
hashed full pathname. The -\b-l\bl option displays output in a format
that may be reused as input.
- If no arguments are given, or if only -\b-l\bl is supplied, h\bha\bas\bsh\bh
- prints information about remembered commands. The -\b-t\bt, -\b-d\bd, and
- -\b-p\bp options (the options that act on the _\bn_\ba_\bm_\be arguments) are mu-
+ If no arguments are given, or if only -\b-l\bl is supplied, h\bha\bas\bsh\bh
+ prints information about remembered commands. The -\b-t\bt, -\b-d\bd, and
+ -\b-p\bp options (the options that act on the _\bn_\ba_\bm_\be arguments) are mu-
tually exclusive. Only one will be active. If more than one is
- supplied, -\b-t\bt has higher priority than -\b-p\bp, and both have higher
+ supplied, -\b-t\bt has higher priority than -\b-p\bp, and both have higher
priority than -\b-d\bd.
- The return status is zero unless a _\bn_\ba_\bm_\be is not found or an in-
+ The return status is zero unless a _\bn_\ba_\bm_\be is not found or an in-
valid 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 it displays a list of all the builtins and
+ 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 it displays a list of all the builtins and
shell compound commands.
-\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-a\ban\bnr\brw\bw [_\bf_\bi_\bl_\be_\bn_\ba_\bm_\be]
h\bhi\bis\bst\bto\bor\bry\by -\b-p\bp _\ba_\br_\bg [_\ba_\br_\bg ...]
h\bhi\bis\bst\bto\bor\bry\by -\b-s\bs _\ba_\br_\bg [_\ba_\br_\bg ...]
- With no options, display the command history list with numbers.
- Entries prefixed with a *\b* have been modified. An argument of _\bn
- lists only the last _\bn entries. 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. If h\bhi\bis\bst\bto\bor\bry\by uses H\bHI\bIS\bST\bTT\bTI\bIM\bME\bEF\bFO\bOR\bRM\bMA\bAT\bT, it does
- not print an intervening space between the formatted time stamp
+ With no options, display the command history list with numbers.
+ Entries prefixed with a *\b* have been modified. An argument of _\bn
+ lists only the last _\bn entries. 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. If h\bhi\bis\bst\bto\bor\bry\by uses H\bHI\bIS\bST\bTT\bTI\bIM\bME\bEF\bFO\bOR\bRM\bMA\bAT\bT, it does
+ not print an intervening space between the formatted time stamp
and the history entry.
If _\bf_\bi_\bl_\be_\bn_\ba_\bm_\be is supplied, h\bhi\bis\bst\bto\bor\bry\by uses it as the name of the his-
- tory file; if not, it uses the value of H\bHI\bIS\bST\bTF\bFI\bIL\bLE\bE. If _\bf_\bi_\bl_\be_\bn_\ba_\bm_\be
- is not supplied and H\bHI\bIS\bST\bTF\bFI\bIL\bLE\bE is unset or null, the -\b-a\ba,\b, -\b-n\bn,\b, -\b-r\br,\b,
+ tory file; if not, it uses the value of H\bHI\bIS\bST\bTF\bFI\bIL\bLE\bE. If _\bf_\bi_\bl_\be_\bn_\ba_\bm_\be
+ is not supplied and H\bHI\bIS\bST\bTF\bFI\bIL\bLE\bE is unset or null, the -\b-a\ba,\b, -\b-n\bn,\b, -\b-r\br,\b,
and -\b-w\bw options have no effect.
Options, if supplied, have the following meanings:
can be used with the other options to replace the history
list.
-\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 range of history entries between positions
- _\bs_\bt_\ba_\br_\bt and _\be_\bn_\bd, inclusive. Positive and negative values
+ 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
+ -\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
+ -\b-n\bn Read the history lines not already read from the history
file and add them to the current history list. These are
lines appended to the history file since the beginning of
the current b\bba\bas\bsh\bh session.
rent history list.
-\b-w\bw Write the current history list to the history file, over-
writing the history file.
- -\b-p\bp Perform history substitution on the following _\ba_\br_\bg_\bs and
- display the result on the standard output, without stor-
- ing 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, without stor-
+ ing 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
adding the _\ba_\br_\bg_\bs.
- If the H\bHI\bIS\bST\bTT\bTI\bIM\bME\bEF\bFO\bOR\bRM\bMA\bAT\bT variable is set, h\bhi\bis\bst\bto\bor\bry\by writes the time
+ If the H\bHI\bIS\bST\bTT\bTI\bIM\bME\bEF\bFO\bOR\bRM\bMA\bAT\bT variable is set, h\bhi\bis\bst\bto\bor\bry\by writes the time
stamp information associated with each history entry to the his-
- tory file, marked with the history comment character as de-
- scribed above. 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
+ tory file, marked with the history comment character as de-
+ scribed above. 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
+ 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 or range is supplied as an argument to -\b-d\bd, or the
history expansion supplied as an argument to -\b-p\bp fails.
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 supplied, j\bjo\bob\bbs\bs restricts output to information
+ If _\bj_\bo_\bb_\bs_\bp_\be_\bc is supplied, j\bjo\bob\bbs\bs restricts output 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.
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] _\bi_\bd [ ... ]
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 specified by _\bs_\bi_\bg_\bs_\bp_\be_\bc or _\bs_\bi_\bg_\bn_\bu_\bm to the processes
+ Send the signal specified by _\bs_\bi_\bg_\bs_\bp_\be_\bc or _\bs_\bi_\bg_\bn_\bu_\bm to the processes
named by each _\bi_\bd. Each _\bi_\bd may be a job specification _\bj_\bo_\bb_\bs_\bp_\be_\bc or
- a process ID _\bp_\bi_\bd. _\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 sig-
- nal number; _\bs_\bi_\bg_\bn_\bu_\bm is a signal number. If _\bs_\bi_\bg_\bs_\bp_\be_\bc is not sup-
+ a process ID _\bp_\bi_\bd. _\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 sig-
+ nal number; _\bs_\bi_\bg_\bn_\bu_\bm is a signal number. If _\bs_\bi_\bg_\bs_\bp_\be_\bc is not sup-
plied, then k\bki\bil\bll\bl sends S\bSI\bIG\bGT\bTE\bER\bRM\bM.
The -\b-l\bl option lists the signal names. If any arguments are sup-
plied when -\b-l\bl is given, k\bki\bil\bll\bl lists the names of the signals cor-
- responding to the arguments, 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 sig-
- nal number or the exit status of a process terminated by a sig-
- nal; if it is supplied, k\bki\bil\bll\bl prints the name of the signal that
+ responding to the arguments, 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 sig-
+ nal number or the exit status of a process terminated by a sig-
+ nal; if it is supplied, k\bki\bil\bll\bl prints the name of the signal that
caused the process to terminate. k\bki\bil\bll\bl assumes that process exit
statuses are greater than 128; anything less than that is a sig-
nal number. 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,
+ k\bki\bil\bll\bl returns true if at least one signal was successfully sent,
or false if an error occurs or an invalid option is encountered.
l\ble\bet\bt _\ba_\br_\bg [_\ba_\br_\bg ...]
- Each _\ba_\br_\bg is evaluated as an arithmetic expression (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
+ Each _\ba_\br_\bg is evaluated as an arithmetic expression (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; otherwise l\ble\bet\bt returns 0.
l\blo\boc\bca\bal\bl [_\bo_\bp_\bt_\bi_\bo_\bn] [_\bn_\ba_\bm_\be[=_\bv_\ba_\bl_\bu_\be] ... | - ]
For each argument, create a local variable named _\bn_\ba_\bm_\be and assign
- it _\bv_\ba_\bl_\bu_\be. The _\bo_\bp_\bt_\bi_\bo_\bn can be any of the options accepted by d\bde\be-\b-
- c\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. It is an error to use l\blo\boc\bca\bal\bl when not
+ it _\bv_\ba_\bl_\bu_\be. The _\bo_\bp_\bt_\bi_\bo_\bn can be any of the options accepted by d\bde\be-\b-
+ c\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. It is an error to use l\blo\boc\bca\bal\bl when not
within a function.
- If _\bn_\ba_\bm_\be is -, it makes the set of shell options local to the
- function in which l\blo\boc\bca\bal\bl is invoked: any shell options changed
- using the s\bse\bet\bt builtin inside the function after the call to l\blo\bo-\b-
- c\bca\bal\bl are restored to their original values when the function re-
- turns. The restore is performed as if a series of s\bse\bet\bt commands
- were executed to restore the values that were in place before
+ If _\bn_\ba_\bm_\be is -, it makes the set of shell options local to the
+ function in which l\blo\boc\bca\bal\bl is invoked: any shell options changed
+ using the s\bse\bet\bt builtin inside the function after the call to l\blo\bo-\b-
+ c\bca\bal\bl are restored to their original values when the function re-
+ turns. The restore is performed as if a series of s\bse\bet\bt commands
+ were executed to restore the values that were in place before
the function.
- With no operands, l\blo\boc\bca\bal\bl writes a list of local variables to the
+ With no operands, l\blo\boc\bca\bal\bl writes a list of local variables to the
standard output.
- The return status is 0 unless l\blo\boc\bca\bal\bl is used outside 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 [\b[_\bn]\b]
- Exit a login shell, returning a status of _\bn to the shell's par-
+ Exit a login shell, returning a status of _\bn to the shell's par-
ent.
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, or from file descriptor _\bf_\bd
- if the -\b-u\bu option is supplied, into the indexed array variable
- _\ba_\br_\br_\ba_\by. 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, or from file descriptor _\bf_\bd
+ if the -\b-u\bu option is supplied, into the indexed array variable
+ _\ba_\br_\br_\ba_\by. 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 Use the first character of _\bd_\be_\bl_\bi_\bm to terminate each input
+ -\b-d\bd Use the first character of _\bd_\be_\bl_\bi_\bm 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 charac-
ter.
-\b-n\bn Copy at most _\bc_\bo_\bu_\bn_\bt lines. If _\bc_\bo_\bu_\bn_\bt is 0, copy all lines.
- -\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 zero 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
+ 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]
- Remove entries from the directory stack. The elements are num-
- bered from 0 starting at the first directory listed by d\bdi\bir\brs\bs, so
- p\bpo\bop\bpd\bd is equivalent to "popd +0." With no arguments, p\bpo\bop\bpd\bd re-
- moves the top directory from the stack, and changes to the new
+ Remove entries from the directory stack. The elements are num-
+ bered from 0 starting at the first directory listed by d\bdi\bir\brs\bs, so
+ p\bpo\bop\bpd\bd is equivalent to "popd +0." With no arguments, p\bpo\bop\bpd\bd re-
+ moves the top directory from the stack, and changes to the new
top directory. Arguments, if supplied, have the following mean-
ings:
-\b-n\bn Suppress the normal change of directory when removing di-
rectories from the stack, only manipulate the stack.
- +\b+_\bn Remove the _\bnth entry counting from the left of the list
- shown by d\bdi\bir\brs\bs, starting with zero, from the stack. For
+ +\b+_\bn Remove the _\bnth entry counting from the left of the list
+ 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 Remove 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
+ -\b-_\bn Remove 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
last.
- 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
+ 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 supplied,
- the directory stack is empty, or _\bn specifies a non-existent di-
+ Otherwise, p\bpo\bop\bpd\bd returns false if an invalid option is supplied,
+ the directory stack is empty, or _\bn specifies a non-existent di-
rectory stack entry.
- If the p\bpo\bop\bpd\bd command is successful, b\bba\bas\bsh\bh runs d\bdi\bir\brs\bs to show the
- final contents of the directory stack, and the return status is
+ If the p\bpo\bop\bpd\bd command is successful, b\bba\bas\bsh\bh 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
- control of the _\bf_\bo_\br_\bm_\ba_\bt. The -\b-v\bv option assigns the output to the
+ Write the formatted _\ba_\br_\bg_\bu_\bm_\be_\bn_\bt_\bs to the standard output under the
+ control of the _\bf_\bo_\br_\bm_\ba_\bt. The -\b-v\bv option assigns the output to the
variable _\bv_\ba_\br rather than printing it to the standard output.
- The _\bf_\bo_\br_\bm_\ba_\bt is a character string which contains three types of
- objects: plain characters, which are simply copied to standard
- output, character escape sequences, which are converted and
- copied to the standard output, and format specifications, each
- of which causes printing of the next successive _\ba_\br_\bg_\bu_\bm_\be_\bn_\bt. In
- addition to the standard _\bp_\br_\bi_\bn_\bt_\bf(3) format characters c\bcC\bCs\bsS\bS-\b-
+ The _\bf_\bo_\br_\bm_\ba_\bt is a character string which contains three types of
+ objects: plain characters, which are simply copied to standard
+ output, character escape sequences, which are converted and
+ copied to the standard output, and format specifications, each
+ of which causes printing of the next successive _\ba_\br_\bg_\bu_\bm_\be_\bn_\bt. In
+ addition to the standard _\bp_\br_\bi_\bn_\bt_\bf(3) format characters c\bcC\bCs\bsS\bS-\b-
n\bnd\bdi\bio\bou\bux\bxX\bXe\beE\bEf\bfF\bFg\bgG\bGa\baA\bA, p\bpr\bri\bin\bnt\btf\bf interprets the following additional for-
mat specifiers:
%\b%b\bb causes p\bpr\bri\bin\bnt\btf\bf to expand backslash escape sequences in 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 and %\b%Q\bQ use
- the $\b$'\b''\b' quoting style if any characters in the argument
- string require it, and backslash quoting otherwise. If
- the format string uses the _\bp_\br_\bi_\bn_\bt_\bf alternate form, these
+ %\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 and %\b%Q\bQ use
+ the $\b$'\b''\b' quoting style if any characters in the argument
+ string require it, and backslash quoting otherwise. If
+ the format string uses the _\bp_\br_\bi_\bn_\bt_\bf alternate form, these
two formats quote the argument string using single
quotes.
- %\b%Q\bQ like %\b%q\bq, but applies any supplied precision to the _\ba_\br_\bg_\bu_\b-
+ %\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. This format specifier
recognizes two special argument values: -1 represents the
- current time, and -2 represents the time the shell was
+ current time, and -2 represents the time the shell was
invoked. If no argument is specified, conversion behaves
- as if -1 had been supplied. This is an exception to the
+ as if -1 had been supplied. This is an exception to the
usual p\bpr\bri\bin\bnt\btf\bf behavior.
The %b, %q, and %T format specifiers all use the field width and
precision arguments from the format specification and write that
- many bytes from (or use that wide a field for) the expanded ar-
- gument, which usually contains more characters than the origi-
+ many bytes from (or use that wide a field for) the expanded ar-
+ gument, which usually contains more characters than the origi-
nal.
The %n format specifier accepts a corresponding argument that is
treated as a shell variable name.
- The %s and %c format specifiers accept an l (long) modifier,
+ The %s and %c format specifiers accept an l (long) modifier,
which forces them to convert the argument string to a wide-char-
acter string and apply any supplied field width and precision in
terms of characters, not bytes. The %S and %C format specifiers
are equivalent to %ls and %lc, respectively.
- 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
- is the numeric value of the following character, using the cur-
+ if the leading character is a single or double quote, the value
+ is the numeric value of the following character, using the cur-
rent locale.
- 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
- value is zero on success, non-zero if an invalid option is sup-
+ 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 if an invalid option is sup-
plied or a write or assignment error occurs.
p\bpu\bus\bsh\bhd\bd [-\b-n\bn] [+_\bn] [-_\bn]
p\bpu\bus\bsh\bhd\bd [-\b-n\bn] [_\bd_\bi_\br]
Add a directory to the top of the directory stack, or rotate the
- stack, making the new top of the stack the current working di-
- rectory. With no arguments, p\bpu\bus\bsh\bhd\bd exchanges the top two ele-
- ments of the directory stack. Arguments, if supplied, have the
+ stack, making the new top of the stack the current working di-
+ rectory. 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 Suppress the normal change of directory when rotating or
- adding directories to the stack, only manipulate the
+ -\b-n\bn Suppress the normal change of directory when rotating or
+ adding directories to the stack, only manipulate the
stack.
+\b+_\bn Rotate the stack so that the _\bnth directory (counting from
- the left of the list shown by d\bdi\bir\brs\bs, starting with zero)
+ 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.
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
+ 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.
- Otherwise, if no arguments are supplied, p\bpu\bus\bsh\bhd\bd returns zero un-
- less the directory stack is empty. When rotating the directory
+ Otherwise, if no arguments are supplied, p\bpu\bus\bsh\bhd\bd returns zero un-
+ less the directory stack is empty. When rotating the directory
stack, p\bpu\bus\bsh\bhd\bd returns zero unless the directory stack is empty or
_\bn specifies a non-existent directory stack element.
- If the p\bpu\bus\bsh\bhd\bd command is successful, b\bba\bas\bsh\bh runs d\bdi\bir\brs\bs to show the
+ If the p\bpu\bus\bsh\bhd\bd command is successful, b\bba\bas\bsh\bh 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\bEe\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 ...]
Read one line from the standard input, or from the file descrip-
- tor _\bf_\bd supplied as an argument to the -\b-u\bu option, split it into
- words as described above under W\bWo\bor\brd\bd S\bSp\bpl\bli\bit\btt\bti\bin\bng\bg, and assign the
- first word 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 re-
- maining 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 the value of the I\bIF\bFS\bS variable are used
+ tor _\bf_\bd supplied as an argument to the -\b-u\bu option, split it into
+ words as described above under W\bWo\bor\brd\bd S\bSp\bpl\bli\bit\btt\bti\bin\bng\bg, and assign the
+ first word 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 re-
+ maining 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 the value of the I\bIF\bFS\bS variable are used
to split the line into words using the same rules the shell uses
for expansion (described above under W\bWo\bor\brd\bd S\bSp\bpl\bli\bit\btt\bti\bin\bng\bg). The back-
- slash character (\\b\) removes any special meaning for the next
+ slash character (\\b\) removes any special meaning for the next
character read and is used 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 terminates the input line,
- rather than newline. If _\bd_\be_\bl_\bi_\bm is the empty string, r\bre\bea\bad\bd
+ The first character of _\bd_\be_\bl_\bi_\bm terminates the input 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\bd
- uses r\bre\bea\bad\bdl\bli\bin\bne\be (see R\bRE\bEA\bAD\bDL\bLI\bIN\bNE\bE above) to obtain the line.
- R\bRe\bea\bad\bdl\bli\bin\bne\be uses the current (or default, if line editing
- was not previously active) editing settings, but uses
+ -\b-e\be If the standard input is coming from a terminal, r\bre\bea\bad\bd
+ uses r\bre\bea\bad\bdl\bli\bin\bne\be (see R\bRE\bEA\bAD\bDL\bLI\bIN\bNE\bE above) to obtain the line.
+ R\bRe\bea\bad\bdl\bli\bin\bne\be uses the current (or default, if line editing
+ was not previously active) editing settings, but uses
r\bre\bea\bad\bdl\bli\bin\bne\be's default filename completion.
- -\b-E\bE If the standard input is coming from a terminal, r\bre\bea\bad\bd
- uses r\bre\bea\bad\bdl\bli\bin\bne\be (see R\bRE\bEA\bAD\bDL\bLI\bIN\bNE\bE above) to obtain the line.
- R\bRe\bea\bad\bdl\bli\bin\bne\be uses the current (or default, if line editing
- was not previously active) editing settings, but uses
+ -\b-E\bE If the standard input is coming from a terminal, r\bre\bea\bad\bd
+ uses r\bre\bea\bad\bdl\bli\bin\bne\be (see R\bRE\bEA\bAD\bDL\bLI\bIN\bNE\bE above) to obtain the line.
+ R\bRe\bea\bad\bdl\bli\bin\bne\be uses the current (or default, if line editing
+ was not previously active) editing settings, but uses
bash's default completion, including programmable comple-
tion.
-\b-i\bi _\bt_\be_\bx_\bt
- If r\bre\bea\bad\bdl\bli\bin\bne\be is being used to read the line, r\bre\bea\bad\bd places
+ If r\bre\bea\bad\bdl\bli\bin\bne\be is being used to read the line, r\bre\bea\bad\bd places
_\bt_\be_\bx_\bt 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
- waiting for a complete line of input, unless it encoun-
- ters EOF or r\bre\bea\bad\bd times out, but honors a delimiter if it
+ r\bre\bea\bad\bd returns after reading _\bn_\bc_\bh_\ba_\br_\bs characters rather than
+ waiting for a complete line of input, unless it encoun-
+ ters EOF or r\bre\bea\bad\bd times out, but honors a delimiter if it
reads fewer than _\bn_\bc_\bh_\ba_\br_\bs characters 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
+ 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
it encounters EOF or r\bre\bea\bad\bd times out. Any delimiter char-
- acters in the input are not treated specially and do not
+ acters in the input are not treated specially and do not
cause r\bre\bea\bad\bd to return until it has read _\bn_\bc_\bh_\ba_\br_\bs characters.
The result is not split on the characters in I\bIF\bFS\bS; the in-
tent is that the variable is assigned exactly the charac-
- ters read (with the exception of backslash; see the -\b-r\br
+ ters read (with the exception of backslash; see the -\b-r\br
option below).
-\b-p\bp _\bp_\br_\bo_\bm_\bp_\bt
Display _\bp_\br_\bo_\bm_\bp_\bt on standard error, without a trailing new-
- line, before attempting to read any input, but only if
+ line, before attempting to read any input, but 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 it does not
- read a complete line of input (or a specified number of
- characters) within _\bt_\bi_\bm_\be_\bo_\bu_\bt seconds. _\bt_\bi_\bm_\be_\bo_\bu_\bt may be a
- decimal number with a fractional portion following the
- decimal 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, it saves any partial input read into
- the specified variable _\bn_\ba_\bm_\be, and the exit status is
- greater than 128. If _\bt_\bi_\bm_\be_\bo_\bu_\bt is 0, r\bre\bea\bad\bd returns immedi-
- ately, without trying to read any data. In this case,
- the exit status is 0 if input is available on the speci-
- fied file descriptor, or the read will return EOF, non-
+ Cause r\bre\bea\bad\bd to time out and return failure if it does not
+ read a complete line of input (or a specified number of
+ characters) within _\bt_\bi_\bm_\be_\bo_\bu_\bt seconds. _\bt_\bi_\bm_\be_\bo_\bu_\bt may be a
+ decimal number with a fractional portion following the
+ decimal 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, it saves any partial input read into
+ the specified variable _\bn_\ba_\bm_\be, and the exit status is
+ greater than 128. If _\bt_\bi_\bm_\be_\bo_\bu_\bt is 0, r\bre\bea\bad\bd returns immedi-
+ ately, without trying to read any data. In this case,
+ the exit status is 0 if input is available on the speci-
+ fied file descriptor, or the read will return EOF, non-
zero otherwise.
- -\b-u\bu _\bf_\bd Read input from file descriptor _\bf_\bd instead of the stan-
+ -\b-u\bu _\bf_\bd Read input from file descriptor _\bf_\bd instead of the stan-
dard input.
- Other than the case where _\bd_\be_\bl_\bi_\bm is the empty string, r\bre\bea\bad\bd ig-
+ Other than the case where _\bd_\be_\bl_\bi_\bm is the empty string, r\bre\bea\bad\bd ig-
nores any NUL characters in the input.
- If no _\bn_\ba_\bm_\be_\bs are supplied, r\bre\bea\bad\bd assigns the line read, without
- the ending delimiter but otherwise unmodified, to the variable
+ If no _\bn_\ba_\bm_\be_\bs are supplied, r\bre\bea\bad\bd assigns the line read, without
+ the ending delimiter but otherwise unmodified, to the variable
R\bRE\bEP\bPL\bLY\bY.
The exit status is zero, unless end-of-file is encountered, r\bre\bea\bad\bd
- times out (in which case the status is greater than 128), a
+ times out (in which case the status is greater than 128), a
variable assignment error (such as assigning to a readonly vari-
- able) occurs, or an invalid file descriptor is supplied as the
+ able) occurs, or an invalid file descriptor is supplied as the
argument to -\b-u\bu.
r\bre\bea\bad\bdo\bon\bnl\bly\by [-\b-a\baA\bAf\bf] [-\b-p\bp] [_\bn_\ba_\bm_\be[=_\bw_\bo_\br_\bd] ...]
- The given _\bn_\ba_\bm_\be_\bs are marked readonly; the values of these _\bn_\ba_\bm_\be_\bs
+ The given _\bn_\ba_\bm_\be_\bs are marked readonly; the values of these _\bn_\ba_\bm_\be_\bs
may not be changed by subsequent assignment or unset. If the -\b-f\bf
- option is supplied, each _\bn_\ba_\bm_\be refers to a shell function. The
- -\b-a\ba option restricts the variables to indexed arrays; the -\b-A\bA op-
+ option is supplied, each _\bn_\ba_\bm_\be refers to a shell function. The
+ -\b-a\ba option restricts the variables to indexed arrays; the -\b-A\bA op-
tion restricts the variables to associative arrays. If both op-
- tions are supplied, -\b-A\bA takes precedence. If no _\bn_\ba_\bm_\be arguments
- are supplied, or if the -\b-p\bp option is supplied, print a list of
- all readonly names. The other options may be used to restrict
+ tions are supplied, -\b-A\bA takes precedence. If no _\bn_\ba_\bm_\be arguments
+ are supplied, or if the -\b-p\bp option is supplied, print a list of
+ all readonly names. The other options may be used to restrict
the output to a subset of the set of readonly names. The -\b-p\bp op-
tion displays output in a format that may be reused as input.
- r\bre\bea\bad\bdo\bon\bnl\bly\by allows the value of a variable to be set at the same
+ r\bre\bea\bad\bdo\bon\bnl\bly\by allows the value of a variable to be set at the same
time the readonly attribute is changed by following the variable
- name with =_\bv_\ba_\bl_\bu_\be. This sets the value of the variable is to
+ name with =_\bv_\ba_\bl_\bu_\be. This sets the value of the variable is to
_\bv_\ba_\bl_\bu_\be while modifying the readonly attribute.
- The return status is 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
+ The return status is 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
supplied with a _\bn_\ba_\bm_\be that is not a function.
r\bre\bet\btu\bur\brn\bn [_\bn]
- Stop executing a shell function or sourced file and return the
+ Stop executing a shell function or sourced file and return the
value specified by _\bn to its caller. If _\bn is omitted, the return
- status is that of the last command executed. If r\bre\bet\btu\bur\brn\bn is exe-
- cuted by a trap handler, the last command used to determine the
+ status is that of the last command executed. If r\bre\bet\btu\bur\brn\bn is exe-
+ cuted by a trap handler, the last command used to determine the
status is the last command executed before the trap handler. If
r\bre\bet\btu\bur\brn\bn is executed during a D\bDE\bEB\bBU\bUG\bG trap, the last command used to
- determine the status is the last command executed by the trap
+ determine the status is the last command executed by the trap
handler before r\bre\bet\btu\bur\brn\bn was invoked.
When r\bre\bet\btu\bur\brn\bn is used to terminate execution of a script being ex-
- ecuted by the .\b. (s\bso\bou\bur\brc\bce\be) command, it causes the shell to stop
- executing that script and return either _\bn or the exit status of
- the last command executed within the script as the exit status
- of the script. If _\bn is supplied, the return value is its least
+ ecuted by the .\b. (s\bso\bou\bur\brc\bce\be) command, it causes the shell to stop
+ executing that script and return either _\bn or the exit status of
+ the last command executed within the script as the exit status
+ of the script. If _\bn is supplied, the return value is its least
significant 8 bits.
- Any command associated with the R\bRE\bET\bTU\bUR\bRN\bN trap is executed before
+ Any command associated with the R\bRE\bET\bTU\bUR\bRN\bN trap is executed before
execution resumes after the function or script.
- The return status is non-zero if r\bre\bet\btu\bur\brn\bn is supplied a non-nu-
+ The return status is non-zero if r\bre\bet\btu\bur\brn\bn is supplied a non-nu-
meric argument, or is used outside a function and not during ex-
ecution of a script by .\b. or s\bso\bou\bur\brc\bce\be.
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 ...]
s\bse\bet\bt -\b-o\bo
- s\bse\bet\bt +\b+o\bo 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-
+ s\bse\bet\bt +\b+o\bo 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 posix mode, only shell variables are listed. The
- output is sorted according to the current locale. When options
- are specified, they set or unset shell attributes. Any argu-
- ments remaining after option processing are treated as values
+ be reset. In posix mode, only shell variables are listed. The
+ output is sorted according to the current locale. When options
+ are specified, they set or unset shell attributes. Any 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$_\bn. Options, if specified, have the following mean-
+ $\b$2\b2, ..., $\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
+ given the export attribute and marked for export to the
environment of subsequent commands.
- -\b-b\bb Report the status of terminated background jobs immedi-
+ -\b-b\bb Report the status of terminated background jobs immedi-
ately, rather than before the next primary prompt or af-
- ter a foreground command terminates. This is effective
+ ter a foreground command terminates. This 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
+ -\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 (subject
- to the state of the p\bpi\bip\bpe\bef\bfa\bai\bil\bl shell option), 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
+ 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 (subject
+ to the state of the p\bpi\bip\bpe\bef\bfa\bai\bil\bl shell option), 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
+ 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.
- If a compound command or shell function executes in a
- context where -\b-e\be is being ignored, none of the commands
- executed within the compound command or function body
- will be affected by the -\b-e\be setting, even if -\b-e\be is set
- and a command returns a failure status. If a compound
- command or shell function sets -\b-e\be while executing in a
- context where -\b-e\be is ignored, that setting will not have
- any effect until the compound command or the command
+ If a compound command or shell function executes in a
+ context where -\b-e\be is being ignored, none of the commands
+ executed within the compound command or function body
+ will be affected by the -\b-e\be setting, even if -\b-e\be is set
+ and a command returns a failure status. If a compound
+ command or shell function sets -\b-e\be while executing in a
+ context where -\b-e\be is ignored, that setting will not have
+ any effect until the compound command or the command
containing the function call completes.
-\b-f\bf Disable pathname expansion.
- -\b-h\bh Remember the location of commands as they are looked up
+ -\b-h\bh Remember the location of commands as they are looked up
for execution. This is enabled by default.
- -\b-k\bk All arguments in the form of assignment statements are
- placed in the environment for a command, not just those
+ -\b-k\bk All arguments in the form of assignment statements are
+ placed in the environment for a command, not just those
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
+ -\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.
-\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-
+ to check a shell script for syntax errors. This is ig-
nored by interactive shells.
-\b-o\bo _\bo_\bp_\bt_\bi_\bo_\bn_\b-_\bn_\ba_\bm_\be
The _\bo_\bp_\bt_\bi_\bo_\bn_\b-_\bn_\ba_\bm_\be can be one of the following:
Same as -\b-a\ba.
b\bbr\bra\bac\bce\bee\bex\bxp\bpa\ban\bnd\bd
Same as -\b-B\bB.
- e\bem\bma\bac\bcs\bs Use an emacs-style command line editing inter-
+ e\bem\bma\bac\bcs\bs Use an emacs-style command line editing inter-
face. This is enabled by default when the shell
is interactive, unless the shell is started with
- the -\b--\b-n\bno\boe\bed\bdi\bit\bti\bin\bng\bg option. This also affects the
+ the -\b--\b-n\bno\boe\bed\bdi\bit\bti\bin\bng\bg option. This also affects the
editing interface used for r\bre\bea\bad\bd -\b-e\be.
e\ber\brr\bre\bex\bxi\bit\bt Same as -\b-e\be.
e\ber\brr\brt\btr\bra\bac\bce\be
H\bHI\bIS\bST\bTO\bOR\bRY\bY. This option is on by default in inter-
active shells.
i\big\bgn\bno\bor\bre\bee\beo\bof\bf
- The effect is as if the shell command
+ The effect is as if the shell command
"IGNOREEOF=10" had been executed (see S\bSh\bhe\bel\bll\bl
V\bVa\bar\bri\bia\bab\bbl\ble\bes\bs above).
k\bke\bey\byw\bwo\bor\brd\bd Same as -\b-k\bk.
p\bph\bhy\bys\bsi\bic\bca\bal\bl
Same as -\b-P\bP.
p\bpi\bip\bpe\bef\bfa\bai\bil\bl
- If set, the return value of a pipeline is the
- value of the last (rightmost) command to exit
- with a non-zero status, or zero if all commands
- in the pipeline exit successfully. This option
+ If set, the return value of a pipeline is the
+ value of the last (rightmost) command to exit
+ with a non-zero status, or zero if all commands
+ in the pipeline exit successfully. This option
is disabled by default.
- 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
+ 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.
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.
- v\bvi\bi Use a vi-style command line editing interface.
+ v\bvi\bi Use a vi-style command line editing interface.
This also affects the editing interface used for
r\bre\bea\bad\bd -\b-e\be.
x\bxt\btr\bra\bac\bce\be Same as -\b-x\bx.
- If -\b-o\bo is supplied with no _\bo_\bp_\bt_\bi_\bo_\bn_\b-_\bn_\ba_\bm_\be, s\bse\bet\bt prints the
- current shell option settings. If +\b+o\bo is supplied with
- no _\bo_\bp_\bt_\bi_\bo_\bn_\b-_\bn_\ba_\bm_\be, s\bse\bet\bt prints a series of s\bse\bet\bt commands to
- recreate the current option settings on the standard
+ If -\b-o\bo is supplied with no _\bo_\bp_\bt_\bi_\bo_\bn_\b-_\bn_\ba_\bm_\be, s\bse\bet\bt prints the
+ current shell option settings. If +\b+o\bo is supplied with
+ no _\bo_\bp_\bt_\bi_\bo_\bn_\b-_\bn_\ba_\bm_\be, s\bse\bet\bt prints a series of s\bse\bet\bt commands to
+ recreate the current option settings on the standard
output.
- -\b-p\bp Turn on _\bp_\br_\bi_\bv_\bi_\bl_\be_\bg_\be_\bd mode. In this mode, the shell does
- not read the $\b$E\bEN\bNV\bV and $\b$B\bBA\bAS\bSH\bH_\b_E\bEN\bNV\bV files, shell functions
- are not inherited from the environment, and the S\bSH\bHE\bEL\bL-\b-
- L\bLO\bOP\bPT\bTS\bS, B\bBA\bAS\bSH\bHO\bOP\bPT\bTS\bS, C\bCD\bDP\bPA\bAT\bTH\bH, and G\bGL\bLO\bOB\bBI\bIG\bGN\bNO\bOR\bRE\bE variables, if
- they appear in the environment, are ignored. If the
- shell is started with the effective user (group) id not
- equal to the real user (group) id, and the -\b-p\bp option is
- not supplied, these actions are taken and the effective
+ -\b-p\bp Turn on _\bp_\br_\bi_\bv_\bi_\bl_\be_\bg_\be_\bd mode. In this mode, the shell does
+ not read the $\b$E\bEN\bNV\bV and $\b$B\bBA\bAS\bSH\bH_\b_E\bEN\bNV\bV files, shell functions
+ are not inherited from the environment, and the S\bSH\bHE\bEL\bL-\b-
+ L\bLO\bOP\bPT\bTS\bS, B\bBA\bAS\bSH\bHO\bOP\bPT\bTS\bS, C\bCD\bDP\bPA\bAT\bTH\bH, and G\bGL\bLO\bOB\bBI\bIG\bGN\bNO\bOR\bRE\bE variables, if
+ they appear in the environment, are ignored. If the
+ shell is started with the effective user (group) id not
+ equal to the real user (group) id, and the -\b-p\bp option is
+ not supplied, these actions are taken and the effective
user id is set to the real user id. If the -\b-p\bp option is
supplied at startup, the effective user id is not reset.
- Turning this option off causes the effective user and
+ 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 "*", 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
+ 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
status.
-\b-v\bv Print shell input lines as they are read.
- -\b-x\bx After expanding each _\bs_\bi_\bm_\bp_\bl_\be _\bc_\bo_\bm_\bm_\ba_\bn_\bd, f\bfo\bor\br command, c\bca\bas\bse\be
+ -\b-x\bx After expanding each _\bs_\bi_\bm_\bp_\bl_\be _\bc_\bo_\bm_\bm_\ba_\bn_\bd, f\bfo\bor\br command, c\bca\bas\bse\be
command, s\bse\bel\ble\bec\bct\bt command, or arithmetic f\bfo\bor\br command, dis-
- play the expanded value of P\bPS\bS4\b4, followed by the command
- and its expanded arguments or associated word list, to
+ play the expanded value of P\bPS\bS4\b4, followed by the command
+ and its expanded arguments or associated word list, to
the standard error.
- -\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
+ -\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.
- -\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. Using the
- redirection operator >\b>|\b| instead of >\b> will override this
+ -\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. Using the
+ redirection operator >\b>|\b| instead of >\b> will override this
and force the creation of an output file.
-\b-E\bE If set, any trap on E\bER\bRR\bR is inherited by shell functions,
- command substitutions, and commands executed in a sub-
- shell environment. The E\bER\bRR\bR trap is normally not inher-
+ command substitutions, and commands executed in a sub-
+ shell environment. The E\bER\bRR\bR trap is normally not inher-
ited in such cases.
-\b-H\bH Enable !\b! style history substitution. This option is on
by default when the shell is interactive.
- -\b-P\bP If set, the shell does not resolve symbolic links when
- executing commands such as c\bcd\bd that change the current
+ -\b-P\bP If set, the shell does not resolve symbolic links when
+ executing commands such as c\bcd\bd that change the current
working directory. It uses the physical directory
structure instead. By default, b\bba\bas\bsh\bh follows the logical
- chain of directories when performing commands which
+ chain of directories when performing commands which
change the current directory.
- -\b-T\bT If set, any traps on D\bDE\bEB\bBU\bUG\bG and R\bRE\bET\bTU\bUR\bRN\bN are inherited by
+ -\b-T\bT If set, any traps on D\bDE\bEB\bBU\bUG\bG and R\bRE\bET\bTU\bUR\bRN\bN are inherited by
shell functions, command substitutions, and commands ex-
- ecuted in a subshell environment. The D\bDE\bEB\bBU\bUG\bG and R\bRE\bET\bTU\bUR\bRN\bN
+ ecuted in a subshell environment. The D\bDE\bEB\bBU\bUG\bG and R\bRE\bET\bTU\bUR\bRN\bN
traps are normally not inherited in such cases.
-\b--\b- If no arguments follow this option, unset the positional
parameters. Otherwise, set the positional parameters to
the _\ba_\br_\bgs, even if some of them begin with a -\b-.
-\b- Signal the end of options, and assign all remaining _\ba_\br_\bgs
to the positional parameters. The -\b-x\bx and -\b-v\bv options are
- turned off. If there are no _\ba_\br_\bgs, the positional para-
+ turned off. If there are no _\ba_\br_\bgs, the positional para-
meters remain unchanged.
- The options are off by default unless otherwise noted. Using +
- rather than - causes these options to be turned off. The op-
+ The options are off by default unless otherwise noted. Using +
+ rather than - causes these options to be turned off. The op-
tions can also be specified as arguments to an invocation of the
- shell. The current set of options may be found in $\b$-\b-. The re-
- turn status is always zero unless an invalid option is encoun-
+ shell. The current set of options may be found in $\b$-\b-. The re-
+ turn status is always zero unless an invalid option is encoun-
tered.
s\bsh\bhi\bif\bft\bt [_\bn]
Rename positional parameters from _\bn+1 ... to $\b$1\b1 .\b..\b..\b..\b. Parameters
- represented by the numbers $\b$#\b# down to $\b$#\b#-_\bn+1 are unset. _\bn must
- be a non-negative number less than or equal to $\b$#\b#. If _\bn is 0,
- no parameters are changed. If _\bn is not given, it is assumed to
- be 1. If _\bn is greater than $\b$#\b#, the positional parameters are
- not changed. The return status is greater than zero if _\bn is
+ represented by the numbers $\b$#\b# down to $\b$#\b#-_\bn+1 are unset. _\bn must
+ be a non-negative number less than or equal to $\b$#\b#. If _\bn is 0,
+ no parameters are changed. If _\bn is not given, it is assumed to
+ be 1. If _\bn is greater than $\b$#\b#, the positional parameters are
+ not changed. The return status is greater than zero if _\bn is
greater than $\b$#\b# or less than zero; otherwise 0.
s\bsh\bho\bop\bpt\bt [-\b-p\bpq\bqs\bsu\bu] [-\b-o\bo] [_\bo_\bp_\bt_\bn_\ba_\bm_\be ...]
- Toggle the values of settings controlling optional shell behav-
- ior. The settings can be either those listed below, or, if the
+ Toggle the values of settings controlling optional shell behav-
+ ior. The settings can be either those listed below, or, if the
-\b-o\bo option is used, those available with the -\b-o\bo option to the s\bse\bet\bt
builtin command.
- With no options, or with the -\b-p\bp option, display a list of all
- settable options, with an indication of whether or not each is
- set; if any _\bo_\bp_\bt_\bn_\ba_\bm_\be_\bs are supplied, the output is restricted to
+ With no options, or with the -\b-p\bp option, display a list of all
+ settable options, with an indication of whether or not each is
+ set; if any _\bo_\bp_\bt_\bn_\ba_\bm_\be_\bs are supplied, the output is restricted to
those options. The -\b-p\bp option displays output in a form that may
be reused as input.
Other options have the following meanings:
-\b-s\bs Enable (set) each _\bo_\bp_\bt_\bn_\ba_\bm_\be.
-\b-u\bu Disable (unset) each _\bo_\bp_\bt_\bn_\ba_\bm_\be.
- -\b-q\bq Suppresses normal output (quiet mode); the return status
+ -\b-q\bq Suppresses normal output (quiet mode); the return status
indicates whether the _\bo_\bp_\bt_\bn_\ba_\bm_\be is set or unset. If multi-
- ple _\bo_\bp_\bt_\bn_\ba_\bm_\be arguments are supplied with -\b-q\bq, the return
+ ple _\bo_\bp_\bt_\bn_\ba_\bm_\be arguments are supplied with -\b-q\bq, the return
status is zero if all _\bo_\bp_\bt_\bn_\ba_\bm_\be_\bs are enabled; non-zero oth-
erwise.
- -\b-o\bo Restricts the values of _\bo_\bp_\bt_\bn_\ba_\bm_\be to be those defined for
+ -\b-o\bo Restricts the values of _\bo_\bp_\bt_\bn_\ba_\bm_\be to be those defined for
the -\b-o\bo option to the s\bse\bet\bt builtin.
- If either -\b-s\bs or -\b-u\bu is used with no _\bo_\bp_\bt_\bn_\ba_\bm_\be arguments, s\bsh\bho\bop\bpt\bt
- shows only those options which are set or unset, respectively.
- Unless otherwise noted, the s\bsh\bho\bop\bpt\bt options are disabled (unset)
+ If either -\b-s\bs or -\b-u\bu is used with no _\bo_\bp_\bt_\bn_\ba_\bm_\be arguments, s\bsh\bho\bop\bpt\bt
+ shows only those options which are set or unset, respectively.
+ Unless otherwise noted, the s\bsh\bho\bop\bpt\bt options are disabled (unset)
by default.
- The return status when listing options is zero if all _\bo_\bp_\bt_\bn_\ba_\bm_\be_\bs
- are enabled, non-zero otherwise. When setting or unsetting op-
- tions, the return status is zero unless an _\bo_\bp_\bt_\bn_\ba_\bm_\be is not a
+ The return status when listing options is zero if all _\bo_\bp_\bt_\bn_\ba_\bm_\be_\bs
+ are enabled, non-zero otherwise. When setting or unsetting op-
+ tions, the return status is zero unless an _\bo_\bp_\bt_\bn_\ba_\bm_\be is not a
valid shell option.
The list of s\bsh\bho\bop\bpt\bt options is:
a\bar\brr\bra\bay\by_\b_e\bex\bxp\bpa\ban\bnd\bd_\b_o\bon\bnc\bce\be
- If set, the shell suppresses multiple evaluation of as-
+ If set, the shell suppresses multiple evaluation of as-
sociative and indexed array subscripts during arithmetic
expression evaluation, while executing builtins that can
- perform variable assignments, and while executing
+ perform variable assignments, and while executing
builtins that perform array dereferencing.
a\bas\bss\bso\boc\bc_\b_e\bex\bxp\bpa\ban\bnd\bd_\b_o\bon\bnc\bce\be
Deprecated; a synonym for a\bar\brr\bra\bay\by_\b_e\bex\bxp\bpa\ban\bnd\bd_\b_o\bon\bnc\bce\be.
- a\bau\but\bto\boc\bcd\bd If set, a command name that is the name of a directory
- is executed as if it were the argument to the c\bcd\bd com-
+ a\bau\but\bto\boc\bcd\bd If set, a command name that is the name of a directory
+ is executed as if it were the argument to the c\bcd\bd com-
mand. This option is only used by interactive shells.
b\bba\bas\bsh\bh_\b_s\bso\bou\bur\brc\bce\be_\b_f\bfu\bul\bll\blp\bpa\bat\bth\bh
- If set, filenames added to the B\bBA\bAS\bSH\bH_\b_S\bSO\bOU\bUR\bRC\bCE\bE array vari-
- able are converted to full pathnames (see S\bSh\bhe\bel\bll\bl V\bVa\bar\bri\bi-\b-
+ If set, filenames added to the B\bBA\bAS\bSH\bH_\b_S\bSO\bOU\bUR\bRC\bCE\bE array vari-
+ able are converted to full pathnames (see S\bSh\bhe\bel\bll\bl V\bVa\bar\bri\bi-\b-
a\bab\bbl\ble\bes\bs above).
c\bcd\bda\bab\bbl\ble\be_\b_v\bva\bar\brs\bs
- If set, an argument to the c\bcd\bd builtin command that is
- not a directory is assumed to be the name of a variable
+ If set, an argument to the c\bcd\bd builtin command that is
+ not a directory is assumed to be the name of a variable
whose value is the directory to change to.
- c\bcd\bds\bsp\bpe\bel\bll\bl If set, the c\bcd\bd command attempts to correct minor errors
- in the spelling of a directory component. Minor errors
- include transposed characters, a missing character, and
+ c\bcd\bds\bsp\bpe\bel\bll\bl If set, the c\bcd\bd command attempts to correct minor errors
+ in the spelling of a directory component. Minor errors
+ include transposed characters, a missing character, and
one extra character. If c\bcd\bd corrects the directory name,
- it prints the corrected filename, and the command pro-
+ it prints the corrected filename, and the command pro-
ceeds. This option is only used by interactive shells.
c\bch\bhe\bec\bck\bkh\bha\bas\bsh\bh
If set, b\bba\bas\bsh\bh checks that a command found in the hash ta-
- ble exists before trying to execute it. If a hashed
- command no longer exists, b\bba\bas\bsh\bh performs a normal path
+ ble exists before trying to execute it. If a hashed
+ command no longer exists, b\bba\bas\bsh\bh performs a normal path
search.
c\bch\bhe\bec\bck\bkj\bjo\bob\bbs\bs
If set, b\bba\bas\bsh\bh lists the status of any stopped and running
- jobs before exiting an interactive shell. If any jobs
+ jobs before exiting an interactive shell. If any jobs
are running, b\bba\bas\bsh\bh defers the exit until a second exit is
- attempted without an intervening command (see J\bJO\bOB\bB C\bCO\bON\bN-\b-
- T\bTR\bRO\bOL\bL above). The shell always postpones exiting if any
+ attempted without an intervening command (see J\bJO\bOB\bB C\bCO\bON\bN-\b-
+ T\bTR\bRO\bOL\bL above). The shell always postpones 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
- values of L\bLI\bIN\bNE\bES\bS and C\bCO\bOL\bLU\bUM\bMN\bNS\bS, using the file descriptor
- associated with the standard error if it is a terminal.
+ If set, b\bba\bas\bsh\bh checks the window size after each external
+ (non-builtin) command and, if necessary, updates the
+ values of L\bLI\bIN\bNE\bES\bS and C\bCO\bOL\bLU\bUM\bMN\bNS\bS, using the file descriptor
+ associated with the standard error if it is a terminal.
This option is enabled by default.
- c\bcm\bmd\bdh\bhi\bis\bst\bt If set, b\bba\bas\bsh\bh attempts to save all lines of a multiple-
- line command in the same history entry. This allows
- easy re-editing of multi-line commands. This option is
- enabled by default, but only has an effect if command
+ c\bcm\bmd\bdh\bhi\bis\bst\bt If set, b\bba\bas\bsh\bh attempts to save all lines of a multiple-
+ line command in the same history entry. This allows
+ easy re-editing of multi-line commands. This option is
+ enabled by default, but only has an effect if command
history is enabled, as described above under H\bHI\bIS\bST\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\b43\b3
c\bco\bom\bmp\bpa\bat\bt4\b44\b4
c\bco\bom\bmp\bpa\bat\bt5\b50\b0
- These control aspects of the shell's compatibility mode
+ 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\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.
+ 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 r\bre\bea\bad\bdl\bli\bin\bne\be editing
- buffer. If not set, b\bba\bas\bsh\bh attempts to preserve what the
+ buffer. 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. and
+ 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. and
_\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. An interactive shell does not exit if
+ not execute the file specified as an argument to the
+ e\bex\bxe\bec\bc builtin. 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
+ 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.
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
+ 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).
- 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, enable the extended pattern matching features
+ e\bex\bxt\btg\bgl\blo\bob\bb If set, enable 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.
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 above for a de-
+ scription 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, pattern matching does not take the
- current locale's collating sequence into account, so b\bb
- will not collate between A\bA and B\bB, and upper-case and
+ 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, pattern matching does not take the
+ current locale's collating sequence 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.
g\bgl\blo\bob\bbs\bsk\bki\bip\bpd\bdo\bot\bts\bs
- If set, pathname expansion will never match the file-
- names _\b. and _\b._\b., even if the pattern begins with a ".".
+ If set, pathname expansion will never match the file-
+ names _\b. and _\b._\b., even if the pattern begins with a ".".
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
If set, shell error messages are written in the standard
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, the user is given
- the opportunity to re-edit a failed history substitu-
+ If set, and r\bre\bea\bad\bdl\bli\bin\bne\be is being used, the user is given
+ the opportunity to re-edit a failed history substitu-
tion.
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
+ 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.
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 posix mode 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 posix mode is
enabled.
i\bin\bnt\bte\ber\bra\bac\bct\bti\biv\bve\be_\b_c\bco\bom\bmm\bme\ben\bnt\bts\bs
- In an interactive shell, a word beginning with #\b# causes
- that word and all remaining characters on that line to
- be ignored, as in a non-interactive shell (see C\bCO\bOM\bMM\bME\bEN\bNT\bTS\bS
+ In an interactive shell, a word beginning with #\b# causes
+ that word and all remaining characters on that line to
+ be ignored, as in a non-interactive shell (see C\bCO\bOM\bMM\bME\bEN\bNT\bTS\bS
above). 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.
l\blo\boc\bca\bal\blv\bva\bar\br_\b_i\bin\bnh\bhe\ber\bri\bit\bt
scope before any new value is assigned. The nameref at-
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
+ 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
+ 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 above). 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, b\bba\bas\bsh\bh
- displays the message "The mail in _\bm_\ba_\bi_\bl_\bf_\bi_\bl_\be has been
+ 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, b\bba\bas\bsh\bh
+ displays the message "The mail in _\bm_\ba_\bi_\bl_\bf_\bi_\bl_\be has been
read".
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 does not search
- P\bPA\bAT\bTH\bH for possible completions when completion is at-
+ P\bPA\bAT\bTH\bH for possible completions when completion is at-
tempted 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).
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 $\b$"\b"..."\b"
- quoting in single quotes instead of double quotes. If
+ If set, b\bba\bas\bsh\bh encloses the translated results of $\b$"\b"..."\b"
+ 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, pathname expansion patterns which match no files
removed, rather than expanding to 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
+ 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
above. This option is enabled by default.
p\bpr\bro\bog\bgc\bco\bom\bmp\bp
- If set, enable the programmable completion facilities
+ If set, enable the programmable completion facilities
(see P\bPr\bro\bog\bgr\bra\bam\bmm\bma\bab\bbl\ble\be C\bCo\bom\bmp\bpl\ble\bet\bti\bio\bon\bn above). This option is en-
abled 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
- treats a command name that doesn't have any completions
+ If set, and programmable completion is enabled, b\bba\bas\bsh\bh
+ treats a command name that doesn't have any completions
as a possible alias and attempts alias expansion. If it
- has an alias, b\bba\bas\bsh\bh attempts programmable completion us-
+ has an alias, b\bba\bas\bsh\bh attempts programmable completion us-
ing the command word resulting from the expanded alias.
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
+ 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.
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-
+ 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.
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
+ If set, the s\bsh\bhi\bif\bft\bt builtin prints an error message when
the shift count exceeds the number of positional parame-
ters.
s\bso\bou\bur\brc\bce\bep\bpa\bat\bth\bh
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 when the -\b-p\bp option is not supplied. This op-
+ find the directory containing the file supplied as an
+ argument when the -\b-p\bp option is not supplied. This op-
tion 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
+ 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\bED\bDI\bIR\bRE\bEC\bCT\bTI\bIO\bON\bN above) 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-
- quences by default. If the p\bpo\bos\bsi\bix\bx shell option is also
+ If set, the e\bec\bch\bho\bo builtin expands backslash-escape se-
+ quences by default. If the p\bpo\bos\bsi\bix\bx shell option is also
enabled, e\bec\bch\bho\bo does not interpret any options.
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, or a shell without job control enabled,
- cannot be suspended; the -\b-f\bf option will 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 sup-
+ 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 will 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 sup-
plied.
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
- operand must be a separate argument. Expressions are composed
- of the primaries described 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.
- t\bte\bes\bst\bt does not accept any options, nor does it accept and ignore
+ ation of the conditional expression _\be_\bx_\bp_\br. Each operator and
+ operand must be a separate argument. Expressions are composed
+ of the primaries described 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.
+ 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-
+ 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. t\bte\bes\bst\bt uses operator
precedence 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
normal operator precedence.
_\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
+ 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
true if the unary test is true. If the first argument is
not a valid unary conditional operator, the expression is
false.
3 arguments
The following conditions are applied in the order listed.
- If the second argument is one of the binary conditional
+ If the second argument is one of the binary conditional
operators listed above under 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
+ 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-
+ is the one-argument test of the second argument. Other-
wise, 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. If the first argument is exactly (\b( and the
+ the three-argument expression composed of the remaining
+ arguments. If the first argument is exactly (\b( and the
fourth argument is exactly )\b), the result is the two-argu-
- ment test of the second and third arguments. Otherwise,
- the expression is parsed and evaluated according to
+ ment test of the second and third arguments. Otherwise,
+ 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 the shell is in posix mode, or if the expression is part of
the [\b[[\b[ command, the <\b< and >\b> operators sort using the current lo-
- cale. If the shell is not in posix mode, the t\bte\bes\bst\bt and [\b[ com-
+ cale. If the shell is not in posix mode, the t\bte\bes\bst\bt and [\b[ com-
mands sort lexicographically using ASCII ordering.
- The historical operator-precedence parsing with 4 or more argu-
- ments can lead to ambiguities when it encounters strings that
- look like primaries. The POSIX standard has deprecated the -\b-a\ba
- and -\b-o\bo primaries and enclosing expressions within parentheses.
- Scripts should no longer use them. It's much more reliable to
- restrict test invocations to a single primary, and to replace
+ The historical operator-precedence parsing with 4 or more argu-
+ ments can lead to ambiguities when it encounters strings that
+ look like primaries. The POSIX standard has deprecated the -\b-a\ba
+ and -\b-o\bo primaries and enclosing expressions within parentheses.
+ Scripts should no longer use them. It's much more reliable to
+ restrict test invocations to a single primary, and to replace
uses of -\b-a\ba and -\b-o\bo with the shell's &\b&&\b& and |\b||\b| list operators.
- 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\bpP\bP] [[_\ba_\bc_\bt_\bi_\bo_\bn] _\bs_\bi_\bg_\bs_\bp_\be_\bc ...]
The _\ba_\bc_\bt_\bi_\bo_\bn is a command that is read and executed when the shell
- receives any of the signals _\bs_\bi_\bg_\bs_\bp_\be_\bc. If _\ba_\bc_\bt_\bi_\bo_\bn is absent (and
+ receives any of the signals _\bs_\bi_\bg_\bs_\bp_\be_\bc. If _\ba_\bc_\bt_\bi_\bo_\bn is absent (and
there is a single _\bs_\bi_\bg_\bs_\bp_\be_\bc) or -\b-, each specified _\bs_\bi_\bg_\bs_\bp_\be_\bc is reset
- to the value it had when the shell was started. If _\ba_\bc_\bt_\bi_\bo_\bn is
- the null string the signal specified by each _\bs_\bi_\bg_\bs_\bp_\be_\bc is ignored
+ to the value it had when the shell was started. If _\ba_\bc_\bt_\bi_\bo_\bn 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 no arguments are supplied, t\btr\bra\bap\bp displays the actions associ-
+ If no arguments are supplied, t\btr\bra\bap\bp displays the actions associ-
ated with each trapped signal as a set of t\btr\bra\bap\bp commands that can
- be reused as shell input to restore the current signal disposi-
- tions. If -\b-p\bp is given, and _\ba_\bc_\bt_\bi_\bo_\bn is not present, then t\btr\bra\bap\bp
- displays the actions associated with each _\bs_\bi_\bg_\bs_\bp_\be_\bc or, if none
+ be reused as shell input to restore the current signal disposi-
+ tions. If -\b-p\bp is given, and _\ba_\bc_\bt_\bi_\bo_\bn is not present, then t\btr\bra\bap\bp
+ displays the actions associated with each _\bs_\bi_\bg_\bs_\bp_\be_\bc or, if none
are supplied, for all trapped signals, as a set of t\btr\bra\bap\bp commands
- that can be reused as shell input to restore the current signal
- dispositions. The -\b-P\bP option behaves similarly, but displays
- only the actions associated with each _\bs_\bi_\bg_\bs_\bp_\be_\bc argument. -\b-P\bP re-
- quires at least one _\bs_\bi_\bg_\bs_\bp_\be_\bc argument. The -\b-P\bP or -\b-p\bp options may
- be used in a subshell environment (e.g., command substitution)
- and, as long as they are used before t\btr\bra\bap\bp is used to change a
+ that can be reused as shell input to restore the current signal
+ dispositions. The -\b-P\bP option behaves similarly, but displays
+ only the actions associated with each _\bs_\bi_\bg_\bs_\bp_\be_\bc argument. -\b-P\bP re-
+ quires at least one _\bs_\bi_\bg_\bs_\bp_\be_\bc argument. The -\b-P\bP or -\b-p\bp options may
+ be used in a subshell environment (e.g., command substitution)
+ and, as long as they are used before t\btr\bra\bap\bp is used to change a
signal's handling, will display the state of its parent's traps.
- The -\b-l\bl option prints a list of signal names and their corre-
- sponding numbers. Each _\bs_\bi_\bg_\bs_\bp_\be_\bc is either a signal name defined
+ The -\b-l\bl option prints a list of signal names and their corre-
+ sponding numbers. Each _\bs_\bi_\bg_\bs_\bp_\be_\bc is either a signal name defined
in <_\bs_\bi_\bg_\bn_\ba_\bl_\b._\bh>, or a signal number. Signal names are case insen-
- sitive and the S\bSI\bIG\bG prefix is optional. If -\b-l\bl is supplied with
+ sitive and the S\bSI\bIG\bG prefix is optional. If -\b-l\bl is supplied with
no _\bs_\bi_\bg_\bs_\bp_\be_\bc arguments, it prints a list of valid signal names.
- If a _\bs_\bi_\bg_\bs_\bp_\be_\bc is E\bEX\bXI\bIT\bT (0), _\ba_\bc_\bt_\bi_\bo_\bn is executed on exit from the
- shell. If a _\bs_\bi_\bg_\bs_\bp_\be_\bc is D\bDE\bEB\bBU\bUG\bG, _\ba_\bc_\bt_\bi_\bo_\bn is executed 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, ((
- arithmetic command, [[ conditional command, arithmetic _\bf_\bo_\br com-
- mand, 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 shell option (see s\bsh\bho\bop\bpt\bt above) for details of its ef-
- fect 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, _\ba_\bc_\bt_\bi_\bo_\bn is exe-
+ If a _\bs_\bi_\bg_\bs_\bp_\be_\bc is E\bEX\bXI\bIT\bT (0), _\ba_\bc_\bt_\bi_\bo_\bn is executed on exit from the
+ shell. If a _\bs_\bi_\bg_\bs_\bp_\be_\bc is D\bDE\bEB\bBU\bUG\bG, _\ba_\bc_\bt_\bi_\bo_\bn is executed 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, ((
+ arithmetic command, [[ conditional command, arithmetic _\bf_\bo_\br com-
+ mand, 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 shell option (see s\bsh\bho\bop\bpt\bt above) for details of its ef-
+ fect 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, _\ba_\bc_\bt_\bi_\bo_\bn is exe-
cuted 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, _\ba_\bc_\bt_\bi_\bo_\bn 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
+ If a _\bs_\bi_\bg_\bs_\bp_\be_\bc is E\bER\bRR\bR, _\ba_\bc_\bt_\bi_\bo_\bn 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
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 (subject to the state of the p\bpi\bip\bpe\bef\bfa\bai\bil\bl shell option), or if
+ following the final &\b&&\b& or |\b||\b|, any command in a pipeline but the
+ last (subject to the state of the p\bpi\bip\bpe\bef\bfa\bai\bil\bl shell option), 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) option.
When the shell is not interactive, signals ignored upon entry to
the shell cannot be trapped or reset. Interactive shells permit
trapping signals ignored on entry. 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
+ 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 invalid; otherwise t\btr\bra\bap\bp returns true.
t\btr\bru\bue\be Does nothing, returns a 0 status.
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 executable file, re-
- spectively. If the _\bn_\ba_\bm_\be is not found, t\bty\byp\bpe\be prints nothing and
+ 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 executable file, re-
+ spectively. If the _\bn_\ba_\bm_\be is not found, t\bty\byp\bpe\be prints nothing and
returns a non-zero exit status.
- If the -\b-p\bp option is used, t\bty\byp\bpe\be either returns the pathname of
- the executable file that would be found by searching $\b$P\bPA\bAT\bTH\bH for
+ If the -\b-p\bp option is used, t\bty\byp\bpe\be either returns the pathname of
+ the executable file that would be found by searching $\b$P\bPA\bAT\bTH\bH for
_\bn_\ba_\bm_\be or nothing if "type -t name" would not return _\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
+ 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 _\bn_\ba_\bm_\be is present in the table of
- hashed commands, -\b-p\bp and -\b-P\bP print the hashed value, which is not
+ hashed commands, -\b-p\bp and -\b-P\bP print the hashed value, which is not
necessarily 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 a command named _\bn_\ba_\bm_\be. This includes aliases, reserved
- words, functions, and builtins, but the path search options (-\b-p\bp
- and -\b-P\bP) can be supplied to restrict the output to executable
- files. t\bty\byp\bpe\be does not consult the table of hashed commands when
+ If the -\b-a\ba option is used, t\bty\byp\bpe\be prints all of the places that
+ contain a command named _\bn_\ba_\bm_\be. This includes aliases, reserved
+ words, functions, and builtins, but the path search options (-\b-p\bp
+ and -\b-P\bP) can be supplied to restrict the output to executable
+ files. t\bty\byp\bpe\be does not consult the table of hashed commands when
using -\b-a\ba with -\b-p\bp, and only performs a P\bPA\bAT\bTH\bH search for _\bn_\ba_\bm_\be.
The -\b-f\bf option suppresses shell function lookup, as with the c\bco\bom\bm-\b-
- m\bma\ban\bnd\bd builtin. t\bty\byp\bpe\be returns true if all of the arguments are
+ m\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
+ Provides control over the resources available to the shell and
to processes it starts, on systems that allow such control.
- The -\b-H\bH and -\b-S\bS options specify whether the hard or soft limit is
+ The -\b-H\bH and -\b-S\bS options specify whether 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-
+ to the value of the hard limit. If neither -\b-H\bH nor -\b-S\bS is speci-
fied, u\bul\bli\bim\bmi\bit\bt sets both the soft and hard limits.
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, respectively. If _\bl_\bi_\bm_\bi_\bt is omitted, u\bul\bli\bim\bmi\bit\bt prints
- the current value of the soft limit of the resource, 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
+ 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, respectively. If _\bl_\bi_\bm_\bi_\bt is omitted, u\bul\bli\bim\bmi\bit\bt prints
+ the current value of the soft limit of the resource, 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 options are interpreted as follows:
-\b-a\ba Report all current limits; 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 supplied, 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 sup-
+ If _\bl_\bi_\bm_\bi_\bt is supplied, 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 sup-
plied, 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
+ 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]
- Set the user file-creation mask to _\bm_\bo_\bd_\be. If _\bm_\bo_\bd_\be begins with a
+ Set the user file-creation mask to _\bm_\bo_\bd_\be. If _\bm_\bo_\bd_\be begins with a
digit, it is interpreted as an octal number; otherwise it is in-
- terpreted as a symbolic mode mask similar to that accepted by
+ terpreted as a symbolic mode mask similar to that accepted by
_\bc_\bh_\bm_\bo_\bd(1). If _\bm_\bo_\bd_\be is omitted, u\bum\bma\bas\bsk\bk prints the current value of
the mask. The -\b-S\bS option without a _\bm_\bo_\bd_\be argument prints the mask
in a symbolic format; 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 zero
- if the mode was successfully changed or if no _\bm_\bo_\bd_\be argument was
+ a form that may be reused as input. The return status is zero
+ if the mode was successfully changed or if no _\bm_\bo_\bd_\be argument was
supplied, and non-zero 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, remove all alias definitions. The return value is
+ Remove each _\bn_\ba_\bm_\be from the list of defined aliases. If -\b-a\ba is
+ supplied, remove all alias definitions. 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. If -\b-f\bf is specified, each _\bn_\ba_\bm_\be
- refers to a shell function, and the function definition is re-
- moved. 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. Read-only variables and functions may not be unset.
- When variables or functions are removed, they are also removed
- from the environment passed to subsequent commands. If no op-
- tions are supplied, each _\bn_\ba_\bm_\be refers to a variable; if there is
- no variable by that name, a function with that name, if any, is
- unset. Some shell variables may not be unset. If any of
+ and that variable is removed. If -\b-f\bf is specified, each _\bn_\ba_\bm_\be
+ refers to a shell function, and the function definition is re-
+ moved. 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. Read-only variables and functions may not be unset.
+ When variables or functions are removed, they are also removed
+ from the environment passed to subsequent commands. If no op-
+ tions are supplied, each _\bn_\ba_\bm_\be refers to a variable; if there is
+ no variable by that name, a function with that name, if any, is
+ unset. Some shell variables may not be unset. 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\bB-\b-
- S\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\bCN\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\bC-\b-
- O\bON\bND\bDS\bS, or S\bSR\bRA\bAN\bND\bDO\bOM\bM are unset, they lose their special properties,
- even if they are subsequently reset. The exit status is true
+ S\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\bCN\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\bC-\b-
+ O\bON\bND\bDS\bS, or S\bSR\bRA\bAN\bND\bDO\bOM\bM are unset, they lose their special properties,
+ even if they are subsequently reset. The exit status is true
unless a _\bn_\ba_\bm_\be is readonly 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 ...]
Wait for each specified child process _\bi_\bd and return the termina-
- tion status of the last _\bi_\bd. Each _\bi_\bd may be a process ID _\bp_\bi_\bd or
- a job specification _\bj_\bo_\bb_\bs_\bp_\be_\bc; if a jobspec is supplied, w\bwa\bai\bit\bt
+ tion status of the last _\bi_\bd. Each _\bi_\bd may be a process ID _\bp_\bi_\bd or
+ a job specification _\bj_\bo_\bb_\bs_\bp_\be_\bc; if a jobspec is supplied, w\bwa\bai\bit\bt
waits for all processes in the job.
- If no options or _\bi_\bds are supplied, w\bwa\bai\bit\bt waits for all running
- background jobs and the last-executed process substitution, if
+ If no options or _\bi_\bds are supplied, 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 any one of the
+ If the -\b-n\bn option is supplied, w\bwa\bai\bit\bt waits for any one of the
given _\bi_\bds or, if no _\bi_\bds are supplied, any job or process substi-
tution, to complete and returns its exit status. If none of the
- supplied _\bi_\bds is a child of the shell, or if no _\bi_\bds are supplied
- and the shell has no unwaited-for children, the exit status is
+ supplied _\bi_\bds is a child of the shell, or if no _\bi_\bds are supplied
+ and the shell has no unwaited-for children, the exit status is
127.
- If the -\b-p\bp option is supplied, w\bwa\bai\bit\bt assigns the process or job
- identifier of the job for which the exit status is returned to
- the variable _\bv_\ba_\br_\bn_\ba_\bm_\be named by the option argument. The vari-
- able, which cannot be readonly, will be unset initially, before
- any assignment. This is useful only when used with the -\b-n\bn op-
+ If the -\b-p\bp option is supplied, w\bwa\bai\bit\bt assigns the process or job
+ identifier of the job for which the exit status is returned to
+ the variable _\bv_\ba_\br_\bn_\ba_\bm_\be named by the option argument. The vari-
+ able, which cannot be readonly, will be unset initially, before
+ any assignment. This is useful only when used with the -\b-n\bn op-
tion.
- Supplying the -\b-f\bf option, when job control is enabled, forces
- w\bwa\bai\bit\bt to wait for each _\bi_\bd to terminate before returning its sta-
+ Supplying the -\b-f\bf option, when job control is enabled, forces
+ w\bwa\bai\bit\bt to wait for each _\bi_\bd to terminate before returning its sta-
tus, instead of returning when it changes status.
- If none of the _\bi_\bds specify one of the shell's active child
- processes, the return status is 127. If w\bwa\bai\bit\bt is interrupted by
- a signal, any _\bv_\ba_\br_\bn_\ba_\bm_\be will remain unset, and the return status
- will be greater than 128, as described under S\bSI\bIG\bGN\bNA\bAL\bLS\bS above.
+ If none of the _\bi_\bds specify one of the shell's active child
+ processes, the return status is 127. If w\bwa\bai\bit\bt is interrupted by
+ a signal, any _\bv_\ba_\br_\bn_\ba_\bm_\be will remain unset, and the return status
+ will be greater than 128, as described under S\bSI\bIG\bGN\bNA\bAL\bLS\bS above.
Otherwise, the return status is the exit status of the last _\bi_\bd.
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 _\bs_\bh_\be_\bl_\bl _\bc_\bo_\bm_\bp_\ba_\bt_\bi_\bb_\bi_\bl_\bi_\bt_\by _\bl_\be_\bv_\be_\bl, speci-
+ 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\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
+ 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-
+ 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 right hand
- side of the regexp matching operator quotes special regexp characters
- in the word, which is default behavior in bash-3.2 and subsequent ver-
+ 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 right hand
+ side of the regexp matching operator quotes special regexp characters
+ in the word, which is default behavior in bash-3.2 and subsequent ver-
sions).
- 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
+ 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, b\bba\bas\bsh\bh began deprecating older compatibility lev-
els. Eventually, the options will be removed in favor of B\bBA\bAS\bSH\bH_\b_C\bCO\bOM\bMP\bPA\bAT\bT.
- Bash-5.0 was the final version for which there was an individual shopt
- option for the previous version. B\bBA\bAS\bSH\bH_\b_C\bCO\bOM\bMP\bPA\bAT\bT is the only mechanism to
+ Bash-5.0 was the final version for which there was an individual shopt
+ option for the previous version. B\bBA\bAS\bSH\bH_\b_C\bCO\bOM\bMP\bPA\bAT\bT is the only mechanism to
control the compatibility level in versions newer than bash-5.0.
- 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 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.
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. B\bBa\bas\bsh\bh 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 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 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-
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
- parameters even if extended debugging mode is not en-
+ +\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 en-
abled.
- +\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-
- duce slightly more randomness. If the shell compatibil-
+ +\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 compatibil-
ity 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
+ 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
+ +\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.
+\bo Arithmetic commands ( (\b((\b(...)\b))\b) ) and the expressions in an
arithmetic for statement can be expanded more than once.
- +\bo Expressions used as arguments to arithmetic operators in
- the [\b[[\b[ conditional command can be expanded more than
+ +\bo Expressions used as arguments to arithmetic operators in
+ the [\b[[\b[ conditional command can be expanded more than
once.
- +\bo The expressions in substring parameter brace expansion
+ +\bo The expressions in substring parameter brace expansion
can be expanded more than once.
+\bo The expressions in the $\b$(\b((\b(...)\b))\b) word expansion can be ex-
panded more than once.
- +\bo Arithmetic expressions used as indexed array subscripts
+ +\bo Arithmetic expressions used as indexed array subscripts
can be expanded more than once.
- +\bo t\bte\bes\bst\bt -\b-v\bv, when given an argument of A\bA[\b[@\b@]\b], where A\bA is an
+ +\bo t\bte\bes\bst\bt -\b-v\bv, when given an argument of A\bA[\b[@\b@]\b], where A\bA is an
existing associative array, will return true if the array
- has any set elements. Bash-5.2 will look for and report
+ has any set elements. Bash-5.2 will look for and report
on a key named @\b@.
+\bo The ${_\bp_\ba_\br_\ba_\bm_\be_\bt_\be_\br[\b[:\b:]\b]=\b=_\bv_\ba_\bl_\bu_\be} word expansion will return
- _\bv_\ba_\bl_\bu_\be, before any variable-specific transformations have
+ _\bv_\ba_\bl_\bu_\be, before any variable-specific transformations have
been performed (e.g., converting to lowercase). Bash-5.2
will return the final value assigned to the variable.
- +\bo Parsing command substitutions will behave as if extended
+ +\bo Parsing command substitutions will behave as if extended
globbing (see the description of the s\bsh\bho\bop\bpt\bt builtin above)
- is enabled, so that parsing a command substitution con-
+ is enabled, so that parsing a command substitution con-
taining an extglob pattern (say, as part of a shell func-
- tion) will not fail. This assumes the intent is to en-
- able extglob before the command is executed and word ex-
- pansions are performed. It will fail at word expansion
- time if extglob hasn't been enabled by the time the com-
+ tion) will not fail. This assumes the intent is to en-
+ able extglob before the command is executed and word ex-
+ pansions are performed. It will fail at word expansion
+ time if extglob hasn't been enabled by the time the com-
mand is executed.
c\bco\bom\bmp\bpa\bat\bt5\b52\b2
- +\bo The t\bte\bes\bst\bt builtin uses its historical algorithm to parse
- parenthesized subexpressions when given five or more ar-
+ +\bo The t\bte\bes\bst\bt builtin uses its historical algorithm to parse
+ parenthesized subexpressions when given five or more ar-
guments.
- +\bo If the -\b-p\bp or -\b-P\bP option is supplied to the b\bbi\bin\bnd\bd builtin,
+ +\bo If the -\b-p\bp or -\b-P\bP option is supplied to the b\bbi\bin\bnd\bd builtin,
b\bbi\bin\bnd\bd treats any arguments remaining after option process-
- ing as bindable command names, and displays any key se-
- quences bound to those commands, instead of treating the
+ ing as bindable command names, and displays any key se-
+ quences bound to those commands, instead of treating the
arguments as key sequences to bind.
R\bRE\bES\bST\bTR\bRI\bIC\bCT\bTE\bED\bD S\bSH\bHE\bEL\bLL\bL
If b\bba\bas\bsh\bh is started with the name r\brb\bba\bas\bsh\bh, or the -\b-r\br option is supplied at
- invocation, the shell becomes _\br_\be_\bs_\bt_\br_\bi_\bc_\bt_\be_\bd. A restricted shell is used
- to set up an environment more controlled than the standard shell. It
- behaves identically to b\bba\bas\bsh\bh with the exception that the following are
+ invocation, the shell becomes _\br_\be_\bs_\bt_\br_\bi_\bc_\bt_\be_\bd. A restricted shell is used
+ to set up an environment more controlled than the standard shell. It
+ behaves identically to b\bba\bas\bsh\bh with the exception that the following are
disallowed or not performed:
+\bo Changing directories with c\bcd\bd.
- +\bo Setting or unsetting the values of S\bSH\bHE\bEL\bLL\bL, P\bPA\bAT\bTH\bH, H\bHI\bIS\bST\bTF\bFI\bIL\bLE\bE, E\bEN\bNV\bV,
+ +\bo Setting or unsetting the values of S\bSH\bHE\bEL\bLL\bL, P\bPA\bAT\bTH\bH, H\bHI\bIS\bST\bTF\bFI\bIL\bLE\bE, E\bEN\bNV\bV,
or B\bBA\bAS\bSH\bH_\b_E\bEN\bNV\bV.
+\bo Specifying command names containing /\b/.
- +\bo Specifying a filename containing a /\b/ as an argument to the .\b.
+ +\bo Specifying a filename containing a /\b/ as an argument to the .\b.
builtin command.
- +\bo Using the -\b-p\bp option to the .\b. builtin command to specify a
+ +\bo Using the -\b-p\bp option to the .\b. builtin command to specify a
search path.
- +\bo Specifying a filename containing a slash as an argument to the
+ +\bo Specifying a filename containing a slash as an argument to the
h\bhi\bis\bst\bto\bor\bry\by builtin command.
- +\bo Specifying a filename containing a slash as an argument to the
+ +\bo Specifying a filename containing a slash as an argument to the
-\b-p\bp option to the h\bha\bas\bsh\bh builtin command.
- +\bo Importing function definitions from the shell environment at
+ +\bo Importing function definitions from the shell environment at
startup.
- +\bo Parsing the value of S\bSH\bHE\bEL\bLL\bLO\bOP\bPT\bTS\bS from the shell environment at
+ +\bo Parsing the value of S\bSH\bHE\bEL\bLL\bLO\bOP\bPT\bTS\bS from the shell environment at
startup.
- +\bo Redirecting output using the >, >|, <>, >&, &>, and >> redirec-
+ +\bo Redirecting output using the >, >|, <>, >&, &>, and >> redirec-
tion operators.
+\bo Using the e\bex\bxe\bec\bc builtin command to replace the shell with another
command.
- +\bo Adding or deleting builtin commands with the -\b-f\bf and -\b-d\bd options
+ +\bo Adding or deleting builtin commands with the -\b-f\bf and -\b-d\bd options
to the e\ben\bna\bab\bbl\ble\be builtin command.
- +\bo Using the e\ben\bna\bab\bbl\ble\be builtin command to enable disabled shell
+ +\bo Using the e\ben\bna\bab\bbl\ble\be builtin command to enable disabled shell
builtins.
+\bo Specifying the -\b-p\bp option to the c\bco\bom\bmm\bma\ban\bnd\bd builtin command.
- +\bo Turning off restricted mode with s\bse\bet\bt +\b+r\br or s\bsh\bho\bop\bpt\bt -\b-u\bu r\bre\be-\b-
+ +\bo Turning off restricted mode with s\bse\bet\bt +\b+r\br or s\bsh\bho\bop\bpt\bt -\b-u\bu r\bre\be-\b-
s\bst\btr\bri\bic\bct\bte\bed\bd_\b_s\bsh\bhe\bel\bll\bl.
These restrictions are enforced after any startup files are read.
When a command that is found to be a shell script is executed (see C\bCO\bOM\bM-\b-
- M\bMA\bAN\bND\bD E\bEX\bXE\bEC\bCU\bUT\bTI\bIO\bON\bN above), r\brb\bba\bas\bsh\bh turns off any restrictions in the shell
+ M\bMA\bAN\bND\bD E\bEX\bXE\bEC\bCU\bUT\bTI\bIO\bON\bN above), r\brb\bba\bas\bsh\bh turns off any restrictions in the shell
spawned to execute the script.
S\bSE\bEE\bE A\bAL\bLS\bSO\bO
_\b~_\b/_\b._\bb_\ba_\bs_\bh_\br_\bc
The individual per-interactive-shell startup file
_\b~_\b/_\b._\bb_\ba_\bs_\bh_\b__\bl_\bo_\bg_\bo_\bu_\bt
- The individual login shell cleanup file, executed when a login
+ The individual login shell cleanup file, executed when a login
shell exits
_\b~_\b/_\b._\bb_\ba_\bs_\bh_\b__\bh_\bi_\bs_\bt_\bo_\br_\by
- The default value of H\bHI\bIS\bST\bTF\bFI\bIL\bLE\bE, the file in which bash saves the
+ The default value of H\bHI\bIS\bST\bTF\bFI\bIL\bLE\bE, the file in which bash saves the
command history
_\b~_\b/_\b._\bi_\bn_\bp_\bu_\bt_\br_\bc
Individual _\br_\be_\ba_\bd_\bl_\bi_\bn_\be initialization file
B\bBU\bUG\bG R\bRE\bEP\bPO\bOR\bRT\bTS\bS
If you find a bug in b\bba\bas\bsh\bh, you should report it. But first, you should
- make sure that it really is a bug, and that it appears in the latest
- version of b\bba\bas\bsh\bh. The latest version is always available from
+ make sure that it really is a bug, and that it appears in the latest
+ version of b\bba\bas\bsh\bh. The latest version is always available from
_\bf_\bt_\bp_\b:_\b/_\b/_\bf_\bt_\bp_\b._\bg_\bn_\bu_\b._\bo_\br_\bg_\b/_\bp_\bu_\bb_\b/_\bg_\bn_\bu_\b/_\bb_\ba_\bs_\bh_\b/ and _\bh_\bt_\bt_\bp_\b:_\b/_\b/_\bg_\bi_\bt_\b._\bs_\ba_\bv_\ba_\bn_\b-
_\bn_\ba_\bh_\b._\bg_\bn_\bu_\b._\bo_\br_\bg_\b/_\bc_\bg_\bi_\bt_\b/_\bb_\ba_\bs_\bh_\b._\bg_\bi_\bt_\b/_\bs_\bn_\ba_\bp_\bs_\bh_\bo_\bt_\b/_\bb_\ba_\bs_\bh_\b-_\bm_\ba_\bs_\bt_\be_\br_\b._\bt_\ba_\br_\b._\bg_\bz.
- Once you have determined that a bug actually exists, use the _\bb_\ba_\bs_\bh_\bb_\bu_\bg
- command to submit a bug report. If you have a fix, you are encouraged
+ Once you have determined that a bug actually exists, use the _\bb_\ba_\bs_\bh_\bb_\bu_\bg
+ command to submit a bug report. If you have a fix, you are encouraged
to mail that as well! You may send suggestions and "philosophical" bug
- reports to _\bb_\bu_\bg_\b-_\bb_\ba_\bs_\bh_\b@_\bg_\bn_\bu_\b._\bo_\br_\bg or post them to the Usenet newsgroup
+ reports to _\bb_\bu_\bg_\b-_\bb_\ba_\bs_\bh_\b@_\bg_\bn_\bu_\b._\bo_\br_\bg or post them to the Usenet newsgroup
g\bgn\bnu\bu.\b.b\bba\bas\bsh\bh.\b.b\bbu\bug\bg.
ALL bug reports should include:
A description of the bug behaviour
A short script or "recipe" which exercises the bug
- _\bb_\ba_\bs_\bh_\bb_\bu_\bg inserts the first three items automatically into the template
+ _\bb_\ba_\bs_\bh_\bb_\bu_\bg inserts the first three items automatically into the template
it provides for filing a bug report.
Comments and bug reports concerning this manual page should be directed
Shell builtin commands and functions are not stoppable/restartable.
Compound commands and command sequences of the form "a ; b ; c" are not
- handled gracefully when process suspension is attempted. When a
- process is stopped, the shell immediately executes the next command in
- the sequence. It suffices to place the sequence of commands between
- parentheses to force it into a subshell, which may be stopped as a
- unit, or to start the command in the background and immediately bring
+ handled gracefully when process suspension is attempted. When a
+ process is stopped, the shell immediately executes the next command in
+ the sequence. It suffices to place the sequence of commands between
+ parentheses to force it into a subshell, which may be stopped as a
+ unit, or to start the command in the background and immediately bring
it into the foreground.
Array variables may not (yet) be exported.
-GNU Bash 5.3 2024 October 15 _\bB_\bA_\bS_\bH(1)
+GNU Bash 5.3 2024 October 20 _\bB_\bA_\bS_\bH(1)
%!PS-Adobe-2.0
%%Creator: dvips(k) 2024.1 (TeX Live 2024) Copyright 2024 Radical Eye Software
%%Title: bashref.dvi
-%%CreationDate: Fri Oct 18 16:02:44 2024
+%%CreationDate: Sun Oct 20 16:37:35 2024
%%Pages: 211
%%PageOrder: Ascend
%%BoundingBox: 0 0 612 792
%DVIPSWebPage: (www.radicaleye.com)
%DVIPSCommandLine: dvips -D 600 -t letter -o bashref.ps bashref.dvi
%DVIPSParameters: dpi=600
-%DVIPSSource: TeX output 2024.10.18:1202
+%DVIPSSource: TeX output 2024.10.20:1237
%%BeginProcSet: tex.pro 0 0
%!
/TeXDict 300 dict def TeXDict begin/N{def}def/B{bind def}N/S{exch}N/X{S
%%Page: 2 2
TeXDict begin 2 1 bop 150 4279 a Fu(This)35 b(text)h(is)g(a)g(brief)f
(description)h(of)f(the)h(features)g(that)g(are)g(presen)m(t)g(in)f
-(the)h(Bash)f(shell)h(\(v)m(ersion)150 4389 y(5.3,)c(15)f(Octob)s(er)f
+(the)h(Bash)f(shell)h(\(v)m(ersion)150 4389 y(5.3,)c(20)f(Octob)s(er)f
(2024\).)150 4523 y(This)35 b(is)g(Edition)h(5.3,)i(last)f(up)s(dated)d
-(15)i(Octob)s(er)g(2024,)j(of)c Fr(The)h(GNU)g(Bash)f(Reference)i(Man)m
+(20)i(Octob)s(er)g(2024,)j(of)c Fr(The)h(GNU)g(Bash)f(Reference)i(Man)m
(ual)p Fu(,)150 4633 y(for)30 b Ft(Bash)p Fu(,)g(V)-8
b(ersion)31 b(5.3.)150 4767 y(Cop)m(yrigh)m(t)602 4764
y(c)577 4767 y Fq(\015)f Fu(1988{2024)35 b(F)-8 b(ree)31
h(:)f(:)g(:)h(:)f(:)24 b Fu(44)399 1508 y(3.7.2)93 b(Command)29
b(Searc)m(h)i(and)f(Execution)15 b Fn(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)g
(:)h(:)f(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)g(:)h(:)f(:)
-28 b Fu(44)399 1617 y(3.7.3)93 b(Command)29 b(Execution)i(En)m
+28 b Fu(45)399 1617 y(3.7.3)93 b(Command)29 b(Execution)i(En)m
(vironmen)m(t)17 b Fn(:)e(:)h(:)f(:)h(:)f(:)h(:)f(:)g(:)h(:)f(:)h(:)f
(:)g(:)h(:)f(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)g(:)30 b Fu(45)399
1727 y(3.7.4)93 b(En)m(vironmen)m(t)26 b Fn(:)16 b(:)f(:)g(:)h(:)f(:)h
b Fu(47)399 1946 y(3.7.6)93 b(Signals)23 b Fn(:)15 b(:)h(:)f(:)h(:)f(:)
g(:)h(:)f(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)g(:)h(:)f
(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)g(:)h(:)f(:)
-h(:)f(:)g(:)h(:)f(:)h(:)f(:)g(:)h(:)f(:)36 b Fu(47)275
+h(:)f(:)g(:)h(:)f(:)h(:)f(:)g(:)h(:)f(:)36 b Fu(48)275
2056 y(3.8)92 b(Shell)30 b(Scripts)12 b Fn(:)i(:)i(:)f(:)h(:)f(:)h(:)f
(:)g(:)h(:)f(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)g(:)h(:)
f(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)g(:)h(:)f(:)h(:)f
-(:)g(:)h(:)f(:)h(:)f(:)g(:)h(:)f(:)25 b Fu(48)150 2306
+(:)g(:)h(:)f(:)h(:)f(:)g(:)h(:)f(:)25 b Fu(49)150 2306
y Fs(4)135 b(Shell)45 b(Builtin)g(Commands)14 b Fo(:)20
b(:)f(:)h(:)f(:)h(:)f(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)h(:)f(:)h(:)f(:)g
(:)h(:)f(:)h(:)f(:)27 b Fs(50)275 2443 y Fu(4.1)92 b(Bourne)30
(concerned)630 830 y(with)k(the)h(Shell)f(and)g(Utilities)i(p)s(ortion)
e(of)h(the)f Fm(posix)g Fu(1003.1)j(standard.)150 995
y Ft(blank)240 b Fu(A)30 b(space)h(or)g(tab)f(c)m(haracter.)150
-1161 y Ft(builtin)144 b Fu(A)35 b(command)g(that)g(is)g(implemen)m(ted)
-g(in)m(ternally)h(b)m(y)f(the)g(shell)g(itself,)i(rather)d(than)h(b)m
-(y)630 1271 y(an)30 b(executable)i(program)e(somewhere)h(in)f(the)g
-(\014le)h(system.)150 1436 y Ft(control)d(operator)630
-1546 y Fu(A)20 b Ft(token)f Fu(that)i(p)s(erforms)e(a)i(con)m(trol)g
-(function.)37 b(It)21 b(is)f(a)h Ft(newline)d Fu(or)j(one)f(of)h(the)f
-(follo)m(wing:)630 1655 y(`)p Ft(||)p Fu(',)31 b(`)p
-Ft(&&)p Fu(',)f(`)p Ft(&)p Fu(',)h(`)p Ft(;)p Fu(',)g(`)p
-Ft(;;)p Fu(',)f(`)p Ft(;&)p Fu(',)h(`)p Ft(;;&)p Fu(',)f(`)p
-Ft(|)p Fu(',)h(`)p Ft(|&)p Fu(',)f(`)p Ft(\()p Fu(',)h(or)f(`)p
-Ft(\))p Fu('.)150 1821 y Ft(exit)f(status)630 1931 y
-Fu(The)f(v)-5 b(alue)29 b(returned)e(b)m(y)h(a)h(command)f(to)h(its)g
-(caller.)41 b(The)28 b(v)-5 b(alue)29 b(is)f(restricted)h(to)h(eigh)m
-(t)630 2040 y(bits,)h(so)f(the)h(maxim)m(um)f(v)-5 b(alue)31
-b(is)f(255.)150 2206 y Ft(field)240 b Fu(A)27 b(unit)g(of)g(text)h
+1161 y Ft(whitespace)630 1271 y Fu(A)f(c)m(haracter)i(b)s(elonging)f
+(to)g(the)g Ft(space)e Fu(c)m(haracter)j(class)f(in)f(the)g(curren)m(t)
+g(lo)s(cale,)j(or)d(for)630 1380 y(whic)m(h)h Ft(isspace\(\))e
+Fu(returns)h(true.)150 1546 y Ft(builtin)144 b Fu(A)35
+b(command)g(that)g(is)g(implemen)m(ted)g(in)m(ternally)h(b)m(y)f(the)g
+(shell)g(itself,)i(rather)d(than)h(b)m(y)630 1655 y(an)30
+b(executable)i(program)e(somewhere)h(in)f(the)g(\014le)h(system.)150
+1821 y Ft(control)d(operator)630 1931 y Fu(A)20 b Ft(token)f
+Fu(that)i(p)s(erforms)e(a)i(con)m(trol)g(function.)37
+b(It)21 b(is)f(a)h Ft(newline)d Fu(or)j(one)f(of)h(the)f(follo)m(wing:)
+630 2040 y(`)p Ft(||)p Fu(',)31 b(`)p Ft(&&)p Fu(',)f(`)p
+Ft(&)p Fu(',)h(`)p Ft(;)p Fu(',)g(`)p Ft(;;)p Fu(',)f(`)p
+Ft(;&)p Fu(',)h(`)p Ft(;;&)p Fu(',)f(`)p Ft(|)p Fu(',)h(`)p
+Ft(|&)p Fu(',)f(`)p Ft(\()p Fu(',)h(or)f(`)p Ft(\))p
+Fu('.)150 2206 y Ft(exit)f(status)630 2315 y Fu(The)f(v)-5
+b(alue)29 b(returned)e(b)m(y)h(a)h(command)f(to)h(its)g(caller.)41
+b(The)28 b(v)-5 b(alue)29 b(is)f(restricted)h(to)h(eigh)m(t)630
+2425 y(bits,)h(so)f(the)h(maxim)m(um)f(v)-5 b(alue)31
+b(is)f(255.)150 2591 y Ft(field)240 b Fu(A)27 b(unit)g(of)g(text)h
(that)g(is)f(the)g(result)g(of)g(one)h(of)f(the)g(shell)g(expansions.)
-40 b(After)27 b(expansion,)630 2315 y(when)e(executing)h(a)g(command,)h
+40 b(After)27 b(expansion,)630 2700 y(when)e(executing)h(a)g(command,)h
(the)f(resulting)f(\014elds)g(are)h(used)f(as)h(the)g(command)f(name)
-630 2425 y(and)30 b(argumen)m(ts.)150 2591 y Ft(filename)96
+630 2810 y(and)30 b(argumen)m(ts.)150 2975 y Ft(filename)96
b Fu(A)30 b(string)h(of)f(c)m(haracters)i(used)e(to)h(iden)m(tify)g(a)f
-(\014le.)150 2756 y Ft(job)336 b Fu(A)31 b(set)h(of)f(pro)s(cesses)g
+(\014le.)150 3141 y Ft(job)336 b Fu(A)31 b(set)h(of)f(pro)s(cesses)g
(comprising)g(a)g(pip)s(eline,)g(and)g(an)m(y)g(pro)s(cesses)g
-(descended)g(from)f(it,)630 2866 y(that)h(are)g(all)g(in)f(the)h(same)f
-(pro)s(cess)g(group.)150 3031 y Ft(job)f(control)630
-3141 y Fu(A)22 b(mec)m(hanism)g(b)m(y)f(whic)m(h)h(users)f(can)h
+(descended)g(from)f(it,)630 3251 y(that)h(are)g(all)g(in)f(the)h(same)f
+(pro)s(cess)g(group.)150 3416 y Ft(job)f(control)630
+3526 y Fu(A)22 b(mec)m(hanism)g(b)m(y)f(whic)m(h)h(users)f(can)h
(selectiv)m(ely)i(stop)e(\(susp)s(end\))e(and)h(restart)i(\(resume\))
-630 3251 y(execution)32 b(of)e(pro)s(cesses.)150 3416
-y Ft(metacharacter)630 3526 y Fu(A)23 b(c)m(haracter)h(that,)h(when)d
+630 3635 y(execution)32 b(of)e(pro)s(cesses.)150 3801
+y Ft(metacharacter)630 3910 y Fu(A)23 b(c)m(haracter)h(that,)h(when)d
(unquoted,)h(separates)h(w)m(ords.)37 b(A)23 b(metac)m(haracter)i(is)e
-(a)g Ft(space)p Fu(,)630 3635 y Ft(tab)p Fu(,)29 b Ft(newline)p
+(a)g Ft(space)p Fu(,)630 4020 y Ft(tab)p Fu(,)29 b Ft(newline)p
Fu(,)e(or)i(one)h(of)f(the)h(follo)m(wing)g(c)m(haracters:)42
b(`)p Ft(|)p Fu(',)29 b(`)p Ft(&)p Fu(',)h(`)p Ft(;)p
Fu(',)g(`)p Ft(\()p Fu(',)g(`)p Ft(\))p Fu(',)g(`)p Ft(<)p
-Fu(',)f(or)h(`)p Ft(>)p Fu('.)150 3801 y Ft(name)288
+Fu(',)f(or)h(`)p Ft(>)p Fu('.)150 4186 y Ft(name)288
b Fu(A)37 b Ft(word)f Fu(consisting)i(solely)h(of)e(letters,)j(n)m(um)m
(b)s(ers,)e(and)f(underscores,)h(and)f(b)s(eginning)630
-3910 y(with)23 b(a)g(letter)h(or)f(underscore.)38 b Ft(Name)p
+4295 y(with)23 b(a)g(letter)h(or)f(underscore.)38 b Ft(Name)p
Fu(s)22 b(are)h(used)f(as)i(shell)f(v)-5 b(ariable)24
-b(and)e(function)h(names.)630 4020 y(Also)31 b(referred)f(to)h(as)f(an)
-h Ft(identifier)p Fu(.)150 4186 y Ft(operator)96 b Fu(A)38
+b(and)e(function)h(names.)630 4405 y(Also)31 b(referred)f(to)h(as)f(an)
+h Ft(identifier)p Fu(.)150 4570 y Ft(operator)96 b Fu(A)38
b Ft(control)28 b(operator)36 b Fu(or)h(a)i Ft(redirection)27
b(operator)p Fu(.)61 b(See)38 b(Section)g(3.6)h([Redirec-)630
-4295 y(tions],)f(page)f(40,)i(for)d(a)g(list)h(of)f(redirection)h(op)s
+4680 y(tions],)f(page)f(40,)i(for)d(a)g(list)h(of)f(redirection)h(op)s
(erators.)58 b(Op)s(erators)35 b(con)m(tain)j(at)f(least)630
-4405 y(one)31 b(unquoted)e Ft(metacharacter)p Fu(.)150
-4570 y Ft(process)f(group)630 4680 y Fu(A)i(collection)k(of)c(related)h
+4790 y(one)31 b(unquoted)e Ft(metacharacter)p Fu(.)150
+4955 y Ft(process)f(group)630 5065 y Fu(A)i(collection)k(of)c(related)h
(pro)s(cesses)g(eac)m(h)g(ha)m(ving)g(the)g(same)f(pro)s(cess)g(group)g
-Fm(id)p Fu(.)150 4846 y Ft(process)e(group)h(ID)630 4955
+Fm(id)p Fu(.)150 5230 y Ft(process)e(group)h(ID)630 5340
y Fu(A)h(unique)g(iden)m(ti\014er)h(that)f(represen)m(ts)h(a)g
-Ft(process)d(group)h Fu(during)g(its)i(lifetime.)150
-5121 y Ft(reserved)d(word)630 5230 y Fu(A)h Ft(word)e
-Fu(that)i(has)f(a)h(sp)s(ecial)g(meaning)f(to)h(the)g(shell.)40
-b(Most)30 b(reserv)m(ed)e(w)m(ords)g(in)m(tro)s(duce)630
-5340 y(shell)j(\015o)m(w)f(con)m(trol)i(constructs,)f(suc)m(h)f(as)g
-Ft(for)g Fu(and)g Ft(while)p Fu(.)p eop end
+Ft(process)d(group)h Fu(during)g(its)i(lifetime.)p eop
+end
%%Page: 4 10
TeXDict begin 4 9 bop 150 -116 a Fu(Chapter)30 b(2:)41
-b(De\014nitions)2662 b(4)150 299 y Ft(return)29 b(status)630
-408 y Fu(A)h(synon)m(ym)g(for)g Ft(exit)g(status)p Fu(.)150
-568 y Ft(signal)192 b Fu(A)40 b(mec)m(hanism)h(b)m(y)e(whic)m(h)h(a)h
+b(De\014nitions)2662 b(4)150 299 y Ft(reserved)28 b(word)630
+408 y Fu(A)h Ft(word)e Fu(that)i(has)f(a)h(sp)s(ecial)g(meaning)f(to)h
+(the)g(shell.)40 b(Most)30 b(reserv)m(ed)e(w)m(ords)g(in)m(tro)s(duce)
+630 518 y(shell)j(\015o)m(w)f(con)m(trol)i(constructs,)f(suc)m(h)f(as)g
+Ft(for)g Fu(and)g Ft(while)p Fu(.)150 677 y Ft(return)f(status)630
+787 y Fu(A)h(synon)m(ym)g(for)g Ft(exit)g(status)p Fu(.)150
+946 y Ft(signal)192 b Fu(A)40 b(mec)m(hanism)h(b)m(y)e(whic)m(h)h(a)h
(pro)s(cess)e(ma)m(y)i(b)s(e)e(noti\014ed)h(b)m(y)g(the)h(k)m(ernel)f
-(of)g(an)g(ev)m(en)m(t)630 677 y(o)s(ccurring)30 b(in)g(the)h(system.)
-150 837 y Ft(special)d(builtin)630 946 y Fu(A)j(shell)f(builtin)g
+(of)g(an)g(ev)m(en)m(t)630 1056 y(o)s(ccurring)30 b(in)g(the)h(system.)
+150 1215 y Ft(special)d(builtin)630 1325 y Fu(A)j(shell)f(builtin)g
(command)h(that)g(has)f(b)s(een)g(classi\014ed)h(as)g(sp)s(ecial)g(b)m
-(y)f(the)h Fm(posix)f Fu(stan-)630 1056 y(dard.)150 1215
+(y)f(the)h Fm(posix)f Fu(stan-)630 1435 y(dard.)150 1594
y Ft(token)240 b Fu(A)38 b(sequence)h(of)f(c)m(haracters)h(considered)f
(a)h(single)g(unit)e(b)m(y)h(the)h(shell.)64 b(It)38
-b(is)g(either)h(a)630 1325 y Ft(word)29 b Fu(or)i(an)f
-Ft(operator)p Fu(.)150 1484 y Ft(word)288 b Fu(A)28 b(sequence)g(of)g
+b(is)g(either)h(a)630 1704 y Ft(word)29 b Fu(or)i(an)f
+Ft(operator)p Fu(.)150 1863 y Ft(word)288 b Fu(A)28 b(sequence)g(of)g
(c)m(haracters)h(treated)g(as)f(a)g(unit)f(b)m(y)h(the)g(shell.)40
-b(W)-8 b(ords)28 b(ma)m(y)g(not)g(include)630 1594 y(unquoted)i
+b(W)-8 b(ords)28 b(ma)m(y)g(not)g(include)630 1973 y(unquoted)i
Ft(metacharacters)p Fu(.)p eop end
%%Page: 5 11
TeXDict begin 5 10 bop 3705 -116 a Fu(5)150 299 y Fp(3)80
(shell's)h(op)s(eration)f(when)f(it)i(reads)f(and)f(executes)j(a)150
3299 y(command.)h(Basically)-8 b(,)34 b(the)c(shell)h(do)s(es)f(the)h
(follo)m(wing:)199 3456 y(1.)61 b(Reads)42 b(its)h(input)e(from)h(a)g
-(\014le)h(\(see)g(Section)g(3.8)g([Shell)f(Scripts],)j(page)e(48\),)k
+(\014le)h(\(see)g(Section)g(3.8)g([Shell)f(Scripts],)j(page)e(49\),)k
(from)41 b(a)i(string)330 3566 y(supplied)30 b(as)h(an)g(argumen)m(t)h
(to)g(the)f Ft(-c)g Fu(in)m(v)m(o)s(cation)i(option)f(\(see)g(Section)g
(6.1)g([In)m(v)m(oking)g(Bash],)330 3675 y(page)f(98\),)h(or)e(from)g
(shell)g(or)f(shell)h(script.)83 b(This)44 b(is)g(set)h(at)h(shell)630
3272 y(initialization.)d(If)27 b(Bash)h(is)g(in)m(v)m(ok)m(ed)h(with)e
(a)i(\014le)e(of)h(commands)g(\(see)g(Section)h(3.8)g([Shell)630
-3381 y(Scripts],)g(page)g(48\),)h Ft($0)e Fu(is)h(set)g(to)g(the)f
+3381 y(Scripts],)g(page)g(49\),)h Ft($0)e Fu(is)h(set)g(to)g(the)f
(name)h(of)f(that)h(\014le.)41 b(If)28 b(Bash)g(is)h(started)g(with)f
(the)630 3491 y Ft(-c)i Fu(option)h(\(see)h(Section)g(6.1)f([In)m(v)m
(oking)h(Bash],)g(page)f(98\),)i(then)d Ft($0)g Fu(is)h(set)g(to)h(the)
b(that)g(no)f(space)h(ma)m(y)g(app)s(ear)150 518 y(b)s(et)m(w)m(een)k
(the)g Ft(<)f Fu(or)h Ft(>)f Fu(and)g(the)h(left)h(paren)m(thesis,)f
(otherwise)g(the)g(construct)g(w)m(ould)g(b)s(e)f(in)m(terpreted)150
-628 y(as)e(a)f(redirection.)275 761 y(Pro)s(cess)j(substitution)h(is)g
+628 y(as)e(a)f(redirection.)275 766 y(Pro)s(cess)j(substitution)h(is)g
(supp)s(orted)e(on)h(systems)h(that)h(supp)s(ort)d(named)h(pip)s(es)g
-(\()p Fm(fif)n(o)p Fu(s\))h(or)g(the)150 870 y Ft(/dev/fd)28
+(\()p Fm(fif)n(o)p Fu(s\))h(or)g(the)150 875 y Ft(/dev/fd)28
b Fu(metho)s(d)i(of)h(naming)f(op)s(en)g(\014les.)275
-1004 y(When)36 b(a)m(v)-5 b(ailable,)40 b(pro)s(cess)c(substitution)h
+1014 y(When)36 b(a)m(v)-5 b(ailable,)40 b(pro)s(cess)c(substitution)h
(is)f(p)s(erformed)f(sim)m(ultaneously)i(with)g(parameter)g(and)150
-1113 y(v)-5 b(ariable)31 b(expansion,)g(command)f(substitution,)g(and)g
-(arithmetic)i(expansion.)150 1310 y Fk(3.5.7)63 b(W)-10
-b(ord)41 b(Splitting)150 1457 y Fu(The)30 b(shell)h(scans)g(the)g
+1123 y(v)-5 b(ariable)31 b(expansion,)g(command)f(substitution,)g(and)g
+(arithmetic)i(expansion.)150 1326 y Fk(3.5.7)63 b(W)-10
+b(ord)41 b(Splitting)150 1473 y Fu(The)30 b(shell)h(scans)g(the)g
(results)f(of)h(parameter)g(expansion,)g(command)g(substitution,)g(and)
-f(arithmetic)150 1567 y(expansion)g(that)h(did)f(not)g(o)s(ccur)h
-(within)e(double)h(quotes)h(for)f(w)m(ord)g(splitting.)275
-1700 y(The)e(shell)g(treats)i(eac)m(h)g(c)m(haracter)g(of)f
-Ft($IFS)e Fu(as)i(a)g(delimiter,)h(and)e(splits)g(the)h(results)f(of)h
-(the)g(other)150 1809 y(expansions)h(in)m(to)h(w)m(ords)f(using)g
+f(arithmetic)150 1583 y(expansion)e(that)i(did)d(not)i(o)s(ccur)f
+(within)g(double)g(quotes)h(for)g(w)m(ord)f(splitting.)41
+b(W)-8 b(ords)29 b(that)g(w)m(ere)g(not)150 1692 y(expanded)h(are)g
+(not)h(split.)275 1831 y(The)d(shell)g(treats)i(eac)m(h)g(c)m(haracter)
+g(of)f Ft($IFS)e Fu(as)i(a)g(delimiter,)h(and)e(splits)g(the)h(results)
+f(of)h(the)g(other)150 1940 y(expansions)h(in)m(to)h(\014elds)f(using)g
(these)h(c)m(haracters)h(as)e(\014eld)g(terminators.)275
-1943 y(If)38 b Ft(IFS)g Fu(is)g(unset,)j(or)e(its)g(v)-5
-b(alue)39 b(is)g(exactly)h Ft(<space><tab><newline>)p
-Fu(,)c(the)j(default,)i(then)d(se-)150 2052 y(quences)27
-b(of)h Ft(space)p Fu(,)f Ft(tab)p Fu(,)g(and)g Ft(newline)e
-Fu(at)j(the)f(b)s(eginning)g(and)g(end)f(of)i(the)f(results)g(of)h(the)
-f(previous)150 2162 y(expansions)38 b(are)g(ignored,)i(and)d(an)m(y)i
-(sequence)f(of)g Ft(IFS)f Fu(c)m(haracters)j(not)e(at)g(the)g(b)s
-(eginning)g(or)g(end)150 2271 y(delimits)29 b(w)m(ords.)40
-b(If)28 b Ft(IFS)g Fu(has)g(a)h(v)-5 b(alue)30 b(other)e(than)h(the)g
-(default,)g(then)g(sequences)f(of)h(the)g(whitespace)150
-2381 y(c)m(haracters)f Ft(space)p Fu(,)e Ft(tab)p Fu(,)h(and)f
-Ft(newline)e Fu(presen)m(t)j(the)f(v)-5 b(alue)27 b(of)g
-Ft(IFS)e Fu(\(an)i Ft(IFS)f Fu(whitespace)h(c)m(haracter\))150
-2491 y(are)36 b(ignored)h(at)f(the)h(b)s(eginning)e(and)g(end)h(of)g
-(the)g(w)m(ord.)57 b(An)m(y)36 b(c)m(haracter)i(in)e
-Ft(IFS)f Fu(that)h(is)h(not)f Ft(IFS)150 2600 y Fu(whitespace,)27
-b(along)f(with)f(an)m(y)g(adjacen)m(t)h Ft(IFS)e Fu(whitespace)i(c)m
-(haracters,)i(delimits)e(a)f(\014eld.)38 b(A)26 b(sequence)150
-2710 y(of)31 b Ft(IFS)e Fu(whitespace)i(c)m(haracters)h(is)e(also)i
-(treated)f(as)g(a)f(delimiter.)275 2843 y(If)22 b(the)h(v)-5
-b(alue)23 b(of)f Ft(IFS)g Fu(is)h(n)m(ull,)h(no)f(w)m(ord)f(splitting)h
-(o)s(ccurs.)38 b(If)22 b Ft(IFS)g Fu(is)h(unset,)h(w)m(ord)e(splitting)
-h(b)s(eha)m(v)m(es)150 2953 y(as)31 b(if)f(it)h(con)m(tained)g(the)g
-(default)g(v)-5 b(alue)30 b Ft(<space><tab><newline>)p
-Fu(.)275 3086 y(Explicit)21 b(n)m(ull)g(argumen)m(ts)g(\()p
-Ft("")g Fu(or)g Ft('')p Fu(\))f(are)h(retained)h(and)e(passed)g(to)i
-(commands)e(as)i(empt)m(y)f(strings.)150 3196 y(Unquoted)37
-b(implicit)i(n)m(ull)f(argumen)m(ts,)i(resulting)d(from)g(the)h
-(expansion)g(of)g(parameters)f(that)i(ha)m(v)m(e)150
-3305 y(no)32 b(v)-5 b(alues,)33 b(are)f(remo)m(v)m(ed.)47
-b(If)32 b(a)g(parameter)h(with)e(no)h(v)-5 b(alue)33
-b(is)f(expanded)f(within)h(double)f(quotes,)j(a)150 3415
-y(n)m(ull)c(argumen)m(t)g(results)g(and)f(is)h(retained)g(and)f(passed)
-g(to)i(a)f(command)g(as)g(an)f(empt)m(y)i(string.)40
-b(When)150 3524 y(a)f(quoted)f(n)m(ull)g(argumen)m(t)h(app)s(ears)e(as)
-i(part)f(of)g(a)g(w)m(ord)g(whose)g(expansion)g(is)h(non-n)m(ull,)h
-(the)e(n)m(ull)150 3634 y(argumen)m(t)i(is)f(remo)m(v)m(ed.)69
-b(That)39 b(is,)j(the)e(w)m(ord)f Ft(-d'')f Fu(b)s(ecomes)i
-Ft(-d)e Fu(after)i(w)m(ord)f(splitting)h(and)f(n)m(ull)150
-3743 y(argumen)m(t)31 b(remo)m(v)-5 b(al.)275 3877 y(Note)31
-b(that)g(if)g(no)f(expansion)g(o)s(ccurs,)g(no)h(splitting)g(is)f(p)s
-(erformed.)150 4073 y Fk(3.5.8)63 b(Filename)41 b(Expansion)150
-4220 y Fu(After)30 b(w)m(ord)f(splitting,)i(unless)d(the)i
-Ft(-f)f Fu(option)h(has)f(b)s(een)g(set)h(\(see)g(Section)h(4.3.1)g
-([The)e(Set)h(Builtin],)150 4330 y(page)d(71\),)i(Bash)d(scans)h(eac)m
-(h)h(w)m(ord)e(for)g(the)h(c)m(haracters)g(`)p Ft(*)p
-Fu(',)h(`)p Ft(?)p Fu(',)g(and)e(`)p Ft([)p Fu('.)39
-b(If)26 b(one)h(of)g(these)f(c)m(haracters)150 4440 y(app)s(ears,)44
-b(and)d(is)h(not)g(quoted,)j(then)d(the)g(w)m(ord)f(is)h(regarded)g(as)
-g(a)g Fr(pattern)p Fu(,)j(and)c(replaced)h(with)150 4549
-y(a)i(sorted)f(list)h(of)f(\014lenames)g(matc)m(hing)i(the)e(pattern)g
-(\(see)i(Section)f(3.5.8.1)h([P)m(attern)g(Matc)m(hing],)150
-4659 y(page)21 b(38\),)j(sub)5 b(ject)20 b(to)h(the)g(v)-5
+2078 y(An)25 b Fr(IFS)g(whitespace)31 b Fu(c)m(haracter)c(is)f
+(whitespace)g(as)g(de\014ned)e(ab)s(o)m(v)m(e)j(\(see)f(Chapter)f(2)h
+([De\014nitions],)150 2188 y(page)37 b(3\))g(that)g(app)s(ears)e(in)h
+(the)g(v)-5 b(alue)37 b(of)f Ft(IFS)p Fu(.)57 b(Space,)38
+b(tab,)g(and)e(newline)g(are)g(alw)m(a)m(ys)i(considered)150
+2298 y(IFS)30 b(whitespace,)h(ev)m(en)g(if)g(they)f(don't)h(app)s(ear)e
+(in)h(the)h(lo)s(cale's)h Ft(space)d Fu(category)-8 b(.)275
+2436 y(If)26 b Ft(IFS)g Fu(is)h(unset,)h(w)m(ord)e(splitting)i(b)s(eha)
+m(v)m(es)g(as)f(if)g(its)g(v)-5 b(alue)28 b(w)m(ere)f
+Ft(<space><tab><newline>)p Fu(,)c(and)150 2545 y(treats)41
+b(these)f(c)m(haracters)h(as)f(IFS)f(whitespace.)70 b(If)39
+b(the)h(v)-5 b(alue)40 b(of)g Ft(IFS)e Fu(is)i(n)m(ull,)i(no)e(w)m(ord)
+f(splitting)150 2655 y(o)s(ccurs,)30 b(but)g(implicit)h(n)m(ull)g
+(argumen)m(ts)f(\(see)i(b)s(elo)m(w\))f(are)f(still)i(remo)m(v)m(ed.)
+275 2793 y(W)-8 b(ord)43 b(splitting)i(b)s(egins)d(b)m(y)i(remo)m(ving)
+g(sequences)g(of)g(IFS)f(whitespace)h(c)m(haracters)h(from)e(the)150
+2903 y(b)s(eginning)h(and)f(end)h(of)g(the)h(results)f(of)g(the)h
+(previous)e(expansions,)48 b(then)c(splits)g(the)h(remaining)150
+3012 y(w)m(ords.)275 3151 y(If)37 b(the)i(v)-5 b(alue)39
+b(of)f Ft(IFS)g Fu(consists)h(solely)g(of)g(IFS)f(whitespace,)j(an)m(y)
+e(sequence)g(of)f(IFS)g(whitespace)150 3260 y(c)m(haracters)47
+b(delimits)f(a)g(\014eld,)j(so)d(a)f(\014eld)h(consists)g(of)f(c)m
+(haracters)i(that)f(are)g(not)g(unquoted)e(IFS)150 3370
+y(whitespace,)31 b(and)f(n)m(ull)g(\014elds)g(result)h(only)f(from)g
+(quoting.)275 3508 y(If)g Ft(IFS)f Fu(con)m(tains)j(a)f(non-whitespace)
+g(c)m(haracter,)i(then)d(an)m(y)h(c)m(haracter)h(in)e(the)h(v)-5
+b(alue)31 b(of)g Ft(IFS)e Fu(that)150 3618 y(is)h(not)h(IFS)f
+(whitespace,)i(along)f(with)f(an)m(y)h(adjacen)m(t)h(IFS)e(whitespace)h
+(c)m(haracters,)h(delimits)f(a)g(\014eld.)150 3727 y(This)i(means)h
+(that)g(adjacen)m(t)h(non-IFS-whitespace)g(delimiters)f(pro)s(duce)f(a)
+h(n)m(ull)g(\014eld.)51 b(A)34 b(sequence)150 3837 y(of)d(IFS)f
+(whitespace)h(c)m(haracters)g(also)h(delimits)f(a)f(\014eld.)275
+3975 y(Explicit)21 b(n)m(ull)g(argumen)m(ts)g(\()p Ft("")g
+Fu(or)g Ft('')p Fu(\))f(are)h(retained)h(and)e(passed)g(to)i(commands)e
+(as)i(empt)m(y)f(strings.)150 4085 y(Unquoted)26 b(implicit)i(n)m(ull)e
+(argumen)m(ts,)i(resulting)f(from)f(the)h(expansion)f(of)h(parameters)g
+(that)g(ha)m(v)m(e)h(no)150 4194 y(v)-5 b(alues,)31 b(are)h(remo)m(v)m
+(ed.)42 b(Expanding)30 b(a)h(parameter)g(with)g(no)f(v)-5
+b(alue)32 b(within)e(double)g(quotes)h(pro)s(duces)150
+4304 y(a)g(n)m(ull)f(\014eld,)g(whic)m(h)g(is)h(retained)g(and)e
+(passed)h(to)h(a)g(command)f(as)h(an)f(empt)m(y)h(string.)275
+4442 y(When)j(a)i(quoted)f(n)m(ull)g(argumen)m(t)g(app)s(ears)g(as)g
+(part)g(of)g(a)g(w)m(ord)g(whose)g(expansion)g(is)g(non-n)m(ull,)150
+4552 y(w)m(ord)29 b(splitting)h(remo)m(v)m(es)h(the)e(n)m(ull)g
+(argumen)m(t)h(p)s(ortion,)g(lea)m(ving)h(the)e(non-n)m(ull)g
+(expansion.)40 b(That)30 b(is,)150 4661 y(the)h(w)m(ord)f
+Ft(-d'')f Fu(b)s(ecomes)h Ft(-d)g Fu(after)h(w)m(ord)f(splitting)h(and)
+f(n)m(ull)g(argumen)m(t)h(remo)m(v)-5 b(al.)150 4864
+y Fk(3.5.8)63 b(Filename)41 b(Expansion)150 5011 y Fu(After)30
+b(w)m(ord)f(splitting,)i(unless)d(the)i Ft(-f)f Fu(option)h(has)f(b)s
+(een)g(set)h(\(see)g(Section)h(4.3.1)g([The)e(Set)h(Builtin],)150
+5121 y(page)d(71\),)i(Bash)d(scans)h(eac)m(h)h(w)m(ord)e(for)g(the)h(c)
+m(haracters)g(`)p Ft(*)p Fu(',)h(`)p Ft(?)p Fu(',)g(and)e(`)p
+Ft([)p Fu('.)39 b(If)26 b(one)h(of)g(these)f(c)m(haracters)150
+5230 y(app)s(ears,)44 b(and)d(is)h(not)g(quoted,)j(then)d(the)g(w)m
+(ord)f(is)h(regarded)g(as)g(a)g Fr(pattern)p Fu(,)j(and)c(replaced)h
+(with)150 5340 y(a)i(sorted)f(list)h(of)f(\014lenames)g(matc)m(hing)i
+(the)e(pattern)g(\(see)i(Section)f(3.5.8.1)h([P)m(attern)g(Matc)m
+(hing],)p eop end
+%%Page: 38 44
+TeXDict begin 38 43 bop 150 -116 a Fu(Chapter)30 b(3:)41
+b(Basic)32 b(Shell)e(F)-8 b(eatures)2246 b(38)150 299
+y(page)21 b(38\),)j(sub)5 b(ject)20 b(to)h(the)g(v)-5
b(alue)21 b(of)g(the)f Ft(GLOBSORT)e Fu(shell)j(v)-5
b(ariable)21 b(\(see)h(Section)f(5.2)g([Bash)g(V)-8 b(ariables],)150
-4768 y(page)31 b(85\).)275 4902 y(If)d(no)g(matc)m(hing)i(\014lenames)f
+408 y(page)31 b(85\).)275 547 y(If)d(no)g(matc)m(hing)i(\014lenames)f
(are)g(found,)f(and)g(the)h(shell)g(option)g Ft(nullglob)e
-Fu(is)h(disabled,)h(the)g(w)m(ord)150 5011 y(is)38 b(left)g(unc)m
+Fu(is)h(disabled,)h(the)g(w)m(ord)150 656 y(is)38 b(left)g(unc)m
(hanged.)62 b(If)37 b(the)g Ft(nullglob)e Fu(option)j(is)g(set,)i(and)d
(no)g(matc)m(hes)i(are)f(found,)g(the)g(w)m(ord)f(is)150
-5121 y(remo)m(v)m(ed.)j(If)23 b(the)h Ft(failglob)d Fu(shell)j(option)h
+766 y(remo)m(v)m(ed.)j(If)23 b(the)h Ft(failglob)d Fu(shell)j(option)h
(is)e(set,)j(and)e(no)f(matc)m(hes)i(are)f(found,)g(Bash)g(prin)m(ts)g
-(an)f(error)150 5230 y(message)28 b(and)e(do)s(es)h(not)g(execute)h
-(the)f(command.)39 b(If)27 b(the)g(shell)g(option)g Ft(nocaseglob)d
-Fu(is)j(enabled,)h(the)150 5340 y(matc)m(h)j(is)g(p)s(erformed)e
+(an)f(error)150 875 y(message)28 b(and)e(do)s(es)h(not)g(execute)h(the)
+f(command.)39 b(If)27 b(the)g(shell)g(option)g Ft(nocaseglob)d
+Fu(is)j(enabled,)h(the)150 985 y(matc)m(h)j(is)g(p)s(erformed)e
(without)h(regard)g(to)h(the)g(case)g(of)g(alphab)s(etic)g(c)m
-(haracters.)p eop end
-%%Page: 38 44
-TeXDict begin 38 43 bop 150 -116 a Fu(Chapter)30 b(3:)41
-b(Basic)32 b(Shell)e(F)-8 b(eatures)2246 b(38)275 299
-y(When)23 b(a)h(pattern)f(is)h(used)f(for)g(\014lename)h(expansion,)h
-(the)e(c)m(haracter)i(`)p Ft(.)p Fu(')f(at)g(the)g(start)g(of)g(a)g
-(\014lename)150 408 y(or)f(immediately)i(follo)m(wing)g(a)f(slash)f(m)m
-(ust)h(b)s(e)f(matc)m(hed)h(explicitly)-8 b(,)27 b(unless)c(the)g
-(shell)h(option)g Ft(dotglob)150 518 y Fu(is)41 b(set.)74
-b(In)40 b(order)h(to)g(matc)m(h)h(the)g(\014lenames)f
-Ft(.)g Fu(and)f Ft(..)p Fu(,)k(the)d(pattern)g(m)m(ust)g(b)s(egin)g
-(with)g(`)p Ft(.)p Fu(')g(\(for)150 628 y(example,)h(`)p
-Ft(.?)p Fu('\),)f(ev)m(en)f(if)f Ft(dotglob)d Fu(is)j(set.)67
-b(If)38 b(the)h Ft(globskipdots)d Fu(shell)j(option)g(is)g(enabled,)i
-(the)150 737 y(\014lenames)30 b Ft(.)f Fu(and)g Ft(..)h
-Fu(nev)m(er)g(matc)m(h,)h(ev)m(en)f(if)g(the)g(pattern)g(b)s(egins)f
-(with)g(a)i(`)p Ft(.)p Fu('.)40 b(When)30 b(not)g(matc)m(hing)150
-847 y(\014lenames,)h(the)f(`)p Ft(.)p Fu(')h(c)m(haracter)h(is)e(not)h
-(treated)g(sp)s(ecially)-8 b(.)275 985 y(When)30 b(matc)m(hing)i(a)f
-(\014lename,)h(the)f(slash)f(c)m(haracter)j(m)m(ust)d(alw)m(a)m(ys)j(b)
-s(e)d(matc)m(hed)h(explicitly)i(b)m(y)e(a)150 1095 y(slash)d(in)f(the)h
-(pattern,)h(but)e(in)h(other)g(matc)m(hing)h(con)m(texts)h(it)e(can)g
-(b)s(e)g(matc)m(hed)g(b)m(y)g(a)g(sp)s(ecial)h(pattern)150
-1204 y(c)m(haracter)j(as)f(describ)s(ed)e(b)s(elo)m(w)h(\(see)i
-(Section)f(3.5.8.1)i([P)m(attern)e(Matc)m(hing],)i(page)e(38\).)275
-1343 y(See)d(the)g(description)g(of)g Ft(shopt)e Fu(in)i(Section)g
-(4.3.2)i([The)e(Shopt)f(Builtin],)i(page)g(76,)g(for)f(a)g(descrip-)150
-1452 y(tion)j(of)f(the)h Ft(nocaseglob)p Fu(,)d Ft(nullglob)p
-Fu(,)g Ft(globskipdots)p Fu(,)f Ft(failglob)p Fu(,)i(and)h
-Ft(dotglob)e Fu(options.)275 1591 y(The)36 b Ft(GLOBIGNORE)d
-Fu(shell)k(v)-5 b(ariable)37 b(ma)m(y)g(b)s(e)f(used)g(to)h(restrict)g
-(the)g(set)g(of)g(\014le)f(names)h(matc)m(hing)150 1700
-y(a)42 b(pattern.)74 b(If)41 b Ft(GLOBIGNORE)e Fu(is)i(set,)k(eac)m(h)e
-(matc)m(hing)f(\014le)g(name)f(that)h(also)h(matc)m(hes)f(one)g(of)g
-(the)150 1810 y(patterns)34 b(in)g Ft(GLOBIGNORE)d Fu(is)k(remo)m(v)m
-(ed)g(from)f(the)g(list)h(of)f(matc)m(hes.)54 b(If)33
-b(the)i Ft(nocaseglob)c Fu(option)k(is)150 1920 y(set,)c(the)e(matc)m
-(hing)i(against)g(the)f(patterns)f(in)h Ft(GLOBIGNORE)c
-Fu(is)k(p)s(erformed)e(without)i(regard)f(to)i(case.)150
-2029 y(The)d(\014lenames)h Ft(.)g Fu(and)f Ft(..)h Fu(are)g(alw)m(a)m
-(ys)h(ignored)f(when)f Ft(GLOBIGNORE)f Fu(is)i(set)g(and)f(not)h(n)m
-(ull.)41 b(Ho)m(w)m(ev)m(er,)150 2139 y(setting)30 b
-Ft(GLOBIGNORE)d Fu(to)j(a)f(non-n)m(ull)g(v)-5 b(alue)30
-b(has)f(the)g(e\013ect)i(of)f(enabling)f(the)h Ft(dotglob)d
-Fu(shell)i(option,)150 2248 y(so)j(all)h(other)f(\014lenames)g(b)s
-(eginning)f(with)h(a)g(`)p Ft(.)p Fu(')g(will)h(matc)m(h.)46
-b(T)-8 b(o)32 b(get)h(the)f(old)g(b)s(eha)m(vior)g(of)h(ignoring)150
-2358 y(\014lenames)c(b)s(eginning)f(with)h(a)h(`)p Ft(.)p
-Fu(',)f(mak)m(e)h(`)p Ft(.*)p Fu(')f(one)h(of)f(the)g(patterns)g(in)g
-Ft(GLOBIGNORE)p Fu(.)37 b(The)29 b Ft(dotglob)150 2468
-y Fu(option)37 b(is)f(disabled)h(when)e Ft(GLOBIGNORE)f
-Fu(is)i(unset.)59 b(The)36 b Ft(GLOBIGNORE)d Fu(pattern)k(matc)m(hing)h
-(honors)150 2577 y(the)31 b(setting)g(of)g(the)f Ft(extglob)f
-Fu(shell)h(option.)275 2716 y(After)c(the)h(pattern)g(is)f(expanded)g
-(and)g(matc)m(hed)h(against)h(\014lenames,)f(the)g(v)-5
-b(alue)27 b(of)g(the)f Ft(GLOBSORT)150 2825 y Fu(shell)j(v)-5
-b(ariable)30 b(con)m(trols)h(ho)m(w)e(the)h(results)f(are)g(sorted,)h
-(as)f(describ)s(ed)g(b)s(elo)m(w)g(\(see)h(Section)g(5.2)h([Bash)150
-2935 y(V)-8 b(ariables],)32 b(page)f(85\).)150 3138 y
-Fk(3.5.8.1)63 b(P)m(attern)40 b(Matc)m(hing)150 3285
-y Fu(An)m(y)24 b(c)m(haracter)h(that)f(app)s(ears)f(in)g(a)h(pattern,)i
-(other)e(than)f(the)h(sp)s(ecial)g(pattern)g(c)m(haracters)h(describ)s
-(ed)150 3395 y(b)s(elo)m(w,)31 b(matc)m(hes)g(itself.)42
-b(The)29 b Fm(nul)h Fu(c)m(haracter)i(ma)m(y)e(not)h(o)s(ccur)f(in)g(a)
-h(pattern.)40 b(A)31 b(bac)m(kslash)g(escap)s(es)150
-3504 y(the)38 b(follo)m(wing)g(c)m(haracter;)43 b(the)37
-b(escaping)i(bac)m(kslash)e(is)h(discarded)f(when)f(matc)m(hing.)63
-b(The)36 b(sp)s(ecial)150 3614 y(pattern)30 b(c)m(haracters)i(m)m(ust)f
-(b)s(e)e(quoted)i(if)f(they)h(are)f(to)i(b)s(e)d(matc)m(hed)i
-(literally)-8 b(.)275 3752 y(The)29 b(sp)s(ecial)i(pattern)g(c)m
-(haracters)h(ha)m(v)m(e)f(the)g(follo)m(wing)h(meanings:)150
-3917 y Ft(*)432 b Fu(Matc)m(hes)31 b(an)m(y)e(string,)h(including)f
-(the)g(n)m(ull)g(string.)41 b(When)29 b(the)g Ft(globstar)e
-Fu(shell)i(option)630 4027 y(is)37 b(enabled,)h(and)e(`)p
-Ft(*)p Fu(')h(is)g(used)f(in)g(a)h(\014lename)g(expansion)g(con)m
-(text,)j(t)m(w)m(o)e(adjacen)m(t)g(`)p Ft(*)p Fu('s)630
-4137 y(used)f(as)g(a)h(single)g(pattern)g(will)f(matc)m(h)i(all)f
-(\014les)f(and)g(zero)h(or)g(more)f(directories)i(and)630
-4246 y(sub)s(directories.)g(If)25 b(follo)m(w)m(ed)j(b)m(y)e(a)g(`)p
+(haracters.)275 1123 y(When)23 b(a)h(pattern)f(is)h(used)f(for)g
+(\014lename)h(expansion,)h(the)e(c)m(haracter)i(`)p Ft(.)p
+Fu(')f(at)g(the)g(start)g(of)g(a)g(\014lename)150 1233
+y(or)f(immediately)i(follo)m(wing)g(a)f(slash)f(m)m(ust)h(b)s(e)f(matc)
+m(hed)h(explicitly)-8 b(,)27 b(unless)c(the)g(shell)h(option)g
+Ft(dotglob)150 1342 y Fu(is)41 b(set.)74 b(In)40 b(order)h(to)g(matc)m
+(h)h(the)g(\014lenames)f Ft(.)g Fu(and)f Ft(..)p Fu(,)k(the)d(pattern)g
+(m)m(ust)g(b)s(egin)g(with)g(`)p Ft(.)p Fu(')g(\(for)150
+1452 y(example,)h(`)p Ft(.?)p Fu('\),)f(ev)m(en)f(if)f
+Ft(dotglob)d Fu(is)j(set.)67 b(If)38 b(the)h Ft(globskipdots)d
+Fu(shell)j(option)g(is)g(enabled,)i(the)150 1561 y(\014lenames)30
+b Ft(.)f Fu(and)g Ft(..)h Fu(nev)m(er)g(matc)m(h,)h(ev)m(en)f(if)g(the)
+g(pattern)g(b)s(egins)f(with)g(a)i(`)p Ft(.)p Fu('.)40
+b(When)30 b(not)g(matc)m(hing)150 1671 y(\014lenames,)h(the)f(`)p
+Ft(.)p Fu(')h(c)m(haracter)h(is)e(not)h(treated)g(sp)s(ecially)-8
+b(.)275 1809 y(When)30 b(matc)m(hing)i(a)f(\014lename,)h(the)f(slash)f
+(c)m(haracter)j(m)m(ust)d(alw)m(a)m(ys)j(b)s(e)d(matc)m(hed)h
+(explicitly)i(b)m(y)e(a)150 1919 y(slash)d(in)f(the)h(pattern,)h(but)e
+(in)h(other)g(matc)m(hing)h(con)m(texts)h(it)e(can)g(b)s(e)g(matc)m
+(hed)g(b)m(y)g(a)g(sp)s(ecial)h(pattern)150 2028 y(c)m(haracter)j(as)f
+(describ)s(ed)e(b)s(elo)m(w)h(\(see)i(Section)f(3.5.8.1)i([P)m(attern)e
+(Matc)m(hing],)i(page)e(38\).)275 2166 y(See)d(the)g(description)g(of)g
+Ft(shopt)e Fu(in)i(Section)g(4.3.2)i([The)e(Shopt)f(Builtin],)i(page)g
+(76,)g(for)f(a)g(descrip-)150 2276 y(tion)j(of)f(the)h
+Ft(nocaseglob)p Fu(,)d Ft(nullglob)p Fu(,)g Ft(globskipdots)p
+Fu(,)f Ft(failglob)p Fu(,)i(and)h Ft(dotglob)e Fu(options.)275
+2414 y(The)36 b Ft(GLOBIGNORE)d Fu(shell)k(v)-5 b(ariable)37
+b(ma)m(y)g(b)s(e)f(used)g(to)h(restrict)g(the)g(set)g(of)g(\014le)f
+(names)h(matc)m(hing)150 2523 y(a)42 b(pattern.)74 b(If)41
+b Ft(GLOBIGNORE)e Fu(is)i(set,)k(eac)m(h)e(matc)m(hing)f(\014le)g(name)
+f(that)h(also)h(matc)m(hes)f(one)g(of)g(the)150 2633
+y(patterns)34 b(in)g Ft(GLOBIGNORE)d Fu(is)k(remo)m(v)m(ed)g(from)f
+(the)g(list)h(of)f(matc)m(hes.)54 b(If)33 b(the)i Ft(nocaseglob)c
+Fu(option)k(is)150 2743 y(set,)c(the)e(matc)m(hing)i(against)g(the)f
+(patterns)f(in)h Ft(GLOBIGNORE)c Fu(is)k(p)s(erformed)e(without)i
+(regard)f(to)i(case.)150 2852 y(The)d(\014lenames)h Ft(.)g
+Fu(and)f Ft(..)h Fu(are)g(alw)m(a)m(ys)h(ignored)f(when)f
+Ft(GLOBIGNORE)f Fu(is)i(set)g(and)f(not)h(n)m(ull.)41
+b(Ho)m(w)m(ev)m(er,)150 2962 y(setting)30 b Ft(GLOBIGNORE)d
+Fu(to)j(a)f(non-n)m(ull)g(v)-5 b(alue)30 b(has)f(the)g(e\013ect)i(of)f
+(enabling)f(the)h Ft(dotglob)d Fu(shell)i(option,)150
+3071 y(so)j(all)h(other)f(\014lenames)g(b)s(eginning)f(with)h(a)g(`)p
+Ft(.)p Fu(')g(will)h(matc)m(h.)46 b(T)-8 b(o)32 b(get)h(the)f(old)g(b)s
+(eha)m(vior)g(of)h(ignoring)150 3181 y(\014lenames)c(b)s(eginning)f
+(with)h(a)h(`)p Ft(.)p Fu(',)f(mak)m(e)h(`)p Ft(.*)p
+Fu(')f(one)h(of)f(the)g(patterns)g(in)g Ft(GLOBIGNORE)p
+Fu(.)37 b(The)29 b Ft(dotglob)150 3291 y Fu(option)37
+b(is)f(disabled)h(when)e Ft(GLOBIGNORE)f Fu(is)i(unset.)59
+b(The)36 b Ft(GLOBIGNORE)d Fu(pattern)k(matc)m(hing)h(honors)150
+3400 y(the)31 b(setting)g(of)g(the)f Ft(extglob)f Fu(shell)h(option.)
+275 3538 y(After)c(the)h(pattern)g(is)f(expanded)g(and)g(matc)m(hed)h
+(against)h(\014lenames,)f(the)g(v)-5 b(alue)27 b(of)g(the)f
+Ft(GLOBSORT)150 3648 y Fu(shell)j(v)-5 b(ariable)30 b(con)m(trols)h(ho)
+m(w)e(the)h(results)f(are)g(sorted,)h(as)f(describ)s(ed)g(b)s(elo)m(w)g
+(\(see)h(Section)g(5.2)h([Bash)150 3757 y(V)-8 b(ariables],)32
+b(page)f(85\).)150 3960 y Fk(3.5.8.1)63 b(P)m(attern)40
+b(Matc)m(hing)150 4107 y Fu(An)m(y)24 b(c)m(haracter)h(that)f(app)s
+(ears)f(in)g(a)h(pattern,)i(other)e(than)f(the)h(sp)s(ecial)g(pattern)g
+(c)m(haracters)h(describ)s(ed)150 4217 y(b)s(elo)m(w,)31
+b(matc)m(hes)g(itself.)42 b(The)29 b Fm(nul)h Fu(c)m(haracter)i(ma)m(y)
+e(not)h(o)s(ccur)f(in)g(a)h(pattern.)40 b(A)31 b(bac)m(kslash)g(escap)s
+(es)150 4326 y(the)38 b(follo)m(wing)g(c)m(haracter;)43
+b(the)37 b(escaping)i(bac)m(kslash)e(is)h(discarded)f(when)f(matc)m
+(hing.)63 b(The)36 b(sp)s(ecial)150 4436 y(pattern)30
+b(c)m(haracters)i(m)m(ust)f(b)s(e)e(quoted)i(if)f(they)h(are)f(to)i(b)s
+(e)d(matc)m(hed)i(literally)-8 b(.)275 4574 y(The)29
+b(sp)s(ecial)i(pattern)g(c)m(haracters)h(ha)m(v)m(e)f(the)g(follo)m
+(wing)h(meanings:)150 4739 y Ft(*)432 b Fu(Matc)m(hes)31
+b(an)m(y)e(string,)h(including)f(the)g(n)m(ull)g(string.)41
+b(When)29 b(the)g Ft(globstar)e Fu(shell)i(option)630
+4848 y(is)37 b(enabled,)h(and)e(`)p Ft(*)p Fu(')h(is)g(used)f(in)g(a)h
+(\014lename)g(expansion)g(con)m(text,)j(t)m(w)m(o)e(adjacen)m(t)g(`)p
+Ft(*)p Fu('s)630 4958 y(used)f(as)g(a)h(single)g(pattern)g(will)f(matc)
+m(h)i(all)f(\014les)f(and)g(zero)h(or)g(more)f(directories)i(and)630
+5067 y(sub)s(directories.)g(If)25 b(follo)m(w)m(ed)j(b)m(y)e(a)g(`)p
Ft(/)p Fu(',)h(t)m(w)m(o)g(adjacen)m(t)h(`)p Ft(*)p Fu('s)e(will)g
-(matc)m(h)h(only)f(directories)630 4356 y(and)k(sub)s(directories.)150
-4519 y Ft(?)432 b Fu(Matc)m(hes)32 b(an)m(y)f(single)g(c)m(haracter.)
-150 4682 y Ft([...)o(])241 b Fu(Matc)m(hes)27 b(an)m(y)e(one)g(of)g
-(the)g(enclosed)g(c)m(haracters.)41 b(A)25 b(pair)f(of)h(c)m(haracters)
-i(separated)e(b)m(y)g(a)630 4792 y(h)m(yphen)k(denotes)i(a)g
+(matc)m(h)h(only)f(directories)630 5177 y(and)k(sub)s(directories.)150
+5340 y Ft(?)432 b Fu(Matc)m(hes)32 b(an)m(y)f(single)g(c)m(haracter.)p
+eop end
+%%Page: 39 45
+TeXDict begin 39 44 bop 150 -116 a Fu(Chapter)30 b(3:)41
+b(Basic)32 b(Shell)e(F)-8 b(eatures)2246 b(39)150 299
+y Ft([...)o(])241 b Fu(Matc)m(hes)27 b(an)m(y)e(one)g(of)g(the)g
+(enclosed)g(c)m(haracters.)41 b(A)25 b(pair)f(of)h(c)m(haracters)i
+(separated)e(b)m(y)g(a)630 408 y(h)m(yphen)k(denotes)i(a)g
Fr(range)g(expression)p Fu(;)f(an)m(y)h(c)m(haracter)h(that)f(falls)g
-(b)s(et)m(w)m(een)g(those)g(t)m(w)m(o)630 4902 y(c)m(haracters,)d
+(b)s(et)m(w)m(een)g(those)g(t)m(w)m(o)630 518 y(c)m(haracters,)d
(inclusiv)m(e,)f(using)d(the)h(curren)m(t)f(lo)s(cale's)j(collating)g
-(sequence)e(and)f(c)m(haracter)630 5011 y(set,)38 b(matc)m(hes.)60
+(sequence)e(and)f(c)m(haracter)630 628 y(set,)38 b(matc)m(hes.)60
b(If)35 b(the)i(\014rst)e(c)m(haracter)j(follo)m(wing)f(the)g(`)p
Ft([)p Fu(')f(is)g(a)h(`)p Ft(!)p Fu(')f(or)g(a)g(`)p
-Ft(^)p Fu(')h(then)f(an)m(y)630 5121 y(c)m(haracter)c(not)e(within)g
+Ft(^)p Fu(')h(then)f(an)m(y)630 737 y(c)m(haracter)c(not)e(within)g
(the)g(range)g(matc)m(hes.)42 b(T)-8 b(o)31 b(matc)m(h)g(a)f(`)p
Fq(\000)p Fu(',)h(include)e(it)i(as)f(the)h(\014rst)630
-5230 y(or)h(last)h(c)m(haracter)g(in)f(the)g(set.)46
-b(T)-8 b(o)32 b(matc)m(h)h(a)f(`)p Ft(])p Fu(',)h(include)f(it)g(as)g
-(the)h(\014rst)e(c)m(haracter)i(in)630 5340 y(the)e(set.)p
-eop end
-%%Page: 39 45
-TeXDict begin 39 44 bop 150 -116 a Fu(Chapter)30 b(3:)41
-b(Basic)32 b(Shell)e(F)-8 b(eatures)2246 b(39)630 299
-y(The)21 b(sorting)h(order)e(of)i(c)m(haracters)h(in)e(range)h
+847 y(or)h(last)h(c)m(haracter)g(in)f(the)g(set.)46 b(T)-8
+b(o)32 b(matc)m(h)h(a)f(`)p Ft(])p Fu(',)h(include)f(it)g(as)g(the)h
+(\014rst)e(c)m(haracter)i(in)630 956 y(the)e(set.)630
+1094 y(The)21 b(sorting)h(order)e(of)i(c)m(haracters)h(in)e(range)h
(expressions,)h(and)d(the)i(c)m(haracters)h(included)630
-408 y(in)37 b(the)g(range,)j(are)d(determined)g(b)m(y)g(the)g(curren)m
+1204 y(in)37 b(the)g(range,)j(are)d(determined)g(b)m(y)g(the)g(curren)m
(t)g(lo)s(cale)i(and)d(the)i(v)-5 b(alues)37 b(of)g(the)h
-Ft(LC_)630 518 y(COLLATE)28 b Fu(and)i Ft(LC_ALL)f Fu(shell)h(v)-5
-b(ariables,)32 b(if)e(set.)630 654 y(F)-8 b(or)34 b(example,)g(in)f
+Ft(LC_)630 1314 y(COLLATE)28 b Fu(and)i Ft(LC_ALL)f Fu(shell)h(v)-5
+b(ariables,)32 b(if)e(set.)630 1452 y(F)-8 b(or)34 b(example,)g(in)f
(the)g(default)g(C)f(lo)s(cale,)k(`)p Ft([a-dx-z])p Fu(')31
b(is)i(equiv)-5 b(alen)m(t)34 b(to)g(`)p Ft([abcdxyz])p
-Fu('.)630 763 y(Man)m(y)68 b(lo)s(cales)h(sort)f(c)m(haracters)h(in)e
+Fu('.)630 1561 y(Man)m(y)68 b(lo)s(cales)h(sort)f(c)m(haracters)h(in)e
(dictionary)i(order,)76 b(and)67 b(in)g(these)h(lo)s(cales)630
-873 y(`)p Ft([a-dx-z])p Fu(')36 b(is)i(t)m(ypically)i(not)e(equiv)-5
+1671 y(`)p Ft([a-dx-z])p Fu(')36 b(is)i(t)m(ypically)i(not)e(equiv)-5
b(alen)m(t)39 b(to)g(`)p Ft([abcdxyz])p Fu(';)g(it)g(migh)m(t)f(b)s(e)f
-(equiv)-5 b(alen)m(t)630 982 y(to)34 b(`)p Ft([aBbCcDdxYyZz])p
+(equiv)-5 b(alen)m(t)630 1780 y(to)34 b(`)p Ft([aBbCcDdxYyZz])p
Fu(',)c(for)j(example.)49 b(T)-8 b(o)33 b(obtain)h(the)f(traditional)h
-(in)m(terpretation)h(of)630 1092 y(ranges)e(in)f(brac)m(k)m(et)i
+(in)m(terpretation)h(of)630 1890 y(ranges)e(in)f(brac)m(k)m(et)i
(expressions,)g(y)m(ou)f(can)g(force)g(the)g(use)f(of)h(the)g(C)f(lo)s
-(cale)i(b)m(y)f(setting)630 1201 y(the)c Ft(LC_COLLATE)e
+(cale)i(b)m(y)f(setting)630 2000 y(the)c Ft(LC_COLLATE)e
Fu(or)i Ft(LC_ALL)f Fu(en)m(vironmen)m(t)i(v)-5 b(ariable)30
b(to)g(the)f(v)-5 b(alue)30 b(`)p Ft(C)p Fu(',)g(or)f(enable)h(the)630
-1311 y Ft(globasciiranges)c Fu(shell)31 b(option.)630
-1447 y(Within)23 b(`)p Ft([)p Fu(')h(and)e(`)p Ft(])p
+2109 y Ft(globasciiranges)c Fu(shell)31 b(option.)630
+2247 y(Within)23 b(`)p Ft([)p Fu(')h(and)e(`)p Ft(])p
Fu(',)j Fr(c)m(haracter)g(classes)j Fu(can)c(b)s(e)e(sp)s(eci\014ed)h
(using)f(the)i(syn)m(tax)f Ft([:)p Fr(class)t Ft(:])p
-Fu(,)630 1556 y(where)30 b Fr(class)35 b Fu(is)30 b(one)h(of)f(the)h
+Fu(,)630 2357 y(where)30 b Fr(class)35 b Fu(is)30 b(one)h(of)f(the)h
(follo)m(wing)h(classes)f(de\014ned)e(in)h(the)h Fm(posix)f
-Fu(standard:)870 1692 y Ft(alnum)142 b(alpha)g(ascii)f(blank)h(cntrl)g
-(digit)g(graph)g(lower)870 1801 y(print)g(punct)g(space)f(upper)h(word)
-190 b(xdigit)630 1937 y Fu(A)42 b(c)m(haracter)h(class)f(matc)m(hes)h
+Fu(standard:)870 2495 y Ft(alnum)142 b(alpha)g(ascii)f(blank)h(cntrl)g
+(digit)g(graph)g(lower)870 2605 y(print)g(punct)g(space)f(upper)h(word)
+190 b(xdigit)630 2743 y Fu(A)42 b(c)m(haracter)h(class)f(matc)m(hes)h
(an)m(y)f(c)m(haracter)h(b)s(elonging)f(to)g(that)g(class.)75
-b(The)41 b Ft(word)630 2046 y Fu(c)m(haracter)32 b(class)f(matc)m(hes)h
+b(The)41 b Ft(word)630 2852 y Fu(c)m(haracter)32 b(class)f(matc)m(hes)h
(letters,)f(digits,)h(and)d(the)i(c)m(haracter)h(`)p
-Ft(_)p Fu('.)630 2182 y(Within)25 b(`)p Ft([)p Fu(')f(and)g(`)p
+Ft(_)p Fu('.)630 2990 y(Within)25 b(`)p Ft([)p Fu(')f(and)g(`)p
Ft(])p Fu(',)i(an)e Fr(equiv)-5 b(alence)26 b(class)j
Fu(can)24 b(b)s(e)g(sp)s(eci\014ed)g(using)g(the)g(syn)m(tax)h
-Ft([=)p Fr(c)6 b Ft(=])p Fu(,)630 2291 y(whic)m(h)29
+Ft([=)p Fr(c)6 b Ft(=])p Fu(,)630 3100 y(whic)m(h)29
b(matc)m(hes)i(all)f(c)m(haracters)h(with)e(the)h(same)g(collation)h(w)
-m(eigh)m(t)g(\(as)f(de\014ned)e(b)m(y)i(the)630 2401
+m(eigh)m(t)g(\(as)f(de\014ned)e(b)m(y)i(the)630 3209
y(curren)m(t)g(lo)s(cale\))j(as)d(the)h(c)m(haracter)h
-Fr(c)p Fu(.)630 2536 y(Within)22 b(`)p Ft([)p Fu(')f(and)g(`)p
+Fr(c)p Fu(.)630 3347 y(Within)22 b(`)p Ft([)p Fu(')f(and)g(`)p
Ft(])p Fu(',)j(the)d(syn)m(tax)h Ft([.)p Fr(sym)m(b)s(ol)t
Ft(.])e Fu(matc)m(hes)i(the)g(collating)i(sym)m(b)s(ol)d
-Fr(sym)m(b)s(ol)p Fu(.)275 2699 y(If)i(the)g Ft(extglob)f
+Fr(sym)m(b)s(ol)p Fu(.)275 3518 y(If)i(the)g Ft(extglob)f
Fu(shell)h(option)h(is)g(enabled)f(using)g(the)h Ft(shopt)e
Fu(builtin,)i(the)g(shell)f(recognizes)j(sev)m(eral)150
-2808 y(extended)i(pattern)f(matc)m(hing)i(op)s(erators.)40
+3627 y(extended)i(pattern)f(matc)m(hing)i(op)s(erators.)40
b(In)26 b(the)i(follo)m(wing)h(description,)g(a)e Fr(pattern-list)k
-Fu(is)d(a)g(list)g(of)150 2918 y(one)23 b(or)f(more)h(patterns)g
+Fu(is)d(a)g(list)g(of)150 3737 y(one)23 b(or)f(more)h(patterns)g
(separated)g(b)m(y)f(a)h(`)p Ft(|)p Fu('.)38 b(When)22
b(matc)m(hing)i(\014lenames,)g(the)f Ft(dotglob)e Fu(shell)h(option)150
-3028 y(determines)h(the)h(set)g(of)g(\014lenames)f(that)h(are)g
+3846 y(determines)h(the)h(set)g(of)g(\014lenames)f(that)h(are)g
(tested,)i(as)d(describ)s(ed)g(ab)s(o)m(v)m(e.)39 b(Comp)s(osite)24
-b(patterns)f(ma)m(y)150 3137 y(b)s(e)30 b(formed)g(using)f(one)i(or)f
-(more)h(of)g(the)f(follo)m(wing)i(sub-patterns:)150 3300
-y Ft(?\()p Fj(pattern-list)p Ft(\))630 3409 y Fu(Matc)m(hes)g(zero)f
+b(patterns)f(ma)m(y)150 3956 y(b)s(e)30 b(formed)g(using)f(one)i(or)f
+(more)h(of)g(the)f(follo)m(wing)i(sub-patterns:)150 4126
+y Ft(?\()p Fj(pattern-list)p Ft(\))630 4236 y Fu(Matc)m(hes)g(zero)f
(or)g(one)f(o)s(ccurrence)h(of)f(the)h(giv)m(en)g(patterns.)150
-3571 y Ft(*\()p Fj(pattern-list)p Ft(\))630 3680 y Fu(Matc)m(hes)h
+4402 y Ft(*\()p Fj(pattern-list)p Ft(\))630 4512 y Fu(Matc)m(hes)h
(zero)f(or)g(more)f(o)s(ccurrences)h(of)f(the)h(giv)m(en)g(patterns.)
-150 3842 y Ft(+\()p Fj(pattern-list)p Ft(\))630 3951
+150 4678 y Ft(+\()p Fj(pattern-list)p Ft(\))630 4788
y Fu(Matc)m(hes)h(one)f(or)f(more)h(o)s(ccurrences)f(of)h(the)f(giv)m
-(en)i(patterns.)150 4113 y Ft(@\()p Fj(pattern-list)p
-Ft(\))630 4222 y Fu(Matc)m(hes)g(one)f(of)f(the)h(giv)m(en)g(patterns.)
-150 4384 y Ft(!\()p Fj(pattern-list)p Ft(\))630 4493
+(en)i(patterns.)150 4954 y Ft(@\()p Fj(pattern-list)p
+Ft(\))630 5064 y Fu(Matc)m(hes)g(one)f(of)f(the)h(giv)m(en)g(patterns.)
+150 5230 y Ft(!\()p Fj(pattern-list)p Ft(\))630 5340
y Fu(Matc)m(hes)h(an)m(ything)f(except)g(one)g(of)f(the)h(giv)m(en)g
-(patterns.)275 4656 y(The)h Ft(extglob)f Fu(option)j(c)m(hanges)g(the)f
-(b)s(eha)m(vior)g(of)h(the)f(parser,)g(since)h(the)f(paren)m(theses)h
-(are)f(nor-)150 4765 y(mally)44 b(treated)g(as)f(op)s(erators)g(with)g
-(syn)m(tactic)i(meaning.)79 b(T)-8 b(o)44 b(ensure)e(that)i(extended)f
-(matc)m(hing)150 4875 y(patterns)30 b(are)g(parsed)f(correctly)-8
-b(,)32 b(mak)m(e)e(sure)g(that)g Ft(extglob)e Fu(is)h(enabled)h(b)s
-(efore)f(parsing)h(constructs)150 4984 y(con)m(taining)i(the)e
-(patterns,)h(including)f(shell)h(functions)f(and)f(command)h
-(substitutions.)275 5121 y(When)c(matc)m(hing)i(\014lenames,)g(the)f
-Ft(dotglob)e Fu(shell)i(option)h(determines)f(the)g(set)g(of)g
-(\014lenames)g(that)150 5230 y(are)34 b(tested:)47 b(when)33
-b Ft(dotglob)e Fu(is)i(enabled,)i(the)e(set)h(of)g(\014lenames)f
-(includes)g(all)h(\014les)g(b)s(eginning)e(with)150 5340
-y(`)p Ft(.)p Fu(',)j(but)e(the)i(\014lenames)f Ft(.)f
-Fu(and)h Ft(..)f Fu(m)m(ust)h(b)s(e)f(matc)m(hed)i(b)m(y)e(a)i(pattern)
-f(or)g(sub-pattern)f(that)h(b)s(egins)p eop end
+(patterns.)p eop end
%%Page: 40 46
TeXDict begin 40 45 bop 150 -116 a Fu(Chapter)30 b(3:)41
-b(Basic)32 b(Shell)e(F)-8 b(eatures)2246 b(40)150 299
-y(with)34 b(a)h(dot;)h(when)e(it)g(is)h(disabled,)g(the)f(set)h(do)s
+b(Basic)32 b(Shell)e(F)-8 b(eatures)2246 b(40)275 299
+y(The)32 b Ft(extglob)f Fu(option)j(c)m(hanges)g(the)f(b)s(eha)m(vior)g
+(of)h(the)f(parser,)g(since)h(the)f(paren)m(theses)h(are)f(nor-)150
+408 y(mally)44 b(treated)g(as)f(op)s(erators)g(with)g(syn)m(tactic)i
+(meaning.)79 b(T)-8 b(o)44 b(ensure)e(that)i(extended)f(matc)m(hing)150
+518 y(patterns)30 b(are)g(parsed)f(correctly)-8 b(,)32
+b(mak)m(e)e(sure)g(that)g Ft(extglob)e Fu(is)h(enabled)h(b)s(efore)f
+(parsing)h(constructs)150 628 y(con)m(taining)i(the)e(patterns,)h
+(including)f(shell)h(functions)f(and)f(command)h(substitutions.)275
+778 y(When)c(matc)m(hing)i(\014lenames,)g(the)f Ft(dotglob)e
+Fu(shell)i(option)h(determines)f(the)g(set)g(of)g(\014lenames)g(that)
+150 887 y(are)34 b(tested:)47 b(when)33 b Ft(dotglob)e
+Fu(is)i(enabled,)i(the)e(set)h(of)g(\014lenames)f(includes)g(all)h
+(\014les)g(b)s(eginning)e(with)150 997 y(`)p Ft(.)p Fu(',)j(but)e(the)i
+(\014lenames)f Ft(.)f Fu(and)h Ft(..)f Fu(m)m(ust)h(b)s(e)f(matc)m(hed)
+i(b)m(y)e(a)i(pattern)f(or)g(sub-pattern)f(that)h(b)s(egins)150
+1106 y(with)g(a)h(dot;)h(when)e(it)g(is)h(disabled,)g(the)f(set)h(do)s
(es)f(not)g(include)g(an)m(y)h(\014lenames)f(b)s(eginning)g(with)g(`)p
-Ft(.)p Fu(')150 408 y(unless)j(the)h(pattern)g(or)g(sub-pattern)f(b)s
+Ft(.)p Fu(')150 1216 y(unless)j(the)h(pattern)g(or)g(sub-pattern)f(b)s
(egins)g(with)h(a)g(`)p Ft(.)p Fu('.)64 b(If)37 b(the)h
-Ft(globskipdots)d Fu(shell)j(option)g(is)150 518 y(enabled,)e(the)e
+Ft(globskipdots)d Fu(shell)j(option)g(is)150 1325 y(enabled,)e(the)e
(\014lenames)h Ft(.)f Fu(and)f Ft(..)h Fu(nev)m(er)h(app)s(ear)e(in)i
(the)f(set.)53 b(As)35 b(ab)s(o)m(v)m(e,)h(`)p Ft(.)p
-Fu(')f(only)f(has)h(a)f(sp)s(ecial)150 628 y(meaning)d(when)e(matc)m
-(hing)i(\014lenames.)275 764 y(Complicated)41 b(extended)f(pattern)g
+Fu(')f(only)f(has)h(a)f(sp)s(ecial)150 1435 y(meaning)d(when)e(matc)m
+(hing)i(\014lenames.)275 1585 y(Complicated)41 b(extended)f(pattern)g
(matc)m(hing)h(against)h(long)f(strings)f(is)g(slo)m(w,)k(esp)s
-(ecially)d(when)150 873 y(the)29 b(patterns)g(con)m(tain)i
+(ecially)d(when)150 1695 y(the)29 b(patterns)g(con)m(tain)i
(alternations)f(and)f(the)g(strings)g(con)m(tain)h(m)m(ultiple)g(matc)m
-(hes.)42 b(Using)29 b(separate)150 983 y(matc)m(hes)38
+(hes.)42 b(Using)29 b(separate)150 1804 y(matc)m(hes)38
b(against)g(shorter)e(strings,)i(or)f(using)f(arra)m(ys)h(of)g(strings)
-f(instead)h(of)g(a)g(single)g(long)h(string,)150 1092
-y(ma)m(y)31 b(b)s(e)f(faster.)150 1293 y Fk(3.5.9)63
-b(Quote)41 b(Remo)m(v)-7 b(al)150 1440 y Fu(After)32
+f(instead)h(of)g(a)g(single)g(long)h(string,)150 1914
+y(ma)m(y)31 b(b)s(e)f(faster.)150 2128 y Fk(3.5.9)63
+b(Quote)41 b(Remo)m(v)-7 b(al)150 2275 y Fu(After)32
b(the)g(preceding)g(expansions,)h(all)f(unquoted)f(o)s(ccurrences)h(of)
g(the)h(c)m(haracters)g(`)p Ft(\\)p Fu(',)g(`)p Ft(')p
-Fu(',)f(and)g(`)p Ft(")p Fu(')150 1549 y(that)f(did)f(not)g(result)g
+Fu(',)f(and)g(`)p Ft(")p Fu(')150 2385 y(that)f(did)f(not)g(result)g
(from)g(one)h(of)g(the)f(ab)s(o)m(v)m(e)i(expansions)e(are)h(remo)m(v)m
-(ed.)150 1792 y Fs(3.6)68 b(Redirections)150 1952 y Fu(Before)32
+(ed.)150 2649 y Fs(3.6)68 b(Redirections)150 2808 y Fu(Before)32
b(a)f(command)f(is)h(executed,)h(its)f(input)e(and)h(output)h(ma)m(y)g
(b)s(e)f Fr(redirected)k Fu(using)c(a)i(sp)s(ecial)f(no-)150
-2061 y(tation)d(in)m(terpreted)f(b)m(y)f(the)h(shell.)40
+2918 y(tation)d(in)m(terpreted)f(b)m(y)f(the)h(shell.)40
b Fr(Redirection)27 b Fu(allo)m(ws)h(commands')f(\014le)f(handles)g(to)
-i(b)s(e)e(duplicated,)150 2171 y(op)s(ened,)i(closed,)i(made)e(to)h
+i(b)s(e)e(duplicated,)150 3027 y(op)s(ened,)i(closed,)i(made)e(to)h
(refer)f(to)h(di\013eren)m(t)f(\014les,)h(and)f(can)g(c)m(hange)h(the)g
-(\014les)f(the)g(command)g(reads)150 2280 y(from)34 b(and)g(writes)h
+(\014les)f(the)g(command)g(reads)150 3137 y(from)34 b(and)g(writes)h
(to.)54 b(When)35 b(used)f(with)g(the)h Ft(exec)f Fu(builtin,)h
(redirections)g(mo)s(dify)f(\014le)h(handles)f(in)150
-2390 y(the)f(curren)m(t)g(shell)g(execution)h(en)m(vironmen)m(t.)49
+3246 y(the)f(curren)m(t)g(shell)g(execution)h(en)m(vironmen)m(t.)49
b(The)33 b(follo)m(wing)h(redirection)g(op)s(erators)f(ma)m(y)h
-(precede)150 2500 y(or)29 b(app)s(ear)g(an)m(ywhere)g(within)g(a)h
+(precede)150 3356 y(or)29 b(app)s(ear)g(an)m(ywhere)g(within)g(a)h
(simple)f(command)g(or)h(ma)m(y)g(follo)m(w)g(a)g(command.)40
-b(Redirections)31 b(are)150 2609 y(pro)s(cessed)f(in)g(the)g(order)g
+b(Redirections)31 b(are)150 3466 y(pro)s(cessed)f(in)g(the)g(order)g
(they)h(app)s(ear,)f(from)g(left)h(to)g(righ)m(t.)275
-2745 y(Eac)m(h)45 b(redirection)h(that)f(ma)m(y)h(b)s(e)e(preceded)g(b)
+3616 y(Eac)m(h)45 b(redirection)h(that)f(ma)m(y)h(b)s(e)e(preceded)g(b)
m(y)h(a)h(\014le)f(descriptor)f(n)m(um)m(b)s(er)g(ma)m(y)h(instead)h(b)
-s(e)150 2855 y(preceded)41 b(b)m(y)g(a)h(w)m(ord)f(of)g(the)h(form)f
+s(e)150 3725 y(preceded)41 b(b)m(y)g(a)h(w)m(ord)f(of)g(the)h(form)f
Fi({)p Fr(v)-5 b(arname)5 b Fi(})p Fu(.)74 b(In)41 b(this)g(case,)k
-(for)c(eac)m(h)i(redirection)f(op)s(erator)150 2964 y(except)37
+(for)c(eac)m(h)i(redirection)f(op)s(erator)150 3835 y(except)37
b Ft(>)p Fu(&-)e(and)g Ft(<)p Fu(&-,)i(the)f(shell)g(will)g(allo)s
(cate)j(a)d(\014le)g(descriptor)f(greater)i(than)f(10)g(and)f(assign)h
-(it)150 3074 y(to)k Fi({)p Fr(v)-5 b(arname)5 b Fi(})p
+(it)150 3944 y(to)k Fi({)p Fr(v)-5 b(arname)5 b Fi(})p
Fu(.)68 b(If)38 b Fi({)p Fr(v)-5 b(arname)5 b Fi(})40
b Fu(precedes)f Ft(>)p Fu(&-)g(or)g Ft(<)p Fu(&-,)i(the)e(v)-5
b(alue)40 b(of)f Fr(v)-5 b(arname)44 b Fu(de\014nes)39
-b(the)g(\014le)150 3183 y(descriptor)34 b(to)g(close.)52
+b(the)g(\014le)150 4054 y(descriptor)34 b(to)g(close.)52
b(If)34 b Fi({)p Fr(v)-5 b(arname)5 b Fi(})34 b Fu(is)g(supplied,)g
(the)g(redirection)g(p)s(ersists)f(b)s(ey)m(ond)g(the)h(scop)s(e)g(of)
-150 3293 y(the)i(command,)h(whic)m(h)e(allo)m(ws)i(the)f(shell)g
+150 4163 y(the)i(command,)h(whic)m(h)e(allo)m(ws)i(the)f(shell)g
(programmer)f(to)h(manage)h(the)e(\014le)h(descriptor's)g(lifetime)150
-3403 y(man)m(ually)d(without)g(using)g(the)g Ft(exec)e
+4273 y(man)m(ually)d(without)g(using)g(the)g Ft(exec)e
Fu(builtin.)48 b(The)32 b Ft(varredir_close)d Fu(shell)k(option)g
-(manages)h(this)150 3512 y(b)s(eha)m(vior)c(\(see)i(Section)f(4.3.2)h
-([The)e(Shopt)g(Builtin],)h(page)g(76\).)275 3648 y(In)c(the)i(follo)m
+(manages)h(this)150 4383 y(b)s(eha)m(vior)c(\(see)i(Section)f(4.3.2)h
+([The)e(Shopt)g(Builtin],)h(page)g(76\).)275 4533 y(In)c(the)i(follo)m
(wing)h(descriptions,)g(if)e(the)h(\014le)g(descriptor)f(n)m(um)m(b)s
(er)g(is)g(omitted,)i(and)f(the)f(\014rst)g(c)m(har-)150
-3758 y(acter)42 b(of)f(the)g(redirection)g(op)s(erator)g(is)g(`)p
+4642 y(acter)42 b(of)f(the)g(redirection)g(op)s(erator)g(is)g(`)p
Ft(<)p Fu(',)i(the)e(redirection)g(refers)g(to)g(the)g(standard)f
-(input)f(\(\014le)150 3867 y(descriptor)33 b(0\).)49
+(input)f(\(\014le)150 4752 y(descriptor)33 b(0\).)49
b(If)33 b(the)g(\014rst)f(c)m(haracter)i(of)g(the)f(redirection)g(op)s
(erator)h(is)f(`)p Ft(>)p Fu(',)h(the)f(redirection)g(refers)150
-3977 y(to)e(the)g(standard)e(output)h(\(\014le)h(descriptor)f(1\).)275
-4113 y(The)h Fr(w)m(ord)k Fu(follo)m(wing)f(the)e(redirection)h(op)s
+4861 y(to)e(the)g(standard)e(output)h(\(\014le)h(descriptor)f(1\).)275
+5011 y(The)h Fr(w)m(ord)k Fu(follo)m(wing)f(the)e(redirection)h(op)s
(erator)f(in)g(the)g(follo)m(wing)h(descriptions,)g(unless)e(other-)150
-4222 y(wise)26 b(noted,)i(is)e(sub)5 b(jected)26 b(to)h(brace)f
+5121 y(wise)26 b(noted,)i(is)e(sub)5 b(jected)26 b(to)h(brace)f
(expansion,)i(tilde)e(expansion,)i(parameter)e(and)g(v)-5
-b(ariable)27 b(expan-)150 4332 y(sion,)i(command)g(substitution,)g
+b(ariable)27 b(expan-)150 5230 y(sion,)i(command)g(substitution,)g
(arithmetic)h(expansion,)g(quote)f(remo)m(v)-5 b(al,)31
-b(\014lename)e(expansion,)h(and)150 4441 y(w)m(ord)g(splitting.)41
+b(\014lename)e(expansion,)h(and)150 5340 y(w)m(ord)g(splitting.)41
b(If)30 b(it)h(expands)f(to)h(more)f(than)h(one)f(w)m(ord,)g(Bash)h
-(rep)s(orts)f(an)g(error.)275 4577 y(The)f(order)h(of)h(redirections)g
-(is)f(signi\014can)m(t.)42 b(F)-8 b(or)31 b(example,)g(the)g(command)
-390 4713 y Ft(ls)47 b(>)h Fj(dirlist)d Ft(2>&1)150 4849
-y Fu(directs)28 b(b)s(oth)f(standard)g(output)g(\(\014le)h(descriptor)f
-(1\))i(and)e(standard)f(error)i(\(\014le)g(descriptor)f(2\))h(to)h(the)
-150 4959 y(\014le)h Fr(dirlist)p Fu(,)h(while)f(the)h(command)390
-5095 y Ft(ls)47 b(2>&1)g(>)g Fj(dirlist)150 5230 y Fu(directs)28
-b(only)f(the)h(standard)e(output)i(to)g(\014le)f Fr(dirlist)p
-Fu(,)h(b)s(ecause)g(the)f(standard)g(error)g(w)m(as)h(made)f(a)h(cop)m
-(y)150 5340 y(of)j(the)f(standard)g(output)g(b)s(efore)g(the)g
-(standard)g(output)g(w)m(as)g(redirected)h(to)g Fr(dirlist)p
-Fu(.)p eop end
+(rep)s(orts)f(an)g(error.)p eop end
%%Page: 41 47
TeXDict begin 41 46 bop 150 -116 a Fu(Chapter)30 b(3:)41
b(Basic)32 b(Shell)e(F)-8 b(eatures)2246 b(41)275 299
-y(Bash)26 b(handles)f(sev)m(eral)j(\014lenames)e(sp)s(ecially)h(when)f
-(they)g(are)g(used)g(in)g(redirections,)i(as)e(describ)s(ed)150
-408 y(in)38 b(the)h(follo)m(wing)h(table.)66 b(If)38
-b(the)h(op)s(erating)g(system)f(on)h(whic)m(h)f(Bash)h(is)f(running)f
-(pro)m(vides)h(these)150 518 y(sp)s(ecial)26 b(\014les,)g(Bash)f(will)h
-(use)e(them;)k(otherwise)d(it)h(will)f(em)m(ulate)i(them)e(in)m
-(ternally)h(with)f(the)g(b)s(eha)m(vior)150 628 y(describ)s(ed)k(b)s
-(elo)m(w.)150 819 y Ft(/dev/fd/)p Fj(fd)630 929 y Fu(If)h
-Fr(fd)j Fu(is)d(a)h(v)-5 b(alid)31 b(in)m(teger,)h(duplicate)f(\014le)f
-(descriptor)h Fr(fd)p Fu(.)150 1110 y Ft(/dev/stdin)630
-1219 y Fu(File)h(descriptor)e(0)h(is)f(duplicated.)150
-1400 y Ft(/dev/stdout)630 1510 y Fu(File)i(descriptor)e(1)h(is)f
-(duplicated.)150 1691 y Ft(/dev/stderr)630 1800 y Fu(File)i(descriptor)
-e(2)h(is)f(duplicated.)150 1981 y Ft(/dev/tcp/)p Fj(host)p
-Ft(/)p Fj(port)630 2091 y Fu(If)41 b Fr(host)i Fu(is)f(a)g(v)-5
-b(alid)41 b(hostname)h(or)f(In)m(ternet)h(address,)i(and)c
-Fr(p)s(ort)j Fu(is)f(an)f(in)m(teger)i(p)s(ort)630 2200
-y(n)m(um)m(b)s(er)23 b(or)i(service)h(name,)g(Bash)f(attempts)h(to)f
-(op)s(en)f(the)h(corresp)s(onding)f(TCP)g(so)s(c)m(k)m(et.)150
-2381 y Ft(/dev/udp/)p Fj(host)p Ft(/)p Fj(port)630 2491
+y(The)29 b(order)h(of)h(redirections)g(is)f(signi\014can)m(t.)42
+b(F)-8 b(or)31 b(example,)g(the)g(command)390 435 y Ft(ls)47
+b(>)h Fj(dirlist)d Ft(2>&1)150 570 y Fu(directs)28 b(b)s(oth)f
+(standard)g(output)g(\(\014le)h(descriptor)f(1\))i(and)e(standard)f
+(error)i(\(\014le)g(descriptor)f(2\))h(to)h(the)150 680
+y(\014le)h Fr(dirlist)p Fu(,)h(while)f(the)h(command)390
+816 y Ft(ls)47 b(2>&1)g(>)g Fj(dirlist)150 951 y Fu(directs)28
+b(only)f(the)h(standard)e(output)i(to)g(\014le)f Fr(dirlist)p
+Fu(,)h(b)s(ecause)g(the)f(standard)g(error)g(w)m(as)h(made)f(a)h(cop)m
+(y)150 1061 y(of)j(the)f(standard)g(output)g(b)s(efore)g(the)g
+(standard)g(output)g(w)m(as)g(redirected)h(to)g Fr(dirlist)p
+Fu(.)275 1197 y(Bash)26 b(handles)f(sev)m(eral)j(\014lenames)e(sp)s
+(ecially)h(when)f(they)g(are)g(used)g(in)g(redirections,)i(as)e
+(describ)s(ed)150 1306 y(in)38 b(the)h(follo)m(wing)h(table.)66
+b(If)38 b(the)h(op)s(erating)g(system)f(on)h(whic)m(h)f(Bash)h(is)f
+(running)f(pro)m(vides)h(these)150 1416 y(sp)s(ecial)26
+b(\014les,)g(Bash)f(will)h(use)e(them;)k(otherwise)d(it)h(will)f(em)m
+(ulate)i(them)e(in)m(ternally)h(with)f(the)g(b)s(eha)m(vior)150
+1526 y(describ)s(ed)k(b)s(elo)m(w.)150 1687 y Ft(/dev/fd/)p
+Fj(fd)630 1796 y Fu(If)h Fr(fd)j Fu(is)d(a)h(v)-5 b(alid)31
+b(in)m(teger,)h(duplicate)f(\014le)f(descriptor)h Fr(fd)p
+Fu(.)150 1957 y Ft(/dev/stdin)630 2067 y Fu(File)h(descriptor)e(0)h(is)
+f(duplicated.)150 2227 y Ft(/dev/stdout)630 2337 y Fu(File)i
+(descriptor)e(1)h(is)f(duplicated.)150 2498 y Ft(/dev/stderr)630
+2607 y Fu(File)i(descriptor)e(2)h(is)f(duplicated.)150
+2768 y Ft(/dev/tcp/)p Fj(host)p Ft(/)p Fj(port)630 2877
y Fu(If)41 b Fr(host)i Fu(is)f(a)g(v)-5 b(alid)41 b(hostname)h(or)f(In)
m(ternet)h(address,)i(and)c Fr(p)s(ort)j Fu(is)f(an)f(in)m(teger)i(p)s
-(ort)630 2600 y(n)m(um)m(b)s(er)23 b(or)h(service)h(name,)h(Bash)e
-(attempts)h(to)g(op)s(en)f(the)g(corresp)s(onding)f(UDP)i(so)s(c)m(k)m
-(et.)275 2792 y(A)30 b(failure)h(to)g(op)s(en)e(or)i(create)h(a)e
-(\014le)h(causes)g(the)f(redirection)h(to)g(fail.)275
-2948 y(Redirections)f(using)e(\014le)i(descriptors)f(greater)h(than)f
-(9)h(should)e(b)s(e)h(used)f(with)h(care,)h(as)g(they)f(ma)m(y)150
-3058 y(con\015ict)i(with)f(\014le)h(descriptors)f(the)g(shell)h(uses)f
-(in)m(ternally)-8 b(.)150 3278 y Fk(3.6.1)63 b(Redirecting)40
-b(Input)150 3425 y Fu(Redirecting)28 b(input)e(op)s(ens)h(the)g(\014le)
-g(whose)g(name)g(results)g(from)g(the)g(expansion)g(of)h
-Fr(w)m(ord)i Fu(for)d(reading)150 3535 y(on)j(\014le)h(descriptor)f
+(ort)630 2987 y(n)m(um)m(b)s(er)23 b(or)i(service)h(name,)g(Bash)f
+(attempts)h(to)f(op)s(en)f(the)h(corresp)s(onding)f(TCP)g(so)s(c)m(k)m
+(et.)150 3148 y Ft(/dev/udp/)p Fj(host)p Ft(/)p Fj(port)630
+3257 y Fu(If)41 b Fr(host)i Fu(is)f(a)g(v)-5 b(alid)41
+b(hostname)h(or)f(In)m(ternet)h(address,)i(and)c Fr(p)s(ort)j
+Fu(is)f(an)f(in)m(teger)i(p)s(ort)630 3367 y(n)m(um)m(b)s(er)23
+b(or)h(service)h(name,)h(Bash)e(attempts)h(to)g(op)s(en)f(the)g
+(corresp)s(onding)f(UDP)i(so)s(c)m(k)m(et.)275 3528 y(A)30
+b(failure)h(to)g(op)s(en)e(or)i(create)h(a)e(\014le)h(causes)g(the)f
+(redirection)h(to)g(fail.)275 3664 y(Redirections)f(using)e(\014le)i
+(descriptors)f(greater)h(than)f(9)h(should)e(b)s(e)h(used)f(with)h
+(care,)h(as)g(they)f(ma)m(y)150 3773 y(con\015ict)i(with)f(\014le)h
+(descriptors)f(the)g(shell)h(uses)f(in)m(ternally)-8
+b(.)150 3974 y Fk(3.6.1)63 b(Redirecting)40 b(Input)150
+4121 y Fu(Redirecting)28 b(input)e(op)s(ens)h(the)g(\014le)g(whose)g
+(name)g(results)g(from)g(the)g(expansion)g(of)h Fr(w)m(ord)i
+Fu(for)d(reading)150 4230 y(on)j(\014le)h(descriptor)f
Ft(n)p Fu(,)g(or)h(the)f(standard)g(input)f(\(\014le)i(descriptor)f
(0\))h(if)g Ft(n)f Fu(is)g(not)h(sp)s(eci\014ed.)275
-3691 y(The)e(general)j(format)e(for)h(redirecting)g(input)e(is:)390
-3847 y Ft([)p Fj(n)p Ft(]<)p Fj(word)150 4068 y Fk(3.6.2)63
-b(Redirecting)40 b(Output)150 4215 y Fu(Redirecting)25
+4366 y(The)e(general)j(format)e(for)h(redirecting)g(input)e(is:)390
+4502 y Ft([)p Fj(n)p Ft(]<)p Fj(word)150 4702 y Fk(3.6.2)63
+b(Redirecting)40 b(Output)150 4849 y Fu(Redirecting)25
b(output)e(op)s(ens)g(the)i(\014le)f(whose)f(name)h(results)g(from)f
(the)h(expansion)g(of)g Fr(w)m(ord)j Fu(for)d(writing)150
-4324 y(on)j(\014le)h(descriptor)f Fr(n)p Fu(,)h(or)f(the)h(standard)e
+4959 y(on)j(\014le)h(descriptor)f Fr(n)p Fu(,)h(or)f(the)h(standard)e
(output)i(\(\014le)f(descriptor)h(1\))g(if)f Fr(n)g Fu(is)h(not)f(sp)s
-(eci\014ed.)39 b(If)27 b(the)h(\014le)150 4434 y(do)s(es)i(not)h(exist)
+(eci\014ed.)39 b(If)27 b(the)h(\014le)150 5068 y(do)s(es)i(not)h(exist)
g(it)g(is)f(created;)i(if)e(it)h(do)s(es)f(exist)h(it)g(is)g(truncated)
-f(to)h(zero)g(size.)275 4590 y(The)e(general)j(format)e(for)h
-(redirecting)g(output)f(is:)390 4746 y Ft([)p Fj(n)p
-Ft(]>[|])p Fj(word)275 4902 y Fu(If)g(the)h(redirection)g(op)s(erator)g
-(is)g(`)p Ft(>)p Fu(',)g(and)f(the)h Ft(noclobber)d Fu(option)j(to)g
-(the)g Ft(set)f Fu(builtin)g(has)h(b)s(een)150 5011 y(enabled,)h(the)g
+f(to)h(zero)g(size.)275 5204 y(The)e(general)j(format)e(for)h
+(redirecting)g(output)f(is:)390 5340 y Ft([)p Fj(n)p
+Ft(]>[|])p Fj(word)p eop end
+%%Page: 42 48
+TeXDict begin 42 47 bop 150 -116 a Fu(Chapter)30 b(3:)41
+b(Basic)32 b(Shell)e(F)-8 b(eatures)2246 b(42)275 299
+y(If)30 b(the)h(redirection)g(op)s(erator)g(is)g(`)p
+Ft(>)p Fu(',)g(and)f(the)h Ft(noclobber)d Fu(option)j(to)g(the)g
+Ft(set)f Fu(builtin)g(has)h(b)s(een)150 408 y(enabled,)h(the)g
(redirection)h(will)f(fail)h(if)e(the)i(\014le)e(whose)h(name)g
(results)g(from)f(the)h(expansion)g(of)g Fr(w)m(ord)150
-5121 y Fu(exists)f(and)f(is)g(a)h(regular)g(\014le.)41
+518 y Fu(exists)f(and)f(is)g(a)h(regular)g(\014le.)41
b(If)30 b(the)h(redirection)g(op)s(erator)g(is)f(`)p
Ft(>|)p Fu(',)h(or)f(the)h(redirection)g(op)s(erator)g(is)150
-5230 y(`)p Ft(>)p Fu(')i(and)f(the)g Ft(noclobber)f Fu(option)i(is)f
+628 y(`)p Ft(>)p Fu(')i(and)f(the)g Ft(noclobber)f Fu(option)i(is)f
(not)h(enabled,)g(Bash)g(attemps)g(the)g(redirection)g(ev)m(en)h(if)e
-(the)h(\014le)150 5340 y(named)d(b)m(y)g Fr(w)m(ord)k
-Fu(exists.)p eop end
-%%Page: 42 48
-TeXDict begin 42 47 bop 150 -116 a Fu(Chapter)30 b(3:)41
-b(Basic)32 b(Shell)e(F)-8 b(eatures)2246 b(42)150 299
-y Fk(3.6.3)63 b(App)s(ending)42 b(Redirected)e(Output)150
-446 y Fu(Redirecting)31 b(output)f(in)g(this)g(fashion)f(op)s(ens)h
-(the)g(\014le)g(whose)g(name)g(results)g(from)g(the)g(expansion)g(of)
-150 555 y Fr(w)m(ord)g Fu(for)c(app)s(ending)f(on)i(\014le)f
-(descriptor)h Fr(n)p Fu(,)g(or)f(the)h(standard)f(output)g(\(\014le)h
-(descriptor)f(1\))i(if)e Fr(n)g Fu(is)h(not)150 665 y(sp)s(eci\014ed.)
-40 b(If)30 b(the)g(\014le)h(do)s(es)f(not)h(exist)g(it)g(is)f(created.)
-275 800 y(The)f(general)j(format)e(for)h(app)s(ending)e(output)h(is:)
-390 935 y Ft([)p Fj(n)p Ft(]>>)p Fj(word)150 1135 y Fk(3.6.4)63
-b(Redirecting)40 b(Standard)h(Output)g(and)g(Standard)g(Error)150
-1282 y Fu(This)26 b(construct)h(redirects)g(b)s(oth)e(the)i(standard)f
+(the)h(\014le)150 737 y(named)d(b)m(y)g Fr(w)m(ord)k
+Fu(exists.)150 934 y Fk(3.6.3)63 b(App)s(ending)42 b(Redirected)e
+(Output)150 1081 y Fu(Redirecting)31 b(output)f(in)g(this)g(fashion)f
+(op)s(ens)h(the)g(\014le)g(whose)g(name)g(results)g(from)g(the)g
+(expansion)g(of)150 1191 y Fr(w)m(ord)g Fu(for)c(app)s(ending)f(on)i
+(\014le)f(descriptor)h Fr(n)p Fu(,)g(or)f(the)h(standard)f(output)g
+(\(\014le)h(descriptor)f(1\))i(if)e Fr(n)g Fu(is)h(not)150
+1300 y(sp)s(eci\014ed.)40 b(If)30 b(the)g(\014le)h(do)s(es)f(not)h
+(exist)g(it)g(is)f(created.)275 1433 y(The)f(general)j(format)e(for)h
+(app)s(ending)e(output)h(is:)390 1567 y Ft([)p Fj(n)p
+Ft(]>>)p Fj(word)150 1763 y Fk(3.6.4)63 b(Redirecting)40
+b(Standard)h(Output)g(and)g(Standard)g(Error)150 1910
+y Fu(This)26 b(construct)h(redirects)g(b)s(oth)e(the)i(standard)f
(output)g(\(\014le)h(descriptor)g(1\))g(and)f(the)h(standard)e(error)
-150 1391 y(output)30 b(\(\014le)h(descriptor)f(2\))h(to)g(the)g(\014le)
+150 2020 y(output)30 b(\(\014le)h(descriptor)f(2\))h(to)g(the)g(\014le)
f(whose)g(name)h(is)f(the)h(expansion)f(of)h Fr(w)m(ord)p
-Fu(.)275 1526 y(There)e(are)i(t)m(w)m(o)h(formats)e(for)h(redirecting)g
-(standard)e(output)h(and)g(standard)f(error:)390 1661
-y Ft(&>)p Fj(word)150 1796 y Fu(and)390 1931 y Ft(>&)p
-Fj(word)150 2066 y Fu(Of)h(the)g(t)m(w)m(o)i(forms,)e(the)h(\014rst)e
+Fu(.)275 2153 y(There)e(are)i(t)m(w)m(o)h(formats)e(for)h(redirecting)g
+(standard)e(output)h(and)g(standard)f(error:)390 2286
+y Ft(&>)p Fj(word)150 2420 y Fu(and)390 2553 y Ft(>&)p
+Fj(word)150 2686 y Fu(Of)h(the)g(t)m(w)m(o)i(forms,)e(the)h(\014rst)e
(is)i(preferred.)39 b(This)30 b(is)g(seman)m(tically)j(equiv)-5
-b(alen)m(t)32 b(to)390 2201 y Ft(>)p Fj(word)46 b Ft(2>&1)275
-2336 y Fu(When)41 b(using)g(the)h(second)f(form,)k Fr(w)m(ord)f
+b(alen)m(t)32 b(to)390 2819 y Ft(>)p Fj(word)46 b Ft(2>&1)275
+2953 y Fu(When)41 b(using)g(the)h(second)f(form,)k Fr(w)m(ord)f
Fu(ma)m(y)e(not)g(expand)f(to)h(a)g(n)m(um)m(b)s(er)f(or)g(`)p
-Ft(-)p Fu('.)75 b(If)41 b(it)h(do)s(es,)150 2446 y(other)27
+Ft(-)p Fu('.)75 b(If)41 b(it)h(do)s(es,)150 3062 y(other)27
b(redirection)g(op)s(erators)f(apply)h(\(see)g(Duplicating)h(File)f
(Descriptors)h(b)s(elo)m(w\))f(for)f(compatibilit)m(y)150
-2555 y(reasons.)150 2755 y Fk(3.6.5)63 b(App)s(ending)42
-b(Standard)f(Output)g(and)g(Standard)g(Error)150 2902
+3172 y(reasons.)150 3369 y Fk(3.6.5)63 b(App)s(ending)42
+b(Standard)f(Output)g(and)g(Standard)g(Error)150 3516
y Fu(This)27 b(construct)h(app)s(ends)d(b)s(oth)i(the)h(standard)f
(output)g(\(\014le)h(descriptor)g(1\))g(and)f(the)h(standard)e(error)
-150 3011 y(output)k(\(\014le)h(descriptor)f(2\))h(to)g(the)g(\014le)f
+150 3625 y(output)k(\(\014le)h(descriptor)f(2\))h(to)g(the)g(\014le)f
(whose)g(name)h(is)f(the)h(expansion)f(of)h Fr(w)m(ord)p
-Fu(.)275 3146 y(The)e(format)i(for)f(app)s(ending)f(standard)h(output)g
-(and)f(standard)h(error)g(is:)390 3281 y Ft(&>>)p Fj(word)150
-3416 y Fu(This)g(is)g(seman)m(tically)j(equiv)-5 b(alen)m(t)32
-b(to)390 3551 y Ft(>>)p Fj(word)46 b Ft(2>&1)275 3686
+Fu(.)275 3758 y(The)e(format)i(for)f(app)s(ending)f(standard)h(output)g
+(and)f(standard)h(error)g(is:)390 3892 y Ft(&>>)p Fj(word)150
+4025 y Fu(This)g(is)g(seman)m(tically)j(equiv)-5 b(alen)m(t)32
+b(to)390 4158 y Ft(>>)p Fj(word)46 b Ft(2>&1)275 4291
y Fu(\(see)31 b(Duplicating)h(File)f(Descriptors)g(b)s(elo)m(w\).)150
-3886 y Fk(3.6.6)63 b(Here)41 b(Do)s(cumen)m(ts)150 4033
+4488 y Fk(3.6.6)63 b(Here)41 b(Do)s(cumen)m(ts)150 4635
y Fu(This)36 b(t)m(yp)s(e)h(of)f(redirection)h(instructs)g(the)f(shell)
h(to)h(read)e(input)g(from)g(the)g(curren)m(t)h(source)g(un)m(til)f(it)
-150 4143 y(reads)h(a)h(line)g(con)m(taining)g(only)g
+150 4745 y(reads)h(a)h(line)g(con)m(taining)g(only)g
Fr(delimiter)45 b Fu(\(with)37 b(no)g(trailing)i(blanks\).)61
-b(All)38 b(of)g(the)f(lines)h(read)f(up)150 4252 y(to)g(that)g(p)s(oin)
+b(All)38 b(of)g(the)f(lines)h(read)f(up)150 4854 y(to)g(that)g(p)s(oin)
m(t)f(then)g(b)s(ecome)h(the)g(standard)e(input)h(\(or)g(\014le)h
(descriptor)f Fr(n)g Fu(if)g Fr(n)g Fu(is)g(sp)s(eci\014ed\))g(for)h(a)
-150 4362 y(command.)275 4497 y(The)29 b(format)i(of)g(here-do)s(cumen)m
-(ts)f(is:)390 4632 y Ft([)p Fj(n)p Ft(]<<[)p Fq(\000)p
-Ft(])p Fj(word)772 4741 y(here-document)390 4851 y(delimiter)275
-4986 y Fu(The)35 b(shell)h(do)s(es)f(not)h(p)s(erform)e(parameter)j
-(and)e(v)-5 b(ariable)36 b(expansion,)h(command)f(substitution,)150
-5095 y(arithmetic)c(expansion,)e(or)g(\014lename)h(expansion)f(on)h
-Fr(w)m(ord)p Fu(.)275 5230 y(If)f(an)m(y)g(part)h(of)g
+150 4964 y(command.)275 5097 y(The)29 b(format)i(of)g(here-do)s(cumen)m
+(ts)f(is:)390 5230 y Ft([)p Fj(n)p Ft(]<<[)p Fq(\000)p
+Ft(])p Fj(word)772 5340 y(here-document)p eop end
+%%Page: 43 49
+TeXDict begin 43 48 bop 150 -116 a Fu(Chapter)30 b(3:)41
+b(Basic)32 b(Shell)e(F)-8 b(eatures)2246 b(43)390 299
+y Fj(delimiter)275 432 y Fu(The)35 b(shell)h(do)s(es)f(not)h(p)s
+(erform)e(parameter)j(and)e(v)-5 b(ariable)36 b(expansion,)h(command)f
+(substitution,)150 542 y(arithmetic)c(expansion,)e(or)g(\014lename)h
+(expansion)f(on)h Fr(w)m(ord)p Fu(.)275 675 y(If)f(an)m(y)g(part)h(of)g
Fr(w)m(ord)i Fu(is)e(quoted,)g(the)g Fr(delimiter)37
b Fu(is)31 b(the)g(result)f(of)h(quote)g(remo)m(v)-5
-b(al)32 b(on)e Fr(w)m(ord)p Fu(,)h(and)150 5340 y(the)36
+b(al)32 b(on)e Fr(w)m(ord)p Fu(,)h(and)150 785 y(the)36
b(lines)f(in)h(the)f(here-do)s(cumen)m(t)h(are)g(not)g(expanded.)55
b(If)35 b Fr(w)m(ord)k Fu(is)c(unquoted,)h Fr(delimiter)43
-b Fu(is)36 b Fr(w)m(ord)p eop end
-%%Page: 43 49
-TeXDict begin 43 48 bop 150 -116 a Fu(Chapter)30 b(3:)41
-b(Basic)32 b(Shell)e(F)-8 b(eatures)2246 b(43)150 299
-y(itself,)37 b(and)d(the)h(here-do)s(cumen)m(t)f(text)i(is)f(treated)g
-(similarly)h(to)f(a)g(double-quoted)g(string:)49 b(all)36
-b(lines)150 408 y(of)i(the)g(here-do)s(cumen)m(t)g(are)g(sub)5
-b(jected)38 b(to)h(parameter)f(expansion,)i(command)e(substitution,)i
-(and)150 518 y(arithmetic)h(expansion,)i(the)d(c)m(haracter)i(sequence)
-e Ft(\\newline)e Fu(is)i(treated)h(literally)-8 b(,)45
-b(and)40 b(`)p Ft(\\)p Fu(')g(m)m(ust)150 628 y(b)s(e)31
-b(used)g(to)i(quote)g(the)f(c)m(haracters)h(`)p Ft(\\)p
-Fu(',)g(`)p Ft($)p Fu(',)f(and)g(`)p Ft(`)p Fu(';)h(ho)m(w)m(ev)m(er,)h
-(double)d(quote)i(c)m(haracters)g(ha)m(v)m(e)g(no)150
-737 y(sp)s(ecial)e(meaning.)275 876 y(If)j(the)i(redirection)g(op)s
+b Fu(is)36 b Fr(w)m(ord)150 894 y Fu(itself,)h(and)d(the)h(here-do)s
+(cumen)m(t)f(text)i(is)f(treated)g(similarly)h(to)f(a)g(double-quoted)g
+(string:)49 b(all)36 b(lines)150 1004 y(of)i(the)g(here-do)s(cumen)m(t)
+g(are)g(sub)5 b(jected)38 b(to)h(parameter)f(expansion,)i(command)e
+(substitution,)i(and)150 1113 y(arithmetic)h(expansion,)i(the)d(c)m
+(haracter)i(sequence)e Ft(\\newline)e Fu(is)i(treated)h(literally)-8
+b(,)45 b(and)40 b(`)p Ft(\\)p Fu(')g(m)m(ust)150 1223
+y(b)s(e)31 b(used)g(to)i(quote)g(the)f(c)m(haracters)h(`)p
+Ft(\\)p Fu(',)g(`)p Ft($)p Fu(',)f(and)g(`)p Ft(`)p Fu(';)h(ho)m(w)m
+(ev)m(er,)h(double)d(quote)i(c)m(haracters)g(ha)m(v)m(e)g(no)150
+1333 y(sp)s(ecial)e(meaning.)275 1466 y(If)j(the)i(redirection)g(op)s
(erator)g(is)f(`)p Ft(<<-)p Fu(',)i(the)f(shell)f(strips)g(leading)h
-(tab)g(c)m(haracters)h(are)e(stripp)s(ed)150 985 y(from)28
+(tab)g(c)m(haracters)h(are)e(stripp)s(ed)150 1575 y(from)28
b(input)f(lines)i(and)f(the)h(line)f(con)m(taining)i
Fr(delimiter)p Fu(.)41 b(This)28 b(allo)m(ws)i(here-do)s(cumen)m(ts)e
-(within)g(shell)150 1095 y(scripts)i(to)h(b)s(e)f(inden)m(ted)g(in)g(a)
-h(natural)f(fashion.)275 1233 y(If)25 b(the)h(delimiter)h(is)f(not)g
+(within)g(shell)150 1685 y(scripts)i(to)h(b)s(e)f(inden)m(ted)g(in)g(a)
+h(natural)f(fashion.)275 1818 y(If)25 b(the)h(delimiter)h(is)f(not)g
(quoted,)i(the)e Ft(\\<newline>)d Fu(sequence)k(is)f(treated)h(as)f(a)g
-(line)h(con)m(tin)m(uation:)150 1343 y(the)j(t)m(w)m(o)h(lines)f(are)g
+(line)h(con)m(tin)m(uation:)150 1928 y(the)j(t)m(w)m(o)h(lines)f(are)g
(joined)g(and)f(the)h(bac)m(kslash-newline)h(is)f(remo)m(v)m(ed.)41
-b(This)29 b(happ)s(ens)f(while)i(reading)150 1452 y(the)j(here-do)s
+b(This)29 b(happ)s(ens)f(while)i(reading)150 2037 y(the)j(here-do)s
(cumen)m(t,)g(b)s(efore)f(the)h(c)m(hec)m(k)h(for)f(the)f(ending)h
(delimiter,)h(so)f(joined)f(lines)h(can)g(form)f(the)150
-1562 y(end)e(delimiter.)150 1765 y Fk(3.6.7)63 b(Here)41
-b(Strings)150 1912 y Fu(A)30 b(v)-5 b(arian)m(t)32 b(of)e(here)h(do)s
-(cumen)m(ts,)f(the)g(format)h(is:)390 2050 y Ft([)p Fj(n)p
-Ft(]<<<)46 b Fj(word)275 2189 y Fu(The)29 b Fr(w)m(ord)k
+2147 y(end)e(delimiter.)150 2344 y Fk(3.6.7)63 b(Here)41
+b(Strings)150 2491 y Fu(A)30 b(v)-5 b(arian)m(t)32 b(of)e(here)h(do)s
+(cumen)m(ts,)f(the)g(format)h(is:)390 2624 y Ft([)p Fj(n)p
+Ft(]<<<)46 b Fj(word)275 2757 y Fu(The)29 b Fr(w)m(ord)k
Fu(undergo)s(es)c(tilde)i(expansion,)f(parameter)h(and)e(v)-5
-b(ariable)31 b(expansion,)f(command)g(sub-)150 2298 y(stitution,)f
+b(ariable)31 b(expansion,)f(command)g(sub-)150 2867 y(stitution,)f
(arithmetic)f(expansion,)g(and)f(quote)h(remo)m(v)-5
b(al.)41 b(Filename)29 b(expansion)e(and)f(w)m(ord)h(splitting)150
-2408 y(are)35 b(not)g(p)s(erformed.)51 b(The)34 b(result)h(is)g
+2976 y(are)35 b(not)g(p)s(erformed.)51 b(The)34 b(result)h(is)g
(supplied)e(as)i(a)f(single)i(string,)f(with)g(a)g(newline)f(app)s
-(ended,)g(to)150 2518 y(the)d(command)f(on)g(its)h(standard)e(input)h
+(ended,)g(to)150 3086 y(the)d(command)f(on)g(its)h(standard)e(input)h
(\(or)g(\014le)h(descriptor)f Fr(n)g Fu(if)g Fr(n)g Fu(is)h(sp)s
-(eci\014ed\).)150 2721 y Fk(3.6.8)63 b(Duplicating)41
-b(File)g(Descriptors)150 2868 y Fu(The)30 b(redirection)h(op)s(erator)
-390 3006 y Ft([)p Fj(n)p Ft(]<&)p Fj(word)150 3144 y
+(eci\014ed\).)150 3283 y Fk(3.6.8)63 b(Duplicating)41
+b(File)g(Descriptors)150 3430 y Fu(The)30 b(redirection)h(op)s(erator)
+390 3563 y Ft([)p Fj(n)p Ft(]<&)p Fj(word)150 3696 y
Fu(is)44 b(used)f(to)i(duplicate)f(input)f(\014le)h(descriptors.)81
b(If)44 b Fr(w)m(ord)j Fu(expands)c(to)i(one)f(or)g(more)g(digits,)k
-(\014le)150 3254 y(descriptor)39 b Fr(n)g Fu(is)g(made)g(to)h(b)s(e)f
+(\014le)150 3806 y(descriptor)39 b Fr(n)g Fu(is)g(made)g(to)h(b)s(e)f
(a)g(cop)m(y)h(of)g(that)f(\014le)h(descriptor.)67 b(It)39
-b(is)g(a)h(redirection)g(error)f(if)g(the)150 3364 y(digits)34
+b(is)g(a)h(redirection)g(error)f(if)g(the)150 3915 y(digits)34
b(in)e Fr(w)m(ord)37 b Fu(do)c(not)g(sp)s(ecify)g(a)g(\014le)g
(descriptor)g(op)s(en)g(for)f(input.)48 b(If)33 b Fr(w)m(ord)j
Fu(ev)-5 b(aluates)35 b(to)f(`)p Ft(-)p Fu(',)g(\014le)150
-3473 y(descriptor)c Fr(n)g Fu(is)g(closed.)42 b(If)30
+4025 y(descriptor)c Fr(n)g Fu(is)g(closed.)42 b(If)30
b Fr(n)g Fu(is)g(not)h(sp)s(eci\014ed,)f(this)g(uses)g(the)g(standard)g
-(input)f(\(\014le)i(descriptor)f(0\).)275 3612 y(The)f(op)s(erator)390
-3750 y Ft([)p Fj(n)p Ft(]>&)p Fj(word)150 3888 y Fu(is)40
+(input)f(\(\014le)i(descriptor)f(0\).)275 4158 y(The)f(op)s(erator)390
+4291 y Ft([)p Fj(n)p Ft(]>&)p Fj(word)150 4425 y Fu(is)40
b(used)g(similarly)h(to)f(duplicate)h(output)f(\014le)g(descriptors.)70
b(If)40 b Fr(n)g Fu(is)g(not)h(sp)s(eci\014ed,)h(this)e(uses)g(the)150
-3998 y(standard)e(output)g(\(\014le)h(descriptor)f(1\).)66
+4534 y(standard)e(output)g(\(\014le)h(descriptor)f(1\).)66
b(It)38 b(is)h(a)f(redirection)h(error)g(if)f(the)h(digits)g(in)f
-Fr(w)m(ord)j Fu(do)e(not)150 4108 y(sp)s(ecify)28 b(a)i(\014le)e
+Fr(w)m(ord)j Fu(do)e(not)150 4644 y(sp)s(ecify)28 b(a)i(\014le)e
(descriptor)h(op)s(en)f(for)h(output.)40 b(If)28 b Fr(w)m(ord)k
Fu(ev)-5 b(aluates)30 b(to)g(`)p Ft(-)p Fu(',)f(\014le)g(descriptor)g
-Fr(n)f Fu(is)h(closed.)150 4217 y(As)34 b(a)g(sp)s(ecial)h(case,)h(if)e
+Fr(n)f Fu(is)h(closed.)150 4753 y(As)34 b(a)g(sp)s(ecial)h(case,)h(if)e
Fr(n)f Fu(is)h(omitted,)i(and)e Fr(w)m(ord)j Fu(do)s(es)d(not)g(expand)
f(to)i(one)f(or)g(more)g(digits)h(or)f(`)p Ft(-)p Fu(',)150
-4327 y(this)c(redirects)h(the)g(standard)e(output)h(and)g(standard)f
-(error)h(as)h(describ)s(ed)e(previously)-8 b(.)150 4530
+4863 y(this)c(redirects)h(the)g(standard)e(output)h(and)g(standard)f
+(error)h(as)h(describ)s(ed)e(previously)-8 b(.)150 5060
y Fk(3.6.9)63 b(Mo)m(ving)41 b(File)h(Descriptors)150
-4677 y Fu(The)30 b(redirection)h(op)s(erator)390 4815
-y Ft([)p Fj(n)p Ft(]<&)p Fj(digit)p Ft(-)150 4954 y Fu(mo)m(v)m(es)i
-(the)f(\014le)g(descriptor)f Fr(digit)k Fu(to)d(\014le)g(descriptor)g
-Fr(n)p Fu(,)f(or)h(the)g(standard)f(input)f(\(\014le)j(descriptor)e
-(0\))150 5063 y(if)f Fr(n)g Fu(is)h(not)f(sp)s(eci\014ed.)40
-b Fr(digit)33 b Fu(is)e(closed)g(after)g(b)s(eing)f(duplicated)g(to)h
-Fr(n)p Fu(.)275 5202 y(Similarly)-8 b(,)31 b(the)f(redirection)h(op)s
-(erator)390 5340 y Ft([)p Fj(n)p Ft(]>&)p Fj(digit)p
-Ft(-)p eop end
+5207 y Fu(The)30 b(redirection)h(op)s(erator)390 5340
+y Ft([)p Fj(n)p Ft(]<&)p Fj(digit)p Ft(-)p eop end
%%Page: 44 50
TeXDict begin 44 49 bop 150 -116 a Fu(Chapter)30 b(3:)41
b(Basic)32 b(Shell)e(F)-8 b(eatures)2246 b(44)150 299
-y(mo)m(v)m(es)29 b(the)g(\014le)f(descriptor)f Fr(digit)k
+y(mo)m(v)m(es)33 b(the)f(\014le)g(descriptor)f Fr(digit)k
+Fu(to)d(\014le)g(descriptor)g Fr(n)p Fu(,)f(or)h(the)g(standard)f
+(input)f(\(\014le)j(descriptor)e(0\))150 408 y(if)f Fr(n)g
+Fu(is)h(not)f(sp)s(eci\014ed.)40 b Fr(digit)33 b Fu(is)e(closed)g
+(after)g(b)s(eing)f(duplicated)g(to)h Fr(n)p Fu(.)275
+562 y(Similarly)-8 b(,)31 b(the)f(redirection)h(op)s(erator)390
+715 y Ft([)p Fj(n)p Ft(]>&)p Fj(digit)p Ft(-)150 868
+y Fu(mo)m(v)m(es)e(the)g(\014le)f(descriptor)f Fr(digit)k
Fu(to)e(\014le)f(descriptor)g Fr(n)p Fu(,)g(or)g(the)g(standard)f
-(output)h(\(\014le)g(descriptor)g(1\))150 408 y(if)i
-Fr(n)g Fu(is)h(not)f(sp)s(eci\014ed.)150 603 y Fk(3.6.10)63
+(output)h(\(\014le)g(descriptor)g(1\))150 978 y(if)i
+Fr(n)g Fu(is)h(not)f(sp)s(eci\014ed.)150 1196 y Fk(3.6.10)63
b(Op)s(ening)42 b(File)g(Descriptors)g(for)g(Reading)e(and)h(W)-10
-b(riting)150 750 y Fu(The)30 b(redirection)h(op)s(erator)390
-882 y Ft([)p Fj(n)p Ft(]<>)p Fj(word)150 1014 y Fu(op)s(ens)37
+b(riting)150 1343 y Fu(The)30 b(redirection)h(op)s(erator)390
+1496 y Ft([)p Fj(n)p Ft(]<>)p Fj(word)150 1649 y Fu(op)s(ens)37
b(the)h(\014le)g(whose)f(name)h(is)g(the)g(expansion)g(of)g
Fr(w)m(ord)j Fu(for)c(b)s(oth)g(reading)h(and)f(writing)h(on)g(\014le)
-150 1123 y(descriptor)i Fr(n)p Fu(,)i(or)f(on)f(\014le)g(descriptor)g
+150 1758 y(descriptor)i Fr(n)p Fu(,)i(or)f(on)f(\014le)g(descriptor)g
(0)h(if)f Fr(n)f Fu(is)i(not)f(sp)s(eci\014ed.)70 b(If)39
b(the)i(\014le)f(do)s(es)g(not)g(exist,)k(it)d(is)150
-1233 y(created.)150 1469 y Fs(3.7)68 b(Executing)46 b(Commands)150
-1691 y Fk(3.7.1)63 b(Simple)41 b(Command)h(Expansion)150
-1838 y Fu(When)34 b(the)g(shell)h(executes)g(a)g(simple)f(command,)h
+1868 y(created.)150 2137 y Fs(3.7)68 b(Executing)46 b(Commands)150
+2361 y Fk(3.7.1)63 b(Simple)41 b(Command)h(Expansion)150
+2508 y Fu(When)34 b(the)g(shell)h(executes)g(a)g(simple)f(command,)h
(it)g(p)s(erforms)d(the)j(follo)m(wing)g(expansions,)g(assign-)150
-1947 y(men)m(ts,)c(and)f(redirections,)h(from)f(left)h(to)g(righ)m(t,)g
-(in)f(the)h(follo)m(wing)h(order.)199 2079 y(1.)61 b(The)38
+2618 y(men)m(ts,)c(and)f(redirections,)h(from)f(left)h(to)g(righ)m(t,)g
+(in)f(the)h(follo)m(wing)h(order.)199 2771 y(1.)61 b(The)38
b(w)m(ords)f(that)i(the)g(parser)e(has)h(mark)m(ed)g(as)h(v)-5
b(ariable)39 b(assignmen)m(ts)g(\(those)g(preceding)f(the)330
-2189 y(command)30 b(name\))h(and)f(redirections)h(are)f(sa)m(v)m(ed)i
-(for)e(later)h(pro)s(cessing.)199 2321 y(2.)61 b(The)39
+2880 y(command)30 b(name\))h(and)f(redirections)h(are)f(sa)m(v)m(ed)i
+(for)e(later)h(pro)s(cessing.)199 3024 y(2.)61 b(The)39
b(w)m(ords)g(that)i(are)f(not)g(v)-5 b(ariable)40 b(assignmen)m(ts)h
(or)e(redirections)i(are)f(expanded)f(\(see)h(Sec-)330
-2430 y(tion)d(3.5)i([Shell)e(Expansions],)h(page)g(24\).)61
+3134 y(tion)d(3.5)i([Shell)e(Expansions],)h(page)g(24\).)61
b(If)37 b(an)m(y)g(w)m(ords)f(remain)h(after)h(expansion,)h(the)e
-(\014rst)330 2540 y(w)m(ord)31 b(is)g(tak)m(en)h(to)g(b)s(e)f(the)g
+(\014rst)330 3243 y(w)m(ord)31 b(is)g(tak)m(en)h(to)g(b)s(e)f(the)g
(name)h(of)f(the)h(command)f(and)f(the)i(remaining)f(w)m(ords)g(are)g
-(the)h(argu-)330 2650 y(men)m(ts.)199 2782 y(3.)61 b(Redirections)25
+(the)h(argu-)330 3353 y(men)m(ts.)199 3497 y(3.)61 b(Redirections)25
b(are)f(p)s(erformed)f(as)h(describ)s(ed)f(ab)s(o)m(v)m(e)i(\(see)g
-(Section)g(3.6)g([Redirections],)i(page)d(40\).)199 2914
+(Section)g(3.6)g([Redirections],)i(page)d(40\).)199 3641
y(4.)61 b(The)25 b(text)h(after)f(the)g(`)p Ft(=)p Fu(')h(in)e(eac)m(h)
j(v)-5 b(ariable)25 b(assignmen)m(t)h(undergo)s(es)e(tilde)i
-(expansion,)g(parameter)330 3023 y(expansion,)49 b(command)d
+(expansion,)g(parameter)330 3750 y(expansion,)49 b(command)d
(substitution,)j(arithmetic)d(expansion,)k(and)45 b(quote)h(remo)m(v)-5
-b(al)46 b(b)s(efore)330 3133 y(b)s(eing)30 b(assigned)h(to)g(the)f(v)-5
-b(ariable.)275 3287 y(If)32 b(no)i(command)f(name)g(results,)h(the)g(v)
+b(al)46 b(b)s(efore)330 3860 y(b)s(eing)30 b(assigned)h(to)g(the)f(v)-5
+b(ariable.)275 4047 y(If)32 b(no)i(command)f(name)g(results,)h(the)g(v)
-5 b(ariable)34 b(assignmen)m(ts)g(a\013ect)h(the)f(curren)m(t)f(shell)
-h(en)m(viron-)150 3397 y(men)m(t.)68 b(In)38 b(the)h(case)i(of)e(suc)m
+h(en)m(viron-)150 4157 y(men)m(t.)68 b(In)38 b(the)h(case)i(of)e(suc)m
(h)g(a)g(command)g(\(one)h(that)g(consists)g(only)f(of)g(assignmen)m(t)
-h(statemen)m(ts)150 3507 y(and)27 b(redirections\),)i(assignmen)m(t)g
+h(statemen)m(ts)150 4266 y(and)27 b(redirections\),)i(assignmen)m(t)g
(statemen)m(ts)g(are)f(p)s(erformed)e(b)s(efore)h(redirections.)41
-b(Otherwise,)28 b(the)150 3616 y(v)-5 b(ariables)27 b(are)g(added)e(to)
+b(Otherwise,)28 b(the)150 4376 y(v)-5 b(ariables)27 b(are)g(added)e(to)
i(the)g(en)m(vironmen)m(t)g(of)f(the)h(executed)g(command)f(and)g(do)g
-(not)h(a\013ect)h(the)e(cur-)150 3726 y(ren)m(t)32 b(shell)f(en)m
+(not)h(a\013ect)h(the)e(cur-)150 4486 y(ren)m(t)32 b(shell)f(en)m
(vironmen)m(t.)44 b(If)31 b(an)m(y)g(of)h(the)f(assignmen)m(ts)h
(attempts)g(to)g(assign)g(a)f(v)-5 b(alue)32 b(to)g(a)g(readonly)150
-3835 y(v)-5 b(ariable,)31 b(an)g(error)f(o)s(ccurs,)g(and)g(the)g
+4595 y(v)-5 b(ariable,)31 b(an)g(error)f(o)s(ccurs,)g(and)g(the)g
(command)g(exits)i(with)e(a)g(non-zero)h(status.)275
-3967 y(If)i(no)g(command)g(name)h(results,)g(redirections)g(are)g(p)s
+4748 y(If)i(no)g(command)g(name)h(results,)g(redirections)g(are)g(p)s
(erformed,)f(but)g(do)h(not)f(a\013ect)i(the)f(curren)m(t)150
-4077 y(shell)d(en)m(vironmen)m(t.)41 b(A)30 b(redirection)h(error)f
+4858 y(shell)d(en)m(vironmen)m(t.)41 b(A)30 b(redirection)h(error)f
(causes)h(the)g(command)f(to)h(exit)g(with)f(a)h(non-zero)g(status.)275
-4209 y(If)26 b(there)i(is)f(a)h(command)f(name)h(left)g(after)g
+5011 y(If)26 b(there)i(is)f(a)h(command)f(name)h(left)g(after)g
(expansion,)g(execution)h(pro)s(ceeds)e(as)g(describ)s(ed)f(b)s(elo)m
-(w.)150 4319 y(Otherwise,)39 b(the)e(command)g(exits.)62
+(w.)150 5121 y(Otherwise,)39 b(the)e(command)g(exits.)62
b(If)37 b(one)g(of)g(the)h(expansions)f(con)m(tained)h(a)g(command)f
-(substitu-)150 4428 y(tion,)i(the)d(exit)h(status)g(of)f(the)h(command)
+(substitu-)150 5230 y(tion,)i(the)d(exit)h(status)g(of)f(the)h(command)
f(is)h(the)f(exit)h(status)g(of)f(the)h(last)g(command)f(substitution)
-150 4538 y(p)s(erformed.)i(If)27 b(there)h(w)m(ere)g(no)f(command)g
-(substitutions,)h(the)g(command)f(exits)h(with)f(a)h(zero)g(status.)150
-4732 y Fk(3.7.2)63 b(Command)41 b(Searc)m(h)f(and)h(Execution)150
-4879 y Fu(After)i(a)h(command)f(has)g(b)s(een)f(split)h(in)m(to)h(w)m
+150 5340 y(p)s(erformed.)i(If)27 b(there)h(w)m(ere)g(no)f(command)g
+(substitutions,)h(the)g(command)f(exits)h(with)f(a)h(zero)g(status.)p
+eop end
+%%Page: 45 51
+TeXDict begin 45 50 bop 150 -116 a Fu(Chapter)30 b(3:)41
+b(Basic)32 b(Shell)e(F)-8 b(eatures)2246 b(45)150 299
+y Fk(3.7.2)63 b(Command)41 b(Searc)m(h)f(and)h(Execution)150
+446 y Fu(After)i(a)h(command)f(has)g(b)s(een)f(split)h(in)m(to)h(w)m
(ords,)j(if)c(it)g(results)g(in)g(a)h(simple)f(command)g(and)f(an)150
-4989 y(optional)32 b(list)f(of)f(argumen)m(ts,)h(the)g(shell)f(p)s
-(erforms)f(the)i(follo)m(wing)g(actions.)199 5121 y(1.)61
+555 y(optional)32 b(list)f(of)f(argumen)m(ts,)h(the)g(shell)f(p)s
+(erforms)f(the)i(follo)m(wing)g(actions.)199 697 y(1.)61
b(If)24 b(the)g(command)g(name)g(con)m(tains)i(no)e(slashes,)i(the)e
(shell)h(attempts)g(to)g(lo)s(cate)h(it.)39 b(If)24 b(there)g(exists)
-330 5230 y(a)h(shell)g(function)f(b)m(y)g(that)h(name,)h(that)f
+330 807 y(a)h(shell)g(function)f(b)m(y)g(that)h(name,)h(that)f
(function)f(is)h(in)m(v)m(ok)m(ed)h(as)e(describ)s(ed)g(in)g(Section)h
-(3.3)h([Shell)330 5340 y(F)-8 b(unctions],)31 b(page)h(19.)p
-eop end
-%%Page: 45 51
-TeXDict begin 45 50 bop 150 -116 a Fu(Chapter)30 b(3:)41
-b(Basic)32 b(Shell)e(F)-8 b(eatures)2246 b(45)199 299
-y(2.)61 b(If)41 b(the)g(name)h(do)s(es)f(not)g(matc)m(h)i(a)e
+(3.3)h([Shell)330 916 y(F)-8 b(unctions],)31 b(page)h(19.)199
+1054 y(2.)61 b(If)41 b(the)g(name)h(do)s(es)f(not)g(matc)m(h)i(a)e
(function,)j(the)e(shell)f(searc)m(hes)i(for)e(it)h(in)f(the)g(list)h
-(of)g(shell)330 408 y(builtins.)e(If)30 b(a)h(matc)m(h)g(is)f(found,)g
-(that)h(builtin)f(is)g(in)m(v)m(ok)m(ed.)199 538 y(3.)61
+(of)g(shell)330 1164 y(builtins.)e(If)30 b(a)h(matc)m(h)g(is)f(found,)g
+(that)h(builtin)f(is)g(in)m(v)m(ok)m(ed.)199 1302 y(3.)61
b(If)40 b(the)g(name)h(is)f(neither)h(a)f(shell)h(function)f(nor)g(a)g
(builtin,)j(and)d(con)m(tains)h(no)g(slashes,)i(Bash)330
-648 y(searc)m(hes)c(eac)m(h)g(elemen)m(t)g(of)g Ft($PATH)d
+1411 y(searc)m(hes)c(eac)m(h)g(elemen)m(t)g(of)g Ft($PATH)d
Fu(for)i(a)g(directory)h(con)m(taining)g(an)f(executable)h(\014le)f(b)m
-(y)g(that)330 757 y(name.)56 b(Bash)36 b(uses)f(a)h(hash)e(table)j(to)f
-(remem)m(b)s(er)f(the)h(full)f(pathnames)g(of)h(executable)h(\014les)e
-(to)330 867 y(a)m(v)m(oid)e(m)m(ultiple)f Ft(PATH)f Fu(searc)m(hes)i
-(\(see)f(the)g(description)g(of)f Ft(hash)g Fu(in)g(Section)i(4.1)f
-([Bourne)g(Shell)330 976 y(Builtins],)h(page)f(50\).)46
-b(Bash)31 b(p)s(erforms)f(a)i(full)g(searc)m(h)g(of)g(the)f
+(y)g(that)330 1521 y(name.)56 b(Bash)36 b(uses)f(a)h(hash)e(table)j(to)
+f(remem)m(b)s(er)f(the)h(full)f(pathnames)g(of)h(executable)h(\014les)e
+(to)330 1631 y(a)m(v)m(oid)e(m)m(ultiple)f Ft(PATH)f
+Fu(searc)m(hes)i(\(see)f(the)g(description)g(of)f Ft(hash)g
+Fu(in)g(Section)i(4.1)f([Bourne)g(Shell)330 1740 y(Builtins],)h(page)f
+(50\).)46 b(Bash)31 b(p)s(erforms)f(a)i(full)g(searc)m(h)g(of)g(the)f
(directories)i(in)e Ft($PATH)f Fu(only)i(if)g(the)330
-1086 y(command)24 b(is)h(not)g(found)e(in)i(the)g(hash)f(table.)39
+1850 y(command)24 b(is)h(not)g(found)e(in)i(the)g(hash)f(table.)39
b(If)25 b(the)f(searc)m(h)i(is)e(unsuccessful,)h(the)g(shell)g(searc)m
-(hes)330 1196 y(for)e(a)h(de\014ned)e(shell)h(function)h(named)e
+(hes)330 1959 y(for)e(a)h(de\014ned)e(shell)h(function)h(named)e
Ft(command_not_found_handle)p Fu(.)32 b(If)23 b(that)h(function)f
-(exists,)330 1305 y(it)33 b(is)f(in)m(v)m(ok)m(ed)i(in)e(a)h(separate)h
+(exists,)330 2069 y(it)33 b(is)f(in)m(v)m(ok)m(ed)i(in)e(a)h(separate)h
(execution)f(en)m(vironmen)m(t)g(with)f(the)h(original)h(command)e(and)
-g(the)330 1415 y(original)26 b(command's)e(argumen)m(ts)h(as)g(its)g
+g(the)330 2178 y(original)26 b(command's)e(argumen)m(ts)h(as)g(its)g
(argumen)m(ts,)h(and)e(the)h(function's)f(exit)i(status)f(b)s(ecomes)
-330 1524 y(the)j(exit)g(status)g(of)f(that)h(subshell.)39
+330 2288 y(the)j(exit)g(status)g(of)f(that)h(subshell.)39
b(If)27 b(that)h(function)f(is)h(not)g(de\014ned,)f(the)g(shell)h(prin)
-m(ts)f(an)g(error)330 1634 y(message)k(and)f(returns)f(an)i(exit)g
-(status)g(of)f(127.)199 1764 y(4.)61 b(If)33 b(the)g(searc)m(h)h(is)g
+m(ts)f(an)g(error)330 2398 y(message)k(and)f(returns)f(an)i(exit)g
+(status)g(of)f(127.)199 2536 y(4.)61 b(If)33 b(the)g(searc)m(h)h(is)g
(successful,)g(or)f(if)g(the)h(command)f(name)g(con)m(tains)i(one)f(or)
-f(more)g(slashes,)i(the)330 1873 y(shell)g(executes)h(the)f(named)f
+f(more)g(slashes,)i(the)330 2645 y(shell)g(executes)h(the)f(named)f
(program)g(in)h(a)g(separate)h(execution)f(en)m(vironmen)m(t.)55
-b(Argumen)m(t)35 b(0)330 1983 y(is)30 b(set)h(to)h(the)e(name)h(giv)m
+b(Argumen)m(t)35 b(0)330 2755 y(is)30 b(set)h(to)h(the)e(name)h(giv)m
(en,)g(and)f(the)h(remaining)f(argumen)m(ts)h(to)g(the)g(command)f(are)
-h(set)g(to)g(the)330 2092 y(argumen)m(ts)g(supplied,)e(if)h(an)m(y)-8
-b(.)199 2222 y(5.)61 b(If)31 b(this)f(execution)j(fails)e(b)s(ecause)g
+h(set)g(to)g(the)330 2864 y(argumen)m(ts)g(supplied,)e(if)h(an)m(y)-8
+b(.)199 3002 y(5.)61 b(If)31 b(this)f(execution)j(fails)e(b)s(ecause)g
(the)g(\014le)g(is)g(not)h(in)e(executable)j(format,)f(and)e(the)h
-(\014le)g(is)g(not)h(a)330 2332 y(directory)-8 b(,)33
+(\014le)g(is)g(not)h(a)330 3112 y(directory)-8 b(,)33
b(it)g(is)e(assumed)g(to)i(b)s(e)e(a)h Fr(shell)g(script)p
Fu(,)g(a)h(\014le)e(con)m(taining)j(shell)e(commands,)g(and)f(the)330
-2441 y(shell)g(executes)g(it)g(as)g(describ)s(ed)e(in)h(Section)h(3.8)h
-([Shell)e(Scripts],)g(page)i(48.)199 2571 y(6.)61 b(If)38
+3222 y(shell)g(executes)g(it)g(as)g(describ)s(ed)e(in)h(Section)h(3.8)h
+([Shell)e(Scripts],)g(page)i(49.)199 3360 y(6.)61 b(If)38
b(the)h(command)f(w)m(as)h(not)g(b)s(egun)e(async)m(hronously)-8
b(,)42 b(the)c(shell)h(w)m(aits)h(for)e(the)h(command)f(to)330
-2681 y(complete)32 b(and)e(collects)i(its)f(exit)g(status.)150
-2870 y Fk(3.7.3)63 b(Command)41 b(Execution)f(En)m(vironmen)m(t)150
-3017 y Fu(The)30 b(shell)g(has)h(an)f Fr(execution)h(en)m(vironmen)m(t)
+3469 y(complete)32 b(and)e(collects)i(its)f(exit)g(status.)150
+3675 y Fk(3.7.3)63 b(Command)41 b(Execution)f(En)m(vironmen)m(t)150
+3822 y Fu(The)30 b(shell)g(has)h(an)f Fr(execution)h(en)m(vironmen)m(t)
p Fu(,)h(whic)m(h)e(consists)h(of)f(the)h(follo)m(wing:)225
-3147 y Fq(\017)60 b Fu(Op)s(en)29 b(\014les)i(inherited)f(b)m(y)g(the)h
+3964 y Fq(\017)60 b Fu(Op)s(en)29 b(\014les)i(inherited)f(b)m(y)g(the)h
(shell)g(at)g(in)m(v)m(o)s(cation,)i(as)e(mo)s(di\014ed)e(b)m(y)i
-(redirections)g(supplied)e(to)330 3256 y(the)i Ft(exec)e
-Fu(builtin.)225 3386 y Fq(\017)60 b Fu(The)33 b(curren)m(t)g(w)m
+(redirections)g(supplied)e(to)330 4074 y(the)i Ft(exec)e
+Fu(builtin.)225 4212 y Fq(\017)60 b Fu(The)33 b(curren)m(t)g(w)m
(orking)h(directory)g(as)f(set)h(b)m(y)g Ft(cd)p Fu(,)g
Ft(pushd)p Fu(,)f(or)g Ft(popd)p Fu(,)g(or)h(inherited)f(b)m(y)g(the)h
-(shell)330 3496 y(at)d(in)m(v)m(o)s(cation.)225 3625
+(shell)330 4321 y(at)d(in)m(v)m(o)s(cation.)225 4459
y Fq(\017)60 b Fu(The)30 b(\014le)g(creation)i(mo)s(de)e(mask)g(as)h
(set)g(b)m(y)f Ft(umask)f Fu(or)h(inherited)h(from)e(the)i(shell's)g
-(paren)m(t.)225 3755 y Fq(\017)60 b Fu(Curren)m(t)29
-b(traps)h(set)h(b)m(y)g Ft(trap)p Fu(.)225 3884 y Fq(\017)60
+(paren)m(t.)225 4597 y Fq(\017)60 b Fu(Curren)m(t)29
+b(traps)h(set)h(b)m(y)g Ft(trap)p Fu(.)225 4735 y Fq(\017)60
b Fu(Shell)28 b(parameters)h(that)g(are)g(set)g(b)m(y)f(v)-5
b(ariable)29 b(assignmen)m(t)g(or)g(with)f Ft(set)f Fu(or)i(inherited)f
-(from)g(the)330 3994 y(shell's)j(paren)m(t)f(in)g(the)h(en)m(vironmen)m
-(t.)225 4124 y Fq(\017)60 b Fu(Shell)42 b(functions)g(de\014ned)f
+(from)g(the)330 4845 y(shell's)j(paren)m(t)f(in)g(the)h(en)m(vironmen)m
+(t.)225 4983 y Fq(\017)60 b Fu(Shell)42 b(functions)g(de\014ned)f
(during)h(execution)h(or)g(inherited)f(from)g(the)g(shell's)h(paren)m
-(t)g(in)f(the)330 4233 y(en)m(vironmen)m(t.)225 4363
+(t)g(in)f(the)330 5092 y(en)m(vironmen)m(t.)225 5230
y Fq(\017)60 b Fu(Options)30 b(enabled)h(at)g(in)m(v)m(o)s(cation)i
(\(either)f(b)m(y)e(default)h(or)g(with)f(command-line)i(argumen)m
-(ts\))f(or)330 4473 y(b)m(y)f Ft(set)p Fu(.)225 4602
+(ts\))f(or)330 5340 y(b)m(y)f Ft(set)p Fu(.)p eop end
+%%Page: 46 52
+TeXDict begin 46 51 bop 150 -116 a Fu(Chapter)30 b(3:)41
+b(Basic)32 b(Shell)e(F)-8 b(eatures)2246 b(46)225 299
y Fq(\017)60 b Fu(Options)30 b(enabled)g(b)m(y)h Ft(shopt)d
Fu(\(see)k(Section)f(4.3.2)h([The)e(Shopt)g(Builtin],)h(page)g(76\).)
-225 4732 y Fq(\017)60 b Fu(Shell)30 b(aliases)i(de\014ned)d(with)h
+225 434 y Fq(\017)60 b Fu(Shell)30 b(aliases)i(de\014ned)d(with)h
Ft(alias)f Fu(\(see)j(Section)f(6.6)g([Aliases],)h(page)g(107\).)225
-4861 y Fq(\017)60 b Fu(V)-8 b(arious)49 b(pro)s(cess)f
+570 y Fq(\017)60 b Fu(V)-8 b(arious)49 b(pro)s(cess)f
Fm(id)p Fu(s,)53 b(including)47 b(those)i(of)f(bac)m(kground)g(jobs)g
-(\(see)h(Section)g(3.2.4)h([Lists],)330 4971 y(page)31
+(\(see)h(Section)g(3.2.4)h([Lists],)330 679 y(page)31
b(11\),)h(the)f(v)-5 b(alue)30 b(of)h Ft($$)p Fu(,)f(and)g(the)g(v)-5
-b(alue)31 b(of)g Ft($PPID)p Fu(.)275 5121 y(When)j(a)g(simple)h
-(command)f(other)g(than)g(a)h(builtin)f(or)g(shell)h(function)f(is)g
-(to)h(b)s(e)f(executed,)i(it)f(is)150 5230 y(in)m(v)m(ok)m(ed)25
-b(in)f(a)g(separate)h(execution)g(en)m(vironmen)m(t)g(that)f(consists)g
-(of)h(the)f(follo)m(wing.)40 b(Unless)24 b(otherwise)150
-5340 y(noted,)31 b(the)f(v)-5 b(alues)31 b(are)g(inherited)f(from)g
-(the)g(shell.)p eop end
-%%Page: 46 52
-TeXDict begin 46 51 bop 150 -116 a Fu(Chapter)30 b(3:)41
-b(Basic)32 b(Shell)e(F)-8 b(eatures)2246 b(46)225 299
-y Fq(\017)60 b Fu(The)28 b(shell's)h(op)s(en)f(\014les,)h(plus)f(an)m
-(y)g(mo)s(di\014cations)h(and)f(additions)h(sp)s(eci\014ed)f(b)m(y)g
-(redirections)h(to)330 408 y(the)i(command.)225 544 y
-Fq(\017)60 b Fu(The)30 b(curren)m(t)g(w)m(orking)h(directory)-8
-b(.)225 679 y Fq(\017)60 b Fu(The)30 b(\014le)g(creation)i(mo)s(de)e
-(mask.)225 814 y Fq(\017)60 b Fu(Shell)31 b(v)-5 b(ariables)31
+b(alue)31 b(of)g Ft($PPID)p Fu(.)275 841 y(When)j(a)g(simple)h(command)
+f(other)g(than)g(a)h(builtin)f(or)g(shell)h(function)f(is)g(to)h(b)s(e)
+f(executed,)i(it)f(is)150 951 y(in)m(v)m(ok)m(ed)25 b(in)f(a)g
+(separate)h(execution)g(en)m(vironmen)m(t)g(that)f(consists)g(of)h(the)
+f(follo)m(wing.)40 b(Unless)24 b(otherwise)150 1060 y(noted,)31
+b(the)f(v)-5 b(alues)31 b(are)g(inherited)f(from)g(the)g(shell.)225
+1197 y Fq(\017)60 b Fu(The)28 b(shell's)h(op)s(en)f(\014les,)h(plus)f
+(an)m(y)g(mo)s(di\014cations)h(and)f(additions)h(sp)s(eci\014ed)f(b)m
+(y)g(redirections)h(to)330 1306 y(the)i(command.)225
+1442 y Fq(\017)60 b Fu(The)30 b(curren)m(t)g(w)m(orking)h(directory)-8
+b(.)225 1577 y Fq(\017)60 b Fu(The)30 b(\014le)g(creation)i(mo)s(de)e
+(mask.)225 1712 y Fq(\017)60 b Fu(Shell)31 b(v)-5 b(ariables)31
b(and)f(functions)h(mark)m(ed)f(for)h(exp)s(ort,)g(along)h(with)e(v)-5
-b(ariables)32 b(exp)s(orted)e(for)h(the)330 923 y(command,)f(passed)g
+b(ariables)32 b(exp)s(orted)e(for)h(the)330 1822 y(command,)f(passed)g
(in)g(the)h(en)m(vironmen)m(t)g(\(see)g(Section)g(3.7.4)i([En)m
-(vironmen)m(t],)e(page)g(46\).)225 1058 y Fq(\017)60
+(vironmen)m(t],)e(page)g(46\).)225 1957 y Fq(\017)60
b Fu(T)-8 b(raps)29 b(caugh)m(t)i(b)m(y)e(the)h(shell)g(are)g(reset)g
(to)g(the)g(v)-5 b(alues)30 b(inherited)f(from)h(the)f(shell's)h(paren)
-m(t,)h(and)330 1168 y(traps)f(ignored)h(b)m(y)f(the)g(shell)h(are)g
-(ignored.)275 1329 y(A)41 b(command)g(in)m(v)m(ok)m(ed)i(in)e(this)h
+m(t,)h(and)330 2067 y(traps)f(ignored)h(b)m(y)f(the)g(shell)h(are)g
+(ignored.)275 2229 y(A)41 b(command)g(in)m(v)m(ok)m(ed)i(in)e(this)h
(separate)g(en)m(vironmen)m(t)g(cannot)g(a\013ect)h(the)f(shell's)g
-(execution)150 1439 y(en)m(vironmen)m(t.)275 1574 y(A)30
+(execution)150 2338 y(en)m(vironmen)m(t.)275 2475 y(A)30
b Fr(subshell)j Fu(is)d(a)h(cop)m(y)g(of)g(the)f(shell)h(pro)s(cess.)
-275 1710 y(Command)k(substitution,)j(commands)e(group)s(ed)f(with)i
-(paren)m(theses,)h(and)e(async)m(hronous)g(com-)150 1820
+275 2611 y(Command)k(substitution,)j(commands)e(group)s(ed)f(with)i
+(paren)m(theses,)h(and)e(async)m(hronous)g(com-)150 2720
y(mands)c(are)h(in)m(v)m(ok)m(ed)i(in)d(a)i(subshell)e(en)m(vironmen)m
(t)h(that)h(is)f(a)g(duplicate)h(of)f(the)g(shell)g(en)m(vironmen)m(t,)
-150 1929 y(except)i(that)g(traps)f(caugh)m(t)h(b)m(y)f(the)h(shell)f
+150 2830 y(except)i(that)g(traps)f(caugh)m(t)h(b)m(y)f(the)h(shell)f
(are)g(reset)h(to)g(the)f(v)-5 b(alues)35 b(that)g(the)f(shell)h
-(inherited)e(from)150 2039 y(its)43 b(paren)m(t)f(at)h(in)m(v)m(o)s
+(inherited)e(from)150 2940 y(its)43 b(paren)m(t)f(at)h(in)m(v)m(o)s
(cation.)78 b(Builtin)43 b(commands)f(that)h(are)f(in)m(v)m(ok)m(ed)i
-(as)e(part)g(of)h(a)f(pip)s(eline,)j(ex-)150 2148 y(cept)32
+(as)e(part)g(of)h(a)f(pip)s(eline,)j(ex-)150 3049 y(cept)32
b(p)s(ossibly)e(in)h(the)h(last)g(elemen)m(t)h(dep)s(ending)c(on)j(the)
f(v)-5 b(alue)32 b(of)f(the)h Ft(lastpipe)d Fu(shell)i(option)h(\(see)
-150 2258 y(Section)37 b(4.3.2)i([The)d(Shopt)g(Builtin],)j(page)e
+150 3159 y(Section)37 b(4.3.2)i([The)d(Shopt)g(Builtin],)j(page)e
(76\),)j(are)d(also)h(executed)f(in)f(a)h(subshell)f(en)m(vironmen)m
-(t.)150 2368 y(Changes)27 b(made)g(to)h(the)g(subshell)e(en)m(vironmen)
+(t.)150 3268 y(Changes)27 b(made)g(to)h(the)g(subshell)e(en)m(vironmen)
m(t)i(cannot)g(a\013ect)h(the)e(shell's)h(execution)g(en)m(vironmen)m
-(t.)275 2503 y(When)i(the)h(shell)g(is)g(in)f Fm(posix)h
+(t.)275 3405 y(When)i(the)h(shell)g(is)g(in)f Fm(posix)h
Fu(mo)s(de,)f(subshells)g(spa)m(wned)g(to)i(execute)g(command)e
-(substitutions)150 2613 y(inherit)35 b(the)g(v)-5 b(alue)35
+(substitutions)150 3514 y(inherit)35 b(the)g(v)-5 b(alue)35
b(of)h(the)f Ft(-e)f Fu(option)h(from)g(the)g(paren)m(t)g(shell.)55
b(When)35 b(not)g(in)g Fm(posix)f Fu(mo)s(de,)i(Bash)150
-2723 y(clears)41 b(the)f Ft(-e)f Fu(option)h(in)g(suc)m(h)f(subshells)g
+3624 y(clears)41 b(the)f Ft(-e)f Fu(option)h(in)g(suc)m(h)f(subshells)g
(See)h(the)g(description)g(of)g(the)g Ft(inherit_errexit)c
-Fu(shell)150 2832 y(option)30 b(\(see)h(Section)g(4.2)g([Bash)f
+Fu(shell)150 3733 y(option)30 b(\(see)h(Section)g(4.2)g([Bash)f
(Builtins],)h(page)g(59\))g(for)f(ho)m(w)g(to)g(con)m(trol)i(this)e(b)s
-(eha)m(vior)g(when)f(not)150 2942 y(in)h Fm(posix)g Fu(mo)s(de.)275
-3077 y(If)23 b(a)h(command)g(is)g(follo)m(w)m(ed)h(b)m(y)f(a)g(`)p
+(eha)m(vior)g(when)f(not)150 3843 y(in)h Fm(posix)g Fu(mo)s(de.)275
+3979 y(If)23 b(a)h(command)g(is)g(follo)m(w)m(ed)h(b)m(y)f(a)g(`)p
Ft(&)p Fu(')g(and)f(job)h(con)m(trol)h(is)f(not)g(activ)m(e,)k(the)c
-(default)g(standard)f(input)150 3187 y(for)35 b(the)g(command)g(is)g
+(default)g(standard)f(input)150 4089 y(for)35 b(the)g(command)g(is)g
(the)g(empt)m(y)h(\014le)f Ft(/dev/null)p Fu(.)52 b(Otherwise,)37
-b(the)e(in)m(v)m(ok)m(ed)h(command)f(inherits)150 3297
+b(the)e(in)m(v)m(ok)m(ed)h(command)f(inherits)150 4198
y(the)c(\014le)f(descriptors)g(of)h(the)f(calling)i(shell)f(as)f(mo)s
-(di\014ed)g(b)m(y)g(redirections.)150 3497 y Fk(3.7.4)63
-b(En)m(vironmen)m(t)150 3644 y Fu(When)29 b(a)g(program)f(is)h(in)m(v)m
+(di\014ed)g(b)m(y)g(redirections.)150 4399 y Fk(3.7.4)63
+b(En)m(vironmen)m(t)150 4546 y Fu(When)29 b(a)g(program)f(is)h(in)m(v)m
(ok)m(ed)h(it)g(is)f(giv)m(en)g(an)g(arra)m(y)g(of)g(strings)g(called)h
(the)f Fr(en)m(vironmen)m(t)p Fu(.)41 b(This)28 b(is)h(a)150
-3754 y(list)i(of)g(name-v)-5 b(alue)31 b(pairs,)f(of)h(the)f(form)g
-Ft(name=value)p Fu(.)275 3889 y(Bash)39 b(pro)m(vides)g(sev)m(eral)i(w)
+4656 y(list)i(of)g(name-v)-5 b(alue)31 b(pairs,)f(of)h(the)f(form)g
+Ft(name=value)p Fu(.)275 4792 y(Bash)39 b(pro)m(vides)g(sev)m(eral)i(w)
m(a)m(ys)g(to)f(manipulate)f(the)h(en)m(vironmen)m(t.)69
-b(On)38 b(in)m(v)m(o)s(cation,)44 b(the)c(shell)150 3999
+b(On)38 b(in)m(v)m(o)s(cation,)44 b(the)c(shell)150 4902
y(scans)g(its)h(o)m(wn)f(en)m(vironmen)m(t)h(and)f(creates)i(a)f
(parameter)f(for)g(eac)m(h)i(name)e(found,)i(automatically)150
-4108 y(marking)23 b(it)h(for)f Ft(export)f Fu(to)i(c)m(hild)g(pro)s
+5011 y(marking)23 b(it)h(for)f Ft(export)f Fu(to)i(c)m(hild)g(pro)s
(cesses.)38 b(Executed)24 b(commands)f(inherit)g(the)g(en)m(vironmen)m
-(t.)39 b(The)150 4218 y Ft(export)p Fu(,)21 b(`)p Ft(declare)29
+(t.)39 b(The)150 5121 y Ft(export)p Fu(,)21 b(`)p Ft(declare)29
b(-x)p Fu(',)22 b(and)e Ft(unset)g Fu(commands)g(mo)s(dify)g(the)h(en)m
-(vironmen)m(t)g(b)m(y)g(adding)f(and)g(deleting)150 4328
+(vironmen)m(t)g(b)m(y)g(adding)f(and)g(deleting)150 5230
y(parameters)43 b(and)f(functions.)78 b(If)42 b(the)h(v)-5
b(alue)43 b(of)g(a)g(parameter)g(in)g(the)g(en)m(vironmen)m(t)g(is)g
-(mo)s(di\014ed,)150 4437 y(the)h(new)f(v)-5 b(alue)45
+(mo)s(di\014ed,)150 5340 y(the)h(new)f(v)-5 b(alue)45
b(automatically)h(b)s(ecomes)f(part)e(of)h(the)g(en)m(vironmen)m(t,)k
-(replacing)d(the)f(old.)81 b(The)150 4547 y(en)m(vironmen)m(t)27
-b(inherited)g(b)m(y)g(an)m(y)g(executed)g(command)g(consists)g(of)g
-(the)g(shell's)g(initial)h(en)m(vironmen)m(t,)150 4656
-y(whose)c(v)-5 b(alues)25 b(ma)m(y)h(b)s(e)e(mo)s(di\014ed)f(in)i(the)f
-(shell,)j(less)e(an)m(y)g(pairs)f(remo)m(v)m(ed)i(b)m(y)e(the)h
-Ft(unset)e Fu(and)h(`)p Ft(export)150 4766 y(-n)p Fu(')30
-b(commands,)g(plus)g(an)m(y)g(additions)h(via)g(the)f
-Ft(export)f Fu(and)h(`)p Ft(declare)e(-x)p Fu(')i(commands.)275
-4902 y(If)f(an)m(y)h(parameter)h(assignmen)m(t)f(statemen)m(ts,)i(as)e
-(describ)s(ed)f(in)h(Section)g(3.4)h([Shell)f(P)m(arameters],)150
-5011 y(page)j(22,)h(app)s(ear)d(b)s(efore)h(a)g(simple)h(command,)f
-(the)h(v)-5 b(ariable)33 b(assignmen)m(ts)f(are)h(part)f(of)g(that)h
-(com-)150 5121 y(mand's)26 b(en)m(vironmen)m(t)h(for)g(as)g(long)h(as)f
-(it)g(executes.)41 b(These)26 b(assignmen)m(t)i(statemen)m(ts)g
-(a\013ect)h(only)e(the)150 5230 y(en)m(vironmen)m(t)h(seen)g(b)m(y)f
-(that)h(command.)40 b(If)27 b(these)h(assignmen)m(ts)g(precede)g(a)g
-(call)h(to)f(a)g(shell)g(function,)150 5340 y(the)j(v)-5
-b(ariables)31 b(are)f(lo)s(cal)i(to)f(the)g(function)f(and)g(exp)s
-(orted)g(to)h(that)g(function's)f(c)m(hildren.)p eop
-end
+(replacing)d(the)f(old.)81 b(The)p eop end
%%Page: 47 53
TeXDict begin 47 52 bop 150 -116 a Fu(Chapter)30 b(3:)41
-b(Basic)32 b(Shell)e(F)-8 b(eatures)2246 b(47)275 299
-y(If)30 b(the)h Ft(-k)g Fu(option)g(is)g(set)h(\(see)g(Section)g(4.3.1)
-g([The)f(Set)g(Builtin],)h(page)g(71\),)h(then)e(all)g(parameter)150
-408 y(assignmen)m(ts)f(are)g(placed)h(in)e(the)h(en)m(vironmen)m(t)g
+b(Basic)32 b(Shell)e(F)-8 b(eatures)2246 b(47)150 299
+y(en)m(vironmen)m(t)27 b(inherited)g(b)m(y)g(an)m(y)g(executed)g
+(command)g(consists)g(of)g(the)g(shell's)g(initial)h(en)m(vironmen)m
+(t,)150 408 y(whose)c(v)-5 b(alues)25 b(ma)m(y)h(b)s(e)e(mo)s(di\014ed)
+f(in)i(the)f(shell,)j(less)e(an)m(y)g(pairs)f(remo)m(v)m(ed)i(b)m(y)e
+(the)h Ft(unset)e Fu(and)h(`)p Ft(export)150 518 y(-n)p
+Fu(')30 b(commands,)g(plus)g(an)m(y)g(additions)h(via)g(the)f
+Ft(export)f Fu(and)h(`)p Ft(declare)e(-x)p Fu(')i(commands.)275
+674 y(If)f(an)m(y)h(parameter)h(assignmen)m(t)f(statemen)m(ts,)i(as)e
+(describ)s(ed)f(in)h(Section)g(3.4)h([Shell)f(P)m(arameters],)150
+784 y(page)j(22,)h(app)s(ear)d(b)s(efore)h(a)g(simple)h(command,)f(the)
+h(v)-5 b(ariable)33 b(assignmen)m(ts)f(are)h(part)f(of)g(that)h(com-)
+150 893 y(mand's)26 b(en)m(vironmen)m(t)h(for)g(as)g(long)h(as)f(it)g
+(executes.)41 b(These)26 b(assignmen)m(t)i(statemen)m(ts)g(a\013ect)h
+(only)e(the)150 1003 y(en)m(vironmen)m(t)h(seen)g(b)m(y)f(that)h
+(command.)40 b(If)27 b(these)h(assignmen)m(ts)g(precede)g(a)g(call)h
+(to)f(a)g(shell)g(function,)150 1112 y(the)j(v)-5 b(ariables)31
+b(are)f(lo)s(cal)i(to)f(the)g(function)f(and)g(exp)s(orted)g(to)h(that)
+g(function's)f(c)m(hildren.)275 1268 y(If)g(the)h Ft(-k)g
+Fu(option)g(is)g(set)h(\(see)g(Section)g(4.3.1)g([The)f(Set)g
+(Builtin],)h(page)g(71\),)h(then)e(all)g(parameter)150
+1378 y(assignmen)m(ts)f(are)g(placed)h(in)e(the)h(en)m(vironmen)m(t)g
(for)g(a)g(command,)f(not)h(just)f(those)i(that)f(precede)g(the)150
-518 y(command)g(name.)275 647 y(When)h(Bash)h(in)m(v)m(ok)m(es)i(an)e
+1487 y(command)g(name.)275 1643 y(When)h(Bash)h(in)m(v)m(ok)m(es)i(an)e
(external)h(command,)f(the)g(v)-5 b(ariable)33 b(`)p
Ft($_)p Fu(')f(is)g(set)h(to)f(the)g(full)g(pathname)150
-756 y(of)f(the)f(command)g(and)g(passed)g(to)h(that)g(command)f(in)g
-(its)h(en)m(vironmen)m(t.)150 943 y Fk(3.7.5)63 b(Exit)40
-b(Status)150 1090 y Fu(The)23 b(exit)i(status)f(of)h(an)e(executed)i
+1753 y(of)f(the)f(command)g(and)g(passed)g(to)h(that)g(command)f(in)g
+(its)h(en)m(vironmen)m(t.)150 1973 y Fk(3.7.5)63 b(Exit)40
+b(Status)150 2120 y Fu(The)23 b(exit)i(status)f(of)h(an)e(executed)i
(command)f(is)g(the)g(v)-5 b(alue)24 b(returned)f(b)m(y)h(the)g
-Ft(waitpid)e Fu(system)i(call)h(or)150 1200 y(equiv)-5
+Ft(waitpid)e Fu(system)i(call)h(or)150 2230 y(equiv)-5
b(alen)m(t)33 b(function.)45 b(Exit)32 b(statuses)g(fall)g(b)s(et)m(w)m
(een)h(0)f(and)f(255,)i(though,)f(as)g(explained)g(b)s(elo)m(w,)h(the)
-150 1310 y(shell)i(ma)m(y)g(use)f(v)-5 b(alues)35 b(ab)s(o)m(v)m(e)g
+150 2340 y(shell)i(ma)m(y)g(use)f(v)-5 b(alues)35 b(ab)s(o)m(v)m(e)g
(125)h(sp)s(ecially)-8 b(.)54 b(Exit)35 b(statuses)g(from)f(shell)h
-(builtins)f(and)f(comp)s(ound)150 1419 y(commands)j(are)g(also)h
+(builtins)f(and)f(comp)s(ound)150 2449 y(commands)j(are)g(also)h
(limited)g(to)g(this)f(range.)58 b(Under)36 b(certain)h(circumstances,)
-h(the)e(shell)h(will)f(use)150 1529 y(sp)s(ecial)31 b(v)-5
+h(the)e(shell)h(will)f(use)150 2559 y(sp)s(ecial)31 b(v)-5
b(alues)31 b(to)g(indicate)g(sp)s(eci\014c)f(failure)h(mo)s(des.)275
-1657 y(F)-8 b(or)32 b(the)g(shell's)g(purp)s(oses,)e(a)j(command)e
+2715 y(F)-8 b(or)32 b(the)g(shell's)g(purp)s(oses,)e(a)j(command)e
(whic)m(h)h(exits)g(with)g(a)g(zero)g(exit)h(status)f(has)f(succeeded.)
-150 1767 y(So)38 b(while)f(an)h(exit)h(status)f(of)g(zero)g(indicates)h
+150 2824 y(So)38 b(while)f(an)h(exit)h(status)f(of)g(zero)g(indicates)h
(success,)h(a)e(non-zero)g(exit)h(status)f(indicates)g(failure.)150
-1876 y(This)27 b(seemingly)i(coun)m(ter-in)m(tuitiv)m(e)i(sc)m(heme)e
+2934 y(This)27 b(seemingly)i(coun)m(ter-in)m(tuitiv)m(e)i(sc)m(heme)e
(is)f(used)f(so)h(there)h(is)f(one)g(w)m(ell-de\014ned)g(w)m(a)m(y)h
-(to)g(indicate)150 1986 y(success)i(and)e(a)i(v)-5 b(ariet)m(y)32
+(to)g(indicate)150 3043 y(success)i(and)e(a)i(v)-5 b(ariet)m(y)32
b(of)e(w)m(a)m(ys)i(to)f(indicate)g(v)-5 b(arious)31
-b(failure)f(mo)s(des.)275 2115 y(When)g(a)h(command)g(terminates)g(on)g
+b(failure)f(mo)s(des.)275 3199 y(When)g(a)h(command)g(terminates)g(on)g
(a)g(fatal)h(signal)f(whose)g(n)m(um)m(b)s(er)e(is)i
-Fr(N)p Fu(,)g(Bash)g(uses)g(the)f(v)-5 b(alue)150 2224
+Fr(N)p Fu(,)g(Bash)g(uses)g(the)f(v)-5 b(alue)150 3309
y(128)p Ft(+)p Fr(N)41 b Fu(as)31 b(the)g(exit)g(status.)275
-2353 y(If)k(a)h(command)g(is)g(not)g(found,)g(the)g(c)m(hild)h(pro)s
+3465 y(If)k(a)h(command)g(is)g(not)g(found,)g(the)g(c)m(hild)h(pro)s
(cess)e(created)i(to)g(execute)g(it)g(returns)d(a)j(status)f(of)150
-2462 y(127.)42 b(If)30 b(a)h(command)f(is)g(found)f(but)h(is)g(not)h
+3574 y(127.)42 b(If)30 b(a)h(command)f(is)g(found)f(but)h(is)g(not)h
(executable,)h(the)f(return)e(status)i(is)f(126.)275
-2591 y(If)i(a)i(command)f(fails)g(b)s(ecause)g(of)h(an)f(error)f
+3730 y(If)i(a)i(command)f(fails)g(b)s(ecause)g(of)h(an)f(error)f
(during)g(expansion)h(or)g(redirection,)i(the)f(exit)g(status)150
-2700 y(is)c(greater)i(than)e(zero.)275 2829 y(The)38
+3840 y(is)c(greater)i(than)e(zero.)275 3996 y(The)38
b(exit)h(status)g(is)g(used)f(b)m(y)g(the)h(Bash)g(conditional)h
-(commands)e(\(see)h(Section)h(3.2.5.2)h([Con-)150 2938
+(commands)e(\(see)h(Section)h(3.2.5.2)h([Con-)150 4105
y(ditional)i(Constructs],)h(page)f(12\))g(and)e(some)i(of)f(the)g(list)
g(constructs)g(\(see)h(Section)f(3.2.4)i([Lists],)150
-3048 y(page)31 b(11\).)275 3177 y(All)40 b(of)g(the)h(Bash)f(builtins)f
+4215 y(page)31 b(11\).)275 4371 y(All)40 b(of)g(the)h(Bash)f(builtins)f
(return)g(an)h(exit)h(status)g(of)f(zero)h(if)f(they)g(succeed)g(and)g
-(a)g(non-zero)150 3286 y(status)34 b(on)f(failure,)i(so)f(they)g(ma)m
+(a)g(non-zero)150 4480 y(status)34 b(on)f(failure,)i(so)f(they)g(ma)m
(y)g(b)s(e)f(used)g(b)m(y)g(the)h(conditional)h(and)e(list)h
-(constructs.)50 b(All)35 b(builtins)150 3396 y(return)e(an)i(exit)g
+(constructs.)50 b(All)35 b(builtins)150 4590 y(return)e(an)i(exit)g
(status)g(of)f(2)h(to)g(indicate)h(incorrect)f(usage,)h(generally)g(in)
-m(v)-5 b(alid)35 b(options)g(or)f(missing)150 3505 y(argumen)m(ts.)275
-3634 y(The)f(exit)i(status)f(of)h(the)f(last)h(command)f(is)g(a)m(v)-5
+m(v)-5 b(alid)35 b(options)g(or)f(missing)150 4699 y(argumen)m(ts.)275
+4855 y(The)f(exit)i(status)f(of)h(the)f(last)h(command)f(is)g(a)m(v)-5
b(ailable)36 b(in)e(the)g(sp)s(ecial)h(parameter)f($?)52
-b(\(see)35 b(Sec-)150 3743 y(tion)c(3.4.2)h([Sp)s(ecial)f(P)m
-(arameters],)h(page)f(23\).)275 3872 y(Bash)h(itself)i(returns)e(the)h
+b(\(see)35 b(Sec-)150 4965 y(tion)c(3.4.2)h([Sp)s(ecial)f(P)m
+(arameters],)h(page)f(23\).)275 5121 y(Bash)h(itself)i(returns)e(the)h
(exit)g(status)g(of)g(the)g(last)h(command)e(executed,)j(unless)d(a)h
-(syn)m(tax)g(error)150 3982 y(o)s(ccurs,)38 b(in)f(whic)m(h)f(case)i
+(syn)m(tax)g(error)150 5230 y(o)s(ccurs,)38 b(in)f(whic)m(h)f(case)i
(it)f(exits)g(with)g(a)g(non-zero)g(v)-5 b(alue.)60 b(See)37
-b(also)h(the)e Ft(exit)g Fu(builtin)g(command)150 4091
+b(also)h(the)e Ft(exit)g Fu(builtin)g(command)150 5340
y(\(see)31 b(Section)h(4.1)f([Bourne)f(Shell)h(Builtins],)g(page)g(50.)
-150 4278 y Fk(3.7.6)63 b(Signals)150 4425 y Fu(When)29
-b(Bash)h(is)f(in)m(teractiv)m(e,)k(in)c(the)h(absence)g(of)g(an)m(y)f
-(traps,)h(it)g(ignores)g Ft(SIGTERM)d Fu(\(so)j(that)h(`)p
-Ft(kill)e(0)p Fu(')150 4535 y(do)s(es)d(not)g(kill)h(an)f(in)m
-(teractiv)m(e)j(shell\),)f(and)e(catc)m(hes)i(and)d(handles)h
-Ft(SIGINT)e Fu(\(so)j(that)g(the)f Ft(wait)f Fu(builtin)150
-4645 y(is)35 b(in)m(terruptible\).)56 b(When)36 b(Bash)f(receiv)m(es)i
-(a)f Ft(SIGINT)p Fu(,)f(it)h(breaks)f(out)h(of)g(an)m(y)f(executing)i
-(lo)s(ops.)56 b(In)150 4754 y(all)39 b(cases,)i(Bash)e(ignores)g
+p eop end
+%%Page: 48 54
+TeXDict begin 48 53 bop 150 -116 a Fu(Chapter)30 b(3:)41
+b(Basic)32 b(Shell)e(F)-8 b(eatures)2246 b(48)150 299
+y Fk(3.7.6)63 b(Signals)150 446 y Fu(When)29 b(Bash)h(is)f(in)m
+(teractiv)m(e,)k(in)c(the)h(absence)g(of)g(an)m(y)f(traps,)h(it)g
+(ignores)g Ft(SIGTERM)d Fu(\(so)j(that)h(`)p Ft(kill)e(0)p
+Fu(')150 555 y(do)s(es)d(not)g(kill)h(an)f(in)m(teractiv)m(e)j
+(shell\),)f(and)e(catc)m(hes)i(and)d(handles)h Ft(SIGINT)e
+Fu(\(so)j(that)g(the)f Ft(wait)f Fu(builtin)150 665 y(is)35
+b(in)m(terruptible\).)56 b(When)36 b(Bash)f(receiv)m(es)i(a)f
+Ft(SIGINT)p Fu(,)f(it)h(breaks)f(out)h(of)g(an)m(y)f(executing)i(lo)s
+(ops.)56 b(In)150 775 y(all)39 b(cases,)i(Bash)e(ignores)g
Ft(SIGQUIT)p Fu(.)62 b(If)38 b(job)g(con)m(trol)h(is)g(in)e(e\013ect)j
-(\(see)f(Chapter)f(7)h([Job)f(Con)m(trol],)150 4864 y(page)31
+(\(see)f(Chapter)f(7)h([Job)f(Con)m(trol],)150 884 y(page)31
b(123\),)h(Bash)f(ignores)g Ft(SIGTTIN)p Fu(,)d Ft(SIGTTOU)p
-Fu(,)h(and)h Ft(SIGTSTP)p Fu(.)275 4992 y(The)25 b Ft(trap)g
+Fu(,)h(and)h Ft(SIGTSTP)p Fu(.)275 1014 y(The)25 b Ft(trap)g
Fu(builtin)h(mo)s(di\014es)g(the)g(shell's)h(signal)g(handling,)f(as)h
(describ)s(ed)e(b)s(elo)m(w)i(\(see)g(Section)g(4.1)150
-5102 y([Bourne)j(Shell)h(Builtins],)g(page)g(50.)275
-5230 y(Non-builtin)38 b(commands)f(Bash)h(executes)i(ha)m(v)m(e)f
+1124 y([Bourne)j(Shell)h(Builtins],)g(page)g(50.)275
+1253 y(Non-builtin)38 b(commands)f(Bash)h(executes)i(ha)m(v)m(e)f
(signal)f(handlers)f(set)i(to)g(the)f(v)-5 b(alues)38
-b(inherited)150 5340 y(b)m(y)c(the)h(shell)f(from)g(its)h(paren)m(t,)h
+b(inherited)150 1363 y(b)m(y)c(the)h(shell)f(from)g(its)h(paren)m(t,)h
(unless)d Ft(trap)g Fu(sets)i(them)f(to)h(b)s(e)f(ignored,)i(in)e(whic)
-m(h)g(case)h(the)g(c)m(hild)p eop end
-%%Page: 48 54
-TeXDict begin 48 53 bop 150 -116 a Fu(Chapter)30 b(3:)41
-b(Basic)32 b(Shell)e(F)-8 b(eatures)2246 b(48)150 299
-y(pro)s(cess)26 b(will)g(ignore)h(them)f(as)g(w)m(ell.)40
-b(When)26 b(job)g(con)m(trol)i(is)e(not)g(in)g(e\013ect,)j(async)m
-(hronous)c(commands)150 408 y(ignore)36 b Ft(SIGINT)e
-Fu(and)h Ft(SIGQUIT)e Fu(in)j(addition)f(to)i(these)f(inherited)f
-(handlers.)55 b(Commands)35 b(run)f(as)i(a)150 518 y(result)27
-b(of)h(command)f(substitution)h(ignore)g(the)g(k)m(eyb)s
-(oard-generated)g(job)g(con)m(trol)h(signals)f Ft(SIGTTIN)p
-Fu(,)150 628 y Ft(SIGTTOU)p Fu(,)h(and)g Ft(SIGTSTP)p
-Fu(.)275 759 y(The)h(shell)i(exits)g(b)m(y)f(default)g(up)s(on)f
-(receipt)i(of)f(a)h Ft(SIGHUP)p Fu(.)42 b(Before)32 b(exiting,)h(an)e
-(in)m(teractiv)m(e)j(shell)150 869 y(resends)i(the)h
-Ft(SIGHUP)e Fu(to)i(all)h(jobs,)g(running)d(or)i(stopp)s(ed.)59
-b(The)36 b(shell)h(sends)f Ft(SIGCONT)e Fu(to)k(stopp)s(ed)150
-978 y(jobs)g(to)h(ensure)e(that)i(they)g(receiv)m(e)h(the)f
-Ft(SIGHUP)d Fu(\(See)j(Chapter)f(7)h([Job)f(Con)m(trol],)j(page)e(123,)
-j(for)150 1088 y(more)31 b(information)g(ab)s(out)g(running)e(and)h
-(stopp)s(ed)g(jobs\).)43 b(T)-8 b(o)31 b(prev)m(en)m(t)h(the)f(shell)g
-(from)f(sending)h(the)150 1198 y Ft(SIGHUP)36 b Fu(signal)i(to)g(a)f
-(particular)h(job,)h(remo)m(v)m(e)g(it)f(from)f(the)g(jobs)g(table)h
-(with)f(the)h Ft(disown)d Fu(builtin)150 1307 y(\(see)i(Section)g(7.2)f
-([Job)g(Con)m(trol)h(Builtins],)h(page)e(124\))i(or)e(mark)f(it)i(not)f
-(to)h(receiv)m(e)g Ft(SIGHUP)d Fu(using)150 1417 y Ft(disown)29
-b(-h)p Fu(.)275 1548 y(If)36 b(the)h Ft(huponexit)d Fu(shell)j(option)g
-(has)g(b)s(een)f(set)h(using)g Ft(shopt)e Fu(\(see)j(Section)g(4.3.2)g
-([The)f(Shopt)150 1658 y(Builtin],)31 b(page)g(76\),)h(Bash)f(sends)e
-(a)i Ft(SIGHUP)e Fu(to)i(all)g(jobs)f(when)f(an)i(in)m(teractiv)m(e)i
-(login)e(shell)g(exits.)275 1789 y(If)d(Bash)h(is)g(w)m(aiting)h(for)e
-(a)i(command)e(to)i(complete)g(and)e(receiv)m(es)j(a)e(signal)g(for)g
-(whic)m(h)f(a)i(trap)e(has)150 1899 y(b)s(een)e(set,)j(the)f(trap)f
-(will)g(not)h(b)s(e)e(executed)i(un)m(til)g(the)f(command)g(completes.)
-41 b(If)27 b(Bash)g(is)h(w)m(aiting)g(for)150 2009 y(an)35
+m(h)g(case)h(the)g(c)m(hild)150 1473 y(pro)s(cess)26
+b(will)g(ignore)h(them)f(as)g(w)m(ell.)40 b(When)26 b(job)g(con)m(trol)
+i(is)e(not)g(in)g(e\013ect,)j(async)m(hronous)c(commands)150
+1582 y(ignore)36 b Ft(SIGINT)e Fu(and)h Ft(SIGQUIT)e
+Fu(in)j(addition)f(to)i(these)f(inherited)f(handlers.)55
+b(Commands)35 b(run)f(as)i(a)150 1692 y(result)27 b(of)h(command)f
+(substitution)h(ignore)g(the)g(k)m(eyb)s(oard-generated)g(job)g(con)m
+(trol)h(signals)f Ft(SIGTTIN)p Fu(,)150 1801 y Ft(SIGTTOU)p
+Fu(,)h(and)g Ft(SIGTSTP)p Fu(.)275 1931 y(The)h(shell)i(exits)g(b)m(y)f
+(default)g(up)s(on)f(receipt)i(of)f(a)h Ft(SIGHUP)p Fu(.)42
+b(Before)32 b(exiting,)h(an)e(in)m(teractiv)m(e)j(shell)150
+2041 y(resends)i(the)h Ft(SIGHUP)e Fu(to)i(all)h(jobs,)g(running)d(or)i
+(stopp)s(ed.)59 b(The)36 b(shell)h(sends)f Ft(SIGCONT)e
+Fu(to)k(stopp)s(ed)150 2150 y(jobs)g(to)h(ensure)e(that)i(they)g
+(receiv)m(e)h(the)f Ft(SIGHUP)d Fu(\(See)j(Chapter)f(7)h([Job)f(Con)m
+(trol],)j(page)e(123,)j(for)150 2260 y(more)31 b(information)g(ab)s
+(out)g(running)e(and)h(stopp)s(ed)g(jobs\).)43 b(T)-8
+b(o)31 b(prev)m(en)m(t)h(the)f(shell)g(from)f(sending)h(the)150
+2369 y Ft(SIGHUP)36 b Fu(signal)i(to)g(a)f(particular)h(job,)h(remo)m
+(v)m(e)g(it)f(from)f(the)g(jobs)g(table)h(with)f(the)h
+Ft(disown)d Fu(builtin)150 2479 y(\(see)i(Section)g(7.2)f([Job)g(Con)m
+(trol)h(Builtins],)h(page)e(124\))i(or)e(mark)f(it)i(not)f(to)h(receiv)
+m(e)g Ft(SIGHUP)d Fu(using)150 2589 y Ft(disown)29 b(-h)p
+Fu(.)275 2718 y(If)36 b(the)h Ft(huponexit)d Fu(shell)j(option)g(has)g
+(b)s(een)f(set)h(using)g Ft(shopt)e Fu(\(see)j(Section)g(4.3.2)g([The)f
+(Shopt)150 2828 y(Builtin],)31 b(page)g(76\),)h(Bash)f(sends)e(a)i
+Ft(SIGHUP)e Fu(to)i(all)g(jobs)f(when)f(an)i(in)m(teractiv)m(e)i(login)
+e(shell)g(exits.)275 2958 y(If)d(Bash)h(is)g(w)m(aiting)h(for)e(a)i
+(command)e(to)i(complete)g(and)e(receiv)m(es)j(a)e(signal)g(for)g(whic)
+m(h)f(a)i(trap)e(has)150 3067 y(b)s(een)e(set,)j(the)f(trap)f(will)g
+(not)h(b)s(e)e(executed)i(un)m(til)g(the)f(command)g(completes.)41
+b(If)27 b(Bash)g(is)h(w)m(aiting)g(for)150 3177 y(an)35
b(async)m(hronous)g(command)g(via)h(the)g Ft(wait)e Fu(builtin,)i(and)f
(it)h(receiv)m(es)h(a)e(signal)h(for)f(whic)m(h)g(a)h(trap)150
-2118 y(has)27 b(b)s(een)g(set,)h(the)g Ft(wait)e Fu(builtin)h(will)g
+3287 y(has)27 b(b)s(een)g(set,)h(the)g Ft(wait)e Fu(builtin)h(will)g
(return)f(immediately)j(with)e(an)g(exit)h(status)g(greater)g(than)f
-(128,)150 2228 y(immediately)32 b(after)f(whic)m(h)f(the)g(shell)h
-(executes)g(the)g(trap.)275 2359 y(When)41 b(job)g(con)m(trol)h(is)g
+(128,)150 3396 y(immediately)32 b(after)f(whic)m(h)f(the)g(shell)h
+(executes)g(the)g(trap.)275 3526 y(When)41 b(job)g(con)m(trol)h(is)g
(not)f(enabled,)k(and)40 b(Bash)i(is)f(w)m(aiting)i(for)e(a)h
-(foreground)e(command)h(to)150 2469 y(complete,)35 b(the)e(shell)h
+(foreground)e(command)h(to)150 3636 y(complete,)35 b(the)e(shell)h
(receiv)m(es)g(k)m(eyb)s(oard-generated)g(signals)g(suc)m(h)e(as)i
-Ft(SIGINT)d Fu(\(usually)i(generated)150 2578 y(b)m(y)e(`)p
+Ft(SIGINT)d Fu(\(usually)i(generated)150 3745 y(b)m(y)e(`)p
Ft(^C)p Fu('\))h(that)g(users)e(commonly)i(in)m(tend)g(to)g(send)e(to)j
(that)f(command.)43 b(This)31 b(happ)s(ens)e(b)s(ecause)j(the)150
-2688 y(shell)23 b(and)g(the)h(command)f(are)g(in)g(the)h(same)f(pro)s
+3855 y(shell)23 b(and)g(the)h(command)f(are)g(in)g(the)h(same)f(pro)s
(cess)g(group)g(as)h(the)f(terminal,)i(and)e(`)p Ft(^C)p
-Fu(')g(sends)g Ft(SIGINT)150 2798 y Fu(to)35 b(all)g(pro)s(cesses)f(in)
+Fu(')g(sends)g Ft(SIGINT)150 3964 y Fu(to)35 b(all)g(pro)s(cesses)f(in)
g(that)g(pro)s(cess)g(group.)51 b(See)35 b(Chapter)e(7)i([Job)f(Con)m
-(trol],)i(page)f(123,)h(for)e(a)h(more)150 2907 y(in-depth)30
-b(discussion)f(of)i(pro)s(cess)f(groups.)275 3039 y(When)35
+(trol],)i(page)f(123,)h(for)e(a)h(more)150 4074 y(in-depth)30
+b(discussion)f(of)i(pro)s(cess)f(groups.)275 4204 y(When)35
b(Bash)h(is)g(running)f(without)h(job)f(con)m(trol)i(enabled)f(and)g
(receiv)m(es)h Ft(SIGINT)e Fu(while)h(w)m(aiting)150
-3148 y(for)g(a)h(foreground)f(command,)i(it)f(w)m(aits)g(un)m(til)g
+4313 y(for)g(a)h(foreground)f(command,)i(it)f(w)m(aits)g(un)m(til)g
(that)g(foreground)f(command)g(terminates)h(and)f(then)150
-3258 y(decides)31 b(what)f(to)h(do)f(ab)s(out)g(the)h
-Ft(SIGINT)p Fu(:)199 3390 y(1.)61 b(If)29 b(the)h(command)f(terminates)
+4423 y(decides)31 b(what)f(to)h(do)f(ab)s(out)g(the)h
+Ft(SIGINT)p Fu(:)199 4553 y(1.)61 b(If)29 b(the)h(command)f(terminates)
i(due)d(to)j(the)e Ft(SIGINT)p Fu(,)g(Bash)g(concludes)h(that)g(the)g
-(user)f(mean)m(t)h(to)330 3499 y(end)25 b(the)h(en)m(tire)h(script,)g
+(user)f(mean)m(t)h(to)330 4662 y(end)25 b(the)h(en)m(tire)h(script,)g
(and)f(acts)h(on)e(the)i Ft(SIGINT)d Fu(\(e.g.,)k(b)m(y)e(running)f(a)h
-Ft(SIGINT)e Fu(trap)i(or)g(exiting)330 3609 y(itself)7
-b(\);)199 3740 y(2.)61 b(If)39 b(the)g(pip)s(eline)g(do)s(es)g(not)h
+Ft(SIGINT)e Fu(trap)i(or)g(exiting)330 4772 y(itself)7
+b(\);)199 4902 y(2.)61 b(If)39 b(the)g(pip)s(eline)g(do)s(es)g(not)h
(terminate)g(due)f(to)h Ft(SIGINT)p Fu(,)g(the)g(program)f(handled)f
-(the)i Ft(SIGINT)330 3850 y Fu(itself)35 b(and)e(did)h(not)g(treat)h
+(the)i Ft(SIGINT)330 5011 y Fu(itself)35 b(and)e(did)h(not)g(treat)h
(it)g(as)f(a)g(fatal)i(signal.)52 b(In)33 b(that)i(case,)h(Bash)e(do)s
-(es)g(not)g(treat)i Ft(SIGINT)330 3959 y Fu(as)41 b(a)g(fatal)g
+(es)g(not)g(treat)i Ft(SIGINT)330 5121 y Fu(as)41 b(a)g(fatal)g
(signal,)j(either,)g(instead)d(assuming)f(that)h(the)g
Ft(SIGINT)d Fu(w)m(as)j(used)f(as)h(part)f(of)h(the)330
-4069 y(program's)32 b(normal)g(op)s(eration)h(\(e.g.,)h
+5230 y(program's)32 b(normal)g(op)s(eration)h(\(e.g.,)h
Ft(emacs)d Fu(uses)g(it)i(to)g(ab)s(ort)f(editing)h(commands\))f(or)g
-(delib-)330 4179 y(erately)41 b(discarded.)69 b(Ho)m(w)m(ev)m(er,)45
+(delib-)330 5340 y(erately)41 b(discarded.)69 b(Ho)m(w)m(ev)m(er,)45
b(Bash)40 b(will)h(run)d(an)m(y)j(trap)e(set)i(on)f Ft(SIGINT)p
-Fu(,)h(as)f(it)h(do)s(es)e(with)330 4288 y(an)m(y)31
-b(other)f(trapp)s(ed)f(signal)i(it)g(receiv)m(es)h(while)e(it)h(is)f(w)
-m(aiting)h(for)f(the)h(foreground)e(command)h(to)330
-4398 y(complete,)i(for)e(compatibilit)m(y)-8 b(.)150
-4633 y Fs(3.8)68 b(Shell)45 b(Scripts)150 4792 y Fu(A)30
-b(shell)f(script)h(is)f(a)h(text)h(\014le)f(con)m(taining)h(shell)f
-(commands.)40 b(When)29 b(suc)m(h)g(a)h(\014le)g(is)f(used)g(as)h(the)g
-(\014rst)150 4902 y(non-option)c(argumen)m(t)h(when)e(in)m(v)m(oking)i
-(Bash,)g(and)f(neither)g(the)g Ft(-c)g Fu(nor)f Ft(-s)h
-Fu(option)g(is)g(supplied)f(\(see)150 5011 y(Section)39
-b(6.1)g([In)m(v)m(oking)g(Bash],)h(page)f(98\),)i(Bash)d(reads)g(and)f
-(executes)i(commands)f(from)f(the)i(\014le,)150 5121
-y(then)29 b(exits.)42 b(This)28 b(mo)s(de)i(of)f(op)s(eration)i
-(creates)g(a)f(non-in)m(teractiv)m(e)i(shell.)41 b(If)29
-b(the)h(\014lename)f(do)s(es)h(not)150 5230 y(con)m(tain)g(an)m(y)e
-(slashes,)h(the)g(shell)f(\014rst)g(searc)m(hes)h(for)f(the)h(\014le)f
-(in)g(the)h(curren)m(t)f(directory)-8 b(,)30 b(and)d(lo)s(oks)i(in)150
-5340 y(the)i(directories)g(in)f Ft($PATH)f Fu(if)h(not)h(found)e
-(there.)p eop end
+Fu(,)h(as)f(it)h(do)s(es)e(with)p eop end
%%Page: 49 55
TeXDict begin 49 54 bop 150 -116 a Fu(Chapter)30 b(3:)41
-b(Basic)32 b(Shell)e(F)-8 b(eatures)2246 b(49)275 299
-y(Bash)34 b(tries)g(to)g(determine)g(whether)g(the)g(\014le)f(is)h(a)h
-(text)f(\014le)g(or)g(a)g(binary)-8 b(,)35 b(and)e(will)h(not)h
-(execute)150 408 y(\014les)30 b(it)h(determines)g(to)g(b)s(e)e
-(binaries.)275 543 y(When)34 b(Bash)h(runs)e(a)i(shell)g(script,)g(it)h
-(sets)f(the)f(sp)s(ecial)i(parameter)f Ft(0)f Fu(to)h(the)g(name)g(of)g
-(the)g(\014le,)150 653 y(rather)k(than)g(the)h(name)f(of)h(the)f
-(shell,)j(and)d(the)h(p)s(ositional)g(parameters)f(are)h(set)g(to)g
-(the)g(remain-)150 762 y(ing)f(argumen)m(ts,)j(if)d(an)m(y)g(are)g(giv)
-m(en.)67 b(If)39 b(no)g(additional)g(argumen)m(ts)h(are)f(supplied,)h
-(the)f(p)s(ositional)150 872 y(parameters)31 b(are)f(unset.)275
-1006 y(A)39 b(shell)h(script)f(ma)m(y)h(b)s(e)f(made)h(executable)h(b)m
+b(Basic)32 b(Shell)e(F)-8 b(eatures)2246 b(49)330 299
+y(an)m(y)31 b(other)f(trapp)s(ed)f(signal)i(it)g(receiv)m(es)h(while)e
+(it)h(is)f(w)m(aiting)h(for)f(the)h(foreground)e(command)h(to)330
+408 y(complete,)i(for)e(compatibilit)m(y)-8 b(.)150 648
+y Fs(3.8)68 b(Shell)45 b(Scripts)150 807 y Fu(A)30 b(shell)f(script)h
+(is)f(a)h(text)h(\014le)f(con)m(taining)h(shell)f(commands.)40
+b(When)29 b(suc)m(h)g(a)h(\014le)g(is)f(used)g(as)h(the)g(\014rst)150
+917 y(non-option)c(argumen)m(t)h(when)e(in)m(v)m(oking)i(Bash,)g(and)f
+(neither)g(the)g Ft(-c)g Fu(nor)f Ft(-s)h Fu(option)g(is)g(supplied)f
+(\(see)150 1026 y(Section)39 b(6.1)g([In)m(v)m(oking)g(Bash],)h(page)f
+(98\),)i(Bash)d(reads)g(and)f(executes)i(commands)f(from)f(the)i
+(\014le,)150 1136 y(then)29 b(exits.)42 b(This)28 b(mo)s(de)i(of)f(op)s
+(eration)i(creates)g(a)f(non-in)m(teractiv)m(e)i(shell.)41
+b(If)29 b(the)h(\014lename)f(do)s(es)h(not)150 1245 y(con)m(tain)g(an)m
+(y)e(slashes,)h(the)g(shell)f(\014rst)g(searc)m(hes)h(for)f(the)h
+(\014le)f(in)g(the)h(curren)m(t)f(directory)-8 b(,)30
+b(and)d(lo)s(oks)i(in)150 1355 y(the)i(directories)g(in)f
+Ft($PATH)f Fu(if)h(not)h(found)e(there.)275 1489 y(Bash)34
+b(tries)g(to)g(determine)g(whether)g(the)g(\014le)f(is)h(a)h(text)f
+(\014le)g(or)g(a)g(binary)-8 b(,)35 b(and)e(will)h(not)h(execute)150
+1598 y(\014les)30 b(it)h(determines)g(to)g(b)s(e)e(binaries.)275
+1732 y(When)34 b(Bash)h(runs)e(a)i(shell)g(script,)g(it)h(sets)f(the)f
+(sp)s(ecial)i(parameter)f Ft(0)f Fu(to)h(the)g(name)g(of)g(the)g
+(\014le,)150 1842 y(rather)k(than)g(the)h(name)f(of)h(the)f(shell,)j
+(and)d(the)h(p)s(ositional)g(parameters)f(are)h(set)g(to)g(the)g
+(remain-)150 1951 y(ing)f(argumen)m(ts,)j(if)d(an)m(y)g(are)g(giv)m
+(en.)67 b(If)39 b(no)g(additional)g(argumen)m(ts)h(are)f(supplied,)h
+(the)f(p)s(ositional)150 2061 y(parameters)31 b(are)f(unset.)275
+2195 y(A)39 b(shell)h(script)f(ma)m(y)h(b)s(e)f(made)h(executable)h(b)m
(y)e(using)g(the)h Ft(chmod)e Fu(command)h(to)h(turn)e(on)i(the)150
-1116 y(execute)j(bit.)73 b(When)41 b(Bash)g(\014nds)e(suc)m(h)i(a)h
+2304 y(execute)j(bit.)73 b(When)41 b(Bash)g(\014nds)e(suc)m(h)i(a)h
(\014le)f(while)g(searc)m(hing)h(the)f Ft($PATH)f Fu(for)h(a)h
-(command,)h(it)150 1225 y(creates)32 b(a)f(new)e(instance)i(of)g
+(command,)h(it)150 2414 y(creates)32 b(a)f(new)e(instance)i(of)g
(itself)g(to)g(execute)h(it.)41 b(In)30 b(other)h(w)m(ords,)f
-(executing)390 1360 y Ft(filename)46 b Fj(arguments)150
-1494 y Fu(is)30 b(equiv)-5 b(alen)m(t)32 b(to)f(executing)390
-1629 y Ft(bash)47 b(filename)e Fj(arguments)150 1763
+(executing)390 2547 y Ft(filename)46 b Fj(arguments)150
+2681 y Fu(is)30 b(equiv)-5 b(alen)m(t)32 b(to)f(executing)390
+2815 y Ft(bash)47 b(filename)e Fj(arguments)150 2949
y Fu(if)30 b Ft(filename)d Fu(is)j(an)f(executable)j(shell)e(script.)40
b(This)29 b(subshell)g(reinitializes)i(itself,)g(so)f(that)h(the)e
-(e\013ect)150 1873 y(is)36 b(as)h(if)g(a)f(new)g(shell)h(had)f(b)s(een)
+(e\013ect)150 3058 y(is)36 b(as)h(if)g(a)f(new)g(shell)h(had)f(b)s(een)
g(in)m(v)m(ok)m(ed)h(to)h(in)m(terpret)e(the)h(script,)h(with)e(the)h
-(exception)h(that)f(the)150 1983 y(lo)s(cations)25 b(of)g(commands)e
+(exception)h(that)f(the)150 3168 y(lo)s(cations)25 b(of)g(commands)e
(remem)m(b)s(ered)h(b)m(y)g(the)g(paren)m(t)g(\(see)h(the)f
(description)g(of)g Ft(hash)f Fu(in)h(Section)h(4.1)150
-2092 y([Bourne)30 b(Shell)h(Builtins],)g(page)g(50\))h(are)e(retained)h
-(b)m(y)f(the)h(c)m(hild.)275 2227 y(The)25 b Fm(gnu)h
+3277 y([Bourne)30 b(Shell)h(Builtins],)g(page)g(50\))h(are)e(retained)h
+(b)m(y)f(the)h(c)m(hild.)275 3411 y(The)25 b Fm(gnu)h
Fu(op)s(erating)g(system,)h(and)f(most)g(v)m(ersions)g(of)g(Unix,)h
(mak)m(e)g(this)f(a)g(part)g(of)g(the)g(op)s(erating)150
-2336 y(system's)36 b(command)g(execution)h(mec)m(hanism.)58
+3521 y(system's)36 b(command)g(execution)h(mec)m(hanism.)58
b(If)35 b(the)h(\014rst)f(line)h(of)g(a)h(script)f(b)s(egins)f(with)g
-(the)i(t)m(w)m(o)150 2446 y(c)m(haracters)46 b(`)p Ft(#!)p
+(the)i(t)m(w)m(o)150 3630 y(c)m(haracters)46 b(`)p Ft(#!)p
Fu(',)i(the)c(remainder)g(of)g(the)h(line)g(sp)s(eci\014es)f(an)g(in)m
-(terpreter)h(for)f(the)g(program)g(and,)150 2555 y(dep)s(ending)34
+(terpreter)h(for)f(the)g(program)g(and,)150 3740 y(dep)s(ending)34
b(on)h(the)h(op)s(erating)f(system,)i(one)f(or)f(more)h(optional)h
-(argumen)m(ts)e(for)g(that)h(in)m(terpreter.)150 2665
+(argumen)m(ts)e(for)g(that)h(in)m(terpreter.)150 3849
y(Th)m(us,)c(y)m(ou)h(can)g(sp)s(ecify)f(Bash,)h Ft(awk)p
Fu(,)g(P)m(erl,)g(or)g(some)g(other)f(in)m(terpreter)h(and)f(write)h
-(the)f(rest)h(of)g(the)150 2775 y(script)d(\014le)h(in)f(that)h
-(language.)275 2909 y(The)k(argumen)m(ts)h(to)h(the)f(in)m(terpreter)h
+(the)f(rest)h(of)g(the)150 3959 y(script)d(\014le)h(in)f(that)h
+(language.)275 4093 y(The)k(argumen)m(ts)h(to)h(the)f(in)m(terpreter)h
(consist)f(of)h(one)f(or)g(more)g(optional)h(argumen)m(ts)f(follo)m
-(wing)150 3019 y(the)e(in)m(terpreter)g(name)g(on)g(the)g(\014rst)g
+(wing)150 4202 y(the)e(in)m(terpreter)g(name)g(on)g(the)g(\014rst)g
(line)g(of)g(the)g(script)g(\014le,)h(follo)m(w)m(ed)h(b)m(y)e(the)g
-(name)g(of)g(the)g(script)150 3128 y(\014le,)k(follo)m(w)m(ed)g(b)m(y)e
+(name)g(of)g(the)g(script)150 4312 y(\014le,)k(follo)m(w)m(ed)g(b)m(y)e
(the)g(rest)g(of)g(the)h(argumen)m(ts)f(supplied)f(to)i(the)f(script.)
-58 b(The)35 b(details)i(of)g(ho)m(w)f(the)150 3238 y(in)m(terpreter)26
+58 b(The)35 b(details)i(of)g(ho)m(w)f(the)150 4421 y(in)m(terpreter)26
b(line)g(is)g(split)g(in)m(to)h(an)f(in)m(terpreter)g(name)g(and)f(a)h
(set)h(of)e(argumen)m(ts)i(v)-5 b(ary)25 b(across)i(systems.)150
-3347 y(Bash)j(will)f(p)s(erform)g(this)g(action)i(on)e(op)s(erating)h
+4531 y(Bash)j(will)f(p)s(erform)g(this)g(action)i(on)e(op)s(erating)h
(systems)g(that)g(do)f(not)h(handle)f(it)h(themselv)m(es.)42
-b(Note)150 3457 y(that)e(some)g(older)g(v)m(ersions)g(of)g(Unix)f
+b(Note)150 4641 y(that)e(some)g(older)g(v)m(ersions)g(of)g(Unix)f
(limit)i(the)f(in)m(terpreter)g(name)g(and)f(a)h(single)g(argumen)m(t)g
-(to)h(a)150 3567 y(maxim)m(um)21 b(of)g(32)h(c)m(haracters,)j(so)c
+(to)h(a)150 4750 y(maxim)m(um)21 b(of)g(32)h(c)m(haracters,)j(so)c
(it's)h(not)g(p)s(ortable)f(to)h(assume)e(that)i(using)f(more)g(than)g
-(one)g(argumen)m(t)150 3676 y(will)31 b(w)m(ork.)275
-3811 y(Bash)h(scripts)g(often)g(b)s(egin)g(with)g Ft(#!)e(/bin/bash)g
+(one)g(argumen)m(t)150 4860 y(will)31 b(w)m(ork.)275
+4994 y(Bash)h(scripts)g(often)g(b)s(egin)g(with)g Ft(#!)e(/bin/bash)g
Fu(\(assuming)i(that)h(Bash)f(has)g(b)s(een)f(installed)i(in)150
-3920 y Ft(/bin)p Fu(\),)26 b(since)h(this)f(ensures)f(that)i(Bash)f
+5103 y Ft(/bin)p Fu(\),)26 b(since)h(this)f(ensures)f(that)i(Bash)f
(will)h(b)s(e)f(used)f(to)i(in)m(terpret)f(the)h(script,)g(ev)m(en)g
-(if)f(it)h(is)f(executed)150 4030 y(under)h(another)h(shell.)41
+(if)f(it)h(is)f(executed)150 5213 y(under)h(another)h(shell.)41
b(It's)28 b(a)h(common)g(idiom)f(to)h(use)f Ft(env)g
Fu(to)h(\014nd)e Ft(bash)g Fu(ev)m(en)i(if)f(it's)i(b)s(een)d
-(installed)150 4139 y(in)h(another)g(directory:)40 b
+(installed)150 5322 y(in)h(another)g(directory:)40 b
Ft(#!/usr/bin/env)27 b(bash)f Fu(will)j(\014nd)d(the)j(\014rst)e(o)s
(ccurrence)h(of)g Ft(bash)f Fu(in)h Ft($PATH)p Fu(.)p
eop end
630 3324 y Ft(huponexit)1110 3433 y Fu(If)i(set,)i(Bash)f(will)h(send)d
Ft(SIGHUP)h Fu(to)h(all)h(jobs)e(when)g(an)g(in)m(teractiv)m(e)k(login)
1110 3543 y(shell)31 b(exits)g(\(see)g(Section)g(3.7.6)h([Signals],)g
-(page)f(47\).)630 3718 y Ft(inherit_errexit)1110 3828
+(page)f(48\).)630 3718 y Ft(inherit_errexit)1110 3828
y Fu(If)e(set,)h(command)g(substitution)f(inherits)g(the)g(v)-5
b(alue)30 b(of)g(the)f Ft(errexit)f Fu(op-)1110 3937
y(tion,)33 b(instead)g(of)f(unsetting)g(it)h(in)f(the)g(subshell)f(en)m
(and)g(disables)g(further)f(option)h(pro)s(cessing.)64
b(An)m(y)630 5230 y(argumen)m(ts)38 b(after)g(the)f Ft(--)g
Fu(are)h(treated)g(as)g(a)g(shell)f(script)h(\014lename)f(\(see)i
-(Section)f(3.8)630 5340 y([Shell)30 b(Scripts],)h(page)g(48\))g(and)f
+(Section)f(3.8)630 5340 y([Shell)30 b(Scripts],)h(page)g(49\))g(and)f
(argumen)m(ts)h(passed)f(to)h(that)g(script.)p eop end
%%Page: 100 106
TeXDict begin 100 105 bop 150 -116 a Fu(Chapter)30 b(6:)41
Fu(option)g(has)150 1300 y(b)s(een)44 b(supplied,)j(the)d(\014rst)g
(argumen)m(t)h(is)g(assumed)e(to)j(b)s(e)d(the)i(name)g(of)f(a)h
(\014le)g(con)m(taining)h(shell)150 1409 y(commands)30
-b(\(see)g(Section)h(3.8)g([Shell)f(Scripts],)g(page)h(48\).)41
+b(\(see)g(Section)h(3.8)g([Shell)f(Scripts],)g(page)h(49\).)41
b(When)30 b(Bash)g(is)g(in)m(v)m(ok)m(ed)i(in)d(this)h(fashion,)150
1519 y Ft($0)37 b Fu(is)g(set)h(to)h(the)e(name)h(of)f(the)h(\014le,)i
(and)c(the)i(p)s(ositional)g(parameters)g(are)g(set)g(to)g(the)g
b(expansion)g(\(see)g(Section)g(6.6)g([Aliases],)i(page)e(107\))h(is)e
(p)s(erformed)f(b)m(y)h(default.)199 893 y(9.)61 b(In)24
b(the)g(absence)h(of)f(an)m(y)h(traps,)g(Bash)g(ignores)f
-Ft(SIGTERM)f Fu(\(see)i(Section)g(3.7.6)h([Signals],)g(page)f(47\).)154
+Ft(SIGTERM)f Fu(\(see)i(Section)g(3.7.6)h([Signals],)g(page)f(48\).)154
1026 y(10.)61 b(In)29 b(the)g(absence)h(of)g(an)m(y)g(traps,)f
Ft(SIGINT)f Fu(is)h(caugh)m(t)i(and)e(handled)f(\(see)j(Section)f
-(3.7.6)h([Signals],)330 1135 y(page)g(47\).)42 b Ft(SIGINT)29
+(3.7.6)h([Signals],)330 1135 y(page)g(48\).)42 b Ft(SIGINT)29
b Fu(will)h(in)m(terrupt)g(some)h(shell)g(builtins.)154
1268 y(11.)61 b(An)40 b(in)m(teractiv)m(e)j(login)e(shell)g(sends)e(a)i
Ft(SIGHUP)d Fu(to)j(all)g(jobs)f(on)g(exit)h(if)g(the)f
Ft(huponexit)e Fu(shell)330 1378 y(option)31 b(has)f(b)s(een)g(enabled)
-g(\(see)h(Section)g(3.7.6)i([Signals],)e(page)g(47\).)154
+g(\(see)h(Section)g(3.7.6)i([Signals],)e(page)g(48\).)154
1511 y(12.)61 b(The)36 b Ft(-n)g Fu(option)i(has)e(no)h(e\013ect,)j
(whether)c(at)i(in)m(v)m(o)s(cation)h(or)d(when)g(using)g(`)p
Ft(set)30 b(-n)p Fu(')37 b(\(see)g(Sec-)330 1620 y(tion)31
(enforced)f(after)h(an)m(y)g(startup)f(\014les)g(are)h(read.)275
4308 y(When)j(a)i(command)e(that)i(is)f(found)f(to)h(b)s(e)g(a)g(shell)
g(script)g(is)g(executed)h(\(see)g(Section)g(3.8)g([Shell)150
-4417 y(Scripts],)25 b(page)e(48\),)j Ft(rbash)c Fu(turns)g(o\013)i(an)m
+4417 y(Scripts],)25 b(page)e(49\),)j Ft(rbash)c Fu(turns)g(o\013)i(an)m
(y)f(restrictions)h(in)f(the)g(shell)h(spa)m(wned)e(to)i(execute)g(the)
g(script.)275 4550 y(The)32 b(restricted)h(shell)g(mo)s(de)g(is)g(only)
g(one)g(comp)s(onen)m(t)g(of)g(a)g(useful)f(restricted)i(en)m(vironmen)
Fr(v)-5 b(arname)49 b Fu(will)44 b(remain)630 2838 y(unset,)34
b(and)f(the)g(return)f(status)i(will)g(b)s(e)e(greater)j(than)e(128,)j
(as)d(describ)s(ed)f(ab)s(o)m(v)m(e)j(\(see)630 2947
-y(Section)29 b(3.7.6)g([Signals],)g(page)g(47\).)41 b(Otherwise,)28
+y(Section)29 b(3.7.6)g([Signals],)g(page)g(48\).)41 b(Otherwise,)28
b(the)g(return)f(status)h(is)g(the)g(exit)h(status)630
3057 y(of)i(the)f(last)h Fr(id)p Fu(.)150 3203 y Ft(disown)870
3331 y(disown)46 b([-ar])g([-h])h([)p Fj(id)g Ft(...)o(])630
g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)34
b Fb(129)150 500 y(command)26 b(execution)12 b Fc(:)h(:)g(:)g(:)g(:)g
(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)
-g(:)h(:)f(:)g(:)g(:)26 b Fb(44)150 587 y(command)g(expansion)c
+g(:)h(:)f(:)g(:)g(:)26 b Fb(45)150 587 y(command)g(expansion)c
Fc(:)13 b(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)g
(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)h(:)36 b Fb(44)150
675 y(command)26 b(history)18 b Fc(:)13 b(:)g(:)g(:)g(:)g(:)h(:)f(:)g
g(:)g(:)g(:)33 b Fb(165)150 763 y(command)26 b(searc)n(h)16
b Fc(:)d(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)
g(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)30
-b Fb(44)150 851 y(command)c(substitution)21 b Fc(:)13
+b Fb(45)150 851 y(command)c(substitution)21 b Fc(:)13
b(:)g(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:)g
(:)g(:)g(:)g(:)h(:)f(:)g(:)35 b Fb(35)150 939 y(command)26
b(timing)11 b Fc(:)i(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:)
g(:)g(:)h(:)f(:)g(:)g(:)g(:)27 b Fb(40)150 3501 y(reserv)n(ed)f(w)n
(ord)13 b Fc(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)
g(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)g
-(:)h(:)f(:)28 b Fb(3)150 3589 y(reserv)n(ed)e(w)n(ords)15
+(:)h(:)f(:)28 b Fb(4)150 3589 y(reserv)n(ed)e(w)n(ords)15
b Fc(:)f(:)f(:)g(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)g(:)h(:)
f(:)g(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:)30
b Fb(9)150 3676 y(restricted)c(shell)12 b Fc(:)i(:)f(:)g(:)h(:)f(:)g(:)
g(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)h(:)32 b Fb(19)2025
597 y(shell)26 b(script)10 b Fc(:)k(:)f(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:)g
(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)
-g(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)25 b Fb(48)2025 687
+g(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)25 b Fb(49)2025 687
y(shell)h(v)l(ariable)7 b Fc(:)14 b(:)f(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)g
(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)
h(:)f(:)g(:)g(:)g(:)g(:)g(:)22 b Fb(22)2025 777 y(shell,)k(in)n
g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)28
b Fb(4)2025 956 y(signal)f(handling)6 b Fc(:)13 b(:)g(:)g(:)h(:)f(:)g
(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)
-g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)21 b Fb(47)2025 1046
+g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)21 b Fb(48)2025 1046
y(sp)r(ecial)27 b(builtin)16 b Fc(:)d(:)g(:)g(:)g(:)g(:)g(:)g(:)g(:)h
(:)f(:)g(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:)
g(:)g(:)g(:)g(:)31 b Fb(4,)26 b(82)2025 1136 y(startup)f(\014les)8