]> git.ipfire.org Git - thirdparty/bash.git/blob - doc/bash.0
bash-4.4 beta release
[thirdparty/bash.git] / doc / bash.0
1 BASH(1) General Commands Manual BASH(1)
2
3
4
5 N\bNA\bAM\bME\bE
6 bash - GNU Bourne-Again SHell
7
8 S\bSY\bYN\bNO\bOP\bPS\bSI\bIS\bS
9 b\bba\bas\bsh\bh [options] [command_string | file]
10
11 C\bCO\bOP\bPY\bYR\bRI\bIG\bGH\bHT\bT
12 Bash is Copyright (C) 1989-2015 by the Free Software Foundation, Inc.
13
14 D\bDE\bES\bSC\bCR\bRI\bIP\bPT\bTI\bIO\bON\bN
15 B\bBa\bas\bsh\bh is an s\bsh\bh-compatible command language interpreter that executes
16 commands read from the standard input or from a file. B\bBa\bas\bsh\bh also incor-
17 porates useful features from the _\bK_\bo_\br_\bn and _\bC shells (k\bks\bsh\bh and c\bcs\bsh\bh).
18
19 B\bBa\bas\bsh\bh is intended to be a conformant implementation of the Shell and
20 Utilities portion of the IEEE POSIX specification (IEEE Standard
21 1003.1). B\bBa\bas\bsh\bh can be configured to be POSIX-conformant by default.
22
23 O\bOP\bPT\bTI\bIO\bON\bNS\bS
24 All of the single-character shell options documented in the description
25 of the s\bse\bet\bt builtin command can be used as options when the shell is
26 invoked. In addition, b\bba\bas\bsh\bh interprets the following options when it is
27 invoked:
28
29 -\b-c\bc If the -\b-c\bc option is present, then commands are read from the
30 first non-option argument _\bc_\bo_\bm_\bm_\ba_\bn_\bd_\b__\bs_\bt_\br_\bi_\bn_\bg. If there are argu-
31 ments after the _\bc_\bo_\bm_\bm_\ba_\bn_\bd_\b__\bs_\bt_\br_\bi_\bn_\bg, the first argument is
32 assigned to $\b$0\b0 and any remaining arguments are assigned to
33 the positional parameters. The assignment to $\b$0\b0 sets the
34 name of the shell, which is used in warning and error mes-
35 sages.
36 -\b-i\bi If the -\b-i\bi option is present, the shell is _\bi_\bn_\bt_\be_\br_\ba_\bc_\bt_\bi_\bv_\be.
37 -\b-l\bl Make b\bba\bas\bsh\bh act as if it had been invoked as a login shell (see
38 I\bIN\bNV\bVO\bOC\bCA\bAT\bTI\bIO\bON\bN below).
39 -\b-r\br If the -\b-r\br option is present, the shell becomes _\br_\be_\bs_\bt_\br_\bi_\bc_\bt_\be_\bd
40 (see R\bRE\bES\bST\bTR\bRI\bIC\bCT\bTE\bED\bD S\bSH\bHE\bEL\bLL\bL below).
41 -\b-s\bs If the -\b-s\bs option is present, or if no arguments remain after
42 option processing, then commands are read from the standard
43 input. This option allows the positional parameters to be
44 set when invoking an interactive shell.
45 -\b-D\bD A list of all double-quoted strings preceded by $\b$ is printed
46 on the standard output. These are the strings that are sub-
47 ject to language translation when the current locale is not C\bC
48 or P\bPO\bOS\bSI\bIX\bX. This implies the -\b-n\bn option; no commands will be
49 executed.
50 [\b[-\b-+\b+]\b]O\bO [\b[_\bs_\bh_\bo_\bp_\bt_\b__\bo_\bp_\bt_\bi_\bo_\bn]\b]
51 _\bs_\bh_\bo_\bp_\bt_\b__\bo_\bp_\bt_\bi_\bo_\bn is one of the shell options accepted by the
52 s\bsh\bho\bop\bpt\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). If
53 _\bs_\bh_\bo_\bp_\bt_\b__\bo_\bp_\bt_\bi_\bo_\bn is present, -\b-O\bO sets the value of that option; +\b+O\bO
54 unsets it. If _\bs_\bh_\bo_\bp_\bt_\b__\bo_\bp_\bt_\bi_\bo_\bn is not supplied, the names and
55 values of the shell options accepted by s\bsh\bho\bop\bpt\bt are printed on
56 the standard output. If the invocation option is +\b+O\bO, the
57 output is displayed in a format that may be reused as input.
58 -\b--\b- A -\b--\b- signals the end of options and disables further option
59 processing. Any arguments after the -\b--\b- are treated as file-
60 names and arguments. An argument of -\b- is equivalent to -\b--\b-.
61
62 B\bBa\bas\bsh\bh also interprets a number of multi-character options. These
63 options must appear on the command line before the single-character
64 options to be recognized.
65
66 -\b--\b-d\bde\beb\bbu\bug\bgg\bge\ber\br
67 Arrange for the debugger profile to be executed before the shell
68 starts. Turns on extended debugging mode (see the description
69 of the e\bex\bxt\btd\bde\beb\bbu\bug\bg option to the s\bsh\bho\bop\bpt\bt builtin below).
70 -\b--\b-d\bdu\bum\bmp\bp-\b-p\bpo\bo-\b-s\bst\btr\bri\bin\bng\bgs\bs
71 Equivalent to -\b-D\bD, but the output is in the GNU _\bg_\be_\bt_\bt_\be_\bx_\bt p\bpo\bo (por-
72 table object) file format.
73 -\b--\b-d\bdu\bum\bmp\bp-\b-s\bst\btr\bri\bin\bng\bgs\bs
74 Equivalent to -\b-D\bD.
75 -\b--\b-h\bhe\bel\blp\bp Display a usage message on standard output and exit success-
76 fully.
77 -\b--\b-i\bin\bni\bit\bt-\b-f\bfi\bil\ble\be _\bf_\bi_\bl_\be
78 -\b--\b-r\brc\bcf\bfi\bil\ble\be _\bf_\bi_\bl_\be
79 Execute commands from _\bf_\bi_\bl_\be instead of the standard personal ini-
80 tialization file _\b~_\b/_\b._\bb_\ba_\bs_\bh_\br_\bc if the shell is interactive (see
81 I\bIN\bNV\bVO\bOC\bCA\bAT\bTI\bIO\bON\bN below).
82
83 -\b--\b-l\blo\bog\bgi\bin\bn
84 Equivalent to -\b-l\bl.
85
86 -\b--\b-n\bno\boe\bed\bdi\bit\bti\bin\bng\bg
87 Do not use the GNU r\bre\bea\bad\bdl\bli\bin\bne\be library to read command lines when
88 the shell is interactive.
89
90 -\b--\b-n\bno\bop\bpr\bro\bof\bfi\bil\ble\be
91 Do not read either the system-wide startup file _\b/_\be_\bt_\bc_\b/_\bp_\br_\bo_\bf_\bi_\bl_\be or
92 any of the personal initialization files _\b~_\b/_\b._\bb_\ba_\bs_\bh_\b__\bp_\br_\bo_\bf_\bi_\bl_\be,
93 _\b~_\b/_\b._\bb_\ba_\bs_\bh_\b__\bl_\bo_\bg_\bi_\bn, or _\b~_\b/_\b._\bp_\br_\bo_\bf_\bi_\bl_\be. By default, b\bba\bas\bsh\bh reads these
94 files when it is invoked as a login shell (see I\bIN\bNV\bVO\bOC\bCA\bAT\bTI\bIO\bON\bN
95 below).
96
97 -\b--\b-n\bno\bor\brc\bc Do not read and execute the personal initialization file
98 _\b~_\b/_\b._\bb_\ba_\bs_\bh_\br_\bc if the shell is interactive. This option is on by
99 default if the shell is invoked as s\bsh\bh.
100
101 -\b--\b-p\bpo\bos\bsi\bix\bx
102 Change the behavior of b\bba\bas\bsh\bh where the default operation differs
103 from the POSIX standard to match the standard (_\bp_\bo_\bs_\bi_\bx _\bm_\bo_\bd_\be). See
104 S\bSE\bEE\bE A\bAL\bLS\bSO\bO below for a reference to a document that details how
105 posix mode affects bash's behavior.
106
107 -\b--\b-r\bre\bes\bst\btr\bri\bic\bct\bte\bed\bd
108 The shell becomes restricted (see R\bRE\bES\bST\bTR\bRI\bIC\bCT\bTE\bED\bD S\bSH\bHE\bEL\bLL\bL below).
109
110 -\b--\b-v\bve\ber\brb\bbo\bos\bse\be
111 Equivalent to -\b-v\bv.
112
113 -\b--\b-v\bve\ber\brs\bsi\bio\bon\bn
114 Show version information for this instance of b\bba\bas\bsh\bh on the stan-
115 dard output and exit successfully.
116
117 A\bAR\bRG\bGU\bUM\bME\bEN\bNT\bTS\bS
118 If arguments remain after option processing, and neither the -\b-c\bc nor the
119 -\b-s\bs option has been supplied, the first argument is assumed to be the
120 name of a file containing shell commands. If b\bba\bas\bsh\bh is invoked in this
121 fashion, $\b$0\b0 is set to the name of the file, and the positional parame-
122 ters are set to the remaining arguments. B\bBa\bas\bsh\bh reads and executes com-
123 mands from this file, then exits. B\bBa\bas\bsh\bh's exit status is the exit sta-
124 tus of the last command executed in the script. If no commands are
125 executed, the exit status is 0. An attempt is first made to open the
126 file in the current directory, and, if no file is found, then the shell
127 searches the directories in P\bPA\bAT\bTH\bH for the script.
128
129 I\bIN\bNV\bVO\bOC\bCA\bAT\bTI\bIO\bON\bN
130 A _\bl_\bo_\bg_\bi_\bn _\bs_\bh_\be_\bl_\bl is one whose first character of argument zero is a -\b-, or
131 one started with the -\b--\b-l\blo\bog\bgi\bin\bn option.
132
133 An _\bi_\bn_\bt_\be_\br_\ba_\bc_\bt_\bi_\bv_\be shell is one started without non-option arguments
134 (unless -\b-s\bs is specified) and without the -\b-c\bc option whose standard input
135 and error are both connected to terminals (as determined by _\bi_\bs_\ba_\bt_\bt_\by(3)),
136 or one started with the -\b-i\bi option. P\bPS\bS1\b1 is set and $\b$-\b- includes i\bi if
137 b\bba\bas\bsh\bh is interactive, allowing a shell script or a startup file to test
138 this state.
139
140 The following paragraphs describe how b\bba\bas\bsh\bh executes its startup files.
141 If any of the files exist but cannot be read, b\bba\bas\bsh\bh reports an error.
142 Tildes are expanded in filenames as described below under T\bTi\bil\bld\bde\be E\bEx\bxp\bpa\ban\bn-\b-
143 s\bsi\bio\bon\bn in the E\bEX\bXP\bPA\bAN\bNS\bSI\bIO\bON\bN section.
144
145 When b\bba\bas\bsh\bh is invoked as an interactive login shell, or as a non-inter-
146 active shell with the -\b--\b-l\blo\bog\bgi\bin\bn option, it first reads and executes com-
147 mands from the file _\b/_\be_\bt_\bc_\b/_\bp_\br_\bo_\bf_\bi_\bl_\be, if that file exists. After reading
148 that file, it looks for _\b~_\b/_\b._\bb_\ba_\bs_\bh_\b__\bp_\br_\bo_\bf_\bi_\bl_\be, _\b~_\b/_\b._\bb_\ba_\bs_\bh_\b__\bl_\bo_\bg_\bi_\bn, and _\b~_\b/_\b._\bp_\br_\bo_\bf_\bi_\bl_\be,
149 in that order, and reads and executes commands from the first one that
150 exists and is readable. The -\b--\b-n\bno\bop\bpr\bro\bof\bfi\bil\ble\be option may be used when the
151 shell is started to inhibit this behavior.
152
153 When an interactive login shell exits, or a non-interactive login shell
154 executes the e\bex\bxi\bit\bt builtin command, b\bba\bas\bsh\bh reads and executes commands
155 from the file _\b~_\b/_\b._\bb_\ba_\bs_\bh_\b__\bl_\bo_\bg_\bo_\bu_\bt, if it exists.
156
157 When an interactive shell that is not a login shell is started, b\bba\bas\bsh\bh
158 reads and executes commands from _\b~_\b/_\b._\bb_\ba_\bs_\bh_\br_\bc, if that file exists. This
159 may be inhibited by using the -\b--\b-n\bno\bor\brc\bc option. The -\b--\b-r\brc\bcf\bfi\bil\ble\be _\bf_\bi_\bl_\be option
160 will force b\bba\bas\bsh\bh to read and execute commands from _\bf_\bi_\bl_\be instead of
161 _\b~_\b/_\b._\bb_\ba_\bs_\bh_\br_\bc.
162
163 When b\bba\bas\bsh\bh is started non-interactively, to run a shell script, for
164 example, it looks for the variable B\bBA\bAS\bSH\bH_\b_E\bEN\bNV\bV in the environment, expands
165 its value if it appears there, and uses the expanded value as the name
166 of a file to read and execute. B\bBa\bas\bsh\bh behaves as if the following com-
167 mand were executed:
168 if [ -n "$BASH_ENV" ]; then . "$BASH_ENV"; fi
169 but the value of the P\bPA\bAT\bTH\bH variable is not used to search for the file-
170 name.
171
172 If b\bba\bas\bsh\bh is invoked with the name s\bsh\bh, it tries to mimic the startup
173 behavior of historical versions of s\bsh\bh as closely as possible, while
174 conforming to the POSIX standard as well. When invoked as an interac-
175 tive login shell, or a non-interactive shell with the -\b--\b-l\blo\bog\bgi\bin\bn option,
176 it first attempts to read and execute commands from _\b/_\be_\bt_\bc_\b/_\bp_\br_\bo_\bf_\bi_\bl_\be and
177 _\b~_\b/_\b._\bp_\br_\bo_\bf_\bi_\bl_\be, in that order. The -\b--\b-n\bno\bop\bpr\bro\bof\bfi\bil\ble\be option may be used to
178 inhibit this behavior. When invoked as an interactive shell with the
179 name s\bsh\bh, b\bba\bas\bsh\bh looks for the variable E\bEN\bNV\bV, expands its value if it is
180 defined, and uses the expanded value as the name of a file to read and
181 execute. Since a shell invoked as s\bsh\bh does not attempt to read and exe-
182 cute commands from any other startup files, the -\b--\b-r\brc\bcf\bfi\bil\ble\be option has no
183 effect. A non-interactive shell invoked with the name s\bsh\bh does not
184 attempt to read any other startup files. When invoked as s\bsh\bh, b\bba\bas\bsh\bh
185 enters _\bp_\bo_\bs_\bi_\bx mode after the startup files are read.
186
187 When b\bba\bas\bsh\bh is started in _\bp_\bo_\bs_\bi_\bx mode, as with the -\b--\b-p\bpo\bos\bsi\bix\bx command line
188 option, it follows the POSIX standard for startup files. In this mode,
189 interactive shells expand the E\bEN\bNV\bV variable and commands are read and
190 executed from the file whose name is the expanded value. No other
191 startup files are read.
192
193 B\bBa\bas\bsh\bh attempts to determine when it is being run with its standard input
194 connected to a network connection, as when executed by the remote shell
195 daemon, usually _\br_\bs_\bh_\bd, or the secure shell daemon _\bs_\bs_\bh_\bd. If b\bba\bas\bsh\bh deter-
196 mines it is being run in this fashion, it reads and executes commands
197 from _\b~_\b/_\b._\bb_\ba_\bs_\bh_\br_\bc, if that file exists and is readable. It will not do
198 this if invoked as s\bsh\bh. The -\b--\b-n\bno\bor\brc\bc option may be used to inhibit this
199 behavior, and the -\b--\b-r\brc\bcf\bfi\bil\ble\be option may be used to force another file to
200 be read, but neither _\br_\bs_\bh_\bd nor _\bs_\bs_\bh_\bd generally invoke the shell with
201 those options or allow them to be specified.
202
203 If the shell is started with the effective user (group) id not equal to
204 the real user (group) id, and the -\b-p\bp option is not supplied, no startup
205 files are read, shell functions are not inherited from the environment,
206 the S\bSH\bHE\bEL\bLL\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
207 appear in the environment, are ignored, and the effective user id is
208 set to the real user id. If the -\b-p\bp option is supplied at invocation,
209 the startup behavior is the same, but the effective user id is not
210 reset.
211
212 D\bDE\bEF\bFI\bIN\bNI\bIT\bTI\bIO\bON\bNS\bS
213 The following definitions are used throughout the rest of this docu-
214 ment.
215 b\bbl\bla\ban\bnk\bk A space or tab.
216 w\bwo\bor\brd\bd A sequence of characters considered as a single unit by the
217 shell. Also known as a t\bto\bok\bke\ben\bn.
218 n\bna\bam\bme\be A _\bw_\bo_\br_\bd consisting only of alphanumeric characters and under-
219 scores, and beginning with an alphabetic character or an under-
220 score. Also referred to as an i\bid\bde\ben\bnt\bti\bif\bfi\bie\ber\br.
221 m\bme\bet\bta\bac\bch\bha\bar\bra\bac\bct\bte\ber\br
222 A character that, when unquoted, separates words. One of the
223 following:
224 |\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
225 c\bco\bon\bnt\btr\bro\bol\bl o\bop\bpe\ber\bra\bat\bto\bor\br
226 A _\bt_\bo_\bk_\be_\bn that performs a control function. It is one of the fol-
227 lowing symbols:
228 |\b||\b| &\b& &\b&&\b& ;\b; ;\b;;\b; (\b( )\b) |\b| |\b|&\b& <\b<n\bne\bew\bwl\bli\bin\bne\be>\b>
229
230 R\bRE\bES\bSE\bER\bRV\bVE\bED\bD W\bWO\bOR\bRD\bDS\bS
231 _\bR_\be_\bs_\be_\br_\bv_\be_\bd _\bw_\bo_\br_\bd_\bs are words that have a special meaning to the shell. The
232 following words are recognized as reserved when unquoted and either the
233 first word of a simple command (see S\bSH\bHE\bEL\bLL\bL G\bGR\bRA\bAM\bMM\bMA\bAR\bR below) or the third
234 word of a c\bca\bas\bse\be or f\bfo\bor\br command:
235
236 !\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
237 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]
238
239 S\bSH\bHE\bEL\bLL\bL G\bGR\bRA\bAM\bMM\bMA\bAR\bR
240 S\bSi\bim\bmp\bpl\ble\be C\bCo\bom\bmm\bma\ban\bnd\bds\bs
241 A _\bs_\bi_\bm_\bp_\bl_\be _\bc_\bo_\bm_\bm_\ba_\bn_\bd is a sequence of optional variable assignments fol-
242 lowed by b\bbl\bla\ban\bnk\bk-separated words and redirections, and terminated by a
243 _\bc_\bo_\bn_\bt_\br_\bo_\bl _\bo_\bp_\be_\br_\ba_\bt_\bo_\br. The first word specifies the command to be executed,
244 and is passed as argument zero. The remaining words are passed as
245 arguments to the invoked command.
246
247 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
248 the command is terminated by signal _\bn.
249
250 P\bPi\bip\bpe\bel\bli\bin\bne\bes\bs
251 A _\bp_\bi_\bp_\be_\bl_\bi_\bn_\be is a sequence of one or more commands separated by one of
252 the control operators |\b| or |\b|&\b&. The format for a pipeline is:
253
254 [t\bti\bim\bme\be [-\b-p\bp]] [ ! ] _\bc_\bo_\bm_\bm_\ba_\bn_\bd [ [|\b|||\b|&\b&] _\bc_\bo_\bm_\bm_\ba_\bn_\bd_\b2 ... ]
255
256 The standard output of _\bc_\bo_\bm_\bm_\ba_\bn_\bd is connected via a pipe to the standard
257 input of _\bc_\bo_\bm_\bm_\ba_\bn_\bd_\b2. This connection is performed before any redirec-
258 tions specified by the command (see R\bRE\bED\bDI\bIR\bRE\bEC\bCT\bTI\bIO\bON\bN below). If |\b|&\b& is used,
259 _\bc_\bo_\bm_\bm_\ba_\bn_\bd's standard error, in addition to its standard output, is con-
260 nected to _\bc_\bo_\bm_\bm_\ba_\bn_\bd_\b2's standard input through the pipe; it is shorthand
261 for 2\b2>\b>&\b&1\b1 |\b|. This implicit redirection of the standard error to the
262 standard output is performed after any redirections specified by the
263 command.
264
265 The return status of a pipeline is the exit status of the last command,
266 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
267 pipeline's return status is the value of the last (rightmost) command
268 to exit with a non-zero status, or zero if all commands exit success-
269 fully. If the reserved word !\b! precedes a pipeline, the exit status of
270 that pipeline is the logical negation of the exit status as described
271 above. The shell waits for all commands in the pipeline to terminate
272 before returning a value.
273
274 If the t\bti\bim\bme\be reserved word precedes a pipeline, the elapsed as well as
275 user and system time consumed by its execution are reported when the
276 pipeline terminates. The -\b-p\bp option changes the output format to that
277 specified by POSIX. When the shell is in _\bp_\bo_\bs_\bi_\bx _\bm_\bo_\bd_\be, it does not rec-
278 ognize t\bti\bim\bme\be as a reserved word if the next token begins with a `-'.
279 The T\bTI\bIM\bME\bEF\bFO\bOR\bRM\bMA\bAT\bT variable may be set to a format string that specifies
280 how the timing information should be displayed; see the description of
281 T\bTI\bIM\bME\bEF\bFO\bOR\bRM\bMA\bAT\bT under S\bSh\bhe\bel\bll\bl V\bVa\bar\bri\bia\bab\bbl\ble\bes\bs below.
282
283 When the shell is in _\bp_\bo_\bs_\bi_\bx _\bm_\bo_\bd_\be, t\bti\bim\bme\be may be followed by a newline. In
284 this case, the shell displays the total user and system time consumed
285 by the shell and its children. The T\bTI\bIM\bME\bEF\bFO\bOR\bRM\bMA\bAT\bT variable may be used to
286 specify the format of the time information.
287
288 Each command in a pipeline is executed as a separate process (i.e., in
289 a subshell).
290
291 L\bLi\bis\bst\bts\bs
292 A _\bl_\bi_\bs_\bt is a sequence of one or more pipelines separated by one of the
293 operators ;\b;, &\b&, &\b&&\b&, or |\b||\b|, and optionally terminated by one of ;\b;, &\b&, or
294 <\b<n\bne\bew\bwl\bli\bin\bne\be>\b>.
295
296 Of these list operators, &\b&&\b& and |\b||\b| have equal precedence, followed by ;\b;
297 and &\b&, which have equal precedence.
298
299 A sequence of one or more newlines may appear in a _\bl_\bi_\bs_\bt instead of a
300 semicolon to delimit commands.
301
302 If a command is terminated by the control operator &\b&, the shell exe-
303 cutes the command in the _\bb_\ba_\bc_\bk_\bg_\br_\bo_\bu_\bn_\bd in a subshell. The shell does not
304 wait for the command to finish, and the return status is 0. Commands
305 separated by a ;\b; are executed sequentially; the shell waits for each
306 command to terminate in turn. The return status is the exit status of
307 the last command executed.
308
309 AND and OR lists are sequences of one of more pipelines separated by
310 the &\b&&\b& and |\b||\b| control operators, respectively. AND and OR lists are
311 executed with left associativity. An AND list has the form
312
313 _\bc_\bo_\bm_\bm_\ba_\bn_\bd_\b1 &\b&&\b& _\bc_\bo_\bm_\bm_\ba_\bn_\bd_\b2
314
315 _\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
316 of zero.
317
318 An OR list has the form
319
320 _\bc_\bo_\bm_\bm_\ba_\bn_\bd_\b1 |\b||\b| _\bc_\bo_\bm_\bm_\ba_\bn_\bd_\b2
321
322 _\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
323 status. The return status of AND and OR lists is the exit status of
324 the last command executed in the list.
325
326 C\bCo\bom\bmp\bpo\bou\bun\bnd\bd C\bCo\bom\bmm\bma\ban\bnd\bds\bs
327 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
328 command's description may be separated from the rest of the command by
329 one or more newlines, and may be followed by a newline in place of a
330 semicolon.
331
332 (_\bl_\bi_\bs_\bt) _\bl_\bi_\bs_\bt is executed in a subshell environment (see C\bCO\bOM\bMM\bMA\bAN\bND\bD E\bEX\bXE\bEC\bCU\bU-\b-
333 T\bTI\bIO\bON\bN E\bEN\bNV\bVI\bIR\bRO\bON\bNM\bME\bEN\bNT\bT below). Variable assignments and builtin com-
334 mands that affect the shell's environment do not remain in
335 effect after the command completes. The return status is the
336 exit status of _\bl_\bi_\bs_\bt.
337
338 { _\bl_\bi_\bs_\bt; }
339 _\bl_\bi_\bs_\bt is simply executed in the current shell environment. _\bl_\bi_\bs_\bt
340 must be terminated with a newline or semicolon. This is known
341 as a _\bg_\br_\bo_\bu_\bp _\bc_\bo_\bm_\bm_\ba_\bn_\bd. The return status is the exit status of
342 _\bl_\bi_\bs_\bt. Note that unlike the metacharacters (\b( and )\b), {\b{ and }\b} are
343 _\br_\be_\bs_\be_\br_\bv_\be_\bd _\bw_\bo_\br_\bd_\bs and must occur where a reserved word is permitted
344 to be recognized. Since they do not cause a word break, they
345 must be separated from _\bl_\bi_\bs_\bt by whitespace or another shell
346 metacharacter.
347
348 ((_\be_\bx_\bp_\br_\be_\bs_\bs_\bi_\bo_\bn))
349 The _\be_\bx_\bp_\br_\be_\bs_\bs_\bi_\bo_\bn is evaluated according to the rules described
350 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 expres-
351 sion is non-zero, the return status is 0; otherwise the return
352 status is 1. This is exactly equivalent to l\ble\bet\bt "\b"_\be_\bx_\bp_\br_\be_\bs_\bs_\bi_\bo_\bn"\b".
353
354 [\b[[\b[ _\be_\bx_\bp_\br_\be_\bs_\bs_\bi_\bo_\bn ]\b]]\b]
355 Return a status of 0 or 1 depending on the evaluation of the
356 conditional expression _\be_\bx_\bp_\br_\be_\bs_\bs_\bi_\bo_\bn. Expressions are composed of
357 the primaries described below 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.
358 Word splitting and pathname expansion are not performed on the
359 words between the [\b[[\b[ and ]\b]]\b]; tilde expansion, parameter and
360 variable expansion, arithmetic expansion, command substitution,
361 process substitution, and quote removal are performed. Condi-
362 tional operators such as -\b-f\bf must be unquoted to be recognized as
363 primaries.
364
365 When used with [\b[[\b[, the <\b< and >\b> operators sort lexicographically
366 using the current locale.
367
368 When the =\b==\b= and !\b!=\b= operators are used, the string to the right
369 of the operator is considered a pattern and matched according to
370 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-
371 g\bgl\blo\bob\bb shell option were enabled. The =\b= operator is equivalent to
372 =\b==\b=. If the n\bno\boc\bca\bas\bse\bem\bma\bat\btc\bch\bh shell option is enabled, the match is
373 performed without regard to the case of alphabetic characters.
374 The return value is 0 if the string matches (=\b==\b=) or does not
375 match (!\b!=\b=) the pattern, and 1 otherwise. Any part of the pat-
376 tern may be quoted to force the quoted portion to be matched as
377 a string.
378
379 An additional binary operator, =\b=~\b~, is available, with the same
380 precedence as =\b==\b= and !\b!=\b=. When it is used, the string to the
381 right of the operator is considered an extended regular expres-
382 sion and matched accordingly (as in _\br_\be_\bg_\be_\bx(3)). The return value
383 is 0 if the string matches the pattern, and 1 otherwise. If the
384 regular expression is syntactically incorrect, the conditional
385 expression's return value is 2. If the n\bno\boc\bca\bas\bse\bem\bma\bat\btc\bch\bh shell option
386 is enabled, the match is performed without regard to the case of
387 alphabetic characters. Any part of the pattern may be quoted to
388 force the quoted portion to be matched as a string. Bracket
389 expressions in regular expressions must be treated carefully,
390 since normal quoting characters lose their meanings between
391 brackets. If the pattern is stored in a shell variable, quoting
392 the variable expansion forces the entire pattern to be matched
393 as a string. Substrings matched by parenthesized subexpressions
394 within the regular expression are saved in the array variable
395 B\bBA\bAS\bSH\bH_\b_R\bRE\bEM\bMA\bAT\bTC\bCH\bH. The element of B\bBA\bAS\bSH\bH_\b_R\bRE\bEM\bMA\bAT\bTC\bCH\bH with index 0 is the
396 portion of the string matching the entire regular expression.
397 The element of B\bBA\bAS\bSH\bH_\b_R\bRE\bEM\bMA\bAT\bTC\bCH\bH with index _\bn is the portion of the
398 string matching the _\bnth parenthesized subexpression.
399
400 Expressions may be combined using the following operators,
401 listed in decreasing order of precedence:
402
403 (\b( _\be_\bx_\bp_\br_\be_\bs_\bs_\bi_\bo_\bn )\b)
404 Returns the value of _\be_\bx_\bp_\br_\be_\bs_\bs_\bi_\bo_\bn. This may be used to
405 override the normal precedence of operators.
406 !\b! _\be_\bx_\bp_\br_\be_\bs_\bs_\bi_\bo_\bn
407 True if _\be_\bx_\bp_\br_\be_\bs_\bs_\bi_\bo_\bn is false.
408 _\be_\bx_\bp_\br_\be_\bs_\bs_\bi_\bo_\bn_\b1 &\b&&\b& _\be_\bx_\bp_\br_\be_\bs_\bs_\bi_\bo_\bn_\b2
409 True if both _\be_\bx_\bp_\br_\be_\bs_\bs_\bi_\bo_\bn_\b1 and _\be_\bx_\bp_\br_\be_\bs_\bs_\bi_\bo_\bn_\b2 are true.
410 _\be_\bx_\bp_\br_\be_\bs_\bs_\bi_\bo_\bn_\b1 |\b||\b| _\be_\bx_\bp_\br_\be_\bs_\bs_\bi_\bo_\bn_\b2
411 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.
412
413 The &\b&&\b& and |\b||\b| operators do not evaluate _\be_\bx_\bp_\br_\be_\bs_\bs_\bi_\bo_\bn_\b2 if the value
414 of _\be_\bx_\bp_\br_\be_\bs_\bs_\bi_\bo_\bn_\b1 is sufficient to determine the return value of
415 the entire conditional expression.
416
417 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
418 The list of words following i\bin\bn is expanded, generating a list of
419 items. The variable _\bn_\ba_\bm_\be is set to each element of this list in
420 turn, and _\bl_\bi_\bs_\bt is executed each time. If the i\bin\bn _\bw_\bo_\br_\bd is omit-
421 ted, the f\bfo\bor\br command executes _\bl_\bi_\bs_\bt once for each positional
422 parameter that is set (see P\bPA\bAR\bRA\bAM\bME\bET\bTE\bER\bRS\bS below). The return status
423 is the exit status of the last command that executes. If the
424 expansion of the items following i\bin\bn results in an empty list, no
425 commands are executed, and the return status is 0.
426
427 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
428 First, the arithmetic expression _\be_\bx_\bp_\br_\b1 is evaluated according to
429 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. The
430 arithmetic expression _\be_\bx_\bp_\br_\b2 is then evaluated repeatedly until
431 it evaluates to zero. Each time _\be_\bx_\bp_\br_\b2 evaluates to a non-zero
432 value, _\bl_\bi_\bs_\bt is executed and the arithmetic expression _\be_\bx_\bp_\br_\b3 is
433 evaluated. If any expression is omitted, it behaves as if it
434 evaluates to 1. The return value is the exit status of the last
435 command in _\bl_\bi_\bs_\bt that is executed, or false if any of the expres-
436 sions is invalid.
437
438 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
439 The list of words following i\bin\bn is expanded, generating a list of
440 items. The set of expanded words is printed on the standard
441 error, each preceded by a number. If the i\bin\bn _\bw_\bo_\br_\bd is omitted,
442 the positional parameters are printed (see P\bPA\bAR\bRA\bAM\bME\bET\bTE\bER\bRS\bS below).
443 The P\bPS\bS3\b3 prompt is then displayed and a line read from the stan-
444 dard input. If the line consists of a number corresponding to
445 one of the displayed words, then the value of _\bn_\ba_\bm_\be is set to
446 that word. If the line is empty, the words and prompt are dis-
447 played again. If EOF is read, the command completes. Any other
448 value read causes _\bn_\ba_\bm_\be to be set to null. The line read is
449 saved in the variable R\bRE\bEP\bPL\bLY\bY. The _\bl_\bi_\bs_\bt is executed after each
450 selection until a b\bbr\bre\bea\bak\bk command is executed. The exit status of
451 s\bse\bel\ble\bec\bct\bt is the exit status of the last command executed in _\bl_\bi_\bs_\bt,
452 or zero if no commands were executed.
453
454 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
455 A c\bca\bas\bse\be command first expands _\bw_\bo_\br_\bd, and tries to match it against
456 each _\bp_\ba_\bt_\bt_\be_\br_\bn in turn, using the same matching rules as for path-
457 name expansion (see P\bPa\bat\bth\bhn\bna\bam\bme\be E\bEx\bxp\bpa\ban\bns\bsi\bio\bon\bn below). The _\bw_\bo_\br_\bd is
458 expanded using tilde expansion, parameter and variable expan-
459 sion, arithmetic expansion, command substitution, process sub-
460 stitution and quote removal. Each _\bp_\ba_\bt_\bt_\be_\br_\bn examined is expanded
461 using tilde expansion, parameter and variable expansion, arith-
462 metic expansion, command substitution, and process substitution.
463 If the n\bno\boc\bca\bas\bse\bem\bma\bat\btc\bch\bh shell option is enabled, the match is per-
464 formed without regard to the case of alphabetic characters.
465 When a match is found, the corresponding _\bl_\bi_\bs_\bt is executed. If
466 the ;\b;;\b; operator is used, no subsequent matches are attempted
467 after the first pattern match. Using ;\b;&\b& in place of ;\b;;\b; causes
468 execution to continue with the _\bl_\bi_\bs_\bt associated with the next set
469 of patterns. Using ;\b;;\b;&\b& in place of ;\b;;\b; causes the shell to test
470 the next pattern list in the statement, if any, and execute any
471 associated _\bl_\bi_\bs_\bt on a successful match. The exit status is zero
472 if no pattern matches. Otherwise, it is the exit status of the
473 last command executed in _\bl_\bi_\bs_\bt.
474
475 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
476 The i\bif\bf _\bl_\bi_\bs_\bt is executed. If its exit status is zero, the t\bth\bhe\ben\bn
477 _\bl_\bi_\bs_\bt is executed. Otherwise, each e\bel\bli\bif\bf _\bl_\bi_\bs_\bt is executed in
478 turn, and if its exit status is zero, the corresponding t\bth\bhe\ben\bn
479 _\bl_\bi_\bs_\bt is executed and the command completes. Otherwise, the e\bel\bls\bse\be
480 _\bl_\bi_\bs_\bt is executed, if present. The exit status is the exit sta-
481 tus of the last command executed, or zero if no condition tested
482 true.
483
484 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
485 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
486 The w\bwh\bhi\bil\ble\be command continuously executes the list _\bl_\bi_\bs_\bt_\b-_\b2 as long
487 as the last command in the list _\bl_\bi_\bs_\bt_\b-_\b1 returns an exit status of
488 zero. The u\bun\bnt\bti\bil\bl command is identical to the w\bwh\bhi\bil\ble\be command,
489 except that the test is negated; _\bl_\bi_\bs_\bt_\b-_\b2 is executed as long as
490 the last command in _\bl_\bi_\bs_\bt_\b-_\b1 returns a non-zero exit status. The
491 exit status of the w\bwh\bhi\bil\ble\be and u\bun\bnt\bti\bil\bl commands is the exit status
492 of the last command executed in _\bl_\bi_\bs_\bt_\b-_\b2, or zero if none was exe-
493 cuted.
494
495 C\bCo\bop\bpr\bro\boc\bce\bes\bss\bse\bes\bs
496 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
497 coprocess is executed asynchronously in a subshell, as if the command
498 had been terminated with the &\b& control operator, with a two-way pipe
499 established between the executing shell and the coprocess.
500
501 The format for a coprocess is:
502
503 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]
504
505 This creates a coprocess named _\bN_\bA_\bM_\bE. If _\bN_\bA_\bM_\bE is not supplied, the
506 default name is C\bCO\bOP\bPR\bRO\bOC\bC. _\bN_\bA_\bM_\bE must not be supplied if _\bc_\bo_\bm_\bm_\ba_\bn_\bd is a _\bs_\bi_\bm_\b-
507 _\bp_\bl_\be _\bc_\bo_\bm_\bm_\ba_\bn_\bd (see above); otherwise, it is interpreted as the first word
508 of the simple command. When the coprocess is executed, the shell cre-
509 ates an array variable (see A\bAr\brr\bra\bay\bys\bs below) named _\bN_\bA_\bM_\bE in the context of
510 the executing shell. The standard output of _\bc_\bo_\bm_\bm_\ba_\bn_\bd is connected via a
511 pipe to a file descriptor in the executing shell, and that file
512 descriptor is assigned to _\bN_\bA_\bM_\bE[0]. The standard input of _\bc_\bo_\bm_\bm_\ba_\bn_\bd is
513 connected via a pipe to a file descriptor in the executing shell, and
514 that file descriptor is assigned to _\bN_\bA_\bM_\bE[1]. This pipe is established
515 before any redirections specified by the command (see R\bRE\bED\bDI\bIR\bRE\bEC\bCT\bTI\bIO\bON\bN
516 below). The file descriptors can be utilized as arguments to shell
517 commands and redirections using standard word expansions. The file
518 descriptors are not available in subshells. The process ID of the
519 shell spawned to execute the coprocess is available as the value of the
520 variable _\bN_\bA_\bM_\bE_PID. The w\bwa\bai\bit\bt builtin command may be used to wait for
521 the coprocess to terminate.
522
523 Since the coprocess is created as an asynchronous command, the c\bco\bop\bpr\bro\boc\bc
524 command always returns success. The return status of a coprocess is
525 the exit status of _\bc_\bo_\bm_\bm_\ba_\bn_\bd.
526
527 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
528 A shell function is an object that is called like a simple command and
529 executes a compound command with a new set of positional parameters.
530 Shell functions are declared as follows:
531
532 _\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]
533 f\bfu\bun\bnc\bct\bti\bio\bon\bn _\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]
534 This defines a function named _\bn_\ba_\bm_\be. The reserved word f\bfu\bun\bnc\bct\bti\bio\bon\bn
535 is optional. If the f\bfu\bun\bnc\bct\bti\bio\bon\bn reserved word is supplied, the
536 parentheses are optional. The _\bb_\bo_\bd_\by of the function is the com-
537 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).
538 That command is usually a _\bl_\bi_\bs_\bt of commands between { and }, but
539 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, with
540 one exception: If the f\bfu\bun\bnc\bct\bti\bio\bon\bn reserved word is used, but the
541 parentheses are not supplied, the braces are required. _\bc_\bo_\bm_\b-
542 _\bp_\bo_\bu_\bn_\bd_\b-_\bc_\bo_\bm_\bm_\ba_\bn_\bd is executed whenever _\bn_\ba_\bm_\be is specified as the name
543 of a simple command. When in _\bp_\bo_\bs_\bi_\bx _\bm_\bo_\bd_\be, _\bn_\ba_\bm_\be may not be the
544 name of one of the POSIX _\bs_\bp_\be_\bc_\bi_\ba_\bl _\bb_\bu_\bi_\bl_\bt_\bi_\bn_\bs. Any redirections
545 (see R\bRE\bED\bDI\bIR\bRE\bEC\bCT\bTI\bIO\bON\bN below) specified when a function is defined are
546 performed when the function is executed. The exit status of a
547 function definition is zero unless a syntax error occurs or a
548 readonly function with the same name already exists. When exe-
549 cuted, the exit status of a function is the exit status of the
550 last command executed in the body. (See F\bFU\bUN\bNC\bCT\bTI\bIO\bON\bNS\bS below.)
551
552 C\bCO\bOM\bMM\bME\bEN\bNT\bTS\bS
553 In a non-interactive shell, or an interactive shell in which the i\bin\bnt\bte\ber\br-\b-
554 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
555 B\bBU\bUI\bIL\bLT\bTI\bIN\bN C\bCO\bOM\bMM\bMA\bAN\bND\bDS\bS below), a word beginning with #\b# causes that word and
556 all remaining characters on that line to be ignored. An interactive
557 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
558 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 on by default in interac-
559 tive shells.
560
561 Q\bQU\bUO\bOT\bTI\bIN\bNG\bG
562 _\bQ_\bu_\bo_\bt_\bi_\bn_\bg is used to remove the special meaning of certain characters or
563 words to the shell. Quoting can be used to disable special treatment
564 for special characters, to prevent reserved words from being recognized
565 as such, and to prevent parameter expansion.
566
567 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
568 meaning to the shell and must be quoted if it is to represent itself.
569
570 When the command history expansion facilities are being used (see H\bHI\bIS\bS-\b-
571 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
572 be quoted to prevent history expansion.
573
574 There are three quoting mechanisms: the _\be_\bs_\bc_\ba_\bp_\be _\bc_\bh_\ba_\br_\ba_\bc_\bt_\be_\br, single
575 quotes, and double quotes.
576
577 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
578 literal value of the next character that follows, with the exception of
579 <newline>. If a \\b\<newline> pair appears, and the backslash is not
580 itself quoted, the \\b\<newline> is treated as a line continuation (that
581 is, it is removed from the input stream and effectively ignored).
582
583 Enclosing characters in single quotes preserves the literal value of
584 each character within the quotes. A single quote may not occur between
585 single quotes, even when preceded by a backslash.
586
587 Enclosing characters in double quotes preserves the literal value of
588 all characters within the quotes, with the exception of $\b$, `\b`, \\b\, and,
589 when history expansion is enabled, !\b!. The characters $\b$ and `\b` retain
590 their special meaning within double quotes. The backslash retains its
591 special meaning only when followed by one of the following characters:
592 $\b$, `\b`, "\b", \\b\, or <\b<n\bne\bew\bwl\bli\bin\bne\be>\b>. A double quote may be quoted within double
593 quotes by preceding it with a backslash. If enabled, history expansion
594 will be performed unless an !\b! appearing in double quotes is escaped
595 using a backslash. The backslash preceding the !\b! is not removed.
596
597 The special parameters *\b* and @\b@ have special meaning when in double
598 quotes (see P\bPA\bAR\bRA\bAM\bME\bET\bTE\bER\bRS\bS below).
599
600 Words of the form $\b$'_\bs_\bt_\br_\bi_\bn_\bg' are treated specially. The word expands to
601 _\bs_\bt_\br_\bi_\bn_\bg, with backslash-escaped characters replaced as specified by the
602 ANSI C standard. Backslash escape sequences, if present, are decoded
603 as follows:
604 \\b\a\ba alert (bell)
605 \\b\b\bb backspace
606 \\b\e\be
607 \\b\E\bE an escape character
608 \\b\f\bf form feed
609 \\b\n\bn new line
610 \\b\r\br carriage return
611 \\b\t\bt horizontal tab
612 \\b\v\bv vertical tab
613 \\b\\\b\ backslash
614 \\b\'\b' single quote
615 \\b\"\b" double quote
616 \\b\?\b? question mark
617 \\b\_\bn_\bn_\bn the eight-bit character whose value is the octal value
618 _\bn_\bn_\bn (one to three digits)
619 \\b\x\bx_\bH_\bH the eight-bit character whose value is the hexadecimal
620 value _\bH_\bH (one or two hex digits)
621 \\b\u\bu_\bH_\bH_\bH_\bH the Unicode (ISO/IEC 10646) character whose value is the
622 hexadecimal value _\bH_\bH_\bH_\bH (one to four hex digits)
623 \\b\U\bU_\bH_\bH_\bH_\bH_\bH_\bH_\bH_\bH
624 the Unicode (ISO/IEC 10646) character whose value is the
625 hexadecimal value _\bH_\bH_\bH_\bH_\bH_\bH_\bH_\bH (one to eight hex digits)
626 \\b\c\bc_\bx a control-_\bx character
627
628 The expanded result is single-quoted, as if the dollar sign had not
629 been present.
630
631 A double-quoted string preceded by a dollar sign ($\b$"_\bs_\bt_\br_\bi_\bn_\bg") will cause
632 the string to be translated according to the current locale. If the
633 current locale is C\bC or P\bPO\bOS\bSI\bIX\bX, the dollar sign is ignored. If the
634 string is translated and replaced, the replacement is double-quoted.
635
636 P\bPA\bAR\bRA\bAM\bME\bET\bTE\bER\bRS\bS
637 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-
638 ber, or one of the special characters listed below under S\bSp\bpe\bec\bci\bia\bal\bl P\bPa\bar\bra\bam\bm-\b-
639 e\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
640 _\bv_\ba_\bl_\bu_\be and zero or more _\ba_\bt_\bt_\br_\bi_\bb_\bu_\bt_\be_\bs. Attributes are assigned using the
641 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).
642
643 A parameter is set if it has been assigned a value. The null string is
644 a valid value. Once a variable is set, it may be unset only by using
645 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).
646
647 A _\bv_\ba_\br_\bi_\ba_\bb_\bl_\be may be assigned to by a statement of the form
648
649 _\bn_\ba_\bm_\be=[_\bv_\ba_\bl_\bu_\be]
650
651 If _\bv_\ba_\bl_\bu_\be is not given, the variable is assigned the null string. All
652 _\bv_\ba_\bl_\bu_\be_\bs undergo tilde expansion, parameter and variable expansion, com-
653 mand substitution, arithmetic expansion, and quote removal (see E\bEX\bXP\bPA\bAN\bN-\b-
654 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
655 is evaluated as an arithmetic expression even if the $((...)) expansion
656 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 is not
657 performed, with the exception of "\b"$\b$@\b@"\b" as explained below under S\bSp\bpe\bec\bci\bia\bal\bl
658 P\bPa\bar\bra\bam\bme\bet\bte\ber\brs\bs. Pathname expansion is not performed. Assignment state-
659 ments may also appear 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,
660 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).
661 When in _\bp_\bo_\bs_\bi_\bx _\bm_\bo_\bd_\be, these builtins may appear in a command after one or
662 more instances of the c\bco\bom\bmm\bma\ban\bnd\bd builtin and retain these assignment
663 statement properties.
664
665 In the context where an assignment statement is assigning a value to a
666 shell variable or array index, the += operator can be used to append to
667 or add to the variable's previous value. This includes arguments to
668 builtin commands such as d\bde\bec\bcl\bla\bar\bre\be that accept assignment statements
669 (_\bd_\be_\bc_\bl_\ba_\br_\ba_\bt_\bi_\bo_\bn commands). When += is applied to a variable for which the
670 _\bi_\bn_\bt_\be_\bg_\be_\br attribute has been set, _\bv_\ba_\bl_\bu_\be is evaluated as an arithmetic
671 expression and added to the variable's current value, which is also
672 evaluated. When += is applied to an array variable using compound
673 assignment (see A\bAr\brr\bra\bay\bys\bs below), the variable's value is not unset (as it
674 is when using =), and new values are appended to the array beginning at
675 one greater than the array's maximum index (for indexed arrays) or
676 added as additional key-value pairs in an associative array. When
677 applied to a string-valued variable, _\bv_\ba_\bl_\bu_\be is expanded and appended to
678 the variable's value.
679
680 A variable can be assigned the _\bn_\ba_\bm_\be_\br_\be_\bf attribute using the -\b-n\bn option to
681 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
682 and l\blo\boc\bca\bal\bl below) to create a _\bn_\ba_\bm_\be_\br_\be_\bf, or a reference to another vari-
683 able. This allows variables to be manipulated indirectly. Whenever
684 the nameref variable is referenced, assigned to, unset, or has its
685 attributes modified (other than the _\bn_\ba_\bm_\be_\br_\be_\bf attribute itself), the
686 operation is actually performed on the variable specified by the
687 nameref variable's value. A nameref is commonly used within shell
688 functions to refer to a variable whose name is passed as an argument to
689 the function. For instance, if a variable name is passed to a shell
690 function as its first argument, running
691 declare -n ref=$1
692 inside the function creates a nameref variable r\bre\bef\bf whose value is the
693 variable name passed as the first argument. References and assignments
694 to r\bre\bef\bf, and changes to its attributes, are treated as references,
695 assignments, and attribute modifications to the variable whose name was
696 passed as $\b$1\b1. If the control variable in a f\bfo\bor\br loop has the nameref
697 attribute, the list of words can be a list of shell variables, and a
698 name reference will be established for each word in the list, in turn,
699 when the loop is executed. Array variables cannot be given the n\bna\bam\bme\ber\bre\bef\bf
700 attribute. However, nameref variables can reference array variables
701 and subscripted array variables. Namerefs can be unset using the -\b-n\bn
702 option to the u\bun\bns\bse\bet\bt builtin. Otherwise, if u\bun\bns\bse\bet\bt is executed with the
703 name of a nameref variable as an argument, the variable referenced by
704 the nameref variable will be unset.
705
706 P\bPo\bos\bsi\bit\bti\bio\bon\bna\bal\bl P\bPa\bar\bra\bam\bme\bet\bte\ber\brs\bs
707 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,
708 other than the single digit 0. Positional parameters are assigned from
709 the shell's arguments when it is invoked, and may be reassigned using
710 the s\bse\bet\bt builtin command. Positional parameters may not be assigned to
711 with assignment statements. The positional parameters are temporarily
712 replaced when a shell function is executed (see F\bFU\bUN\bNC\bCT\bTI\bIO\bON\bNS\bS below).
713
714 When a positional parameter consisting of more than a single digit is
715 expanded, it must be enclosed in braces (see E\bEX\bXP\bPA\bAN\bNS\bSI\bIO\bON\bN below).
716
717 S\bSp\bpe\bec\bci\bia\bal\bl P\bPa\bar\bra\bam\bme\bet\bte\ber\brs\bs
718 The shell treats several parameters specially. These parameters may
719 only be referenced; assignment to them is not allowed.
720 *\b* Expands to the positional parameters, starting from one. When
721 the expansion is not within double quotes, each positional
722 parameter expands to a separate word. In contexts where it is
723 performed, those words are subject to further word splitting and
724 pathname expansion. When the expansion occurs within double
725 quotes, it expands to a single word with the value of each
726 parameter separated by the first character of the I\bIF\bFS\bS special
727 variable. That is, "$\b$*\b*" is equivalent to "$\b$1\b1_\bc$\b$2\b2_\bc.\b..\b..\b.", where _\bc
728 is the first character of the value of the I\bIF\bFS\bS variable. If I\bIF\bFS\bS
729 is unset, the parameters are separated by spaces. If I\bIF\bFS\bS is
730 null, the parameters are joined without intervening separators.
731 @\b@ Expands to the positional parameters, starting from one. When
732 the expansion occurs within double quotes, each parameter
733 expands to a separate word. That is, "$\b$@\b@" is equivalent to "$\b$1\b1"
734 "$\b$2\b2" ... If the double-quoted expansion occurs within a word,
735 the expansion of the first parameter is joined with the begin-
736 ning part of the original word, and the expansion of the last
737 parameter is joined with the last part of the original word.
738 When there are no positional parameters, "$\b$@\b@" and $\b$@\b@ expand to
739 nothing (i.e., they are removed).
740 #\b# Expands to the number of positional parameters in decimal.
741 ?\b? Expands to the exit status of the most recently executed fore-
742 ground pipeline.
743 -\b- Expands to the current option flags as specified upon invoca-
744 tion, by the s\bse\bet\bt builtin command, or those set by the shell
745 itself (such as the -\b-i\bi option).
746 $\b$ Expands to the process ID of the shell. In a () subshell, it
747 expands to the process ID of the current shell, not the sub-
748 shell.
749 !\b! Expands to the process ID of the job most recently placed into
750 the background, whether executed as an asynchronous command or
751 using the b\bbg\bg builtin (see J\bJO\bOB\bB C\bCO\bON\bNT\bTR\bRO\bOL\bL below).
752 0\b0 Expands to the name of the shell or shell script. This is set
753 at shell initialization. If b\bba\bas\bsh\bh is invoked with a file of com-
754 mands, $\b$0\b0 is set to the name of that file. If b\bba\bas\bsh\bh is started
755 with the -\b-c\bc option, then $\b$0\b0 is set to the first argument after
756 the string to be executed, if one is present. Otherwise, it is
757 set to the filename used to invoke b\bba\bas\bsh\bh, as given by argument
758 zero.
759 _\b_ At shell startup, set to the absolute pathname used to invoke
760 the shell or shell script being executed as passed in the envi-
761 ronment or argument list. Subsequently, expands to the last
762 argument to the previous command, after expansion. Also set to
763 the full pathname used to invoke each command executed and
764 placed in the environment exported to that command. When check-
765 ing mail, this parameter holds the name of the mail file cur-
766 rently being checked.
767
768 S\bSh\bhe\bel\bll\bl V\bVa\bar\bri\bia\bab\bbl\ble\bes\bs
769 The following variables are set by the shell:
770
771 B\bBA\bAS\bSH\bH Expands to the full filename used to invoke this instance of
772 b\bba\bas\bsh\bh.
773 B\bBA\bAS\bSH\bHO\bOP\bPT\bTS\bS
774 A colon-separated list of enabled shell options. Each word in
775 the list is a valid argument for the -\b-s\bs option to the s\bsh\bho\bop\bpt\bt
776 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
777 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
778 this variable is in the environment when b\bba\bas\bsh\bh starts up, each
779 shell option in the list will be enabled before reading any
780 startup files. This variable is read-only.
781 B\bBA\bAS\bSH\bHP\bPI\bID\bD
782 Expands to the process ID of the current b\bba\bas\bsh\bh process. This
783 differs from $\b$$\b$ under certain circumstances, such as subshells
784 that do not require b\bba\bas\bsh\bh to be re-initialized.
785 B\bBA\bAS\bSH\bH_\b_A\bAL\bLI\bIA\bAS\bSE\bES\bS
786 An associative array variable whose members correspond to the
787 internal list of aliases as maintained by the a\bal\bli\bia\bas\bs builtin.
788 Elements added to this array appear in the alias list; unsetting
789 array elements cause aliases to be removed from the alias list.
790 B\bBA\bAS\bSH\bH_\b_A\bAR\bRG\bGC\bC
791 An array variable whose values are the number of parameters in
792 each frame of the current b\bba\bas\bsh\bh execution call stack. The number
793 of parameters to the current subroutine (shell function or
794 script executed with .\b. or s\bso\bou\bur\brc\bce\be) is at the top of the stack.
795 When a subroutine is executed, the number of parameters passed
796 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
797 extended debugging mode (see the description of the e\bex\bxt\btd\bde\beb\bbu\bug\bg
798 option to the s\bsh\bho\bop\bpt\bt builtin below)
799 B\bBA\bAS\bSH\bH_\b_A\bAR\bRG\bGV\bV
800 An array variable containing all of the parameters in the cur-
801 rent b\bba\bas\bsh\bh execution call stack. The final parameter of the last
802 subroutine call is at the top of the stack; the first parameter
803 of the initial call is at the bottom. When a subroutine is exe-
804 cuted, the parameters supplied are pushed onto B\bBA\bAS\bSH\bH_\b_A\bAR\bRG\bGV\bV. The
805 shell sets B\bBA\bAS\bSH\bH_\b_A\bAR\bRG\bGV\bV only when in extended debugging mode (see
806 the description of the e\bex\bxt\btd\bde\beb\bbu\bug\bg option to the s\bsh\bho\bop\bpt\bt builtin
807 below)
808 B\bBA\bAS\bSH\bH_\b_C\bCM\bMD\bDS\bS
809 An associative array variable whose members correspond to the
810 internal hash table of commands as maintained by the h\bha\bas\bsh\bh
811 builtin. Elements added to this array appear in the hash table;
812 unsetting array elements cause commands to be removed from the
813 hash table.
814 B\bBA\bAS\bSH\bH_\b_C\bCO\bOM\bMM\bMA\bAN\bND\bD
815 The command currently being executed or about to be executed,
816 unless the shell is executing a command as the result of a trap,
817 in which case it is the command executing at the time of the
818 trap.
819 B\bBA\bAS\bSH\bH_\b_E\bEX\bXE\bEC\bCU\bUT\bTI\bIO\bON\bN_\b_S\bST\bTR\bRI\bIN\bNG\bG
820 The command argument to the -\b-c\bc invocation option.
821 B\bBA\bAS\bSH\bH_\b_L\bLI\bIN\bNE\bEN\bNO\bO
822 An array variable whose members are the line numbers in source
823 files where each corresponding member of F\bFU\bUN\bNC\bCN\bNA\bAM\bME\bE was invoked.
824 $\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
825 ($\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
826 $\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-
827 tion). Use L\bLI\bIN\bNE\bEN\bNO\bO to obtain the current line number.
828 B\bBA\bAS\bSH\bH_\b_L\bLO\bOA\bAD\bDA\bAB\bBL\bLE\bES\bS_\b_P\bPA\bAT\bTH\bH
829 A colon-separated list of directories in which the shell looks
830 for dynamically loadable builtins specified by the e\ben\bna\bab\bbl\ble\be com-
831 mand.
832 B\bBA\bAS\bSH\bH_\b_R\bRE\bEM\bMA\bAT\bTC\bCH\bH
833 An array variable whose members are assigned by the =\b=~\b~ binary
834 operator to the [\b[[\b[ conditional command. The element with index
835 0 is the portion of the string matching the entire regular
836 expression. The element with index _\bn is the portion of the
837 string matching the _\bnth parenthesized subexpression. This vari-
838 able is read-only.
839 B\bBA\bAS\bSH\bH_\b_S\bSO\bOU\bUR\bRC\bCE\bE
840 An array variable whose members are the source filenames where
841 the corresponding shell function names in the F\bFU\bUN\bNC\bCN\bNA\bAM\bME\bE array
842 variable are defined. The shell function $\b${\b{F\bFU\bUN\bNC\bCN\bNA\bAM\bME\bE[\b[_\b$_\bi]\b]}\b} is
843 defined 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
844 $\b${\b{B\bBA\bAS\bSH\bH_\b_S\bSO\bOU\bUR\bRC\bCE\bE[\b[_\b$_\bi_\b+_\b1]\b]}\b}.
845 B\bBA\bAS\bSH\bH_\b_S\bSU\bUB\bBS\bSH\bHE\bEL\bLL\bL
846 Incremented by one within each subshell or subshell environment
847 when the shell begins executing in that environment. The ini-
848 tial value is 0.
849 B\bBA\bAS\bSH\bH_\b_V\bVE\bER\bRS\bSI\bIN\bNF\bFO\bO
850 A readonly array variable whose members hold version information
851 for this instance of b\bba\bas\bsh\bh. The values assigned to the array
852 members are as follows:
853 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).
854 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).
855 B\bBA\bAS\bSH\bH_\b_V\bVE\bER\bRS\bSI\bIN\bNF\bFO\bO[\b[2]\b] The patch level.
856 B\bBA\bAS\bSH\bH_\b_V\bVE\bER\bRS\bSI\bIN\bNF\bFO\bO[\b[3]\b] The build version.
857 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_\b1).
858 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.
859 B\bBA\bAS\bSH\bH_\b_V\bVE\bER\bRS\bSI\bIO\bON\bN
860 Expands to a string describing the version of this instance of
861 b\bba\bas\bsh\bh.
862 C\bCO\bOM\bMP\bP_\b_C\bCW\bWO\bOR\bRD\bD
863 An index into $\b${\b{C\bCO\bOM\bMP\bP_\b_W\bWO\bOR\bRD\bDS\bS}\b} of the word containing the current
864 cursor position. This variable is available only in shell func-
865 tions invoked by the programmable completion facilities (see
866 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).
867 C\bCO\bOM\bMP\bP_\b_K\bKE\bEY\bY
868 The key (or final key of a key sequence) used to invoke the cur-
869 rent completion function.
870 C\bCO\bOM\bMP\bP_\b_L\bLI\bIN\bNE\bE
871 The current command line. This variable is available only in
872 shell functions and external commands invoked by the program-
873 mable 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).
874 C\bCO\bOM\bMP\bP_\b_P\bPO\bOI\bIN\bNT\bT
875 The index of the current cursor position relative to the begin-
876 ning of the current command. If the current cursor position is
877 at the end of the current command, the value of this variable is
878 equal to $\b${\b{#\b#C\bCO\bOM\bMP\bP_\b_L\bLI\bIN\bNE\bE}\b}. This variable is available only in
879 shell functions and external commands invoked by the program-
880 mable 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).
881 C\bCO\bOM\bMP\bP_\b_T\bTY\bYP\bPE\bE
882 Set to an integer value corresponding to the type of completion
883 attempted that caused a completion function to be called: _\bT_\bA_\bB,
884 for normal completion, _\b?, for listing completions after succes-
885 sive tabs, _\b!, for listing alternatives on partial word comple-
886 tion, _\b@, to list completions if the word is not unmodified, or
887 _\b%, for menu completion. This variable is available only in
888 shell functions and external commands invoked by the program-
889 mable 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).
890 C\bCO\bOM\bMP\bP_\b_W\bWO\bOR\bRD\bDB\bBR\bRE\bEA\bAK\bKS\bS
891 The set of characters that the r\bre\bea\bad\bdl\bli\bin\bne\be library treats as word
892 separators when performing word completion. If C\bCO\bOM\bMP\bP_\b_W\bWO\bOR\bRD\bDB\bBR\bRE\bEA\bAK\bKS\bS
893 is unset, it loses its special properties, even if it is subse-
894 quently reset.
895 C\bCO\bOM\bMP\bP_\b_W\bWO\bOR\bRD\bDS\bS
896 An array variable (see A\bAr\brr\bra\bay\bys\bs below) consisting of the individ-
897 ual words in the current command line. The line is split into
898 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
899 described above. This variable is available only in shell func-
900 tions invoked by the programmable completion facilities (see
901 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).
902 C\bCO\bOP\bPR\bRO\bOC\bC An array variable (see A\bAr\brr\bra\bay\bys\bs below) created to hold the file
903 descriptors for output from and input to an unnamed coprocess
904 (see C\bCo\bop\bpr\bro\boc\bce\bes\bss\bse\bes\bs above).
905 D\bDI\bIR\bRS\bST\bTA\bAC\bCK\bK
906 An array variable (see A\bAr\brr\bra\bay\bys\bs below) containing the current con-
907 tents of the directory stack. Directories appear in the stack
908 in the order they are displayed by the d\bdi\bir\brs\bs builtin. Assigning
909 to members of this array variable may be used to modify directo-
910 ries already in the stack, but the p\bpu\bus\bsh\bhd\bd and p\bpo\bop\bpd\bd builtins must
911 be used to add and remove directories. Assignment to this vari-
912 able will not change the current directory. If D\bDI\bIR\bRS\bST\bTA\bAC\bCK\bK is
913 unset, it loses its special properties, even if it is subse-
914 quently reset.
915 E\bEU\bUI\bID\bD Expands to the effective user ID of the current user, initial-
916 ized at shell startup. This variable is readonly.
917 F\bFU\bUN\bNC\bCN\bNA\bAM\bME\bE
918 An array variable containing the names of all shell functions
919 currently in the execution call stack. The element with index 0
920 is the name of any currently-executing shell function. The bot-
921 tom-most element (the one with the highest index) is "main".
922 This variable exists only when a shell function is executing.
923 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,
924 it loses its special properties, even if it is subsequently
925 reset.
926
927 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.
928 Each element of F\bFU\bUN\bNC\bCN\bNA\bAM\bME\bE has corresponding elements in
929 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
930 instance, $\b${\b{F\bFU\bUN\bNC\bCN\bNA\bAM\bME\bE[\b[_\b$_\bi]\b]}\b} was called from the file
931 $\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
932 c\bca\bal\bll\ble\ber\br builtin displays the current call stack using this infor-
933 mation.
934 G\bGR\bRO\bOU\bUP\bPS\bS An array variable containing the list of groups of which the
935 current user is a member. Assignments to G\bGR\bRO\bOU\bUP\bPS\bS have no effect.
936 If G\bGR\bRO\bOU\bUP\bPS\bS is unset, it loses its special properties, even if it
937 is subsequently reset.
938 H\bHI\bIS\bST\bTC\bCM\bMD\bD
939 The history number, or index in the history list, of the current
940 command. If H\bHI\bIS\bST\bTC\bCM\bMD\bD is unset, it loses its special properties,
941 even if it is subsequently reset.
942 H\bHO\bOS\bST\bTN\bNA\bAM\bME\bE
943 Automatically set to the name of the current host.
944 H\bHO\bOS\bST\bTT\bTY\bYP\bPE\bE
945 Automatically set to a string that uniquely describes the type
946 of machine on which b\bba\bas\bsh\bh is executing. The default is system-
947 dependent.
948 L\bLI\bIN\bNE\bEN\bNO\bO Each time this parameter is referenced, the shell substitutes a
949 decimal number representing the current sequential line number
950 (starting with 1) within a script or function. When not in a
951 script or function, the value substituted is not guaranteed to
952 be meaningful. If L\bLI\bIN\bNE\bEN\bNO\bO is unset, it loses its special proper-
953 ties, even if it is subsequently reset.
954 M\bMA\bAC\bCH\bHT\bTY\bYP\bPE\bE
955 Automatically set to a string that fully describes the system
956 type on which b\bba\bas\bsh\bh is executing, in the standard GNU _\bc_\bp_\bu_\b-_\bc_\bo_\bm_\b-
957 _\bp_\ba_\bn_\by_\b-_\bs_\by_\bs_\bt_\be_\bm format. The default is system-dependent.
958 M\bMA\bAP\bPF\bFI\bIL\bLE\bE
959 An array variable (see A\bAr\brr\bra\bay\bys\bs below) created to hold the text
960 read by the m\bma\bap\bpf\bfi\bil\ble\be builtin when no variable name is supplied.
961 O\bOL\bLD\bDP\bPW\bWD\bD The previous working directory as set by the c\bcd\bd command.
962 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
963 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).
964 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
965 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).
966 O\bOS\bST\bTY\bYP\bPE\bE Automatically set to a string that describes the operating sys-
967 tem on which b\bba\bas\bsh\bh is executing. The default is system-depen-
968 dent.
969 P\bPI\bIP\bPE\bES\bST\bTA\bAT\bTU\bUS\bS
970 An array variable (see A\bAr\brr\bra\bay\bys\bs below) containing a list of exit
971 status values from the processes in the most-recently-executed
972 foreground pipeline (which may contain only a single command).
973 P\bPP\bPI\bID\bD The process ID of the shell's parent. This variable is read-
974 only.
975 P\bPW\bWD\bD The current working directory as set by the c\bcd\bd command.
976 R\bRA\bAN\bND\bDO\bOM\bM Each time this parameter is referenced, a random integer between
977 0 and 32767 is generated. The sequence of random numbers may be
978 initialized by assigning a value to R\bRA\bAN\bND\bDO\bOM\bM. If R\bRA\bAN\bND\bDO\bOM\bM is unset,
979 it loses its special properties, even if it is subsequently
980 reset.
981 R\bRE\bEA\bAD\bDL\bLI\bIN\bNE\bE_\b_L\bLI\bIN\bNE\bE
982 The contents of the r\bre\bea\bad\bdl\bli\bin\bne\be line buffer, for use with "bind -x"
983 (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).
984 R\bRE\bEA\bAD\bDL\bLI\bIN\bNE\bE_\b_P\bPO\bOI\bIN\bNT\bT
985 The position of the insertion point in the r\bre\bea\bad\bdl\bli\bin\bne\be line buffer,
986 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).
987 R\bRE\bEP\bPL\bLY\bY Set to the line of input read by the r\bre\bea\bad\bd builtin command when
988 no arguments are supplied.
989 S\bSE\bEC\bCO\bON\bND\bDS\bS
990 Each time this parameter is referenced, the number of seconds
991 since shell invocation is returned. If a value is assigned to
992 S\bSE\bEC\bCO\bON\bND\bDS\bS, the value returned upon subsequent references is the
993 number of seconds since the assignment plus the value assigned.
994 If S\bSE\bEC\bCO\bON\bND\bDS\bS is unset, it loses its special properties, even if it
995 is subsequently reset.
996 S\bSH\bHE\bEL\bLL\bLO\bOP\bPT\bTS\bS
997 A colon-separated list of enabled shell options. Each word in
998 the list is a valid argument for the -\b-o\bo option to the s\bse\bet\bt
999 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
1000 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
1001 this variable is in the environment when b\bba\bas\bsh\bh starts up, each
1002 shell option in the list will be enabled before reading any
1003 startup files. This variable is read-only.
1004 S\bSH\bHL\bLV\bVL\bL Incremented by one each time an instance of b\bba\bas\bsh\bh is started.
1005 U\bUI\bID\bD Expands to the user ID of the current user, initialized at shell
1006 startup. This variable is readonly.
1007
1008 The following variables are used by the shell. In some cases, b\bba\bas\bsh\bh
1009 assigns a default value to a variable; these cases are noted below.
1010
1011 B\bBA\bAS\bSH\bH_\b_C\bCO\bOM\bMP\bPA\bAT\bT
1012 The value is used to set the shell's compatibility level. See
1013 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
1014 C\bCO\bOM\bMM\bMA\bAN\bND\bDS\bS for a description of the various compatibility levels
1015 and their effects. The value may be a decimal number (e.g.,
1016 4.2) or an integer (e.g., 42) corresponding to the desired com-
1017 patibility level. If B\bBA\bAS\bSH\bH_\b_C\bCO\bOM\bMP\bPA\bAT\bT is unset or set to the empty
1018 string, the compatibility level is set to the default for the
1019 current version. If B\bBA\bAS\bSH\bH_\b_C\bCO\bOM\bMP\bPA\bAT\bT is set to a value that is not
1020 one of the valid compatibility levels, the shell prints an error
1021 message and sets the compatibility level to the default for the
1022 current version. The valid compatibility levels correspond to
1023 the compatibility options accepted by the s\bsh\bho\bop\bpt\bt builtin
1024 described below (for example, c\bco\bom\bmp\bpa\bat\bt4\b42\b2 means that 4.2 and 42 are
1025 valid values). The current version is also a valid value.
1026 B\bBA\bAS\bSH\bH_\b_E\bEN\bNV\bV
1027 If this parameter is set when b\bba\bas\bsh\bh is executing a shell script,
1028 its value is interpreted as a filename containing commands to
1029 initialize the shell, as in _\b~_\b/_\b._\bb_\ba_\bs_\bh_\br_\bc. The value of B\bBA\bAS\bSH\bH_\b_E\bEN\bNV\bV is
1030 subjected to parameter expansion, command substitution, and
1031 arithmetic expansion before being interpreted as a filename.
1032 P\bPA\bAT\bTH\bH is not used to search for the resultant filename.
1033 B\bBA\bAS\bSH\bH_\b_X\bXT\bTR\bRA\bAC\bCE\bEF\bFD\bD
1034 If set to an integer corresponding to a valid file descriptor,
1035 b\bba\bas\bsh\bh will write the trace output generated when _\bs_\be_\bt _\b-_\bx is
1036 enabled to that file descriptor. The file descriptor is closed
1037 when B\bBA\bAS\bSH\bH_\b_X\bXT\bTR\bRA\bAC\bCE\bEF\bFD\bD is unset or assigned a new value. Unsetting
1038 B\bBA\bAS\bSH\bH_\b_X\bXT\bTR\bRA\bAC\bCE\bEF\bFD\bD or assigning it the empty string causes the trace
1039 output to be sent to the standard error. Note that setting
1040 B\bBA\bAS\bSH\bH_\b_X\bXT\bTR\bRA\bAC\bCE\bEF\bFD\bD to 2 (the standard error file descriptor) and then
1041 unsetting it will result in the standard error being closed.
1042 C\bCD\bDP\bPA\bAT\bTH\bH The search path for the c\bcd\bd command. This is a colon-separated
1043 list of directories in which the shell looks for destination
1044 directories specified by the c\bcd\bd command. A sample value is
1045 ".:~:/usr".
1046 C\bCH\bHI\bIL\bLD\bD_\b_M\bMA\bAX\bX
1047 Set the number of exited child status values for the shell to
1048 remember. Bash will not allow this value to be decreased below
1049 a POSIX-mandated minimum, and there is a maximum value (cur-
1050 rently 8192) that this may not exceed. The minimum value is
1051 system-dependent.
1052 C\bCO\bOL\bLU\bUM\bMN\bNS\bS
1053 Used by the s\bse\bel\ble\bec\bct\bt compound command to determine the terminal
1054 width when printing selection lists. Automatically set if the
1055 c\bch\bhe\bec\bck\bkw\bwi\bin\bns\bsi\biz\bze\be option is enabled or in an interactive shell upon
1056 receipt of a S\bSI\bIG\bGW\bWI\bIN\bNC\bCH\bH.
1057 C\bCO\bOM\bMP\bPR\bRE\bEP\bPL\bLY\bY
1058 An array variable from which b\bba\bas\bsh\bh reads the possible completions
1059 generated by a shell function invoked by the programmable com-
1060 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
1061 array element contains one possible completion.
1062 E\bEM\bMA\bAC\bCS\bS If b\bba\bas\bsh\bh finds this variable in the environment when the shell
1063 starts with value "t", it assumes that the shell is running in
1064 an Emacs shell buffer and disables line editing.
1065 E\bEN\bNV\bV Similar to B\bBA\bAS\bSH\bH_\b_E\bEN\bNV\bV; used when the shell is invoked in POSIX
1066 mode.
1067 E\bEX\bXE\bEC\bCI\bIG\bGN\bNO\bOR\bRE\bE
1068 A colon-separated list of extended glob patterns (see P\bPa\bat\btt\bte\ber\brn\bn
1069 M\bMa\bat\btc\bch\bhi\bin\bng\bg) defining the list of filenames to be ignored by com-
1070 mand search. Files whose full pathnames match one of these pat-
1071 terns are not considered executable files for the purposes of
1072 completion and command execution. This does not affect the
1073 behavior of the [\b[, t\bte\bes\bst\bt, and [\b[[\b[ commands. Use this variable to
1074 ignore shared library files that have the executable bit set,
1075 but are not executable files.
1076 F\bFC\bCE\bED\bDI\bIT\bT The default editor for the f\bfc\bc builtin command.
1077 F\bFI\bIG\bGN\bNO\bOR\bRE\bE
1078 A colon-separated list of suffixes to ignore when performing
1079 filename completion (see R\bRE\bEA\bAD\bDL\bLI\bIN\bNE\bE below). A filename whose suf-
1080 fix matches one of the entries in F\bFI\bIG\bGN\bNO\bOR\bRE\bE is excluded from the
1081 list of matched filenames. A sample value is ".o:~".
1082 F\bFU\bUN\bNC\bCN\bNE\bES\bST\bT
1083 If set to a numeric value greater than 0, defines a maximum
1084 function nesting level. Function invocations that exceed this
1085 nesting level will cause the current command to abort.
1086 G\bGL\bLO\bOB\bBI\bIG\bGN\bNO\bOR\bRE\bE
1087 A colon-separated list of patterns defining the set of filenames
1088 to be ignored by pathname expansion. If a filename matched by a
1089 pathname expansion pattern also matches one of the patterns in
1090 G\bGL\bLO\bOB\bBI\bIG\bGN\bNO\bOR\bRE\bE, it is removed from the list of matches.
1091 H\bHI\bIS\bST\bTC\bCO\bON\bNT\bTR\bRO\bOL\bL
1092 A colon-separated list of values controlling how commands are
1093 saved on the history list. If the list of values includes
1094 _\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
1095 saved in the history list. A value of _\bi_\bg_\bn_\bo_\br_\be_\bd_\bu_\bp_\bs causes lines
1096 matching the previous history entry to not be saved. A value of
1097 _\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
1098 of _\be_\br_\ba_\bs_\be_\bd_\bu_\bp_\bs causes all previous lines matching the current line
1099 to be removed from the history list before that line is saved.
1100 Any value not in the above list is ignored. If H\bHI\bIS\bST\bTC\bCO\bON\bNT\bTR\bRO\bOL\bL is
1101 unset, or does not include a valid value, all lines read by the
1102 shell parser are saved on the history list, subject to the value
1103 of H\bHI\bIS\bST\bTI\bIG\bGN\bNO\bOR\bRE\bE. The second and subsequent lines of a multi-line
1104 compound command are not tested, and are added to the history
1105 regardless of the value of H\bHI\bIS\bST\bTC\bCO\bON\bNT\bTR\bRO\bOL\bL.
1106 H\bHI\bIS\bST\bTF\bFI\bIL\bLE\bE
1107 The name of the file in which command history is saved (see H\bHI\bIS\bS-\b-
1108 T\bTO\bOR\bRY\bY below). The default value is _\b~_\b/_\b._\bb_\ba_\bs_\bh_\b__\bh_\bi_\bs_\bt_\bo_\br_\by. If unset,
1109 the command history is not saved when a shell exits.
1110 H\bHI\bIS\bST\bTF\bFI\bIL\bLE\bES\bSI\bIZ\bZE\bE
1111 The maximum number of lines contained in the history file. When
1112 this variable is assigned a value, the history file is trun-
1113 cated, if necessary, to contain no more than that number of
1114 lines by removing the oldest entries. The history file is also
1115 truncated to this size after writing it when a shell exits. If
1116 the value is 0, the history file is truncated to zero size.
1117 Non-numeric values and numeric values less than zero inhibit
1118 truncation. The shell sets the default value to the value of
1119 H\bHI\bIS\bST\bTS\bSI\bIZ\bZE\bE after reading any startup files.
1120 H\bHI\bIS\bST\bTI\bIG\bGN\bNO\bOR\bRE\bE
1121 A colon-separated list of patterns used to decide which command
1122 lines should be saved on the history list. Each pattern is
1123 anchored at the beginning of the line and must match the com-
1124 plete line (no implicit `*\b*' is appended). Each pattern is
1125 tested against the line after the checks specified by H\bHI\bIS\bST\bTC\bCO\bON\bN-\b-
1126 T\bTR\bRO\bOL\bL are applied. In addition to the normal shell pattern
1127 matching characters, `&\b&' matches the previous history line. `&\b&'
1128 may be escaped using a backslash; the backslash is removed
1129 before attempting a match. The second and subsequent lines of a
1130 multi-line compound command are not tested, and are added to the
1131 history regardless of the value of H\bHI\bIS\bST\bTI\bIG\bGN\bNO\bOR\bRE\bE.
1132 H\bHI\bIS\bST\bTS\bSI\bIZ\bZE\bE
1133 The number of commands to remember in the command history (see
1134 H\bHI\bIS\bST\bTO\bOR\bRY\bY below). If the value is 0, commands are not saved in
1135 the history list. Numeric values less than zero result in every
1136 command being saved on the history list (there is no limit).
1137 The shell sets the default value to 500 after reading any
1138 startup files.
1139 H\bHI\bIS\bST\bTT\bTI\bIM\bME\bEF\bFO\bOR\bRM\bMA\bAT\bT
1140 If this variable is set and not null, its value is used as a
1141 format string for _\bs_\bt_\br_\bf_\bt_\bi_\bm_\be(3) to print the time stamp associated
1142 with each history entry displayed by the h\bhi\bis\bst\bto\bor\bry\by builtin. If
1143 this variable is set, time stamps are written to the history
1144 file so they may be preserved across shell sessions. This uses
1145 the history comment character to distinguish timestamps from
1146 other history lines.
1147 H\bHO\bOM\bME\bE The home directory of the current user; the default argument for
1148 the c\bcd\bd builtin command. The value of this variable is also used
1149 when performing tilde expansion.
1150 H\bHO\bOS\bST\bTF\bFI\bIL\bLE\bE
1151 Contains the name of a file in the same format as _\b/_\be_\bt_\bc_\b/_\bh_\bo_\bs_\bt_\bs
1152 that should be read when the shell needs to complete a hostname.
1153 The list of possible hostname completions may be changed while
1154 the shell is running; the next time hostname completion is
1155 attempted after the value is changed, b\bba\bas\bsh\bh adds the contents of
1156 the new file to the existing list. If H\bHO\bOS\bST\bTF\bFI\bIL\bLE\bE is set, but has
1157 no value, or does not name a readable file, b\bba\bas\bsh\bh attempts to
1158 read _\b/_\be_\bt_\bc_\b/_\bh_\bo_\bs_\bt_\bs to obtain the list of possible hostname comple-
1159 tions. When H\bHO\bOS\bST\bTF\bFI\bIL\bLE\bE is unset, the hostname list is cleared.
1160 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
1161 after expansion and to split lines into words with the r\bre\bea\bad\bd
1162 builtin command. The default value is ``<space><tab><new-
1163 line>''.
1164 I\bIG\bGN\bNO\bOR\bRE\bEE\bEO\bOF\bF
1165 Controls the action of an interactive shell on receipt of an E\bEO\bOF\bF
1166 character as the sole input. If set, the value is the number of
1167 consecutive E\bEO\bOF\bF characters which must be typed as the first
1168 characters on an input line before b\bba\bas\bsh\bh exits. If the variable
1169 exists but does not have a numeric value, or has no value, the
1170 default value is 10. If it does not exist, E\bEO\bOF\bF signifies the
1171 end of input to the shell.
1172 I\bIN\bNP\bPU\bUT\bTR\bRC\bC
1173 The filename for the r\bre\bea\bad\bdl\bli\bin\bne\be startup file, overriding the
1174 default of _\b~_\b/_\b._\bi_\bn_\bp_\bu_\bt_\br_\bc (see R\bRE\bEA\bAD\bDL\bLI\bIN\bNE\bE below).
1175 L\bLA\bAN\bNG\bG Used to determine the locale category for any category not
1176 specifically selected with a variable starting with L\bLC\bC_\b_.
1177 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_
1178 variable specifying a locale category.
1179 L\bLC\bC_\b_C\bCO\bOL\bLL\bLA\bAT\bTE\bE
1180 This variable determines the collation order used when sorting
1181 the results of pathname expansion, and determines the behavior
1182 of range expressions, equivalence classes, and collating
1183 sequences within pathname expansion and pattern matching.
1184 L\bLC\bC_\b_C\bCT\bTY\bYP\bPE\bE
1185 This variable determines the interpretation of characters and
1186 the behavior of character classes within pathname expansion and
1187 pattern matching.
1188 L\bLC\bC_\b_M\bME\bES\bSS\bSA\bAG\bGE\bES\bS
1189 This variable determines the locale used to translate double-
1190 quoted strings preceded by a $\b$.
1191 L\bLC\bC_\b_N\bNU\bUM\bME\bER\bRI\bIC\bC
1192 This variable determines the locale category used for number
1193 formatting.
1194 L\bLI\bIN\bNE\bES\bS Used by the s\bse\bel\ble\bec\bct\bt compound command to determine the column
1195 length for printing selection lists. Automatically set if the
1196 c\bch\bhe\bec\bck\bkw\bwi\bin\bns\bsi\biz\bze\be option is enabled or in an interactive shell upon
1197 receipt of a S\bSI\bIG\bGW\bWI\bIN\bNC\bCH\bH.
1198 M\bMA\bAI\bIL\bL If this parameter is set to a file or directory name and the
1199 M\bMA\bAI\bIL\bLP\bPA\bAT\bTH\bH variable is not set, b\bba\bas\bsh\bh informs the user of the
1200 arrival of mail in the specified file or Maildir-format direc-
1201 tory.
1202 M\bMA\bAI\bIL\bLC\bCH\bHE\bEC\bCK\bK
1203 Specifies how often (in seconds) b\bba\bas\bsh\bh checks for mail. The
1204 default is 60 seconds. When it is time to check for mail, the
1205 shell does so before displaying the primary prompt. If this
1206 variable is unset, or set to a value that is not a number
1207 greater than or equal to zero, the shell disables mail checking.
1208 M\bMA\bAI\bIL\bLP\bPA\bAT\bTH\bH
1209 A colon-separated list of filenames to be checked for mail. The
1210 message to be printed when mail arrives in a particular file may
1211 be specified by separating the filename from the message with a
1212 `?'. When used in the text of the message, $\b$_\b_ expands to the
1213 name of the current mailfile. Example:
1214 M\bMA\bAI\bIL\bLP\bPA\bAT\bTH\bH='/var/mail/bfox?"You have mail":~/shell-mail?"$_ has
1215 mail!"'
1216 B\bBa\bas\bsh\bh supplies a default value for this variable, but the loca-
1217 tion of the user mail files that it uses is system dependent
1218 (e.g., /var/mail/$\b$U\bUS\bSE\bER\bR).
1219 O\bOP\bPT\bTE\bER\bRR\bR If set to the value 1, b\bba\bas\bsh\bh displays error messages generated by
1220 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).
1221 O\bOP\bPT\bTE\bER\bRR\bR is initialized to 1 each time the shell is invoked or a
1222 shell script is executed.
1223 P\bPA\bAT\bTH\bH The search path for commands. It is a colon-separated list of
1224 directories in which the shell looks for commands (see C\bCO\bOM\bMM\bMA\bAN\bND\bD
1225 E\bEX\bXE\bEC\bCU\bUT\bTI\bIO\bON\bN below). A zero-length (null) directory name in the
1226 value of P\bPA\bAT\bTH\bH indicates the current directory. A null directory
1227 name may appear as two adjacent colons, or as an initial or
1228 trailing colon. The default path is system-dependent, and is
1229 set by the administrator who installs b\bba\bas\bsh\bh. A common value is
1230 ``/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/bin:/sbin''.
1231 P\bPO\bOS\bSI\bIX\bXL\bLY\bY_\b_C\bCO\bOR\bRR\bRE\bEC\bCT\bT
1232 If this variable is in the environment when b\bba\bas\bsh\bh starts, the
1233 shell enters _\bp_\bo_\bs_\bi_\bx _\bm_\bo_\bd_\be before reading the startup files, as if
1234 the -\b--\b-p\bpo\bos\bsi\bix\bx invocation option had been supplied. If it is set
1235 while the shell is running, b\bba\bas\bsh\bh enables _\bp_\bo_\bs_\bi_\bx _\bm_\bo_\bd_\be, as if the
1236 command _\bs_\be_\bt _\b-_\bo _\bp_\bo_\bs_\bi_\bx had been executed.
1237 P\bPR\bRO\bOM\bMP\bPT\bT_\b_C\bCO\bOM\bMM\bMA\bAN\bND\bD
1238 If set, the value is executed as a command prior to issuing each
1239 primary prompt.
1240 P\bPR\bRO\bOM\bMP\bPT\bT_\b_D\bDI\bIR\bRT\bTR\bRI\bIM\bM
1241 If set to a number greater than zero, the value is used as the
1242 number of trailing directory components to retain when expanding
1243 the \\b\w\bw and \\b\W\bW prompt string escapes (see P\bPR\bRO\bOM\bMP\bPT\bTI\bIN\bNG\bG below).
1244 Characters removed are replaced with an ellipsis.
1245 P\bPS\bS1\b1 The value of this parameter is expanded (see P\bPR\bRO\bOM\bMP\bPT\bTI\bIN\bNG\bG below)
1246 and used as the primary prompt string. The default value is
1247 ``\\b\s\bs-\b-\\b\v\bv\\b\$\b$ ''.
1248 P\bPS\bS2\b2 The value of this parameter is expanded as with P\bPS\bS1\b1 and used as
1249 the secondary prompt string. The default is ``>\b> ''.
1250 P\bPS\bS3\b3 The value of this parameter is used as the prompt for the s\bse\bel\ble\bec\bct\bt
1251 command (see S\bSH\bHE\bEL\bLL\bL G\bGR\bRA\bAM\bMM\bMA\bAR\bR above).
1252 P\bPS\bS4\b4 The value of this parameter is expanded as with P\bPS\bS1\b1 and the
1253 value is printed before each command b\bba\bas\bsh\bh displays during an
1254 execution trace. The first character of P\bPS\bS4\b4 is replicated mul-
1255 tiple times, as necessary, to indicate multiple levels of indi-
1256 rection. The default is ``+\b+ ''.
1257 S\bSH\bHE\bEL\bLL\bL The full pathname to the shell is kept in this environment vari-
1258 able. If it is not set when the shell starts, b\bba\bas\bsh\bh assigns to
1259 it the full pathname of the current user's login shell.
1260 T\bTI\bIM\bME\bEF\bFO\bOR\bRM\bMA\bAT\bT
1261 The value of this parameter is used as a format string specify-
1262 ing how the timing information for pipelines prefixed with the
1263 t\bti\bim\bme\be reserved word should be displayed. The %\b% character intro-
1264 duces an escape sequence that is expanded to a time value or
1265 other information. The escape sequences and their meanings are
1266 as follows; the braces denote optional portions.
1267 %\b%%\b% A literal %\b%.
1268 %\b%[\b[_\bp]\b][\b[l\bl]\b]R\bR The elapsed time in seconds.
1269 %\b%[\b[_\bp]\b][\b[l\bl]\b]U\bU The number of CPU seconds spent in user mode.
1270 %\b%[\b[_\bp]\b][\b[l\bl]\b]S\bS The number of CPU seconds spent in system mode.
1271 %\b%P\bP The CPU percentage, computed as (%U + %S) / %R.
1272
1273 The optional _\bp is a digit specifying the _\bp_\br_\be_\bc_\bi_\bs_\bi_\bo_\bn, the number
1274 of fractional digits after a decimal point. A value of 0 causes
1275 no decimal point or fraction to be output. At most three places
1276 after the decimal point may be specified; values of _\bp greater
1277 than 3 are changed to 3. If _\bp is not specified, the value 3 is
1278 used.
1279
1280 The optional l\bl specifies a longer format, including minutes, of
1281 the form _\bM_\bMm_\bS_\bS._\bF_\bFs. The value of _\bp determines whether or not
1282 the fraction is included.
1283
1284 If this variable is not set, b\bba\bas\bsh\bh acts as if it had the value
1285 $\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,
1286 no timing information is displayed. A trailing newline is added
1287 when the format string is displayed.
1288 T\bTM\bMO\bOU\bUT\bT If set to a value greater than zero, T\bTM\bMO\bOU\bUT\bT is treated as the
1289 default timeout for the r\bre\bea\bad\bd builtin. The s\bse\bel\ble\bec\bct\bt command termi-
1290 nates if input does not arrive after T\bTM\bMO\bOU\bUT\bT seconds when input is
1291 coming from a terminal. In an interactive shell, the value is
1292 interpreted as the number of seconds to wait for a line of input
1293 after issuing the primary prompt. B\bBa\bas\bsh\bh terminates after waiting
1294 for that number of seconds if a complete line of input does not
1295 arrive.
1296 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
1297 b\bba\bas\bsh\bh creates temporary files for the shell's use.
1298 a\bau\but\bto\bo_\b_r\bre\bes\bsu\bum\bme\be
1299 This variable controls how the shell interacts with the user and
1300 job control. If this variable is set, single word simple com-
1301 mands without redirections are treated as candidates for resump-
1302 tion of an existing stopped job. There is no ambiguity allowed;
1303 if there is more than one job beginning with the string typed,
1304 the job most recently accessed is selected. The _\bn_\ba_\bm_\be of a
1305 stopped job, in this context, is the command line used to start
1306 it. If set to the value _\be_\bx_\ba_\bc_\bt, the string supplied must match
1307 the name of a stopped job exactly; if set to _\bs_\bu_\bb_\bs_\bt_\br_\bi_\bn_\bg, the
1308 string supplied needs to match a substring of the name of a
1309 stopped job. The _\bs_\bu_\bb_\bs_\bt_\br_\bi_\bn_\bg value provides functionality analo-
1310 gous to the %\b%?\b? job identifier (see J\bJO\bOB\bB C\bCO\bON\bNT\bTR\bRO\bOL\bL below). If set
1311 to any other value, the supplied string must be a prefix of a
1312 stopped job's name; this provides functionality analogous to the
1313 %\b%_\bs_\bt_\br_\bi_\bn_\bg job identifier.
1314 h\bhi\bis\bst\btc\bch\bha\bar\brs\bs
1315 The two or three characters which control history expansion and
1316 tokenization (see H\bHI\bIS\bST\bTO\bOR\bRY\bY E\bEX\bXP\bPA\bAN\bNS\bSI\bIO\bON\bN below). The first character
1317 is the _\bh_\bi_\bs_\bt_\bo_\br_\by _\be_\bx_\bp_\ba_\bn_\bs_\bi_\bo_\bn character, the character which signals
1318 the start of a history expansion, normally `!\b!'. The second
1319 character is the _\bq_\bu_\bi_\bc_\bk _\bs_\bu_\bb_\bs_\bt_\bi_\bt_\bu_\bt_\bi_\bo_\bn character, which is used as
1320 shorthand for re-running the previous command entered, substi-
1321 tuting one string for another in the command. The default is
1322 `^\b^'. The optional third character is the character which indi-
1323 cates that the remainder of the line is a comment when found as
1324 the first character of a word, normally `#\b#'. The history com-
1325 ment character causes history substitution to be skipped for the
1326 remaining words on the line. It does not necessarily cause the
1327 shell parser to treat the rest of the line as a comment.
1328
1329 A\bAr\brr\bra\bay\bys\bs
1330 B\bBa\bas\bsh\bh provides one-dimensional indexed and associative array variables.
1331 Any variable may be used as an indexed array; the d\bde\bec\bcl\bla\bar\bre\be builtin will
1332 explicitly declare an array. There is no maximum limit on the size of
1333 an array, nor any requirement that members be indexed or assigned con-
1334 tiguously. Indexed arrays are referenced using integers (including
1335 arithmetic expressions) and are zero-based; associative arrays are ref-
1336 erenced using arbitrary strings. Unless otherwise noted, indexed array
1337 indices must be non-negative integers.
1338
1339 An indexed array is created automatically if any variable is assigned
1340 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
1341 an arithmetic expression that must evaluate to a number. To explicitly
1342 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\bM-\b-
1343 M\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_\b-
1344 _\bs_\bc_\br_\bi_\bp_\bt is ignored.
1345
1346 Associative arrays are created using d\bde\bec\bcl\bla\bar\bre\be -\b-A\bA _\bn_\ba_\bm_\be.
1347
1348 Attributes may be specified for an array variable using the d\bde\bec\bcl\bla\bar\bre\be and
1349 r\bre\bea\bad\bdo\bon\bnl\bly\by builtins. Each attribute applies to all members of an array.
1350
1351 Arrays are assigned to using compound assignments of the form
1352 _\bn_\ba_\bm_\be=(\b(value_\b1 ... value_\bn)\b), where each _\bv_\ba_\bl_\bu_\be is of the form [_\bs_\bu_\bb_\b-
1353 _\bs_\bc_\br_\bi_\bp_\bt]=_\bs_\bt_\br_\bi_\bn_\bg. Indexed array assignments do not require anything but
1354 _\bs_\bt_\br_\bi_\bn_\bg. When assigning to indexed arrays, if the optional brackets and
1355 subscript are supplied, that index is assigned to; otherwise the index
1356 of the element assigned is the last index assigned to by the statement
1357 plus one. Indexing starts at zero.
1358
1359 When assigning to an associative array, the subscript is required.
1360
1361 This syntax is also accepted by the d\bde\bec\bcl\bla\bar\bre\be builtin. Individual array
1362 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
1363 introduced above. When assigning to an indexed array, if _\bn_\ba_\bm_\be is sub-
1364 scripted by a negative number, that number is interpreted as relative
1365 to one greater than the maximum index of _\bn_\ba_\bm_\be, so negative indices
1366 count back from the end of the array, and an index of -1 references the
1367 last element.
1368
1369 Any element of an array may be referenced using ${_\bn_\ba_\bm_\be[_\bs_\bu_\bb_\bs_\bc_\br_\bi_\bp_\bt]}.
1370 The braces are required to avoid conflicts with pathname expansion. If
1371 _\bs_\bu_\bb_\bs_\bc_\br_\bi_\bp_\bt is @\b@ or *\b*, the word expands to all members of _\bn_\ba_\bm_\be. These
1372 subscripts differ only when the word appears within double quotes. If
1373 the word is double-quoted, ${_\bn_\ba_\bm_\be[*]} expands to a single word with the
1374 value of each array member separated by the first character of the I\bIF\bFS\bS
1375 special variable, and ${_\bn_\ba_\bm_\be[@]} expands each element of _\bn_\ba_\bm_\be to a sep-
1376 arate word. When there are no array members, ${_\bn_\ba_\bm_\be[@]} expands to
1377 nothing. If the double-quoted expansion occurs within a word, the
1378 expansion of the first parameter is joined with the beginning part of
1379 the original word, and the expansion of the last parameter is joined
1380 with the last part of the original word. This is analogous to the
1381 expansion of the special parameters *\b* and @\b@ (see S\bSp\bpe\bec\bci\bia\bal\bl P\bPa\bar\bra\bam\bme\bet\bte\ber\brs\bs
1382 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_\b-
1383 _\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 ele-
1384 ments in the array. If the _\bs_\bu_\bb_\bs_\bc_\br_\bi_\bp_\bt used to reference an element of
1385 an indexed array evaluates to a number less than zero, it is inter-
1386 preted as relative to one greater than the maximum index of the array,
1387 so negative indices count back from the end of the array, and an index
1388 of -1 references the last element.
1389
1390 Referencing an array variable without a subscript is equivalent to ref-
1391 erencing the array with a subscript of 0. Any reference to a variable
1392 using a valid subscript is legal, and b\bba\bas\bsh\bh will create an array if nec-
1393 essary.
1394
1395 An array variable is considered set if a subscript has been assigned a
1396 value. The null string is a valid value.
1397
1398 It is possible to obtain the keys (indices) of an array as well as the
1399 values. ${!\b!_\bn_\ba_\bm_\be[_\b@]} and ${!\b!_\bn_\ba_\bm_\be[_\b*]} expand to the indices assigned in
1400 array variable _\bn_\ba_\bm_\be. The treatment when in double quotes is similar to
1401 the expansion of the special parameters _\b@ and _\b* within double quotes.
1402
1403 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]
1404 destroys the array element at index _\bs_\bu_\bb_\bs_\bc_\br_\bi_\bp_\bt. Negative subscripts to
1405 indexed arrays are interpreted as described above. Care must be taken
1406 to avoid unwanted side effects caused by pathname expansion. u\bun\bns\bse\bet\bt
1407 _\bn_\ba_\bm_\be, where _\bn_\ba_\bm_\be is an array, or u\bun\bns\bse\bet\bt _\bn_\ba_\bm_\be[_\bs_\bu_\bb_\bs_\bc_\br_\bi_\bp_\bt], where _\bs_\bu_\bb_\bs_\bc_\br_\bi_\bp_\bt
1408 is *\b* or @\b@, removes the entire array.
1409
1410 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
1411 specify an indexed array and a -\b-A\bA option to specify an associative
1412 array. If both options are supplied, -\b-A\bA takes precedence. The r\bre\bea\bad\bd
1413 builtin accepts a -\b-a\ba option to assign a list of words read from the
1414 standard input to an array. The s\bse\bet\bt and d\bde\bec\bcl\bla\bar\bre\be builtins display array
1415 values in a way that allows them to be reused as assignments.
1416
1417 E\bEX\bXP\bPA\bAN\bNS\bSI\bIO\bON\bN
1418 Expansion is performed on the command line after it has been split into
1419 words. There are seven kinds of expansion performed: _\bb_\br_\ba_\bc_\be _\be_\bx_\bp_\ba_\bn_\bs_\bi_\bo_\bn,
1420 _\bt_\bi_\bl_\bd_\be _\be_\bx_\bp_\ba_\bn_\bs_\bi_\bo_\bn, _\bp_\ba_\br_\ba_\bm_\be_\bt_\be_\br _\ba_\bn_\bd _\bv_\ba_\br_\bi_\ba_\bb_\bl_\be _\be_\bx_\bp_\ba_\bn_\bs_\bi_\bo_\bn, _\bc_\bo_\bm_\bm_\ba_\bn_\bd _\bs_\bu_\bb_\bs_\bt_\bi_\bt_\bu_\b-
1421 _\bt_\bi_\bo_\bn, _\ba_\br_\bi_\bt_\bh_\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, and _\bp_\ba_\bt_\bh_\bn_\ba_\bm_\be _\be_\bx_\bp_\ba_\bn_\bs_\bi_\bo_\bn.
1422
1423 The order of expansions is: brace expansion; tilde expansion, parameter
1424 and variable expansion, arithmetic expansion, and command substitution
1425 (done in a left-to-right fashion); word splitting; and pathname expan-
1426 sion.
1427
1428 On systems that can support it, there is an additional expansion avail-
1429 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
1430 tilde, parameter, variable, and arithmetic expansion and command sub-
1431 stitution.
1432
1433 Only brace expansion, word splitting, and pathname expansion can change
1434 the number of words of the expansion; other expansions expand a single
1435 word to a single word. The only exceptions to this are the expansions
1436 of "$\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).
1437
1438 B\bBr\bra\bac\bce\be E\bEx\bxp\bpa\ban\bns\bsi\bio\bon\bn
1439 _\bB_\br_\ba_\bc_\be _\be_\bx_\bp_\ba_\bn_\bs_\bi_\bo_\bn is a mechanism by which arbitrary strings may be gener-
1440 ated. This mechanism is similar to _\bp_\ba_\bt_\bh_\bn_\ba_\bm_\be _\be_\bx_\bp_\ba_\bn_\bs_\bi_\bo_\bn, but the file-
1441 names generated need not exist. Patterns to be brace expanded take the
1442 form of an optional _\bp_\br_\be_\ba_\bm_\bb_\bl_\be, followed by either a series of comma-sep-
1443 arated strings or a sequence expression between a pair of braces, fol-
1444 lowed by an optional _\bp_\bo_\bs_\bt_\bs_\bc_\br_\bi_\bp_\bt. The preamble is prefixed to each
1445 string contained within the braces, and the postscript is then appended
1446 to each resulting string, expanding left to right.
1447
1448 Brace expansions may be nested. The results of each expanded string
1449 are not sorted; left to right order is preserved. For example,
1450 a{\b{d,c,b}\b}e expands into `ade ace abe'.
1451
1452 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
1453 either integers or single characters, and _\bi_\bn_\bc_\br, an optional increment,
1454 is an integer. When integers are supplied, the expression expands to
1455 each number between _\bx and _\by, inclusive. Supplied integers may be pre-
1456 fixed with _\b0 to force each term to have the same width. When either _\bx
1457 or _\by begins with a zero, the shell attempts to force all generated
1458 terms to contain the same number of digits, zero-padding where neces-
1459 sary. When characters are supplied, the expression expands to each
1460 character lexicographically between _\bx and _\by, inclusive, using the
1461 default C locale. Note that both _\bx and _\by must be of the same type.
1462 When the increment is supplied, it is used as the difference between
1463 each term. The default increment is 1 or -1 as appropriate.
1464
1465 Brace expansion is performed before any other expansions, and any char-
1466 acters special to other expansions are preserved in the result. It is
1467 strictly textual. B\bBa\bas\bsh\bh does not apply any syntactic interpretation to
1468 the context of the expansion or the text between the braces.
1469
1470 A correctly-formed brace expansion must contain unquoted opening and
1471 closing braces, and at least one unquoted comma or a valid sequence
1472 expression. Any incorrectly formed brace expansion is left unchanged.
1473 A {\b{ or ,\b, may be quoted with a backslash to prevent its being considered
1474 part of a brace expression. To avoid conflicts with parameter expan-
1475 sion, the string $\b${\b{ is not considered eligible for brace expansion.
1476
1477 This construct is typically used as shorthand when the common prefix of
1478 the strings to be generated is longer than in the above example:
1479
1480 mkdir /usr/local/src/bash/{old,new,dist,bugs}
1481 or
1482 chown root /usr/{ucb/{ex,edit},lib/{ex?.?*,how_ex}}
1483
1484 Brace expansion introduces a slight incompatibility with historical
1485 versions of s\bsh\bh. s\bsh\bh does not treat opening or closing braces specially
1486 when they appear as part of a word, and preserves them in the output.
1487 B\bBa\bas\bsh\bh removes braces from words as a consequence of brace expansion.
1488 For example, a word entered to s\bsh\bh as _\bf_\bi_\bl_\be_\b{_\b1_\b,_\b2_\b} appears identically in
1489 the output. The same word is output as _\bf_\bi_\bl_\be_\b1 _\bf_\bi_\bl_\be_\b2 after expansion by
1490 b\bba\bas\bsh\bh. If strict compatibility with s\bsh\bh is desired, start b\bba\bas\bsh\bh with the
1491 +\b+B\bB option or disable brace expansion with the +\b+B\bB option to the s\bse\bet\bt com-
1492 mand (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).
1493
1494 T\bTi\bil\bld\bde\be E\bEx\bxp\bpa\ban\bns\bsi\bio\bon\bn
1495 If a word begins with an unquoted tilde character (`~\b~'), all of the
1496 characters preceding the first unquoted slash (or all characters, if
1497 there is no unquoted slash) are considered a _\bt_\bi_\bl_\bd_\be_\b-_\bp_\br_\be_\bf_\bi_\bx. If none of
1498 the characters in the tilde-prefix are quoted, the characters in the
1499 tilde-prefix following the tilde are treated as a possible _\bl_\bo_\bg_\bi_\bn _\bn_\ba_\bm_\be.
1500 If this login name is the null string, the tilde is replaced with the
1501 value of the shell parameter H\bHO\bOM\bME\bE. If H\bHO\bOM\bME\bE is unset, the home direc-
1502 tory of the user executing the shell is substituted instead. Other-
1503 wise, the tilde-prefix is replaced with the home directory associated
1504 with the specified login name.
1505
1506 If the tilde-prefix is a `~+', the value of the shell variable P\bPW\bWD\bD
1507 replaces the tilde-prefix. If the tilde-prefix is a `~-', the value of
1508 the shell variable O\bOL\bLD\bDP\bPW\bWD\bD, if it is set, is substituted. If the char-
1509 acters following the tilde in the tilde-prefix consist of a number _\bN,
1510 optionally prefixed by a `+' or a `-', the tilde-prefix is replaced
1511 with the corresponding element from the directory stack, as it would be
1512 displayed by the d\bdi\bir\brs\bs builtin invoked with the tilde-prefix as an argu-
1513 ment. If the characters following the tilde in the tilde-prefix con-
1514 sist of a number without a leading `+' or `-', `+' is assumed.
1515
1516 If the login name is invalid, or the tilde expansion fails, the word is
1517 unchanged.
1518
1519 Each variable assignment is checked for unquoted tilde-prefixes immedi-
1520 ately following a :\b: or the first =\b=. In these cases, tilde expansion is
1521 also performed. Consequently, one may use filenames with tildes in
1522 assignments 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
1523 expanded value.
1524
1525 P\bPa\bar\bra\bam\bme\bet\bte\ber\br E\bEx\bxp\bpa\ban\bns\bsi\bio\bon\bn
1526 The `$\b$' character introduces parameter expansion, command substitution,
1527 or arithmetic expansion. The parameter name or symbol to be expanded
1528 may be enclosed in braces, which are optional but serve to protect the
1529 variable to be expanded from characters immediately following it which
1530 could be interpreted as part of the name.
1531
1532 When braces are used, the matching ending brace is the first `}\b}' not
1533 escaped by a backslash or within a quoted string, and not within an
1534 embedded arithmetic expansion, command substitution, or parameter
1535 expansion.
1536
1537 ${_\bp_\ba_\br_\ba_\bm_\be_\bt_\be_\br}
1538 The value of _\bp_\ba_\br_\ba_\bm_\be_\bt_\be_\br is substituted. The braces are required
1539 when _\bp_\ba_\br_\ba_\bm_\be_\bt_\be_\br is a positional parameter with more than one
1540 digit, or when _\bp_\ba_\br_\ba_\bm_\be_\bt_\be_\br is followed by a character which is not
1541 to be interpreted as part of its name. The _\bp_\ba_\br_\ba_\bm_\be_\bt_\be_\br is a shell
1542 parameter as described above P\bPA\bAR\bRA\bAM\bME\bET\bTE\bER\bRS\bS) or an array reference
1543 (A\bAr\brr\bra\bay\bys\bs).
1544
1545 If the first character of _\bp_\ba_\br_\ba_\bm_\be_\bt_\be_\br is an exclamation point (!\b!), and
1546 _\bp_\ba_\br_\ba_\bm_\be_\bt_\be_\br is not a _\bn_\ba_\bm_\be_\br_\be_\bf, it introduces a level of variable indirec-
1547 tion. B\bBa\bas\bsh\bh uses the value of the variable formed from the rest of
1548 _\bp_\ba_\br_\ba_\bm_\be_\bt_\be_\br as the name of the variable; this variable is then expanded
1549 and that value is used in the rest of the substitution, rather than the
1550 value of _\bp_\ba_\br_\ba_\bm_\be_\bt_\be_\br itself. This is known as _\bi_\bn_\bd_\bi_\br_\be_\bc_\bt _\be_\bx_\bp_\ba_\bn_\bs_\bi_\bo_\bn. If
1551 _\bp_\ba_\br_\ba_\bm_\be_\bt_\be_\br is a nameref, this expands to the name of the variable refer-
1552 enced by _\bp_\ba_\br_\ba_\bm_\be_\bt_\be_\br instead of performing the complete indirect expan-
1553 sion. The exceptions to this are the expansions of ${!\b!_\bp_\br_\be_\bf_\bi_\bx*\b*} and
1554 ${!\b!_\bn_\ba_\bm_\be[_\b@]} described below. The exclamation point must immediately
1555 follow the left brace in order to introduce indirection.
1556
1557 In each of the cases below, _\bw_\bo_\br_\bd is subject to tilde expansion, parame-
1558 ter expansion, command substitution, and arithmetic expansion.
1559
1560 When not performing substring expansion, using the forms documented
1561 below (e.g., :\b:-\b-), b\bba\bas\bsh\bh tests for a parameter that is unset or null.
1562 Omitting the colon results in a test only for a parameter that is
1563 unset.
1564
1565 ${_\bp_\ba_\br_\ba_\bm_\be_\bt_\be_\br:\b:-\b-_\bw_\bo_\br_\bd}
1566 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-
1567 sion of _\bw_\bo_\br_\bd is substituted. Otherwise, the value of _\bp_\ba_\br_\ba_\bm_\be_\bt_\be_\br
1568 is substituted.
1569 ${_\bp_\ba_\br_\ba_\bm_\be_\bt_\be_\br:\b:=\b=_\bw_\bo_\br_\bd}
1570 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
1571 expansion of _\bw_\bo_\br_\bd is assigned to _\bp_\ba_\br_\ba_\bm_\be_\bt_\be_\br. The value of _\bp_\ba_\br_\ba_\bm_\b-
1572 _\be_\bt_\be_\br is then substituted. Positional parameters and special
1573 parameters may not be assigned to in this way.
1574 ${_\bp_\ba_\br_\ba_\bm_\be_\bt_\be_\br:\b:?\b?_\bw_\bo_\br_\bd}
1575 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,
1576 the expansion of _\bw_\bo_\br_\bd (or a message to that effect if _\bw_\bo_\br_\bd is
1577 not present) is written to the standard error and the shell, if
1578 it is not interactive, exits. Otherwise, the value of _\bp_\ba_\br_\ba_\bm_\be_\bt_\be_\br
1579 is substituted.
1580 ${_\bp_\ba_\br_\ba_\bm_\be_\bt_\be_\br:\b:+\b+_\bw_\bo_\br_\bd}
1581 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
1582 substituted, otherwise the expansion of _\bw_\bo_\br_\bd is substituted.
1583 ${_\bp_\ba_\br_\ba_\bm_\be_\bt_\be_\br:\b:_\bo_\bf_\bf_\bs_\be_\bt}
1584 ${_\bp_\ba_\br_\ba_\bm_\be_\bt_\be_\br:\b:_\bo_\bf_\bf_\bs_\be_\bt:\b:_\bl_\be_\bn_\bg_\bt_\bh}
1585 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
1586 value of _\bp_\ba_\br_\ba_\bm_\be_\bt_\be_\br starting at the character specified by _\bo_\bf_\bf_\b-
1587 _\bs_\be_\bt. If _\bp_\ba_\br_\ba_\bm_\be_\bt_\be_\br is @\b@, an indexed array subscripted by @\b@ or *\b*,
1588 or an associative array name, the results differ as described
1589 below. If _\bl_\be_\bn_\bg_\bt_\bh is omitted, expands to the substring of the
1590 value of _\bp_\ba_\br_\ba_\bm_\be_\bt_\be_\br starting at the character specified by _\bo_\bf_\bf_\bs_\be_\bt
1591 and extending to the end of the value. _\bl_\be_\bn_\bg_\bt_\bh and _\bo_\bf_\bf_\bs_\be_\bt are
1592 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).
1593
1594 If _\bo_\bf_\bf_\bs_\be_\bt evaluates to a number less than zero, the value is
1595 used as an offset in characters from the end of the value of
1596 _\bp_\ba_\br_\ba_\bm_\be_\bt_\be_\br. If _\bl_\be_\bn_\bg_\bt_\bh evaluates to a number less than zero, it
1597 is interpreted as an offset in characters from the end of the
1598 value of _\bp_\ba_\br_\ba_\bm_\be_\bt_\be_\br rather than a number of characters, and the
1599 expansion is the characters between _\bo_\bf_\bf_\bs_\be_\bt and that result.
1600 Note that a negative offset must be separated from the colon by
1601 at least one space to avoid being confused with the :\b:-\b- expan-
1602 sion.
1603
1604 If _\bp_\ba_\br_\ba_\bm_\be_\bt_\be_\br is @\b@, the result is _\bl_\be_\bn_\bg_\bt_\bh positional parameters
1605 beginning at _\bo_\bf_\bf_\bs_\be_\bt. A negative _\bo_\bf_\bf_\bs_\be_\bt is taken relative to one
1606 greater than the greatest positional parameter, so an offset of
1607 -1 evaluates to the last positional parameter. It is an expan-
1608 sion error if _\bl_\be_\bn_\bg_\bt_\bh evaluates to a number less than zero.
1609
1610 If _\bp_\ba_\br_\ba_\bm_\be_\bt_\be_\br is an indexed array name subscripted by @ or *, the
1611 result is the _\bl_\be_\bn_\bg_\bt_\bh members of the array beginning with
1612 ${_\bp_\ba_\br_\ba_\bm_\be_\bt_\be_\br[_\bo_\bf_\bf_\bs_\be_\bt]}. A negative _\bo_\bf_\bf_\bs_\be_\bt is taken relative to
1613 one greater than the maximum index of the specified array. It
1614 is an expansion error if _\bl_\be_\bn_\bg_\bt_\bh evaluates to a number less than
1615 zero.
1616
1617 Substring expansion applied to an associative array produces
1618 undefined results.
1619
1620 Substring indexing is zero-based unless the positional parame-
1621 ters are used, in which case the indexing starts at 1 by
1622 default. If _\bo_\bf_\bf_\bs_\be_\bt is 0, and the positional parameters are
1623 used, $\b$0\b0 is prefixed to the list.
1624
1625 ${!\b!_\bp_\br_\be_\bf_\bi_\bx*\b*}
1626 ${!\b!_\bp_\br_\be_\bf_\bi_\bx@\b@}
1627 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
1628 names begin with _\bp_\br_\be_\bf_\bi_\bx, separated by the first character of the
1629 I\bIF\bFS\bS special variable. When _\b@ is used and the expansion appears
1630 within double quotes, each variable name expands to a separate
1631 word.
1632
1633 ${!\b!_\bn_\ba_\bm_\be[_\b@]}
1634 ${!\b!_\bn_\ba_\bm_\be[_\b*]}
1635 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
1636 the list of array indices (keys) assigned in _\bn_\ba_\bm_\be. If _\bn_\ba_\bm_\be is
1637 not an array, expands to 0 if _\bn_\ba_\bm_\be is set and null otherwise.
1638 When _\b@ is used and the expansion appears within double quotes,
1639 each key expands to a separate word.
1640
1641 ${#\b#_\bp_\ba_\br_\ba_\bm_\be_\bt_\be_\br}
1642 P\bPa\bar\bra\bam\bme\bet\bte\ber\br l\ble\ben\bng\bgt\bth\bh. The length in characters of the value of
1643 _\bp_\ba_\br_\ba_\bm_\be_\bt_\be_\br is substituted. If _\bp_\ba_\br_\ba_\bm_\be_\bt_\be_\br is *\b* or @\b@, the value
1644 substituted is the number of positional parameters. If _\bp_\ba_\br_\ba_\bm_\be_\b-
1645 _\bt_\be_\br is an array name subscripted by *\b* or @\b@, the value substi-
1646 tuted is the number of elements in the array. If _\bp_\ba_\br_\ba_\bm_\be_\bt_\be_\br is
1647 an indexed array name subscripted by a negative number, that
1648 number is interpreted as relative to one greater than the maxi-
1649 mum index of _\bp_\ba_\br_\ba_\bm_\be_\bt_\be_\br, so negative indices count back from the
1650 end of the array, and an index of -1 references the last ele-
1651 ment.
1652
1653 ${_\bp_\ba_\br_\ba_\bm_\be_\bt_\be_\br#\b#_\bw_\bo_\br_\bd}
1654 ${_\bp_\ba_\br_\ba_\bm_\be_\bt_\be_\br#\b##\b#_\bw_\bo_\br_\bd}
1655 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
1656 a pattern just as in pathname expansion. If the pattern matches
1657 the beginning of the value of _\bp_\ba_\br_\ba_\bm_\be_\bt_\be_\br, then the result of the
1658 expansion is the expanded value of _\bp_\ba_\br_\ba_\bm_\be_\bt_\be_\br with the shortest
1659 matching pattern (the ``#\b#'' case) or the longest matching pat-
1660 tern (the ``#\b##\b#'' case) deleted. If _\bp_\ba_\br_\ba_\bm_\be_\bt_\be_\br is @\b@ or *\b*, the
1661 pattern removal operation is applied to each positional parame-
1662 ter in turn, and the expansion is the resultant list. If _\bp_\ba_\br_\ba_\bm_\b-
1663 _\be_\bt_\be_\br is an array variable subscripted with @\b@ or *\b*, the pattern
1664 removal operation is applied to each member of the array in
1665 turn, and the expansion is the resultant list.
1666
1667 ${_\bp_\ba_\br_\ba_\bm_\be_\bt_\be_\br%\b%_\bw_\bo_\br_\bd}
1668 ${_\bp_\ba_\br_\ba_\bm_\be_\bt_\be_\br%\b%%\b%_\bw_\bo_\br_\bd}
1669 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
1670 a pattern just as in pathname expansion. If the pattern matches
1671 a trailing portion of the expanded value of _\bp_\ba_\br_\ba_\bm_\be_\bt_\be_\br, then the
1672 result of the expansion is the expanded value of _\bp_\ba_\br_\ba_\bm_\be_\bt_\be_\br with
1673 the shortest matching pattern (the ``%\b%'' case) or the longest
1674 matching pattern (the ``%\b%%\b%'' case) deleted. If _\bp_\ba_\br_\ba_\bm_\be_\bt_\be_\br is @\b@
1675 or *\b*, the pattern removal operation is applied to each posi-
1676 tional parameter in turn, and the expansion is the resultant
1677 list. If _\bp_\ba_\br_\ba_\bm_\be_\bt_\be_\br is an array variable subscripted with @\b@ or
1678 *\b*, the pattern removal operation is applied to each member of
1679 the array in turn, and the expansion is the resultant list.
1680
1681 ${_\bp_\ba_\br_\ba_\bm_\be_\bt_\be_\br/\b/_\bp_\ba_\bt_\bt_\be_\br_\bn/\b/_\bs_\bt_\br_\bi_\bn_\bg}
1682 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-
1683 tern just as in pathname expansion. _\bP_\ba_\br_\ba_\bm_\be_\bt_\be_\br is expanded and
1684 the longest match of _\bp_\ba_\bt_\bt_\be_\br_\bn against its value is replaced with
1685 _\bs_\bt_\br_\bi_\bn_\bg. If _\bp_\ba_\bt_\bt_\be_\br_\bn begins with /\b/, all matches of _\bp_\ba_\bt_\bt_\be_\br_\bn are
1686 replaced with _\bs_\bt_\br_\bi_\bn_\bg. Normally only the first match is
1687 replaced. If _\bp_\ba_\bt_\bt_\be_\br_\bn begins with #\b#, it must match at the begin-
1688 ning of the expanded value of _\bp_\ba_\br_\ba_\bm_\be_\bt_\be_\br. If _\bp_\ba_\bt_\bt_\be_\br_\bn begins with
1689 %\b%, it must match at the end of the expanded value of _\bp_\ba_\br_\ba_\bm_\be_\bt_\be_\br.
1690 If _\bs_\bt_\br_\bi_\bn_\bg is null, matches of _\bp_\ba_\bt_\bt_\be_\br_\bn are deleted and the /\b/ fol-
1691 lowing _\bp_\ba_\bt_\bt_\be_\br_\bn may be omitted. If the n\bno\boc\bca\bas\bse\bem\bma\bat\btc\bch\bh shell option
1692 is enabled, the match is performed without regard to the case of
1693 alphabetic characters. If _\bp_\ba_\br_\ba_\bm_\be_\bt_\be_\br is @\b@ or *\b*, the substitution
1694 operation is applied to each positional parameter in turn, and
1695 the expansion is the resultant list. If _\bp_\ba_\br_\ba_\bm_\be_\bt_\be_\br is an array
1696 variable subscripted with @\b@ or *\b*, the substitution operation is
1697 applied to each member of the array in turn, and the expansion
1698 is the resultant list.
1699
1700 ${_\bp_\ba_\br_\ba_\bm_\be_\bt_\be_\br^\b^_\bp_\ba_\bt_\bt_\be_\br_\bn}
1701 ${_\bp_\ba_\br_\ba_\bm_\be_\bt_\be_\br^\b^^\b^_\bp_\ba_\bt_\bt_\be_\br_\bn}
1702 ${_\bp_\ba_\br_\ba_\bm_\be_\bt_\be_\br,\b,_\bp_\ba_\bt_\bt_\be_\br_\bn}
1703 ${_\bp_\ba_\br_\ba_\bm_\be_\bt_\be_\br,\b,,\b,_\bp_\ba_\bt_\bt_\be_\br_\bn}
1704 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-
1705 betic characters in _\bp_\ba_\br_\ba_\bm_\be_\bt_\be_\br. The _\bp_\ba_\bt_\bt_\be_\br_\bn is expanded to pro-
1706 duce a pattern just as in pathname expansion. Each character in
1707 the expanded value of _\bp_\ba_\br_\ba_\bm_\be_\bt_\be_\br is tested against _\bp_\ba_\bt_\bt_\be_\br_\bn, and,
1708 if it matches the pattern, its case is converted. The pattern
1709 should not attempt to match more than one character. The ^\b^
1710 operator converts lowercase letters matching _\bp_\ba_\bt_\bt_\be_\br_\bn to upper-
1711 case; the ,\b, operator converts matching uppercase letters to low-
1712 ercase. The ^\b^^\b^ and ,\b,,\b, expansions convert each matched character
1713 in the expanded value; the ^\b^ and ,\b, expansions match and convert
1714 only the first character in the expanded value. If _\bp_\ba_\bt_\bt_\be_\br_\bn is
1715 omitted, it is treated like a ?\b?, which matches every character.
1716 If _\bp_\ba_\br_\ba_\bm_\be_\bt_\be_\br is @\b@ or *\b*, the case modification operation is
1717 applied to each positional parameter in turn, and the expansion
1718 is the resultant list. If _\bp_\ba_\br_\ba_\bm_\be_\bt_\be_\br is an array variable sub-
1719 scripted with @\b@ or *\b*, the case modification operation is applied
1720 to each member of the array in turn, and the expansion is the
1721 resultant list.
1722
1723 ${_\bp_\ba_\br_\ba_\bm_\be_\bt_\be_\br@\b@_\bo_\bp_\be_\br_\ba_\bt_\bo_\br}
1724 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-
1725 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
1726 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
1727 single letter:
1728
1729 Q\bQ The expansion is a string that is the value of _\bp_\ba_\br_\ba_\bm_\be_\bt_\be_\br
1730 quoted in a format that can be reused as input.
1731 E\bE The expansion is a string that is the value of _\bp_\ba_\br_\ba_\bm_\be_\bt_\be_\br
1732 with backslash escape sequences expanded as with the
1733 $\b$'\b'.\b..\b..\b.'\b' quoting mechansim.
1734 P\bP The expansion is a string that is the result of expanding
1735 the value of _\bp_\ba_\br_\ba_\bm_\be_\bt_\be_\br as if it were a prompt string (see
1736 P\bPR\bRO\bOM\bMP\bPT\bTI\bIN\bNG\bG below).
1737 A\bA The expansion is a string in the form of an assignment
1738 statement or d\bde\bec\bcl\bla\bar\bre\be command that, if evaluated, will
1739 recreate _\bp_\ba_\br_\ba_\bm_\be_\bt_\be_\br with its attributes and value.
1740 a\ba The expansion is a string consisting of flag values rep-
1741 resenting _\bp_\ba_\br_\ba_\bm_\be_\bt_\be_\br's attributes.
1742
1743 If _\bp_\ba_\br_\ba_\bm_\be_\bt_\be_\br is @\b@ or *\b*, the operation is applied to each posi-
1744 tional parameter in turn, and the expansion is the resultant
1745 list. If _\bp_\ba_\br_\ba_\bm_\be_\bt_\be_\br is an array variable subscripted with @\b@ or
1746 *\b*, the case modification operation is applied to each member of
1747 the array in turn, and the expansion is the resultant list.
1748
1749 The result of the expansion is subject to word splitting and
1750 pathname expansion as described below.
1751
1752 C\bCo\bom\bmm\bma\ban\bnd\bd S\bSu\bub\bbs\bst\bti\bit\btu\but\bti\bio\bon\bn
1753 _\bC_\bo_\bm_\bm_\ba_\bn_\bd _\bs_\bu_\bb_\bs_\bt_\bi_\bt_\bu_\bt_\bi_\bo_\bn allows the output of a command to replace the com-
1754 mand name. There are two forms:
1755
1756 $\b$(\b(_\bc_\bo_\bm_\bm_\ba_\bn_\bd)\b)
1757 or
1758 `\b`_\bc_\bo_\bm_\bm_\ba_\bn_\bd`\b`
1759
1760 B\bBa\bas\bsh\bh performs the expansion by executing _\bc_\bo_\bm_\bm_\ba_\bn_\bd and replacing the com-
1761 mand substitution with the standard output of the command, with any
1762 trailing newlines deleted. Embedded newlines are not deleted, but they
1763 may be removed during word splitting. The command substitution $\b$(\b(c\bca\bat\bt
1764 _\bf_\bi_\bl_\be)\b) can be replaced by the equivalent but faster $\b$(\b(<\b< _\bf_\bi_\bl_\be)\b).
1765
1766 When the old-style backquote form of substitution is used, backslash
1767 retains its literal meaning except when followed by $\b$, `\b`, or \\b\. The
1768 first backquote not preceded by a backslash terminates the command sub-
1769 stitution. When using the $(_\bc_\bo_\bm_\bm_\ba_\bn_\bd) form, all characters between the
1770 parentheses make up the command; none are treated specially.
1771
1772 Command substitutions may be nested. To nest when using the backquoted
1773 form, escape the inner backquotes with backslashes.
1774
1775 If the substitution appears within double quotes, word splitting and
1776 pathname expansion are not performed on the results.
1777
1778 A\bAr\bri\bit\bth\bhm\bme\bet\bti\bic\bc E\bEx\bxp\bpa\ban\bns\bsi\bio\bon\bn
1779 Arithmetic expansion allows the evaluation of an arithmetic expression
1780 and the substitution of the result. The format for arithmetic expan-
1781 sion is:
1782
1783 $\b$(\b((\b(_\be_\bx_\bp_\br_\be_\bs_\bs_\bi_\bo_\bn)\b))\b)
1784
1785 The _\be_\bx_\bp_\br_\be_\bs_\bs_\bi_\bo_\bn is treated as if it were within double quotes, but a
1786 double quote inside the parentheses is not treated specially. All
1787 tokens in the expression undergo parameter and variable expansion, com-
1788 mand substitution, and quote removal. The result is treated as the
1789 arithmetic expression to be evaluated. Arithmetic expansions may be
1790 nested.
1791
1792 The evaluation is performed according to the rules listed below under
1793 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
1794 indicating failure and no substitution occurs.
1795
1796 P\bPr\bro\boc\bce\bes\bss\bs S\bSu\bub\bbs\bst\bti\bit\btu\but\bti\bio\bon\bn
1797 _\bP_\br_\bo_\bc_\be_\bs_\bs _\bs_\bu_\bb_\bs_\bt_\bi_\bt_\bu_\bt_\bi_\bo_\bn is supported on systems that support named pipes
1798 (_\bF_\bI_\bF_\bO_\bs) or the /\b/d\bde\bev\bv/\b/f\bfd\bd method of naming open files. It takes the form
1799 of <\b<(\b(_\bl_\bi_\bs_\bt)\b) or >\b>(\b(_\bl_\bi_\bs_\bt)\b). The process _\bl_\bi_\bs_\bt is run with its input or out-
1800 put connected to a _\bF_\bI_\bF_\bO or some file in /\b/d\bde\bev\bv/\b/f\bfd\bd. The name of this file
1801 is passed as an argument to the current command as the result of the
1802 expansion. If the >\b>(\b(_\bl_\bi_\bs_\bt)\b) form is used, writing to the file will pro-
1803 vide input for _\bl_\bi_\bs_\bt. If the <\b<(\b(_\bl_\bi_\bs_\bt)\b) form is used, the file passed as
1804 an argument should be read to obtain the output of _\bl_\bi_\bs_\bt.
1805
1806 When available, process substitution is performed simultaneously with
1807 parameter and variable expansion, command substitution, and arithmetic
1808 expansion.
1809
1810 W\bWo\bor\brd\bd S\bSp\bpl\bli\bit\btt\bti\bin\bng\bg
1811 The shell scans the results of parameter expansion, command substitu-
1812 tion, and arithmetic expansion that did not occur within double quotes
1813 for _\bw_\bo_\br_\bd _\bs_\bp_\bl_\bi_\bt_\bt_\bi_\bn_\bg.
1814
1815 The shell treats each character of I\bIF\bFS\bS as a delimiter, and splits the
1816 results of the other expansions into words using these characters as
1817 field terminators. If I\bIF\bFS\bS is unset, or its value is exactly
1818 <\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 default, then sequences of <\b<s\bsp\bpa\bac\bce\be>\b>, <\b<t\bta\bab\bb>\b>,
1819 and <\b<n\bne\bew\bwl\bli\bin\bne\be>\b> at the beginning and end of the results of the previous
1820 expansions are ignored, and any sequence of I\bIF\bFS\bS characters not at the
1821 beginning or end serves to delimit words. If I\bIF\bFS\bS has a value other
1822 than the default, then sequences of the whitespace characters s\bsp\bpa\bac\bce\be and
1823 t\bta\bab\bb are ignored at the beginning and end of the word, as long as the
1824 whitespace character is in the value of I\bIF\bFS\bS (an I\bIF\bFS\bS whitespace charac-
1825 ter). Any character in I\bIF\bFS\bS that is not I\bIF\bFS\bS whitespace, along with any
1826 adjacent I\bIF\bFS\bS whitespace characters, delimits a field. A sequence of
1827 I\bIF\bFS\bS whitespace characters is also treated as a delimiter. If the value
1828 of I\bIF\bFS\bS is null, no word splitting occurs.
1829
1830 Explicit null arguments ("\b""\b" or '\b''\b') are retained. Unquoted implicit
1831 null arguments, resulting from the expansion of parameters that have no
1832 values, are removed. If a parameter with no value is expanded within
1833 double quotes, a null argument results and is retained.
1834
1835 Note that if no expansion occurs, no splitting is performed.
1836
1837 P\bPa\bat\bth\bhn\bna\bam\bme\be E\bEx\bxp\bpa\ban\bns\bsi\bio\bon\bn
1838 After word splitting, unless the -\b-f\bf option has been set, b\bba\bas\bsh\bh scans
1839 each word for the characters *\b*, ?\b?, and [\b[. If one of these characters
1840 appears, then the word is regarded as a _\bp_\ba_\bt_\bt_\be_\br_\bn, and replaced with an
1841 alphabetically sorted list of filenames matching the pattern (see P\bPa\bat\bt-\b-
1842 t\bte\ber\brn\bn M\bMa\bat\btc\bch\bhi\bin\bng\bg below). If no matching filenames are found, and the
1843 shell option n\bnu\bul\bll\blg\bgl\blo\bob\bb is not enabled, the word is left unchanged. If
1844 the n\bnu\bul\bll\blg\bgl\blo\bob\bb option is set, and no matches are found, the word is
1845 removed. If the f\bfa\bai\bil\blg\bgl\blo\bob\bb shell option is set, and no matches are
1846 found, an error message is printed and the command is not executed. If
1847 the shell option n\bno\boc\bca\bas\bse\beg\bgl\blo\bob\bb is enabled, the match is performed without
1848 regard to the case of alphabetic characters. When a pattern is used
1849 for pathname expansion, the character `\b``\b`.\b.'\b''\b' at the start of a name or
1850 immediately following a slash must be matched explicitly, unless the
1851 shell option d\bdo\bot\btg\bgl\blo\bob\bb is set. When matching a pathname, the slash char-
1852 acter must always be matched explicitly. In other cases, the `\b``\b`.\b.'\b''\b'
1853 character is not treated specially. See the description of s\bsh\bho\bop\bpt\bt below
1854 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\bl-\b-
1855 g\bgl\blo\bob\bb, f\bfa\bai\bil\blg\bgl\blo\bob\bb, and d\bdo\bot\btg\bgl\blo\bob\bb shell options.
1856
1857 The G\bGL\bLO\bOB\bBI\bIG\bGN\bNO\bOR\bRE\bE shell variable may be used to restrict the set of file-
1858 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 filename
1859 that also matches one of the patterns in G\bGL\bLO\bOB\bBI\bIG\bGN\bNO\bOR\bRE\bE is removed from the
1860 list of matches. If the n\bno\boc\bca\bas\bse\beg\bgl\blo\bob\bb option is set, the matching against
1861 the patterns in G\bGL\bLO\bOB\bBI\bIG\bGN\bNO\bOR\bRE\bE is performed without regard to case. The
1862 filenames `\b``\b`.\b.'\b''\b' and `\b``\b`.\b..\b.'\b''\b' are always ignored when G\bGL\bLO\bOB\bBI\bIG\bGN\bNO\bOR\bRE\bE is set
1863 and not null. However, setting G\bGL\bLO\bOB\bBI\bIG\bGN\bNO\bOR\bRE\bE to a non-null value has the
1864 effect of enabling the d\bdo\bot\btg\bgl\blo\bob\bb shell option, so all other filenames
1865 beginning with a `\b``\b`.\b.'\b''\b' will match. To get the old behavior of ignor-
1866 ing filenames beginning with a `\b``\b`.\b.'\b''\b', make `\b``\b`.\b.*\b*'\b''\b' one of the patterns
1867 in G\bGL\bLO\bOB\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
1868 unset.
1869
1870 P\bPa\bat\btt\bte\ber\brn\bn M\bMa\bat\btc\bch\bhi\bin\bng\bg
1871
1872 Any character that appears in a pattern, other than the special pattern
1873 characters described below, matches itself. The NUL character may not
1874 occur in a pattern. A backslash escapes the following character; the
1875 escaping backslash is discarded when matching. The special pattern
1876 characters must be quoted if they are to be matched literally.
1877
1878 The special pattern characters have the following meanings:
1879
1880 *\b* Matches any string, including the null string. When the
1881 g\bgl\blo\bob\bbs\bst\bta\bar\br shell option is enabled, and *\b* is used in a
1882 pathname expansion context, two adjacent *\b*s used as a
1883 single pattern will match all files and zero or more
1884 directories and subdirectories. If followed by a /\b/, two
1885 adjacent *\b*s will match only directories and subdirecto-
1886 ries.
1887 ?\b? Matches any single character.
1888 [\b[.\b..\b..\b.]\b] Matches any one of the enclosed characters. A pair of
1889 characters separated by a hyphen denotes a _\br_\ba_\bn_\bg_\be _\be_\bx_\bp_\br_\be_\bs_\b-
1890 _\bs_\bi_\bo_\bn; any character that falls between those two charac-
1891 ters, inclusive, using the current locale's collating
1892 sequence and character set, is matched. If the first
1893 character following the [\b[ is a !\b! or a ^\b^ then any charac-
1894 ter not enclosed is matched. The sorting order of char-
1895 acters in range expressions is determined by the current
1896 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
1897 variables, if set. To obtain the traditional interpreta-
1898 tion of range expressions, where [\b[a\ba-\b-d\bd]\b] is equivalent to
1899 [\b[a\bab\bbc\bcd\bd]\b], set value of the L\bLC\bC_\b_A\bAL\bLL\bL shell variable to C\bC, or
1900 enable the g\bgl\blo\bob\bba\bas\bsc\bci\bii\bir\bra\ban\bng\bge\bes\bs shell option. A -\b- may be
1901 matched by including it as the first or last character in
1902 the set. A ]\b] may be matched by including it as the first
1903 character in the set.
1904
1905 Within [\b[ and ]\b], _\bc_\bh_\ba_\br_\ba_\bc_\bt_\be_\br _\bc_\bl_\ba_\bs_\bs_\be_\bs can be specified using
1906 the syntax [\b[:\b:_\bc_\bl_\ba_\bs_\bs:\b:]\b], where _\bc_\bl_\ba_\bs_\bs is one of the following
1907 classes defined in the POSIX standard:
1908 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
1909 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
1910 A character class matches any character belonging to that
1911 class. The w\bwo\bor\brd\bd character class matches letters, digits,
1912 and the character _.
1913
1914 Within [\b[ and ]\b], an _\be_\bq_\bu_\bi_\bv_\ba_\bl_\be_\bn_\bc_\be _\bc_\bl_\ba_\bs_\bs can be specified
1915 using the syntax [\b[=\b=_\bc=\b=]\b], which matches all characters with
1916 the same collation weight (as defined by the current
1917 locale) as the character _\bc.
1918
1919 Within [\b[ and ]\b], the syntax [\b[.\b._\bs_\by_\bm_\bb_\bo_\bl.\b.]\b] matches the collat-
1920 ing symbol _\bs_\by_\bm_\bb_\bo_\bl.
1921
1922 If the e\bex\bxt\btg\bgl\blo\bob\bb shell option is enabled using the s\bsh\bho\bop\bpt\bt builtin, several
1923 extended pattern matching operators are recognized. In the following
1924 description, a _\bp_\ba_\bt_\bt_\be_\br_\bn_\b-_\bl_\bi_\bs_\bt is a list of one or more patterns separated
1925 by a |\b|. Composite patterns may be formed using one or more of the fol-
1926 lowing sub-patterns:
1927
1928 ?\b?(\b(_\bp_\ba_\bt_\bt_\be_\br_\bn_\b-_\bl_\bi_\bs_\bt)\b)
1929 Matches zero or one occurrence of the given patterns
1930 *\b*(\b(_\bp_\ba_\bt_\bt_\be_\br_\bn_\b-_\bl_\bi_\bs_\bt)\b)
1931 Matches zero or more occurrences of the given patterns
1932 +\b+(\b(_\bp_\ba_\bt_\bt_\be_\br_\bn_\b-_\bl_\bi_\bs_\bt)\b)
1933 Matches one or more occurrences of the given patterns
1934 @\b@(\b(_\bp_\ba_\bt_\bt_\be_\br_\bn_\b-_\bl_\bi_\bs_\bt)\b)
1935 Matches one of the given patterns
1936 !\b!(\b(_\bp_\ba_\bt_\bt_\be_\br_\bn_\b-_\bl_\bi_\bs_\bt)\b)
1937 Matches anything except one of the given patterns
1938
1939 Q\bQu\buo\bot\bte\be R\bRe\bem\bmo\bov\bva\bal\bl
1940 After the preceding expansions, all unquoted occurrences of the charac-
1941 ters \\b\, '\b', and "\b" that did not result from one of the above expansions
1942 are removed.
1943
1944 R\bRE\bED\bDI\bIR\bRE\bEC\bCT\bTI\bIO\bON\bN
1945 Before a command is executed, its input and output may be _\br_\be_\bd_\bi_\br_\be_\bc_\bt_\be_\bd
1946 using a special notation interpreted by the shell. Redirection allows
1947 commands' file handles to be duplicated, opened, closed, made to refer
1948 to different files, and can change the files the command reads from and
1949 writes to. Redirection may also be used to modify file handles in the
1950 current shell execution environment. The following redirection opera-
1951 tors may precede or appear anywhere within a _\bs_\bi_\bm_\bp_\bl_\be _\bc_\bo_\bm_\bm_\ba_\bn_\bd or may fol-
1952 low a _\bc_\bo_\bm_\bm_\ba_\bn_\bd. Redirections are processed in the order they appear,
1953 from left to right.
1954
1955 Each redirection that may be preceded by a file descriptor number may
1956 instead be preceded by a word of the form {_\bv_\ba_\br_\bn_\ba_\bm_\be}. In this case, for
1957 each redirection operator except >&- and <&-, the shell will allocate a
1958 file descriptor greater than or equal to 10 and assign it to _\bv_\ba_\br_\bn_\ba_\bm_\be.
1959 If >&- or <&- is preceded by {_\bv_\ba_\br_\bn_\ba_\bm_\be}, the value of _\bv_\ba_\br_\bn_\ba_\bm_\be defines
1960 the file descriptor to close.
1961
1962 In the following descriptions, if the file descriptor number is omit-
1963 ted, and the first character of the redirection operator is <\b<, the re-
1964 direction refers to the standard input (file descriptor 0). If the
1965 first character of the redirection operator is >\b>, the redirection
1966 refers to the standard output (file descriptor 1).
1967
1968 The word following the redirection operator in the following descrip-
1969 tions, unless otherwise noted, is subjected to brace expansion, tilde
1970 expansion, parameter and variable expansion, command substitution,
1971 arithmetic expansion, quote removal, pathname expansion, and word
1972 splitting. If it expands to more than one word, b\bba\bas\bsh\bh reports an error.
1973
1974 Note that the order of redirections is significant. For example, the
1975 command
1976
1977 ls >\b> dirlist 2>\b>&\b&1
1978
1979 directs both standard output and standard error to the file _\bd_\bi_\br_\bl_\bi_\bs_\bt,
1980 while the command
1981
1982 ls 2>\b>&\b&1 >\b> dirlist
1983
1984 directs only the standard output to file _\bd_\bi_\br_\bl_\bi_\bs_\bt, because the standard
1985 error was duplicated from the standard output before the standard out-
1986 put was redirected to _\bd_\bi_\br_\bl_\bi_\bs_\bt.
1987
1988 B\bBa\bas\bsh\bh handles several filenames specially when they are used in redirec-
1989 tions, as described in the following table:
1990
1991 /\b/d\bde\bev\bv/\b/f\bfd\bd/\b/_\bf_\bd
1992 If _\bf_\bd is a valid integer, file descriptor _\bf_\bd is dupli-
1993 cated.
1994 /\b/d\bde\bev\bv/\b/s\bst\btd\bdi\bin\bn
1995 File descriptor 0 is duplicated.
1996 /\b/d\bde\bev\bv/\b/s\bst\btd\bdo\bou\but\bt
1997 File descriptor 1 is duplicated.
1998 /\b/d\bde\bev\bv/\b/s\bst\btd\bde\ber\brr\br
1999 File descriptor 2 is duplicated.
2000 /\b/d\bde\bev\bv/\b/t\btc\bcp\bp/\b/_\bh_\bo_\bs_\bt/\b/_\bp_\bo_\br_\bt
2001 If _\bh_\bo_\bs_\bt is a valid hostname or Internet address, and _\bp_\bo_\br_\bt
2002 is an integer port number or service name, b\bba\bas\bsh\bh attempts
2003 to open the corresponding TCP socket.
2004 /\b/d\bde\bev\bv/\b/u\bud\bdp\bp/\b/_\bh_\bo_\bs_\bt/\b/_\bp_\bo_\br_\bt
2005 If _\bh_\bo_\bs_\bt is a valid hostname or Internet address, and _\bp_\bo_\br_\bt
2006 is an integer port number or service name, b\bba\bas\bsh\bh attempts
2007 to open the corresponding UDP socket.
2008
2009 A failure to open or create a file causes the redirection to fail.
2010
2011 Redirections using file descriptors greater than 9 should be used with
2012 care, as they may conflict with file descriptors the shell uses inter-
2013 nally.
2014
2015 R\bRe\bed\bdi\bir\bre\bec\bct\bti\bin\bng\bg I\bIn\bnp\bpu\but\bt
2016 Redirection of input causes the file whose name results from the expan-
2017 sion of _\bw_\bo_\br_\bd to be opened for reading on file descriptor _\bn, or the
2018 standard input (file descriptor 0) if _\bn is not specified.
2019
2020 The general format for redirecting input is:
2021
2022 [_\bn]<\b<_\bw_\bo_\br_\bd
2023
2024 R\bRe\bed\bdi\bir\bre\bec\bct\bti\bin\bng\bg O\bOu\but\btp\bpu\but\bt
2025 Redirection of output causes the file whose name results from the
2026 expansion of _\bw_\bo_\br_\bd to be opened for writing on file descriptor _\bn, or the
2027 standard output (file descriptor 1) if _\bn is not specified. If the file
2028 does not exist it is created; if it does exist it is truncated to zero
2029 size.
2030
2031 The general format for redirecting output is:
2032
2033 [_\bn]>\b>_\bw_\bo_\br_\bd
2034
2035 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
2036 builtin has been enabled, the redirection will fail if the file whose
2037 name results from the expansion of _\bw_\bo_\br_\bd exists and is a regular file.
2038 If the redirection operator is >\b>|\b|, or the redirection operator is >\b> and
2039 the n\bno\boc\bcl\blo\bob\bbb\bbe\ber\br option to the s\bse\bet\bt builtin command is not enabled, the re-
2040 direction is attempted even if the file named by _\bw_\bo_\br_\bd exists.
2041
2042 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
2043 Redirection of output in this fashion causes the file whose name
2044 results from the expansion of _\bw_\bo_\br_\bd to be opened for appending on file
2045 descriptor _\bn, or the standard output (file descriptor 1) if _\bn is not
2046 specified. If the file does not exist it is created.
2047
2048 The general format for appending output is:
2049
2050 [_\bn]>\b>>\b>_\bw_\bo_\br_\bd
2051
2052 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
2053 This construct allows both the standard output (file descriptor 1) and
2054 the standard error output (file descriptor 2) to be redirected to the
2055 file whose name is the expansion of _\bw_\bo_\br_\bd.
2056
2057 There are two formats for redirecting standard output and standard
2058 error:
2059
2060 &\b&>\b>_\bw_\bo_\br_\bd
2061 and
2062 >\b>&\b&_\bw_\bo_\br_\bd
2063
2064 Of the two forms, the first is preferred. This is semantically equiva-
2065 lent to
2066
2067 >\b>_\bw_\bo_\br_\bd 2>\b>&\b&1
2068
2069 When using the second form, _\bw_\bo_\br_\bd may not expand to a number or -\b-. If
2070 it does, other redirection operators apply (see D\bDu\bup\bpl\bli\bic\bca\bat\bti\bin\bng\bg F\bFi\bil\ble\be
2071 D\bDe\bes\bsc\bcr\bri\bip\bpt\bto\bor\brs\bs below) for compatibility reasons.
2072
2073 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
2074 This construct allows both the standard output (file descriptor 1) and
2075 the standard error output (file descriptor 2) to be appended to the
2076 file whose name is the expansion of _\bw_\bo_\br_\bd.
2077
2078 The format for appending standard output and standard error is:
2079
2080 &\b&>\b>>\b>_\bw_\bo_\br_\bd
2081
2082 This is semantically equivalent to
2083
2084 >\b>>\b>_\bw_\bo_\br_\bd 2>\b>&\b&1
2085
2086 (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).
2087
2088 H\bHe\ber\bre\be D\bDo\boc\bcu\bum\bme\ben\bnt\bts\bs
2089 This type of redirection instructs the shell to read input from the
2090 current source until a line containing only _\bd_\be_\bl_\bi_\bm_\bi_\bt_\be_\br (with no trailing
2091 blanks) is seen. All of the lines read up to that point are then used
2092 as the standard input (or file descriptor _\bn if _\bn is specified) for a
2093 command.
2094
2095 The format of here-documents is:
2096
2097 [_\bn]<\b<<\b<[-\b-]_\bw_\bo_\br_\bd
2098 _\bh_\be_\br_\be_\b-_\bd_\bo_\bc_\bu_\bm_\be_\bn_\bt
2099 _\bd_\be_\bl_\bi_\bm_\bi_\bt_\be_\br
2100
2101 No parameter and variable expansion, command substitution, arithmetic
2102 expansion, or pathname expansion is performed on _\bw_\bo_\br_\bd. If any charac-
2103 ters in _\bw_\bo_\br_\bd are quoted, the _\bd_\be_\bl_\bi_\bm_\bi_\bt_\be_\br is the result of quote removal
2104 on _\bw_\bo_\br_\bd, and the lines in the here-document are not expanded. If _\bw_\bo_\br_\bd
2105 is unquoted, all lines of the here-document are subjected to parameter
2106 expansion, command substitution, and arithmetic expansion, the charac-
2107 ter sequence \\b\<\b<n\bne\bew\bwl\bli\bin\bne\be>\b> is ignored, and \\b\ must be used to quote the
2108 characters \\b\, $\b$, and `\b`.
2109
2110 If the redirection operator is <\b<<\b<-\b-, then all leading tab characters are
2111 stripped from input lines and the line containing _\bd_\be_\bl_\bi_\bm_\bi_\bt_\be_\br. This
2112 allows here-documents within shell scripts to be indented in a natural
2113 fashion.
2114
2115 H\bHe\ber\bre\be S\bSt\btr\bri\bin\bng\bgs\bs
2116 A variant of here documents, the format is:
2117
2118 [_\bn]<\b<<\b<<\b<_\bw_\bo_\br_\bd
2119
2120 The _\bw_\bo_\br_\bd undergoes brace expansion, tilde expansion, parameter and
2121 variable expansion, command substitution, arithmetic expansion, and
2122 quote removal. Pathname expansion and word splitting are not per-
2123 formed. The result is supplied as a single string to the command on
2124 its standard input (or file descriptor _\bn if _\bn is specified).
2125
2126 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
2127 The redirection operator
2128
2129 [_\bn]<\b<&\b&_\bw_\bo_\br_\bd
2130
2131 is used to duplicate input file descriptors. If _\bw_\bo_\br_\bd expands to one or
2132 more digits, the file descriptor denoted by _\bn is made to be a copy of
2133 that file descriptor. If the digits in _\bw_\bo_\br_\bd do not specify a file
2134 descriptor open for input, a redirection error occurs. If _\bw_\bo_\br_\bd evalu-
2135 ates to -\b-, file descriptor _\bn is closed. If _\bn is not specified, the
2136 standard input (file descriptor 0) is used.
2137
2138 The operator
2139
2140 [_\bn]>\b>&\b&_\bw_\bo_\br_\bd
2141
2142 is used similarly to duplicate output file descriptors. If _\bn is not
2143 specified, the standard output (file descriptor 1) is used. If the
2144 digits in _\bw_\bo_\br_\bd do not specify a file descriptor open for output, a re-
2145 direction error occurs. If _\bw_\bo_\br_\bd evaluates to -\b-, file descriptor _\bn is
2146 closed. As a special case, if _\bn is omitted, and _\bw_\bo_\br_\bd does not expand
2147 to one or more digits or -\b-, the standard output and standard error are
2148 redirected as described previously.
2149
2150 M\bMo\bov\bvi\bin\bng\bg F\bFi\bil\ble\be D\bDe\bes\bsc\bcr\bri\bip\bpt\bto\bor\brs\bs
2151 The redirection operator
2152
2153 [_\bn]<\b<&\b&_\bd_\bi_\bg_\bi_\bt-\b-
2154
2155 moves the file descriptor _\bd_\bi_\bg_\bi_\bt to file descriptor _\bn, or the standard
2156 input (file descriptor 0) if _\bn is not specified. _\bd_\bi_\bg_\bi_\bt is closed after
2157 being duplicated to _\bn.
2158
2159 Similarly, the redirection operator
2160
2161 [_\bn]>\b>&\b&_\bd_\bi_\bg_\bi_\bt-\b-
2162
2163 moves the file descriptor _\bd_\bi_\bg_\bi_\bt to file descriptor _\bn, or the standard
2164 output (file descriptor 1) if _\bn is not specified.
2165
2166 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
2167 The redirection operator
2168
2169 [_\bn]<\b<>\b>_\bw_\bo_\br_\bd
2170
2171 causes the file whose name is the expansion of _\bw_\bo_\br_\bd to be opened for
2172 both reading and writing on file descriptor _\bn, or on file descriptor 0
2173 if _\bn is not specified. If the file does not exist, it is created.
2174
2175 A\bAL\bLI\bIA\bAS\bSE\bES\bS
2176 _\bA_\bl_\bi_\ba_\bs_\be_\bs allow a string to be substituted for a word when it is used as
2177 the first word of a simple command. The shell maintains a list of
2178 aliases that may be set and unset with the a\bal\bli\bia\bas\bs and u\bun\bna\bal\bli\bia\bas\bs builtin
2179 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). The first word of each
2180 simple command, if unquoted, is checked to see if it has an alias. If
2181 so, that word is replaced by the text of the alias. The characters /\b/,
2182 $\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
2183 listed above may not appear in an alias name. The replacement text may
2184 contain any valid shell input, including shell metacharacters. The
2185 first word of the replacement text is tested for aliases, but a word
2186 that is identical to an alias being expanded is not expanded a second
2187 time. This means that one may alias l\bls\bs to l\bls\bs -\b-F\bF, for instance, and
2188 b\bba\bas\bsh\bh does not try to recursively expand the replacement text. If the
2189 last character of the alias value is a _\bb_\bl_\ba_\bn_\bk, then the next command
2190 word following the alias is also checked for alias expansion.
2191
2192 Aliases are created and listed with the a\bal\bli\bia\bas\bs command, and removed with
2193 the u\bun\bna\bal\bli\bia\bas\bs command.
2194
2195 There is no mechanism for using arguments in the replacement text. If
2196 arguments are needed, a shell function should be used (see F\bFU\bUN\bNC\bCT\bTI\bIO\bON\bNS\bS
2197 below).
2198
2199 Aliases are not expanded when the shell is not interactive, unless the
2200 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
2201 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).
2202
2203 The rules concerning the definition and use of aliases are somewhat
2204 confusing. B\bBa\bas\bsh\bh always reads at least one complete line of input
2205 before executing any of the commands on that line. Aliases are
2206 expanded when a command is read, not when it is executed. Therefore,
2207 an alias definition appearing on the same line as another command does
2208 not take effect until the next line of input is read. The commands
2209 following the alias definition on that line are not affected by the new
2210 alias. This behavior is also an issue when functions are executed.
2211 Aliases are expanded when a function definition is read, not when the
2212 function is executed, because a function definition is itself a com-
2213 mand. As a consequence, aliases defined in a function are not avail-
2214 able until after that function is executed. To be safe, always put
2215 alias definitions on a separate line, and do not use a\bal\bli\bia\bas\bs in compound
2216 commands.
2217
2218 For almost every purpose, aliases are superseded by shell functions.
2219
2220 F\bFU\bUN\bNC\bCT\bTI\bIO\bON\bNS\bS
2221 A shell function, defined as described above under S\bSH\bHE\bEL\bLL\bL G\bGR\bRA\bAM\bMM\bMA\bAR\bR,
2222 stores a series of commands for later execution. When the name of a
2223 shell function is used as a simple command name, the list of commands
2224 associated with that function name is executed. Functions are executed
2225 in the context of the current shell; no new process is created to
2226 interpret them (contrast this with the execution of a shell script).
2227 When a function is executed, the arguments to the function become the
2228 positional parameters during its execution. The special parameter #\b# is
2229 updated to reflect the change. Special parameter 0\b0 is unchanged. The
2230 first element of the F\bFU\bUN\bNC\bCN\bNA\bAM\bME\bE variable is set to the name of the func-
2231 tion while the function is executing.
2232
2233 All other aspects of the shell execution environment are identical
2234 between a function and its caller with these exceptions: the D\bDE\bEB\bBU\bUG\bG and
2235 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
2236 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
2237 given the t\btr\bra\bac\bce\be attribute (see the description of the d\bde\bec\bcl\bla\bar\bre\be builtin
2238 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
2239 builtin (in which case all functions inherit the D\bDE\bEB\bBU\bUG\bG and R\bRE\bET\bTU\bUR\bRN\bN
2240 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
2241 option has been enabled.
2242
2243 Variables local to the function may be declared with the l\blo\boc\bca\bal\bl builtin
2244 command. Ordinarily, variables and their values are shared between the
2245 function and its caller.
2246
2247 The F\bFU\bUN\bNC\bCN\bNE\bES\bST\bT variable, if set to a numeric value greater than 0,
2248 defines a maximum function nesting level. Function invocations that
2249 exceed the limit cause the entire command to abort.
2250
2251 If the builtin command r\bre\bet\btu\bur\brn\bn is executed in a function, the function
2252 completes and execution resumes with the next command after the func-
2253 tion call. Any command associated with the R\bRE\bET\bTU\bUR\bRN\bN trap is executed
2254 before execution resumes. When a function completes, the values of the
2255 positional parameters and the special parameter #\b# are restored to the
2256 values they had prior to the function's execution.
2257
2258 Function names and definitions may be listed with the -\b-f\bf option to the
2259 d\bde\bec\bcl\bla\bar\bre\be or t\bty\byp\bpe\bes\bse\bet\bt builtin commands. The -\b-F\bF option to d\bde\bec\bcl\bla\bar\bre\be or t\bty\byp\bpe\be-\b-
2260 s\bse\bet\bt will list the function names only (and optionally the source file
2261 and line number, if the e\bex\bxt\btd\bde\beb\bbu\bug\bg shell option is enabled). Functions
2262 may be exported so that subshells automatically have them defined with
2263 the -\b-f\bf option to the e\bex\bxp\bpo\bor\brt\bt builtin. A function definition may be
2264 deleted using the -\b-f\bf option to the u\bun\bns\bse\bet\bt builtin. Note that shell
2265 functions and variables with the same name may result in multiple iden-
2266 tically-named entries in the environment passed to the shell's chil-
2267 dren. Care should be taken in cases where this may cause a problem.
2268
2269 Functions may be recursive. The F\bFU\bUN\bNC\bCN\bNE\bES\bST\bT variable may be used to limit
2270 the depth of the function call stack and restrict the number of func-
2271 tion invocations. By default, no limit is imposed on the number of
2272 recursive calls.
2273
2274 A\bAR\bRI\bIT\bTH\bHM\bME\bET\bTI\bIC\bC E\bEV\bVA\bAL\bLU\bUA\bAT\bTI\bIO\bON\bN
2275 The shell allows arithmetic expressions to be evaluated, under certain
2276 circumstances (see the l\ble\bet\bt and d\bde\bec\bcl\bla\bar\bre\be builtin commands and A\bAr\bri\bit\bth\bhm\bme\bet\bti\bic\bc
2277 E\bEx\bxp\bpa\ban\bns\bsi\bio\bon\bn). Evaluation is done in fixed-width integers with no check
2278 for overflow, though division by 0 is trapped and flagged as an error.
2279 The operators and their precedence, associativity, and values are the
2280 same as in the C language. The following list of operators is grouped
2281 into levels of equal-precedence operators. The levels are listed in
2282 order of decreasing precedence.
2283
2284 _\bi_\bd+\b++\b+ _\bi_\bd-\b--\b-
2285 variable post-increment and post-decrement
2286 +\b++\b+_\bi_\bd -\b--\b-_\bi_\bd
2287 variable pre-increment and pre-decrement
2288 -\b- +\b+ unary minus and plus
2289 !\b! ~\b~ logical and bitwise negation
2290 *\b**\b* exponentiation
2291 *\b* /\b/ %\b% multiplication, division, remainder
2292 +\b+ -\b- addition, subtraction
2293 <\b<<\b< >\b>>\b> left and right bitwise shifts
2294 <\b<=\b= >\b>=\b= <\b< >\b>
2295 comparison
2296 =\b==\b= !\b!=\b= equality and inequality
2297 &\b& bitwise AND
2298 ^\b^ bitwise exclusive OR
2299 |\b| bitwise OR
2300 &\b&&\b& logical AND
2301 |\b||\b| logical OR
2302 _\be_\bx_\bp_\br?\b?_\be_\bx_\bp_\br:\b:_\be_\bx_\bp_\br
2303 conditional operator
2304 =\b= *\b*=\b= /\b/=\b= %\b%=\b= +\b+=\b= -\b-=\b= <\b<<\b<=\b= >\b>>\b>=\b= &\b&=\b= ^\b^=\b= |\b|=\b=
2305 assignment
2306 _\be_\bx_\bp_\br_\b1 ,\b, _\be_\bx_\bp_\br_\b2
2307 comma
2308
2309 Shell variables are allowed as operands; parameter expansion is per-
2310 formed before the expression is evaluated. Within an expression, shell
2311 variables may also be referenced by name without using the parameter
2312 expansion syntax. A shell variable that is null or unset evaluates to
2313 0 when referenced by name without using the parameter expansion syntax.
2314 The value of a variable is evaluated as an arithmetic expression when
2315 it is referenced, or when a variable which has been given the _\bi_\bn_\bt_\be_\bg_\be_\br
2316 attribute using d\bde\bec\bcl\bla\bar\bre\be -\b-i\bi is assigned a value. A null value evaluates
2317 to 0. A shell variable need not have its _\bi_\bn_\bt_\be_\bg_\be_\br attribute turned on
2318 to be used in an expression.
2319
2320 Constants with a leading 0 are interpreted as octal numbers. A leading
2321 0x or 0X denotes hexadecimal. Otherwise, numbers take the form
2322 [_\bb_\ba_\bs_\be_\b#]n, where the optional _\bb_\ba_\bs_\be is a decimal number between 2 and 64
2323 representing the arithmetic base, and _\bn is a number in that base. If
2324 _\bb_\ba_\bs_\be_\b# is omitted, then base 10 is used. When specifying _\bn, the digits
2325 greater than 9 are represented by the lowercase letters, the uppercase
2326 letters, @, and _, in that order. If _\bb_\ba_\bs_\be is less than or equal to 36,
2327 lowercase and uppercase letters may be used interchangeably to repre-
2328 sent numbers between 10 and 35.
2329
2330 Operators are evaluated in order of precedence. Sub-expressions in
2331 parentheses are evaluated first and may override the precedence rules
2332 above.
2333
2334 C\bCO\bON\bND\bDI\bIT\bTI\bIO\bON\bNA\bAL\bL E\bEX\bXP\bPR\bRE\bES\bSS\bSI\bIO\bON\bNS\bS
2335 Conditional expressions are used by the [\b[[\b[ compound command and the
2336 t\bte\bes\bst\bt and [\b[ builtin commands to test file attributes and perform string
2337 and arithmetic comparisons. Expressions are formed from the following
2338 unary or binary primaries. If any _\bf_\bi_\bl_\be argument to one of the pri-
2339 maries is of the form _\b/_\bd_\be_\bv_\b/_\bf_\bd_\b/_\bn, then file descriptor _\bn is checked. If
2340 the _\bf_\bi_\bl_\be argument to one of the primaries is one of _\b/_\bd_\be_\bv_\b/_\bs_\bt_\bd_\bi_\bn,
2341 _\b/_\bd_\be_\bv_\b/_\bs_\bt_\bd_\bo_\bu_\bt, or _\b/_\bd_\be_\bv_\b/_\bs_\bt_\bd_\be_\br_\br, file descriptor 0, 1, or 2, respectively,
2342 is checked.
2343
2344 Unless otherwise specified, primaries that operate on files follow sym-
2345 bolic links and operate on the target of the link, rather than the link
2346 itself.
2347
2348 When used with [\b[[\b[, the <\b< and >\b> operators sort lexicographically using
2349 the current locale. The t\bte\bes\bst\bt command sorts using ASCII ordering.
2350
2351 -\b-a\ba _\bf_\bi_\bl_\be
2352 True if _\bf_\bi_\bl_\be exists.
2353 -\b-b\bb _\bf_\bi_\bl_\be
2354 True if _\bf_\bi_\bl_\be exists and is a block special file.
2355 -\b-c\bc _\bf_\bi_\bl_\be
2356 True if _\bf_\bi_\bl_\be exists and is a character special file.
2357 -\b-d\bd _\bf_\bi_\bl_\be
2358 True if _\bf_\bi_\bl_\be exists and is a directory.
2359 -\b-e\be _\bf_\bi_\bl_\be
2360 True if _\bf_\bi_\bl_\be exists.
2361 -\b-f\bf _\bf_\bi_\bl_\be
2362 True if _\bf_\bi_\bl_\be exists and is a regular file.
2363 -\b-g\bg _\bf_\bi_\bl_\be
2364 True if _\bf_\bi_\bl_\be exists and is set-group-id.
2365 -\b-h\bh _\bf_\bi_\bl_\be
2366 True if _\bf_\bi_\bl_\be exists and is a symbolic link.
2367 -\b-k\bk _\bf_\bi_\bl_\be
2368 True if _\bf_\bi_\bl_\be exists and its ``sticky'' bit is set.
2369 -\b-p\bp _\bf_\bi_\bl_\be
2370 True if _\bf_\bi_\bl_\be exists and is a named pipe (FIFO).
2371 -\b-r\br _\bf_\bi_\bl_\be
2372 True if _\bf_\bi_\bl_\be exists and is readable.
2373 -\b-s\bs _\bf_\bi_\bl_\be
2374 True if _\bf_\bi_\bl_\be exists and has a size greater than zero.
2375 -\b-t\bt _\bf_\bd True if file descriptor _\bf_\bd is open and refers to a terminal.
2376 -\b-u\bu _\bf_\bi_\bl_\be
2377 True if _\bf_\bi_\bl_\be exists and its set-user-id bit is set.
2378 -\b-w\bw _\bf_\bi_\bl_\be
2379 True if _\bf_\bi_\bl_\be exists and is writable.
2380 -\b-x\bx _\bf_\bi_\bl_\be
2381 True if _\bf_\bi_\bl_\be exists and is executable.
2382 -\b-G\bG _\bf_\bi_\bl_\be
2383 True if _\bf_\bi_\bl_\be exists and is owned by the effective group id.
2384 -\b-L\bL _\bf_\bi_\bl_\be
2385 True if _\bf_\bi_\bl_\be exists and is a symbolic link.
2386 -\b-N\bN _\bf_\bi_\bl_\be
2387 True if _\bf_\bi_\bl_\be exists and has been modified since it was last
2388 read.
2389 -\b-O\bO _\bf_\bi_\bl_\be
2390 True if _\bf_\bi_\bl_\be exists and is owned by the effective user id.
2391 -\b-S\bS _\bf_\bi_\bl_\be
2392 True if _\bf_\bi_\bl_\be exists and is a socket.
2393 _\bf_\bi_\bl_\be_\b1 -\b-e\bef\bf _\bf_\bi_\bl_\be_\b2
2394 True if _\bf_\bi_\bl_\be_\b1 and _\bf_\bi_\bl_\be_\b2 refer to the same device and inode num-
2395 bers.
2396 _\bf_\bi_\bl_\be_\b1 -n\bnt\bt _\bf_\bi_\bl_\be_\b2
2397 True if _\bf_\bi_\bl_\be_\b1 is newer (according to modification date) than
2398 _\bf_\bi_\bl_\be_\b2, or if _\bf_\bi_\bl_\be_\b1 exists and _\bf_\bi_\bl_\be_\b2 does not.
2399 _\bf_\bi_\bl_\be_\b1 -o\bot\bt _\bf_\bi_\bl_\be_\b2
2400 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
2401 does not.
2402 -\b-o\bo _\bo_\bp_\bt_\bn_\ba_\bm_\be
2403 True if the shell option _\bo_\bp_\bt_\bn_\ba_\bm_\be is enabled. See the list of
2404 options under the description of the -\b-o\bo option to the s\bse\bet\bt
2405 builtin below.
2406 -\b-v\bv _\bv_\ba_\br_\bn_\ba_\bm_\be
2407 True if the shell variable _\bv_\ba_\br_\bn_\ba_\bm_\be is set (has been assigned a
2408 value).
2409 -\b-R\bR _\bv_\ba_\br_\bn_\ba_\bm_\be
2410 True if the shell variable _\bv_\ba_\br_\bn_\ba_\bm_\be is set and is a name refer-
2411 ence.
2412 -\b-z\bz _\bs_\bt_\br_\bi_\bn_\bg
2413 True if the length of _\bs_\bt_\br_\bi_\bn_\bg is zero.
2414 _\bs_\bt_\br_\bi_\bn_\bg
2415 -\b-n\bn _\bs_\bt_\br_\bi_\bn_\bg
2416 True if the length of _\bs_\bt_\br_\bi_\bn_\bg is non-zero.
2417
2418 _\bs_\bt_\br_\bi_\bn_\bg_\b1 =\b==\b= _\bs_\bt_\br_\bi_\bn_\bg_\b2
2419 _\bs_\bt_\br_\bi_\bn_\bg_\b1 =\b= _\bs_\bt_\br_\bi_\bn_\bg_\b2
2420 True if the strings are equal. =\b= should be used with the t\bte\bes\bst\bt
2421 command for POSIX conformance. When used with the [\b[[\b[ command,
2422 this performs pattern matching as described above (C\bCo\bom\bmp\bpo\bou\bun\bnd\bd C\bCo\bom\bm-\b-
2423 m\bma\ban\bnd\bds\bs).
2424
2425 _\bs_\bt_\br_\bi_\bn_\bg_\b1 !\b!=\b= _\bs_\bt_\br_\bi_\bn_\bg_\b2
2426 True if the strings are not equal.
2427
2428 _\bs_\bt_\br_\bi_\bn_\bg_\b1 <\b< _\bs_\bt_\br_\bi_\bn_\bg_\b2
2429 True if _\bs_\bt_\br_\bi_\bn_\bg_\b1 sorts before _\bs_\bt_\br_\bi_\bn_\bg_\b2 lexicographically.
2430
2431 _\bs_\bt_\br_\bi_\bn_\bg_\b1 >\b> _\bs_\bt_\br_\bi_\bn_\bg_\b2
2432 True if _\bs_\bt_\br_\bi_\bn_\bg_\b1 sorts after _\bs_\bt_\br_\bi_\bn_\bg_\b2 lexicographically.
2433
2434 _\ba_\br_\bg_\b1 O\bOP\bP _\ba_\br_\bg_\b2
2435 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
2436 binary operators return true if _\ba_\br_\bg_\b1 is equal to, not equal to,
2437 less than, less than or equal to, greater than, or greater than
2438 or equal to _\ba_\br_\bg_\b2, respectively. _\bA_\br_\bg_\b1 and _\ba_\br_\bg_\b2 may be positive
2439 or negative integers.
2440
2441 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
2442 When a simple command is executed, the shell performs the following
2443 expansions, assignments, and redirections, from left to right.
2444
2445 1. The words that the parser has marked as variable assignments
2446 (those preceding the command name) and redirections are saved
2447 for later processing.
2448
2449 2. The words that are not variable assignments or redirections are
2450 expanded. If any words remain after expansion, the first word
2451 is taken to be the name of the command and the remaining words
2452 are the arguments.
2453
2454 3. Redirections are performed as described above under R\bRE\bED\bDI\bIR\bRE\bEC\bCT\bTI\bIO\bON\bN.
2455
2456 4. The text after the =\b= in each variable assignment undergoes tilde
2457 expansion, parameter expansion, command substitution, arithmetic
2458 expansion, and quote removal before being assigned to the vari-
2459 able.
2460
2461 If no command name results, the variable assignments affect the current
2462 shell environment. Otherwise, the variables are added to the environ-
2463 ment of the executed command and do not affect the current shell envi-
2464 ronment. If any of the assignments attempts to assign a value to a
2465 readonly variable, an error occurs, and the command exits with a non-
2466 zero status.
2467
2468 If no command name results, redirections are performed, but do not
2469 affect the current shell environment. A redirection error causes the
2470 command to exit with a non-zero status.
2471
2472 If there is a command name left after expansion, execution proceeds as
2473 described below. Otherwise, the command exits. If one of the expan-
2474 sions contained a command substitution, the exit status of the command
2475 is the exit status of the last command substitution performed. If
2476 there were no command substitutions, the command exits with a status of
2477 zero.
2478
2479 C\bCO\bOM\bMM\bMA\bAN\bND\bD E\bEX\bXE\bEC\bCU\bUT\bTI\bIO\bON\bN
2480 After a command has been split into words, if it results in a simple
2481 command and an optional list of arguments, the following actions are
2482 taken.
2483
2484 If the command name contains no slashes, the shell attempts to locate
2485 it. If there exists a shell function by that name, that function is
2486 invoked as described above in F\bFU\bUN\bNC\bCT\bTI\bIO\bON\bNS\bS. If the name does not match a
2487 function, the shell searches for it in the list of shell builtins. If
2488 a match is found, that builtin is invoked.
2489
2490 If the name is neither a shell function nor a builtin, and contains no
2491 slashes, b\bba\bas\bsh\bh searches each element of the P\bPA\bAT\bTH\bH for a directory con-
2492 taining an executable file by that name. B\bBa\bas\bsh\bh uses a hash table to
2493 remember the full pathnames of executable files (see h\bha\bas\bsh\bh under S\bSH\bHE\bEL\bLL\bL
2494 B\bBU\bUI\bIL\bLT\bTI\bIN\bN C\bCO\bOM\bMM\bMA\bAN\bND\bDS\bS below). A full search of the directories in P\bPA\bAT\bTH\bH is
2495 performed only if the command is not found in the hash table. If the
2496 search is unsuccessful, the shell searches for a defined shell function
2497 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
2498 with the original command and the original command's arguments as its
2499 arguments, and the function's exit status becomes the exit status of
2500 the shell. If that function is not defined, the shell prints an error
2501 message and returns an exit status of 127.
2502
2503 If the search is successful, or if the command name contains one or
2504 more slashes, the shell executes the named program in a separate execu-
2505 tion environment. Argument 0 is set to the name given, and the remain-
2506 ing arguments to the command are set to the arguments given, if any.
2507
2508 If this execution fails because the file is not in executable format,
2509 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
2510 file containing shell commands. A subshell is spawned to execute it.
2511 This subshell reinitializes itself, so that the effect is as if a new
2512 shell had been invoked to handle the script, with the exception that
2513 the locations of commands remembered by the parent (see h\bha\bas\bsh\bh below
2514 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.
2515
2516 If the program is a file beginning with #\b#!\b!, the remainder of the first
2517 line specifies an interpreter for the program. The shell executes the
2518 specified interpreter on operating systems that do not handle this exe-
2519 cutable format themselves. The arguments to the interpreter consist of
2520 a single optional argument following the interpreter name on the first
2521 line of the program, followed by the name of the program, followed by
2522 the command arguments, if any.
2523
2524 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
2525 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-
2526 ing:
2527
2528 +\bo open files inherited by the shell at invocation, as modified by
2529 redirections supplied to the e\bex\bxe\bec\bc builtin
2530
2531 +\bo the current working directory as set by c\bcd\bd, p\bpu\bus\bsh\bhd\bd, or p\bpo\bop\bpd\bd, or
2532 inherited by the shell at invocation
2533
2534 +\bo the file creation mode mask as set by u\bum\bma\bas\bsk\bk or inherited from
2535 the shell's parent
2536
2537 +\bo current traps set by t\btr\bra\bap\bp
2538
2539 +\bo shell parameters that are set by variable assignment or with s\bse\bet\bt
2540 or inherited from the shell's parent in the environment
2541
2542 +\bo shell functions defined during execution or inherited from the
2543 shell's parent in the environment
2544
2545 +\bo options enabled at invocation (either by default or with com-
2546 mand-line arguments) or by s\bse\bet\bt
2547
2548 +\bo options enabled by s\bsh\bho\bop\bpt\bt
2549
2550 +\bo shell aliases defined with a\bal\bli\bia\bas\bs
2551
2552 +\bo various process IDs, including those of background jobs, the
2553 value of $\b$$\b$, and the value of P\bPP\bPI\bID\bD
2554
2555 When a simple command other than a builtin or shell function is to be
2556 executed, it is invoked in a separate execution environment that con-
2557 sists of the following. Unless otherwise noted, the values are inher-
2558 ited from the shell.
2559
2560
2561 +\bo the shell's open files, plus any modifications and additions
2562 specified by redirections to the command
2563
2564 +\bo the current working directory
2565
2566 +\bo the file creation mode mask
2567
2568 +\bo shell variables and functions marked for export, along with
2569 variables exported for the command, passed in the environment
2570
2571 +\bo traps caught by the shell are reset to the values inherited from
2572 the shell's parent, and traps ignored by the shell are ignored
2573
2574 A command invoked in this separate environment cannot affect the
2575 shell's execution environment.
2576
2577 Command substitution, commands grouped with parentheses, and asynchro-
2578 nous commands are invoked in a subshell environment that is a duplicate
2579 of the shell environment, except that traps caught by the shell are
2580 reset to the values that the shell inherited from its parent at invoca-
2581 tion. Builtin commands that are invoked as part of a pipeline are also
2582 executed in a subshell environment. Changes made to the subshell envi-
2583 ronment cannot affect the shell's execution environment.
2584
2585 Subshells spawned to execute command substitutions inherit the value of
2586 the -\b-e\be option from the parent shell. When not in _\bp_\bo_\bs_\bi_\bx mode, b\bba\bas\bsh\bh
2587 clears the -\b-e\be option in such subshells.
2588
2589 If a command is followed by a &\b& and job control is not active, the
2590 default standard input for the command is the empty file _\b/_\bd_\be_\bv_\b/_\bn_\bu_\bl_\bl.
2591 Otherwise, the invoked command inherits the file descriptors of the
2592 calling shell as modified by redirections.
2593
2594 E\bEN\bNV\bVI\bIR\bRO\bON\bNM\bME\bEN\bNT\bT
2595 When a program is invoked it is given an array of strings called the
2596 _\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
2597 _\bn_\ba_\bm_\be=_\bv_\ba_\bl_\bu_\be.
2598
2599 The shell provides several ways to manipulate the environment. On
2600 invocation, the shell scans its own environment and creates a parameter
2601 for each name found, automatically marking it for _\be_\bx_\bp_\bo_\br_\bt to child pro-
2602 cesses. Executed commands inherit the environment. The e\bex\bxp\bpo\bor\brt\bt and
2603 d\bde\bec\bcl\bla\bar\bre\be -\b-x\bx commands allow parameters and functions to be added to and
2604 deleted from the environment. If the value of a parameter in the envi-
2605 ronment is modified, the new value becomes part of the environment,
2606 replacing the old. The environment inherited by any executed command
2607 consists of the shell's initial environment, whose values may be modi-
2608 fied in the shell, less any pairs removed by the u\bun\bns\bse\bet\bt command, plus
2609 any additions via the e\bex\bxp\bpo\bor\brt\bt and d\bde\bec\bcl\bla\bar\bre\be -\b-x\bx commands.
2610
2611 The environment for any _\bs_\bi_\bm_\bp_\bl_\be _\bc_\bo_\bm_\bm_\ba_\bn_\bd or function may be augmented
2612 temporarily by prefixing it with parameter assignments, as described
2613 above in P\bPA\bAR\bRA\bAM\bME\bET\bTE\bER\bRS\bS. These assignment statements affect only the envi-
2614 ronment seen by that command.
2615
2616 If the -\b-k\bk option is set (see the s\bse\bet\bt builtin command below), then _\ba_\bl_\bl
2617 parameter assignments are placed in the environment for a command, not
2618 just those that precede the command name.
2619
2620 When b\bba\bas\bsh\bh invokes an external command, the variable _\b_ is set to the
2621 full filename of the command and passed to that command in its environ-
2622 ment.
2623
2624 E\bEX\bXI\bIT\bT S\bST\bTA\bAT\bTU\bUS\bS
2625 The exit status of an executed command is the value returned by the
2626 _\bw_\ba_\bi_\bt_\bp_\bi_\bd system call or equivalent function. Exit statuses fall between
2627 0 and 255, though, as explained below, the shell may use values above
2628 125 specially. Exit statuses from shell builtins and compound commands
2629 are also limited to this range. Under certain circumstances, the shell
2630 will use special values to indicate specific failure modes.
2631
2632 For the shell's purposes, a command which exits with a zero exit status
2633 has succeeded. An exit status of zero indicates success. A non-zero
2634 exit status indicates failure. When a command terminates on a fatal
2635 signal _\bN, b\bba\bas\bsh\bh uses the value of 128+_\bN as the exit status.
2636
2637 If a command is not found, the child process created to execute it
2638 returns a status of 127. If a command is found but is not executable,
2639 the return status is 126.
2640
2641 If a command fails because of an error during expansion or redirection,
2642 the exit status is greater than zero.
2643
2644 Shell builtin commands return a status of 0 (_\bt_\br_\bu_\be) if successful, and
2645 non-zero (_\bf_\ba_\bl_\bs_\be) if an error occurs while they execute. All builtins
2646 return an exit status of 2 to indicate incorrect usage, generally
2647 invalid options or missing arguments.
2648
2649 B\bBa\bas\bsh\bh itself returns the exit status of the last command executed,
2650 unless a syntax error occurs, in which case it exits with a non-zero
2651 value. See also the e\bex\bxi\bit\bt builtin command below.
2652
2653 S\bSI\bIG\bGN\bNA\bAL\bLS\bS
2654 When b\bba\bas\bsh\bh is interactive, in the absence of any traps, it ignores
2655 S\bSI\bIG\bGT\bTE\bER\bRM\bM (so that k\bki\bil\bll\bl 0\b0 does not kill an interactive shell), and S\bSI\bIG\bGI\bIN\bNT\bT
2656 is caught and handled (so that the w\bwa\bai\bit\bt builtin is interruptible). In
2657 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
2658 ignores 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.
2659
2660 Non-builtin commands run by b\bba\bas\bsh\bh have signal handlers set to the values
2661 inherited by the shell from its parent. When job control is not in
2662 effect, asynchronous commands ignore S\bSI\bIG\bGI\bIN\bNT\bT and S\bSI\bIG\bGQ\bQU\bUI\bIT\bT in addition to
2663 these inherited handlers. Commands run as a result of command substi-
2664 tution ignore the keyboard-generated job control signals S\bSI\bIG\bGT\bTT\bTI\bIN\bN, S\bSI\bIG\bGT\bT-\b-
2665 T\bTO\bOU\bU, and S\bSI\bIG\bGT\bTS\bST\bTP\bP.
2666
2667 The shell exits by default upon receipt of a S\bSI\bIG\bGH\bHU\bUP\bP. Before exiting,
2668 an interactive shell resends the S\bSI\bIG\bGH\bHU\bUP\bP to all jobs, running or
2669 stopped. Stopped jobs are sent S\bSI\bIG\bGC\bCO\bON\bNT\bT to ensure that they receive the
2670 S\bSI\bIG\bGH\bHU\bUP\bP. To prevent the shell from sending the signal to a particular
2671 job, it should be removed from the jobs table with the d\bdi\bis\bso\bow\bwn\bn builtin
2672 (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 marked to not receive S\bSI\bIG\bGH\bHU\bUP\bP
2673 using d\bdi\bis\bso\bow\bwn\bn -\b-h\bh.
2674
2675 If the h\bhu\bup\bpo\bon\bne\bex\bxi\bit\bt shell option has been set with s\bsh\bho\bop\bpt\bt, b\bba\bas\bsh\bh sends a
2676 S\bSI\bIG\bGH\bHU\bUP\bP to all jobs when an interactive login shell exits.
2677
2678 If b\bba\bas\bsh\bh is waiting for a command to complete and receives a signal for
2679 which a trap has been set, the trap will not be executed until the com-
2680 mand completes. When b\bba\bas\bsh\bh is waiting for an asynchronous command via
2681 the w\bwa\bai\bit\bt builtin, the reception of a signal for which a trap has been
2682 set will cause the w\bwa\bai\bit\bt builtin to return immediately with an exit sta-
2683 tus greater than 128, immediately after which the trap is executed.
2684
2685 J\bJO\bOB\bB C\bCO\bON\bNT\bTR\bRO\bOL\bL
2686 _\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
2687 execution of processes and continue (_\br_\be_\bs_\bu_\bm_\be) their execution at a later
2688 point. A user typically employs this facility via an interactive
2689 interface supplied jointly by the operating system kernel's terminal
2690 driver and b\bba\bas\bsh\bh.
2691
2692 The shell associates a _\bj_\bo_\bb with each pipeline. It keeps a table of
2693 currently executing jobs, which may be listed with the j\bjo\bob\bbs\bs command.
2694 When b\bba\bas\bsh\bh starts a job asynchronously (in the _\bb_\ba_\bc_\bk_\bg_\br_\bo_\bu_\bn_\bd), it prints a
2695 line that looks like:
2696
2697 [1] 25647
2698
2699 indicating that this job is job number 1 and that the process ID of the
2700 last process in the pipeline associated with this job is 25647. All of
2701 the processes in a single pipeline are members of the same job. B\bBa\bas\bsh\bh
2702 uses the _\bj_\bo_\bb abstraction as the basis for job control.
2703
2704 To facilitate the implementation of the user interface to job control,
2705 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
2706 _\bg_\br_\bo_\bu_\bp _\bI_\bD. Members of this process group (processes whose process group
2707 ID is equal to the current terminal process group ID) receive keyboard-
2708 generated signals such as S\bSI\bIG\bGI\bIN\bNT\bT. These processes are said to be in
2709 the _\bf_\bo_\br_\be_\bg_\br_\bo_\bu_\bn_\bd. _\bB_\ba_\bc_\bk_\bg_\br_\bo_\bu_\bn_\bd processes are those whose process group ID
2710 differs from the terminal's; such processes are immune to keyboard-gen-
2711 erated signals. Only foreground processes are allowed to read from or,
2712 if the user so specifies with stty tostop, write to the terminal.
2713 Background processes which attempt to read from (write to when stty
2714 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
2715 by the kernel's terminal driver, which, unless caught, suspends the
2716 process.
2717
2718 If the operating system on which b\bba\bas\bsh\bh is running supports job control,
2719 b\bba\bas\bsh\bh contains facilities to use it. Typing the _\bs_\bu_\bs_\bp_\be_\bn_\bd character (typ-
2720 ically ^\b^Z\bZ, Control-Z) while a process is running causes that process to
2721 be stopped 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
2722 character (typically ^\b^Y\bY, Control-Y) causes the process to be stopped
2723 when it attempts to read input from the terminal, and control to be
2724 returned to b\bba\bas\bsh\bh. The user may then manipulate the state of this job,
2725 using the b\bbg\bg command to continue it in the background, the f\bfg\bg command
2726 to continue it in the foreground, or the k\bki\bil\bll\bl command to kill it. A ^\b^Z\bZ
2727 takes effect immediately, and has the additional side effect of causing
2728 pending output and typeahead to be discarded.
2729
2730 There are a number of ways to refer to a job in the shell. The charac-
2731 ter %\b% introduces a job specification (_\bj_\bo_\bb_\bs_\bp_\be_\bc). Job number _\bn may be
2732 referred to as %\b%n\bn. A job may also be referred to using a prefix of the
2733 name used to start it, or using a substring that appears in its command
2734 line. For example, %\b%c\bce\be refers to a stopped c\bce\be job. If a prefix
2735 matches more than one job, b\bba\bas\bsh\bh reports an error. Using %\b%?\b?c\bce\be, on the
2736 other hand, refers to any job containing the string c\bce\be in its command
2737 line. If the substring matches more than one job, b\bba\bas\bsh\bh reports an
2738 error. The symbols %\b%%\b% and %\b%+\b+ refer to the shell's notion of the _\bc_\bu_\br_\b-
2739 _\br_\be_\bn_\bt _\bj_\bo_\bb, which is the last job stopped while it was in the foreground
2740 or started in the background. The _\bp_\br_\be_\bv_\bi_\bo_\bu_\bs _\bj_\bo_\bb may be referenced using
2741 %\b%-\b-. If there is only a single job, %\b%+\b+ and %\b%-\b- can both be used to refer
2742 to that job. In output pertaining to jobs (e.g., the output of the
2743 j\bjo\bob\bbs\bs command), the current job is always flagged with a +\b+, and the pre-
2744 vious job with a -\b-. A single % (with no accompanying job specifica-
2745 tion) also refers to the current job.
2746
2747 Simply naming a job can be used to bring it into the foreground: %\b%1\b1 is
2748 a synonym for `\b``\b`f\bfg\bg %\b%1\b1'\b''\b', bringing job 1 from the background into the
2749 foreground. Similarly, `\b``\b`%\b%1\b1 &\b&'\b''\b' resumes job 1 in the background,
2750 equivalent to `\b``\b`b\bbg\bg %\b%1\b1'\b''\b'.
2751
2752 The shell learns immediately whenever a job changes state. Normally,
2753 b\bba\bas\bsh\bh waits until it is about to print a prompt before reporting changes
2754 in a job's status so as to not interrupt any other output. If the -\b-b\bb
2755 option to the s\bse\bet\bt builtin command is enabled, b\bba\bas\bsh\bh reports such changes
2756 immediately. Any trap on S\bSI\bIG\bGC\bCH\bHL\bLD\bD is executed for each child that
2757 exits.
2758
2759 If an attempt to exit b\bba\bas\bsh\bh is made while jobs are stopped (or, if the
2760 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-
2761 ning), the shell prints a warning message, and, if the c\bch\bhe\bec\bck\bkj\bjo\bob\bbs\bs option
2762 is enabled, lists the jobs and their statuses. The j\bjo\bob\bbs\bs command may
2763 then be used to inspect their status. If a second attempt to exit is
2764 made without an intervening command, the shell does not print another
2765 warning, and any stopped jobs are terminated.
2766
2767 P\bPR\bRO\bOM\bMP\bPT\bTI\bIN\bNG\bG
2768 When executing interactively, b\bba\bas\bsh\bh displays the primary prompt P\bPS\bS1\b1 when
2769 it is ready to read a command, and the secondary prompt P\bPS\bS2\b2 when it
2770 needs more input to complete a command. B\bBa\bas\bsh\bh allows these prompt
2771 strings to be customized by inserting a number of backslash-escaped
2772 special characters that are decoded as follows:
2773 \\b\a\ba an ASCII bell character (07)
2774 \\b\d\bd the date in "Weekday Month Date" format (e.g., "Tue May
2775 26")
2776 \\b\D\bD{\b{_\bf_\bo_\br_\bm_\ba_\bt}\b}
2777 the _\bf_\bo_\br_\bm_\ba_\bt is passed to _\bs_\bt_\br_\bf_\bt_\bi_\bm_\be(3) and the result is
2778 inserted into the prompt string; an empty _\bf_\bo_\br_\bm_\ba_\bt results
2779 in a locale-specific time representation. The braces are
2780 required
2781 \\b\e\be an ASCII escape character (033)
2782 \\b\h\bh the hostname up to the first `.'
2783 \\b\H\bH the hostname
2784 \\b\j\bj the number of jobs currently managed by the shell
2785 \\b\l\bl the basename of the shell's terminal device name
2786 \\b\n\bn newline
2787 \\b\r\br carriage return
2788 \\b\s\bs the name of the shell, the basename of $\b$0\b0 (the portion
2789 following the final slash)
2790 \\b\t\bt the current time in 24-hour HH:MM:SS format
2791 \\b\T\bT the current time in 12-hour HH:MM:SS format
2792 \\b\@\b@ the current time in 12-hour am/pm format
2793 \\b\A\bA the current time in 24-hour HH:MM format
2794 \\b\u\bu the username of the current user
2795 \\b\v\bv the version of b\bba\bas\bsh\bh (e.g., 2.00)
2796 \\b\V\bV the release of b\bba\bas\bsh\bh, version + patch level (e.g., 2.00.0)
2797 \\b\w\bw the current working directory, with $\b$H\bHO\bOM\bME\bE abbreviated
2798 with a tilde (uses the value of the P\bPR\bRO\bOM\bMP\bPT\bT_\b_D\bDI\bIR\bRT\bTR\bRI\bIM\bM vari-
2799 able)
2800 \\b\W\bW the basename of the current working directory, with $\b$H\bHO\bOM\bME\bE
2801 abbreviated with a tilde
2802 \\b\!\b! the history number of this command
2803 \\b\#\b# the command number of this command
2804 \\b\$\b$ if the effective UID is 0, a #\b#, otherwise a $\b$
2805 \\b\_\bn_\bn_\bn the character corresponding to the octal number _\bn_\bn_\bn
2806 \\b\\\b\ a backslash
2807 \\b\[\b[ begin a sequence of non-printing characters, which could
2808 be used to embed a terminal control sequence into the
2809 prompt
2810 \\b\]\b] end a sequence of non-printing characters
2811
2812 The command number and the history number are usually different: the
2813 history number of a command is its position in the history list, which
2814 may include commands restored from the history file (see H\bHI\bIS\bST\bTO\bOR\bRY\bY
2815 below), while the command number is the position in the sequence of
2816 commands executed during the current shell session. After the string
2817 is decoded, it is expanded via parameter expansion, command substitu-
2818 tion, arithmetic expansion, and quote removal, subject to the value of
2819 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
2820 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).
2821
2822 R\bRE\bEA\bAD\bDL\bLI\bIN\bNE\bE
2823 This is the library that handles reading input when using an interac-
2824 tive shell, unless the -\b--\b-n\bno\boe\bed\bdi\bit\bti\bin\bng\bg option is given at shell invocation.
2825 Line editing is also used when using the -\b-e\be option to the r\bre\bea\bad\bd builtin.
2826 By default, the line editing commands are similar to those of Emacs. A
2827 vi-style line editing interface is also available. Line editing can be
2828 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
2829 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
2830 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
2831 s\bse\bet\bt builtin.
2832
2833 R\bRe\bea\bad\bdl\bli\bin\bne\be N\bNo\bot\bta\bat\bti\bio\bon\bn
2834 In this section, the Emacs-style notation is used to denote keystrokes.
2835 Control keys are denoted by C-_\bk_\be_\by, e.g., C-n means Control-N. Simi-
2836 larly, _\bm_\be_\bt_\ba keys are denoted by M-_\bk_\be_\by, so M-x means Meta-X. (On key-
2837 boards without a _\bm_\be_\bt_\ba key, M-_\bx means ESC _\bx, i.e., press the Escape key
2838 then the _\bx key. This makes ESC the _\bm_\be_\bt_\ba _\bp_\br_\be_\bf_\bi_\bx. The combination M-C-_\bx
2839 means ESC-Control-_\bx, or press the Escape key then hold the Control key
2840 while pressing the _\bx key.)
2841
2842 Readline commands may be given numeric _\ba_\br_\bg_\bu_\bm_\be_\bn_\bt_\bs, which normally act as
2843 a repeat count. Sometimes, however, it is the sign of the argument
2844 that is significant. Passing a negative argument to a command that
2845 acts in the forward direction (e.g., k\bki\bil\bll\bl-\b-l\bli\bin\bne\be) causes that command to
2846 act in a backward direction. Commands whose behavior with arguments
2847 deviates from this are noted below.
2848
2849 When a command is described as _\bk_\bi_\bl_\bl_\bi_\bn_\bg text, the text deleted is saved
2850 for possible future retrieval (_\by_\ba_\bn_\bk_\bi_\bn_\bg). The killed text is saved in a
2851 _\bk_\bi_\bl_\bl _\br_\bi_\bn_\bg. Consecutive kills cause the text to be accumulated into one
2852 unit, which can be yanked all at once. Commands which do not kill text
2853 separate the chunks of text on the kill ring.
2854
2855 R\bRe\bea\bad\bdl\bli\bin\bne\be I\bIn\bni\bit\bti\bia\bal\bli\biz\bza\bat\bti\bio\bon\bn
2856 Readline is customized by putting commands in an initialization file
2857 (the _\bi_\bn_\bp_\bu_\bt_\br_\bc file). The name of this file is taken from the value of
2858 the I\bIN\bNP\bPU\bUT\bTR\bRC\bC variable. If that variable is unset, the default is
2859 _\b~_\b/_\b._\bi_\bn_\bp_\bu_\bt_\br_\bc. When a program which uses the readline library starts up,
2860 the initialization file is read, and the key bindings and variables are
2861 set. There are only a few basic constructs allowed in the readline
2862 initialization file. Blank lines are ignored. Lines beginning with a
2863 #\b# are comments. Lines beginning with a $\b$ indicate conditional con-
2864 structs. Other lines denote key bindings and variable settings.
2865
2866 The default key-bindings may be changed with an _\bi_\bn_\bp_\bu_\bt_\br_\bc file. Other
2867 programs that use this library may add their own commands and bindings.
2868
2869 For example, placing
2870
2871 M-Control-u: universal-argument
2872 or
2873 C-Meta-u: universal-argument
2874 into the _\bi_\bn_\bp_\bu_\bt_\br_\bc would make M-C-u execute the readline command _\bu_\bn_\bi_\bv_\be_\br_\b-
2875 _\bs_\ba_\bl_\b-_\ba_\br_\bg_\bu_\bm_\be_\bn_\bt.
2876
2877 The following symbolic character names are recognized: _\bR_\bU_\bB_\bO_\bU_\bT, _\bD_\bE_\bL,
2878 _\bE_\bS_\bC, _\bL_\bF_\bD, _\bN_\bE_\bW_\bL_\bI_\bN_\bE, _\bR_\bE_\bT, _\bR_\bE_\bT_\bU_\bR_\bN, _\bS_\bP_\bC, _\bS_\bP_\bA_\bC_\bE, and _\bT_\bA_\bB.
2879
2880 In addition to command names, readline allows keys to be bound to a
2881 string that is inserted when the key is pressed (a _\bm_\ba_\bc_\br_\bo).
2882
2883 R\bRe\bea\bad\bdl\bli\bin\bne\be K\bKe\bey\by B\bBi\bin\bnd\bdi\bin\bng\bgs\bs
2884 The syntax for controlling key bindings in the _\bi_\bn_\bp_\bu_\bt_\br_\bc file is simple.
2885 All that is required is the name of the command or the text of a macro
2886 and a key sequence to which it should be bound. The name may be speci-
2887 fied in one of two ways: as a symbolic key name, possibly with _\bM_\be_\bt_\ba_\b- or
2888 _\bC_\bo_\bn_\bt_\br_\bo_\bl_\b- prefixes, or as a key sequence.
2889
2890 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
2891 of a key spelled out in English. For example:
2892
2893 Control-u: universal-argument
2894 Meta-Rubout: backward-kill-word
2895 Control-o: "> output"
2896
2897 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,
2898 _\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
2899 run the macro expressed on the right hand side (that is, to insert the
2900 text ``> output'' into the line).
2901
2902 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
2903 from k\bke\bey\byn\bna\bam\bme\be above in that strings denoting an entire key sequence may
2904 be specified by placing the sequence within double quotes. Some GNU
2905 Emacs style key escapes can be used, as in the following example, but
2906 the symbolic character names are not recognized.
2907
2908 "\C-u": universal-argument
2909 "\C-x\C-r": re-read-init-file
2910 "\e[11~": "Function Key 1"
2911
2912 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.
2913 _\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
2914 bound to insert the text ``Function Key 1''.
2915
2916 The full set of GNU Emacs style escape sequences is
2917 \\b\C\bC-\b- control prefix
2918 \\b\M\bM-\b- meta prefix
2919 \\b\e\be an escape character
2920 \\b\\\b\ backslash
2921 \\b\"\b" literal "
2922 \\b\'\b' literal '
2923
2924 In addition to the GNU Emacs style escape sequences, a second set of
2925 backslash escapes is available:
2926 \\b\a\ba alert (bell)
2927 \\b\b\bb backspace
2928 \\b\d\bd delete
2929 \\b\f\bf form feed
2930 \\b\n\bn newline
2931 \\b\r\br carriage return
2932 \\b\t\bt horizontal tab
2933 \\b\v\bv vertical tab
2934 \\b\_\bn_\bn_\bn the eight-bit character whose value is the octal value
2935 _\bn_\bn_\bn (one to three digits)
2936 \\b\x\bx_\bH_\bH the eight-bit character whose value is the hexadecimal
2937 value _\bH_\bH (one or two hex digits)
2938
2939 When entering the text of a macro, single or double quotes must be used
2940 to indicate a macro definition. Unquoted text is assumed to be a func-
2941 tion name. In the macro body, the backslash escapes described above
2942 are expanded. Backslash will quote any other character in the macro
2943 text, including " and '.
2944
2945 B\bBa\bas\bsh\bh allows the current readline key bindings to be displayed or modi-
2946 fied with the b\bbi\bin\bnd\bd builtin command. The editing mode may be switched
2947 during interactive use by using the -\b-o\bo option to the s\bse\bet\bt builtin com-
2948 mand (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).
2949
2950 R\bRe\bea\bad\bdl\bli\bin\bne\be V\bVa\bar\bri\bia\bab\bbl\ble\bes\bs
2951 Readline has variables that can be used to further customize its behav-
2952 ior. A variable may be set in the _\bi_\bn_\bp_\bu_\bt_\br_\bc file with a statement of the
2953 form
2954
2955 s\bse\bet\bt _\bv_\ba_\br_\bi_\ba_\bb_\bl_\be_\b-_\bn_\ba_\bm_\be _\bv_\ba_\bl_\bu_\be
2956
2957 Except where noted, readline variables can take the values O\bOn\bn or O\bOf\bff\bf
2958 (without regard to case). Unrecognized variable names are ignored.
2959 When a variable value is read, empty or null values, "on" (case-insen-
2960 sitive), and "1" are equivalent to O\bOn\bn. All other values are equivalent
2961 to O\bOf\bff\bf. The variables and their default values are:
2962
2963 b\bbe\bel\bll\bl-\b-s\bst\bty\byl\ble\be (\b(a\bau\bud\bdi\bib\bbl\ble\be)\b)
2964 Controls what happens when readline wants to ring the terminal
2965 bell. If set to n\bno\bon\bne\be, readline never rings the bell. If set to
2966 v\bvi\bis\bsi\bib\bbl\ble\be, readline uses a visible bell if one is available. If
2967 set to a\bau\bud\bdi\bib\bbl\ble\be, readline attempts to ring the terminal's bell.
2968 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)
2969 If set to O\bOn\bn, readline attempts to bind the control characters
2970 treated specially by the kernel's terminal driver to their read-
2971 line equivalents.
2972 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)
2973 If set to O\bOn\bn, when listing completions, readline displays the
2974 common prefix of the set of possible completions using a differ-
2975 ent color. The color definitions are taken from the value of
2976 the L\bLS\bS_\b_C\bCO\bOL\bLO\bOR\bRS\bS environment variable.
2977 c\bco\bol\blo\bor\bre\bed\bd-\b-s\bst\bta\bat\bts\bs (\b(O\bOf\bff\bf)\b)
2978 If set to O\bOn\bn, readline displays possible completions using dif-
2979 ferent colors to indicate their file type. The color defini-
2980 tions are taken from the value of the L\bLS\bS_\b_C\bCO\bOL\bLO\bOR\bRS\bS environment
2981 variable.
2982 c\bco\bom\bmm\bme\ben\bnt\bt-\b-b\bbe\beg\bgi\bin\bn (\b(`\b``\b`#\b#'\b''\b')\b)
2983 The string that is inserted when the readline i\bin\bns\bse\ber\brt\bt-\b-c\bco\bom\bmm\bme\ben\bnt\bt
2984 command is executed. This command is bound to M\bM-\b-#\b# in emacs mode
2985 and to #\b# in vi command mode.
2986 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)
2987 If set to O\bOn\bn, readline performs filename matching and completion
2988 in a case-insensitive fashion.
2989 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)
2990 The length in characters of the common prefix of a list of pos-
2991 sible completions that is displayed without modification. When
2992 set to a value greater than zero, common prefixes longer than
2993 this value are replaced with an ellipsis when displaying possi-
2994 ble completions.
2995 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)
2996 This determines when the user is queried about viewing the num-
2997 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-
2998 t\bti\bio\bon\bns\bs command. It may be set to any integer value greater than
2999 or equal to zero. If the number of possible completions is
3000 greater than or equal to the value of this variable, the user is
3001 asked whether or not he wishes to view them; otherwise they are
3002 simply listed on the terminal.
3003 c\bco\bon\bnv\bve\ber\brt\bt-\b-m\bme\bet\bta\ba (\b(O\bOn\bn)\b)
3004 If set to O\bOn\bn, readline will convert characters with the eighth
3005 bit set to an ASCII key sequence by stripping the eighth bit and
3006 prefixing an escape character (in effect, using escape as the
3007 _\bm_\be_\bt_\ba _\bp_\br_\be_\bf_\bi_\bx).
3008 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)
3009 If set to O\bOn\bn, readline will inhibit word completion. Completion
3010 characters will be inserted into the line as if they had been
3011 mapped to s\bse\bel\blf\bf-\b-i\bin\bns\bse\ber\brt\bt.
3012 e\bed\bdi\bit\bti\bin\bng\bg-\b-m\bmo\bod\bde\be (\b(e\bem\bma\bac\bcs\bs)\b)
3013 Controls whether readline begins with a set of key bindings sim-
3014 ilar 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
3015 v\bvi\bi.
3016 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)
3017 When set to O\bOn\bn, on operating systems that indicate they support
3018 it, readline echoes a character corresponding to a signal gener-
3019 ated from the keyboard.
3020 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\bOf\bff\bf)\b)
3021 When set to O\bOn\bn, readline will configure the terminal in a way
3022 that will enable it to insert each paste into the editing buffer
3023 as a single string of characters, instead of treating each char-
3024 acter as if it had been read from the keyboard. This can pre-
3025 vent pasted characters from being interpreted as editing com-
3026 mands.
3027 e\ben\bna\bab\bbl\ble\be-\b-k\bke\bey\byp\bpa\bad\bd (\b(O\bOf\bff\bf)\b)
3028 When set to O\bOn\bn, readline will try to enable the application key-
3029 pad when it is called. Some systems need this to enable the
3030 arrow keys.
3031 e\ben\bna\bab\bbl\ble\be-\b-m\bme\bet\bta\ba-\b-k\bke\bey\by (\b(O\bOn\bn)\b)
3032 When set to O\bOn\bn, readline will try to enable any meta modifier
3033 key the terminal claims to support when it is called. On many
3034 terminals, the meta key is used to send eight-bit characters.
3035 e\bex\bxp\bpa\ban\bnd\bd-\b-t\bti\bil\bld\bde\be (\b(O\bOf\bff\bf)\b)
3036 If set to O\bOn\bn, tilde expansion is performed when readline
3037 attempts word completion.
3038 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)
3039 If set to O\bOn\bn, the history code attempts to place point at the
3040 same location on each history line retrieved with p\bpr\bre\bev\bvi\bio\bou\bus\bs-\b-h\bhi\bis\bs-\b-
3041 t\bto\bor\bry\by or n\bne\bex\bxt\bt-\b-h\bhi\bis\bst\bto\bor\bry\by.
3042 h\bhi\bis\bst\bto\bor\bry\by-\b-s\bsi\biz\bze\be (\b(u\bun\bns\bse\bet\bt)\b)
3043 Set the maximum number of history entries saved in the history
3044 list. If set to zero, any existing history entries are deleted
3045 and no new entries are saved. If set to a value less than zero,
3046 the number of history entries is not limited. By default, the
3047 number of history entries is not limited.
3048 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)
3049 When set to O\bOn\bn, makes readline use a single line for display,
3050 scrolling the input horizontally on a single screen line when it
3051 becomes longer than the screen width rather than wrapping to a
3052 new line.
3053 i\bin\bnp\bpu\but\bt-\b-m\bme\bet\bta\ba (\b(O\bOf\bff\bf)\b)
3054 If set to O\bOn\bn, readline will enable eight-bit input (that is, it
3055 will not strip the high bit from the characters it reads),
3056 regardless of what the terminal claims it can support. The name
3057 m\bme\bet\bta\ba-\b-f\bfl\bla\bag\bg is a synonym for this variable.
3058 i\bis\bse\bea\bar\brc\bch\bh-\b-t\bte\ber\brm\bmi\bin\bna\bat\bto\bor\brs\bs (\b(`\b``\b`C\bC-\b-[\b[C\bC-\b-J\bJ'\b''\b')\b)
3059 The string of characters that should terminate an incremental
3060 search without subsequently executing the character as a com-
3061 mand. If this variable has not been given a value, the charac-
3062 ters _\bE_\bS_\bC and _\bC_\b-_\bJ will terminate an incremental search.
3063 k\bke\bey\bym\bma\bap\bp (\b(e\bem\bma\bac\bcs\bs)\b)
3064 Set the current readline keymap. The set of valid keymap names
3065 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-
3066 _\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
3067 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
3068 value of e\bed\bdi\bit\bti\bin\bng\bg-\b-m\bmo\bod\bde\be also affects the default keymap.
3069 e\bem\bma\bac\bcs\bs-\b-m\bmo\bod\bde\be-\b-s\bst\btr\bri\bin\bng\bg (\b(@\b@)\b)
3070 This string is displayed immediately before the last line of the
3071 primary prompt when emacs editing mode is active. The value is
3072 expanded like a key binding, so the standard set of meta- and
3073 control prefixes and backslash escape sequences is available.
3074 Use the \1 and \2 escapes to begin and end sequences of non-
3075 printing characters, which can be used to embed a terminal con-
3076 trol sequence into the mode string.
3077 k\bke\bey\bys\bse\beq\bq-\b-t\bti\bim\bme\beo\bou\but\bt (\b(5\b50\b00\b0)\b)
3078 Specifies the duration _\br_\be_\ba_\bd_\bl_\bi_\bn_\be will wait for a character when
3079 reading an ambiguous key sequence (one that can form a complete
3080 key sequence using the input read so far, or can take additional
3081 input to complete a longer key sequence). If no input is
3082 received within the timeout, _\br_\be_\ba_\bd_\bl_\bi_\bn_\be will use the shorter but
3083 complete key sequence. The value is specified in milliseconds,
3084 so a value of 1000 means that _\br_\be_\ba_\bd_\bl_\bi_\bn_\be will wait one second for
3085 additional input. If this variable is set to a value less than
3086 or equal to zero, or to a non-numeric value, _\br_\be_\ba_\bd_\bl_\bi_\bn_\be will wait
3087 until another key is pressed to decide which key sequence to
3088 complete.
3089 m\bma\bar\brk\bk-\b-d\bdi\bir\bre\bec\bct\bto\bor\bri\bie\bes\bs (\b(O\bOn\bn)\b)
3090 If set to O\bOn\bn, completed directory names have a slash appended.
3091 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)
3092 If set to O\bOn\bn, history lines that have been modified are dis-
3093 played with a preceding asterisk (*\b*).
3094 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)
3095 If set to O\bOn\bn, completed names which are symbolic links to direc-
3096 tories have a slash appended (subject to the value of
3097 m\bma\bar\brk\bk-\b-d\bdi\bir\bre\bec\bct\bto\bor\bri\bie\bes\bs).
3098 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)
3099 This variable, when set to O\bOn\bn, causes readline to match files
3100 whose names begin with a `.' (hidden files) when performing
3101 filename completion. If set to O\bOf\bff\bf, the leading `.' must be
3102 supplied by the user in the filename to be completed.
3103 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)
3104 If set to O\bOn\bn, menu completion displays the common prefix of the
3105 list of possible completions (which may be empty) before cycling
3106 through the list.
3107 o\bou\but\btp\bpu\but\bt-\b-m\bme\bet\bta\ba (\b(O\bOf\bff\bf)\b)
3108 If set to O\bOn\bn, readline will display characters with the eighth
3109 bit set directly rather than as a meta-prefixed escape sequence.
3110 p\bpa\bag\bge\be-\b-c\bco\bom\bmp\bpl\ble\bet\bti\bio\bon\bns\bs (\b(O\bOn\bn)\b)
3111 If set to O\bOn\bn, readline uses an internal _\bm_\bo_\br_\be-like pager to dis-
3112 play a screenful of possible completions at a time.
3113 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)
3114 If set to O\bOn\bn, readline will display completions with matches
3115 sorted horizontally in alphabetical order, rather than down the
3116 screen.
3117 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)
3118 If set to O\bOn\bn, readline will undo all changes to history lines
3119 before returning when a\bac\bcc\bce\bep\bpt\bt-\b-l\bli\bin\bne\be is executed. By default, his-
3120 tory lines may be modified and retain individual undo lists
3121 across calls to r\bre\bea\bad\bdl\bli\bin\bne\be.
3122 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)
3123 This alters the default behavior of the completion functions.
3124 If set to O\bOn\bn, words which have more than one possible completion
3125 cause the matches to be listed immediately instead of ringing
3126 the bell.
3127 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)
3128 This alters the default behavior of the completion functions in
3129 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
3130 which have more than one possible completion without any possi-
3131 ble partial completion (the possible completions don't share a
3132 common prefix) cause the matches to be listed immediately
3133 instead of ringing the bell.
3134 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)
3135 If set to O\bOn\bn, add a character to the beginning of the prompt
3136 indicating the editing mode: emacs (@), vi command (:) or vi
3137 insertion (+).
3138 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)
3139 If set to O\bOn\bn, this alters the default completion behavior when
3140 inserting a single match into the line. It's only active when
3141 performing completion in the middle of a word. If enabled,
3142 readline does not insert characters from the completion that
3143 match characters after point in the word being completed, so
3144 portions of the word following the cursor are not duplicated.
3145 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)
3146 This string is displayed immediately before the last line of the
3147 primary prompt when vi editing mode is active and in command
3148 mode. The value is expanded like a key binding, so the standard
3149 set of meta- and control prefixes and backslash escape sequences
3150 is available. Use the \1 and \2 escapes to begin and end
3151 sequences of non-printing characters, which can be used to embed
3152 a terminal control sequence into the mode string.
3153 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)
3154 This string is displayed immediately before the last line of the
3155 primary prompt when vi editing mode is active and in insertion
3156 mode. The value is expanded like a key binding, so the standard
3157 set of meta- and control prefixes and backslash escape sequences
3158 is available. Use the \1 and \2 escapes to begin and end
3159 sequences of non-printing characters, which can be used to embed
3160 a terminal control sequence into the mode string.
3161 v\bvi\bis\bsi\bib\bbl\ble\be-\b-s\bst\bta\bat\bts\bs (\b(O\bOf\bff\bf)\b)
3162 If set to O\bOn\bn, a character denoting a file's type as reported by
3163 _\bs_\bt_\ba_\bt(2) is appended to the filename when listing possible com-
3164 pletions.
3165
3166 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
3167 Readline implements a facility similar in spirit to the conditional
3168 compilation features of the C preprocessor which allows key bindings
3169 and variable settings to be performed as the result of tests. There
3170 are four parser directives used.
3171
3172 $\b$i\bif\bf The $\b$i\bif\bf construct allows bindings to be made based on the edit-
3173 ing mode, the terminal being used, or the application using
3174 readline. The text of the test extends to the end of the line;
3175 no characters are required to isolate it.
3176
3177 m\bmo\bod\bde\be The m\bmo\bod\bde\be=\b= form of the $\b$i\bif\bf directive is used to test
3178 whether readline is in emacs or vi mode. This may be
3179 used in conjunction with the s\bse\bet\bt k\bke\bey\bym\bma\bap\bp command, for
3180 instance, to set bindings in the _\be_\bm_\ba_\bc_\bs_\b-_\bs_\bt_\ba_\bn_\bd_\ba_\br_\bd and
3181 _\be_\bm_\ba_\bc_\bs_\b-_\bc_\bt_\bl_\bx keymaps only if readline is starting out in
3182 emacs mode.
3183
3184 t\bte\ber\brm\bm The t\bte\ber\brm\bm=\b= form may be used to include terminal-specific
3185 key bindings, perhaps to bind the key sequences output by
3186 the terminal's function keys. The word on the right side
3187 of the =\b= is tested against both the full name of the ter-
3188 minal and the portion of the terminal name before the
3189 first -\b-. This allows _\bs_\bu_\bn to match both _\bs_\bu_\bn and _\bs_\bu_\bn_\b-_\bc_\bm_\bd,
3190 for instance.
3191
3192 a\bap\bpp\bpl\bli\bic\bca\bat\bti\bio\bon\bn
3193 The a\bap\bpp\bpl\bli\bic\bca\bat\bti\bio\bon\bn construct is used to include application-
3194 specific settings. Each program using the readline
3195 library sets the _\ba_\bp_\bp_\bl_\bi_\bc_\ba_\bt_\bi_\bo_\bn _\bn_\ba_\bm_\be, and an initialization
3196 file can test for a particular value. This could be used
3197 to bind key sequences to functions useful for a specific
3198 program. For instance, the following command adds a key
3199 sequence that quotes the current or previous word in
3200 b\bba\bas\bsh\bh:
3201
3202 $\b$i\bif\bf Bash
3203 # Quote the current or previous word
3204 "\C-xq": "\eb\"\ef\""
3205 $\b$e\ben\bnd\bdi\bif\bf
3206
3207 $\b$e\ben\bnd\bdi\bif\bf This command, as seen in the previous example, terminates an $\b$i\bif\bf
3208 command.
3209
3210 $\b$e\bel\bls\bse\be Commands in this branch of the $\b$i\bif\bf directive are executed if the
3211 test fails.
3212
3213 $\b$i\bin\bnc\bcl\blu\bud\bde\be
3214 This directive takes a single filename as an argument and reads
3215 commands and bindings from that file. For example, the follow-
3216 ing directive would read _\b/_\be_\bt_\bc_\b/_\bi_\bn_\bp_\bu_\bt_\br_\bc:
3217
3218 $\b$i\bin\bnc\bcl\blu\bud\bde\be _\b/_\be_\bt_\bc_\b/_\bi_\bn_\bp_\bu_\bt_\br_\bc
3219
3220 S\bSe\bea\bar\brc\bch\bhi\bin\bng\bg
3221 Readline provides commands for searching through the command history
3222 (see H\bHI\bIS\bST\bTO\bOR\bRY\bY below) for lines containing a specified string. There are
3223 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.
3224
3225 Incremental searches begin before the user has finished typing the
3226 search string. As each character of the search string is typed, read-
3227 line displays the next entry from the history matching the string typed
3228 so far. An incremental search requires only as many characters as
3229 needed to find the desired history entry. The characters present in
3230 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
3231 incremental search. If that variable has not been assigned a value the
3232 Escape and Control-J characters will terminate an incremental search.
3233 Control-G will abort an incremental search and restore the original
3234 line. When the search is terminated, the history entry containing the
3235 search string becomes the current line.
3236
3237 To find other matching entries in the history list, type Control-S or
3238 Control-R as appropriate. This will search backward or forward in the
3239 history for the next entry matching the search string typed so far.
3240 Any other key sequence bound to a readline command will terminate the
3241 search and execute that command. For instance, a _\bn_\be_\bw_\bl_\bi_\bn_\be will termi-
3242 nate the search and accept the line, thereby executing the command from
3243 the history list.
3244
3245 Readline remembers the last incremental search string. If two Control-
3246 Rs are typed without any intervening characters defining a new search
3247 string, any remembered search string is used.
3248
3249 Non-incremental searches read the entire search string before starting
3250 to search for matching history lines. The search string may be typed
3251 by the user or be part of the contents of the current line.
3252
3253 R\bRe\bea\bad\bdl\bli\bin\bne\be C\bCo\bom\bmm\bma\ban\bnd\bd N\bNa\bam\bme\bes\bs
3254 The following is a list of the names of the commands and the default
3255 key sequences to which they are bound. Command names without an accom-
3256 panying key sequence are unbound by default. In the following descrip-
3257 tions, _\bp_\bo_\bi_\bn_\bt refers to the current cursor position, and _\bm_\ba_\br_\bk refers to
3258 a cursor position saved by the s\bse\bet\bt-\b-m\bma\bar\brk\bk command. The text between the
3259 point and mark is referred to as the _\br_\be_\bg_\bi_\bo_\bn.
3260
3261 C\bCo\bom\bmm\bma\ban\bnd\bds\bs f\bfo\bor\br M\bMo\bov\bvi\bin\bng\bg
3262 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)
3263 Move to the start of the current line.
3264 e\ben\bnd\bd-\b-o\bof\bf-\b-l\bli\bin\bne\be (\b(C\bC-\b-e\be)\b)
3265 Move to the end of the line.
3266 f\bfo\bor\brw\bwa\bar\brd\bd-\b-c\bch\bha\bar\br (\b(C\bC-\b-f\bf)\b)
3267 Move forward a character.
3268 b\bba\bac\bck\bkw\bwa\bar\brd\bd-\b-c\bch\bha\bar\br (\b(C\bC-\b-b\bb)\b)
3269 Move back a character.
3270 f\bfo\bor\brw\bwa\bar\brd\bd-\b-w\bwo\bor\brd\bd (\b(M\bM-\b-f\bf)\b)
3271 Move forward to the end of the next word. Words are composed of
3272 alphanumeric characters (letters and digits).
3273 b\bba\bac\bck\bkw\bwa\bar\brd\bd-\b-w\bwo\bor\brd\bd (\b(M\bM-\b-b\bb)\b)
3274 Move back to the start of the current or previous word. Words
3275 are composed of alphanumeric characters (letters and digits).
3276 s\bsh\bhe\bel\bll\bl-\b-f\bfo\bor\brw\bwa\bar\brd\bd-\b-w\bwo\bor\brd\bd
3277 Move forward to the end of the next word. Words are delimited
3278 by non-quoted shell metacharacters.
3279 s\bsh\bhe\bel\bll\bl-\b-b\bba\bac\bck\bkw\bwa\bar\brd\bd-\b-w\bwo\bor\brd\bd
3280 Move back to the start of the current or previous word. Words
3281 are delimited by non-quoted shell metacharacters.
3282 c\bcl\ble\bea\bar\br-\b-s\bsc\bcr\bre\bee\ben\bn (\b(C\bC-\b-l\bl)\b)
3283 Clear the screen leaving the current line at the top of the
3284 screen. With an argument, refresh the current line without
3285 clearing the screen.
3286 r\bre\bed\bdr\bra\baw\bw-\b-c\bcu\bur\brr\bre\ben\bnt\bt-\b-l\bli\bin\bne\be
3287 Refresh the current line.
3288
3289 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
3290 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)
3291 Accept the line regardless of where the cursor is. If this line
3292 is non-empty, add it to the history list according to the state
3293 of the H\bHI\bIS\bST\bTC\bCO\bON\bNT\bTR\bRO\bOL\bL variable. If the line is a modified history
3294 line, then restore the history line to its original state.
3295 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)
3296 Fetch the previous command from the history list, moving back in
3297 the list.
3298 n\bne\bex\bxt\bt-\b-h\bhi\bis\bst\bto\bor\bry\by (\b(C\bC-\b-n\bn)\b)
3299 Fetch the next command from the history list, moving forward in
3300 the list.
3301 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)
3302 Move to the first line in the history.
3303 e\ben\bnd\bd-\b-o\bof\bf-\b-h\bhi\bis\bst\bto\bor\bry\by (\b(M\bM-\b->\b>)\b)
3304 Move to the end of the input history, i.e., the line currently
3305 being entered.
3306 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)
3307 Search backward starting at the current line and moving `up'
3308 through the history as necessary. This is an incremental
3309 search.
3310 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)
3311 Search forward starting at the current line and moving `down'
3312 through the history as necessary. This is an incremental
3313 search.
3314 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)
3315 Search backward through the history starting at the current line
3316 using a non-incremental search for a string supplied by the
3317 user.
3318 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)
3319 Search forward through the history using a non-incremental
3320 search for a string supplied by the user.
3321 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
3322 Search forward through the history for the string of characters
3323 between the start of the current line and the point. This is a
3324 non-incremental search.
3325 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
3326 Search backward through the history for the string of characters
3327 between the start of the current line and the point. This is a
3328 non-incremental search.
3329 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)
3330 Insert the first argument to the previous command (usually the
3331 second word on the previous line) at point. With an argument _\bn,
3332 insert the _\bnth word from the previous command (the words in the
3333 previous command begin with word 0). A negative argument
3334 inserts the _\bnth word from the end of the previous command. Once
3335 the argument _\bn is computed, the argument is extracted as if the
3336 "!_\bn" history expansion had been specified.
3337 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)
3338 Insert the last argument to the previous command (the last word
3339 of the previous history entry). With a numeric argument, behave
3340 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
3341 move back through the history list, inserting the last word (or
3342 the word specified by the argument to the first call) of each
3343 line in turn. Any numeric argument supplied to these successive
3344 calls determines the direction to move through the history. A
3345 negative argument switches the direction through the history
3346 (back or forward). The history expansion facilities are used to
3347 extract the last word, as if the "!$" history expansion had been
3348 specified.
3349 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)
3350 Expand the line as the shell does. This performs alias and his-
3351 tory expansion as well as all of the shell word expansions. See
3352 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.
3353 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)
3354 Perform history expansion on the current line. See H\bHI\bIS\bST\bTO\bOR\bRY\bY
3355 E\bEX\bXP\bPA\bAN\bNS\bSI\bIO\bON\bN below for a description of history expansion.
3356 m\bma\bag\bgi\bic\bc-\b-s\bsp\bpa\bac\bce\be
3357 Perform history expansion on the current line and insert a
3358 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
3359 expansion.
3360 a\bal\bli\bia\bas\bs-\b-e\bex\bxp\bpa\ban\bnd\bd-\b-l\bli\bin\bne\be
3361 Perform alias expansion on the current line. See A\bAL\bLI\bIA\bAS\bSE\bES\bS above
3362 for a description of alias expansion.
3363 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
3364 Perform history and alias expansion on the current line.
3365 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)
3366 A synonym for y\bya\ban\bnk\bk-\b-l\bla\bas\bst\bt-\b-a\bar\brg\bg.
3367 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)
3368 Accept the current line for execution and fetch the next line
3369 relative to the current line from the history for editing. Any
3370 argument is ignored.
3371 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\bxC\bC-\b-e\be)\b)
3372 Invoke an editor on the current command line, and execute the
3373 result as shell commands. B\bBa\bas\bsh\bh attempts to invoke $\b$V\bVI\bIS\bSU\bUA\bAL\bL,
3374 $\b$E\bED\bDI\bIT\bTO\bOR\bR, and _\be_\bm_\ba_\bc_\bs as the editor, in that order.
3375
3376 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
3377 _\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)
3378 The character indicating end-of-file as set, for example, by
3379 ``stty''. If this character is read when there are no charac-
3380 ters on the line, and point is at the beginning of the line,
3381 Readline interprets it as the end of input and returns E\bEO\bOF\bF.
3382 d\bde\bel\ble\bet\bte\be-\b-c\bch\bha\bar\br (\b(C\bC-\b-d\bd)\b)
3383 Delete the character at point. If this function is bound to the
3384 same character as the tty E\bEO\bOF\bF character, as C\bC-\b-d\bd commonly is, see
3385 above for the effects.
3386 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)
3387 Delete the character behind the cursor. When given a numeric
3388 argument, save the deleted text on the kill ring.
3389 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
3390 Delete the character under the cursor, unless the cursor is at
3391 the end of the line, in which case the character behind the cur-
3392 sor is deleted.
3393 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)
3394 Add the next character typed to the line verbatim. This is how
3395 to insert characters like C\bC-\b-q\bq, for example.
3396 t\bta\bab\bb-\b-i\bin\bns\bse\ber\brt\bt (\b(C\bC-\b-v\bv T\bTA\bAB\bB)\b)
3397 Insert a tab character.
3398 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..\b..\b.)\b)
3399 Insert the character typed.
3400 t\btr\bra\ban\bns\bsp\bpo\bos\bse\be-\b-c\bch\bha\bar\brs\bs (\b(C\bC-\b-t\bt)\b)
3401 Drag the character before point forward over the character at
3402 point, moving point forward as well. If point is at the end of
3403 the line, then this transposes the two characters before point.
3404 Negative arguments have no effect.
3405 t\btr\bra\ban\bns\bsp\bpo\bos\bse\be-\b-w\bwo\bor\brd\bds\bs (\b(M\bM-\b-t\bt)\b)
3406 Drag the word before point past the word after point, moving
3407 point over that word as well. If point is at the end of the
3408 line, this transposes the last two words on the line.
3409 u\bup\bpc\bca\bas\bse\be-\b-w\bwo\bor\brd\bd (\b(M\bM-\b-u\bu)\b)
3410 Uppercase the current (or following) word. With a negative
3411 argument, uppercase the previous word, but do not move point.
3412 d\bdo\bow\bwn\bnc\bca\bas\bse\be-\b-w\bwo\bor\brd\bd (\b(M\bM-\b-l\bl)\b)
3413 Lowercase the current (or following) word. With a negative
3414 argument, lowercase the previous word, but do not move point.
3415 c\bca\bap\bpi\bit\bta\bal\bli\biz\bze\be-\b-w\bwo\bor\brd\bd (\b(M\bM-\b-c\bc)\b)
3416 Capitalize the current (or following) word. With a negative
3417 argument, capitalize the previous word, but do not move point.
3418 o\bov\bve\ber\brw\bwr\bri\bit\bte\be-\b-m\bmo\bod\bde\be
3419 Toggle overwrite mode. With an explicit positive numeric argu-
3420 ment, switches to overwrite mode. With an explicit non-positive
3421 numeric argument, switches to insert mode. This command affects
3422 only e\bem\bma\bac\bcs\bs mode; v\bvi\bi mode does overwrite differently. Each call
3423 to _\br_\be_\ba_\bd_\bl_\bi_\bn_\be_\b(_\b) starts in insert mode. In overwrite mode, charac-
3424 ters bound to s\bse\bel\blf\bf-\b-i\bin\bns\bse\ber\brt\bt replace the text at point rather than
3425 pushing the text to the right. Characters bound to b\bba\bac\bck\bk-\b-
3426 w\bwa\bar\brd\bd-\b-d\bde\bel\ble\bet\bte\be-\b-c\bch\bha\bar\br replace the character before point with a
3427 space. By default, this command is unbound.
3428
3429 K\bKi\bil\bll\bli\bin\bng\bg a\ban\bnd\bd Y\bYa\ban\bnk\bki\bin\bng\bg
3430 k\bki\bil\bll\bl-\b-l\bli\bin\bne\be (\b(C\bC-\b-k\bk)\b)
3431 Kill the text from point to the end of the line.
3432 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)
3433 Kill backward to the beginning of the line.
3434 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)
3435 Kill backward from point to the beginning of the line. The
3436 killed text is saved on the kill-ring.
3437 k\bki\bil\bll\bl-\b-w\bwh\bho\bol\ble\be-\b-l\bli\bin\bne\be
3438 Kill all characters on the current line, no matter where point
3439 is.
3440 k\bki\bil\bll\bl-\b-w\bwo\bor\brd\bd (\b(M\bM-\b-d\bd)\b)
3441 Kill from point to the end of the current word, or if between
3442 words, to the end of the next word. Word boundaries are the
3443 same as those used by f\bfo\bor\brw\bwa\bar\brd\bd-\b-w\bwo\bor\brd\bd.
3444 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)
3445 Kill the word behind point. Word boundaries are the same as
3446 those used by b\bba\bac\bck\bkw\bwa\bar\brd\bd-\b-w\bwo\bor\brd\bd.
3447 s\bsh\bhe\bel\bll\bl-\b-k\bki\bil\bll\bl-\b-w\bwo\bor\brd\bd
3448 Kill from point to the end of the current word, or if between
3449 words, to the end of the next word. Word boundaries are the
3450 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.
3451 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
3452 Kill the word behind point. Word boundaries are the same as
3453 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.
3454 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)
3455 Kill the word behind point, using white space as a word bound-
3456 ary. The killed text is saved on the kill-ring.
3457 u\bun\bni\bix\bx-\b-f\bfi\bil\ble\ben\bna\bam\bme\be-\b-r\bru\bub\bbo\bou\but\bt
3458 Kill the word behind point, using white space and the slash
3459 character as the word boundaries. The killed text is saved on
3460 the kill-ring.
3461 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)
3462 Delete all spaces and tabs around point.
3463 k\bki\bil\bll\bl-\b-r\bre\beg\bgi\bio\bon\bn
3464 Kill the text in the current region.
3465 c\bco\bop\bpy\by-\b-r\bre\beg\bgi\bio\bon\bn-\b-a\bas\bs-\b-k\bki\bil\bll\bl
3466 Copy the text in the region to the kill buffer.
3467 c\bco\bop\bpy\by-\b-b\bba\bac\bck\bkw\bwa\bar\brd\bd-\b-w\bwo\bor\brd\bd
3468 Copy the word before point to the kill buffer. The word bound-
3469 aries are the same as b\bba\bac\bck\bkw\bwa\bar\brd\bd-\b-w\bwo\bor\brd\bd.
3470 c\bco\bop\bpy\by-\b-f\bfo\bor\brw\bwa\bar\brd\bd-\b-w\bwo\bor\brd\bd
3471 Copy the word following point to the kill buffer. The word
3472 boundaries are the same as f\bfo\bor\brw\bwa\bar\brd\bd-\b-w\bwo\bor\brd\bd.
3473 y\bya\ban\bnk\bk (\b(C\bC-\b-y\by)\b)
3474 Yank the top of the kill ring into the buffer at point.
3475 y\bya\ban\bnk\bk-\b-p\bpo\bop\bp (\b(M\bM-\b-y\by)\b)
3476 Rotate the kill ring, and yank the new top. Only works follow-
3477 ing y\bya\ban\bnk\bk or y\bya\ban\bnk\bk-\b-p\bpo\bop\bp.
3478
3479 N\bNu\bum\bme\ber\bri\bic\bc A\bAr\brg\bgu\bum\bme\ben\bnt\bts\bs
3480 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..\b..\b.,\b, M\bM-\b--\b-)\b)
3481 Add this digit to the argument already accumulating, or start a
3482 new argument. M-- starts a negative argument.
3483 u\bun\bni\biv\bve\ber\brs\bsa\bal\bl-\b-a\bar\brg\bgu\bum\bme\ben\bnt\bt
3484 This is another way to specify an argument. If this command is
3485 followed by one or more digits, optionally with a leading minus
3486 sign, those digits define the argument. If the command is fol-
3487 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
3488 numeric argument, but is otherwise ignored. As a special case,
3489 if this command is immediately followed by a character that is
3490 neither a digit nor minus sign, the argument count for the next
3491 command is multiplied by four. The argument count is initially
3492 one, so executing this function the first time makes the argu-
3493 ment count four, a second time makes the argument count sixteen,
3494 and so on.
3495
3496 C\bCo\bom\bmp\bpl\ble\bet\bti\bin\bng\bg
3497 c\bco\bom\bmp\bpl\ble\bet\bte\be (\b(T\bTA\bAB\bB)\b)
3498 Attempt to perform completion on the text before point. B\bBa\bas\bsh\bh
3499 attempts completion treating the text as a variable (if the text
3500 begins with $\b$), username (if the text begins with ~\b~), hostname
3501 (if the text begins with @\b@), or command (including aliases and
3502 functions) in turn. If none of these produces a match, filename
3503 completion is attempted.
3504 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)
3505 List the possible completions of the text before point.
3506 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)
3507 Insert all completions of the text before point that would have
3508 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.
3509 m\bme\ben\bnu\bu-\b-c\bco\bom\bmp\bpl\ble\bet\bte\be
3510 Similar to c\bco\bom\bmp\bpl\ble\bet\bte\be, but replaces the word to be completed with
3511 a single match from the list of possible completions. Repeated
3512 execution of m\bme\ben\bnu\bu-\b-c\bco\bom\bmp\bpl\ble\bet\bte\be steps through the list of possible
3513 completions, inserting each match in turn. At the end of the
3514 list of completions, the bell is rung (subject to the setting of
3515 b\bbe\bel\bll\bl-\b-s\bst\bty\byl\ble\be) and the original text is restored. An argument of _\bn
3516 moves _\bn positions forward in the list of matches; a negative
3517 argument may be used to move backward through the list. This
3518 command is intended to be bound to T\bTA\bAB\bB, but is unbound by
3519 default.
3520 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
3521 Identical to m\bme\ben\bnu\bu-\b-c\bco\bom\bmp\bpl\ble\bet\bte\be, but moves backward through the list
3522 of possible completions, as if m\bme\ben\bnu\bu-\b-c\bco\bom\bmp\bpl\ble\bet\bte\be had been given a
3523 negative argument. This command is unbound by default.
3524 d\bde\bel\ble\bet\bte\be-\b-c\bch\bha\bar\br-\b-o\bor\br-\b-l\bli\bis\bst\bt
3525 Deletes the character under the cursor if not at the beginning
3526 or end of the line (like d\bde\bel\ble\bet\bte\be-\b-c\bch\bha\bar\br). If at the end of the
3527 line, 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
3528 is unbound by default.
3529 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)
3530 Attempt filename completion on the text before point.
3531 p\bpo\bos\bss\bsi\bib\bbl\ble\be-\b-f\bfi\bil\ble\ben\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)
3532 List the possible completions of the text before point, treating
3533 it as a filename.
3534 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)
3535 Attempt completion on the text before point, treating it as a
3536 username.
3537 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)
3538 List the possible completions of the text before point, treating
3539 it as a username.
3540 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)
3541 Attempt completion on the text before point, treating it as a
3542 shell variable.
3543 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)
3544 List the possible completions of the text before point, treating
3545 it as a shell variable.
3546 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)
3547 Attempt completion on the text before point, treating it as a
3548 hostname.
3549 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)
3550 List the possible completions of the text before point, treating
3551 it as a hostname.
3552 c\bco\bom\bmp\bpl\ble\bet\bte\be-\b-c\bco\bom\bmm\bma\ban\bnd\bd (\b(M\bM-\b-!\b!)\b)
3553 Attempt completion on the text before point, treating it as a
3554 command name. Command completion attempts to match the text
3555 against aliases, reserved words, shell functions, shell
3556 builtins, and finally executable filenames, in that order.
3557 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)
3558 List the possible completions of the text before point, treating
3559 it as a command name.
3560 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)
3561 Attempt completion on the text before point, comparing the text
3562 against lines from the history list for possible completion
3563 matches.
3564 d\bda\bab\bbb\bbr\bre\bev\bv-\b-e\bex\bxp\bpa\ban\bnd\bd
3565 Attempt menu completion on the text before point, comparing the
3566 text against lines from the history list for possible completion
3567 matches.
3568 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)
3569 Perform filename completion and insert the list of possible com-
3570 pletions enclosed within braces so the list is available to the
3571 shell (see B\bBr\bra\bac\bce\be E\bEx\bxp\bpa\ban\bns\bsi\bio\bon\bn above).
3572
3573 K\bKe\bey\byb\bbo\boa\bar\brd\bd M\bMa\bac\bcr\bro\bos\bs
3574 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)
3575 Begin saving the characters typed into the current keyboard
3576 macro.
3577 e\ben\bnd\bd-\b-k\bkb\bbd\bd-\b-m\bma\bac\bcr\bro\bo (\b(C\bC-\b-x\bx )\b))\b)
3578 Stop saving the characters typed into the current keyboard macro
3579 and store the definition.
3580 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)
3581 Re-execute the last keyboard macro defined, by making the char-
3582 acters in the macro appear as if typed at the keyboard.
3583 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)
3584 Print the last keyboard macro defined in a format suitable for
3585 the _\bi_\bn_\bp_\bu_\bt_\br_\bc file.
3586
3587 M\bMi\bis\bsc\bce\bel\bll\bla\ban\bne\beo\bou\bus\bs
3588 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)
3589 Read in the contents of the _\bi_\bn_\bp_\bu_\bt_\br_\bc file, and incorporate any
3590 bindings or variable assignments found there.
3591 a\bab\bbo\bor\brt\bt (\b(C\bC-\b-g\bg)\b)
3592 Abort the current editing command and ring the terminal's bell
3593 (subject to the setting of b\bbe\bel\bll\bl-\b-s\bst\bty\byl\ble\be).
3594 d\bdo\bo-\b-u\bup\bpp\bpe\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..\b..\b.)\b)
3595 If the metafied character _\bx is lowercase, run the command that
3596 is bound to the corresponding uppercase character.
3597 p\bpr\bre\bef\bfi\bix\bx-\b-m\bme\bet\bta\ba (\b(E\bES\bSC\bC)\b)
3598 Metafy the next character typed. E\bES\bSC\bC f\bf is equivalent to M\bMe\bet\bta\ba-\b-f\bf.
3599 u\bun\bnd\bdo\bo (\b(C\bC-\b-_\b_,\b, C\bC-\b-x\bx C\bC-\b-u\bu)\b)
3600 Incremental undo, separately remembered for each line.
3601 r\bre\bev\bve\ber\brt\bt-\b-l\bli\bin\bne\be (\b(M\bM-\b-r\br)\b)
3602 Undo all changes made to this line. This is like executing the
3603 u\bun\bnd\bdo\bo command enough times to return the line to its initial
3604 state.
3605 t\bti\bil\bld\bde\be-\b-e\bex\bxp\bpa\ban\bnd\bd (\b(M\bM-\b-&\b&)\b)
3606 Perform tilde expansion on the current word.
3607 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)
3608 Set the mark to the point. If a numeric argument is supplied,
3609 the mark is set to that position.
3610 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)
3611 Swap the point with the mark. The current cursor position is
3612 set to the saved position, and the old cursor position is saved
3613 as the mark.
3614 c\bch\bha\bar\bra\bac\bct\bte\ber\br-\b-s\bse\bea\bar\brc\bch\bh (\b(C\bC-\b-]\b])\b)
3615 A character is read and point is moved to the next occurrence of
3616 that character. A negative count searches for previous occur-
3617 rences.
3618 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)
3619 A character is read and point is moved to the previous occur-
3620 rence of that character. A negative count searches for subse-
3621 quent occurrences.
3622 s\bsk\bki\bip\bp-\b-c\bcs\bsi\bi-\b-s\bse\beq\bqu\bue\ben\bnc\bce\be
3623 Read enough characters to consume a multi-key sequence such as
3624 those defined for keys like Home and End. Such sequences begin
3625 with a Control Sequence Indicator (CSI), usually ESC-[. If this
3626 sequence is bound to "\[", keys producing such sequences will
3627 have no effect unless explicitly bound to a readline command,
3628 instead of inserting stray characters into the editing buffer.
3629 This is unbound by default, but usually bound to ESC-[.
3630 i\bin\bns\bse\ber\brt\bt-\b-c\bco\bom\bmm\bme\ben\bnt\bt (\b(M\bM-\b-#\b#)\b)
3631 Without a numeric argument, the value of the readline c\bco\bom\bm-\b-
3632 m\bme\ben\bnt\bt-\b-b\bbe\beg\bgi\bin\bn variable is inserted at the beginning of the current
3633 line. If a numeric argument is supplied, this command acts as a
3634 toggle: if the characters at the beginning of the line do not
3635 match the value of c\bco\bom\bmm\bme\ben\bnt\bt-\b-b\bbe\beg\bgi\bin\bn, the value is inserted, other-
3636 wise the characters in c\bco\bom\bmm\bme\ben\bnt\bt-\b-b\bbe\beg\bgi\bin\bn are deleted from the begin-
3637 ning of the line. In either case, the line is accepted as if a
3638 newline had been typed. The default value of c\bco\bom\bmm\bme\ben\bnt\bt-\b-b\bbe\beg\bgi\bin\bn
3639 causes this command to make the current line a shell comment.
3640 If a numeric argument causes the comment character to be
3641 removed, the line will be executed by the shell.
3642 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)
3643 The word before point is treated as a pattern for pathname
3644 expansion, with an asterisk implicitly appended. This pattern
3645 is used to generate a list of matching filenames for possible
3646 completions.
3647 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)
3648 The word before point is treated as a pattern for pathname
3649 expansion, and the list of matching filenames is inserted,
3650 replacing the word. If a numeric argument is supplied, an
3651 asterisk is appended before pathname expansion.
3652 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)
3653 The list of expansions that would have been generated by
3654 g\bgl\blo\bob\bb-\b-e\bex\bxp\bpa\ban\bnd\bd-\b-w\bwo\bor\brd\bd is displayed, and the line is redrawn. If a
3655 numeric argument is supplied, an asterisk is appended before
3656 pathname expansion.
3657 d\bdu\bum\bmp\bp-\b-f\bfu\bun\bnc\bct\bti\bio\bon\bns\bs
3658 Print all of the functions and their key bindings to the read-
3659 line output stream. If a numeric argument is supplied, the out-
3660 put is formatted in such a way that it can be made part of an
3661 _\bi_\bn_\bp_\bu_\bt_\br_\bc file.
3662 d\bdu\bum\bmp\bp-\b-v\bva\bar\bri\bia\bab\bbl\ble\bes\bs
3663 Print all of the settable readline variables and their values to
3664 the readline output stream. If a numeric argument is supplied,
3665 the output is formatted in such a way that it can be made part
3666 of an _\bi_\bn_\bp_\bu_\bt_\br_\bc file.
3667 d\bdu\bum\bmp\bp-\b-m\bma\bac\bcr\bro\bos\bs
3668 Print all of the readline key sequences bound to macros and the
3669 strings they output. If a numeric argument is supplied, the
3670 output is formatted in such a way that it can be made part of an
3671 _\bi_\bn_\bp_\bu_\bt_\br_\bc file.
3672 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)
3673 Display version information about the current instance of b\bba\bas\bsh\bh.
3674
3675 P\bPr\bro\bog\bgr\bra\bam\bmm\bma\bab\bbl\ble\be C\bCo\bom\bmp\bpl\ble\bet\bti\bio\bon\bn
3676 When word completion is attempted for an argument to a command for
3677 which a completion specification (a _\bc_\bo_\bm_\bp_\bs_\bp_\be_\bc) has been defined using
3678 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), the program-
3679 mable completion facilities are invoked.
3680
3681 First, the command name is identified. If the command word is the
3682 empty string (completion attempted at the beginning of an empty line),
3683 any compspec defined with the -\b-E\bE option to c\bco\bom\bmp\bpl\ble\bet\bte\be is used. If a
3684 compspec has been defined for that command, the compspec is used to
3685 generate the list of possible completions for the word. If the command
3686 word is a full pathname, a compspec for the full pathname is searched
3687 for first. If no compspec is found for the full pathname, an attempt
3688 is made to find a compspec for the portion following the final slash.
3689 If those searches do not result in a compspec, any compspec defined
3690 with the -\b-D\bD option to c\bco\bom\bmp\bpl\ble\bet\bte\be is used as the default.
3691
3692 Once a compspec has been found, it is used to generate the list of
3693 matching words. If a compspec is not found, the default b\bba\bas\bsh\bh comple-
3694 tion as described above under C\bCo\bom\bmp\bpl\ble\bet\bti\bin\bng\bg is performed.
3695
3696 First, the actions specified by the compspec are used. Only matches
3697 which are prefixed by the word being completed are returned. When the
3698 -\b-f\bf or -\b-d\bd option is used for filename or directory name completion, the
3699 shell variable F\bFI\bIG\bGN\bNO\bOR\bRE\bE is used to filter the matches.
3700
3701 Any completions specified by a pathname expansion pattern to the -\b-G\bG
3702 option are generated next. The words generated by the pattern need not
3703 match the word being completed. The G\bGL\bLO\bOB\bBI\bIG\bGN\bNO\bOR\bRE\bE shell variable is not
3704 used to filter the matches, but the F\bFI\bIG\bGN\bNO\bOR\bRE\bE variable is used.
3705
3706 Next, the string specified as the argument to the -\b-W\bW option is consid-
3707 ered. The string is first split using the characters in the I\bIF\bFS\bS spe-
3708 cial variable as delimiters. Shell quoting is honored. Each word is
3709 then expanded using brace expansion, tilde expansion, parameter and
3710 variable expansion, command substitution, and arithmetic expansion, as
3711 described above under E\bEX\bXP\bPA\bAN\bNS\bSI\bIO\bON\bN. The results are split using the rules
3712 described above under W\bWo\bor\brd\bd S\bSp\bpl\bli\bit\btt\bti\bin\bng\bg. The results of the expansion are
3713 prefix-matched against the word being completed, and the matching words
3714 become the possible completions.
3715
3716 After these matches have been generated, any shell function or command
3717 specified with the -\b-F\bF and -\b-C\bC options is invoked. When the command or
3718 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
3719 variables are assigned values as described above under S\bSh\bhe\bel\bll\bl V\bVa\bar\bri\bia\bab\bbl\ble\bes\bs.
3720 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
3721 variables are also set. When the function or command is invoked, the
3722 first argument ($\b$1\b1) is the name of the command whose arguments are
3723 being completed, the second argument ($\b$2\b2) is the word being completed,
3724 and the third argument ($\b$3\b3) is the word preceding the word being com-
3725 pleted on the current command line. No filtering of the generated com-
3726 pletions against the word being completed is performed; the function or
3727 command has complete freedom in generating the matches.
3728
3729 Any function specified with -\b-F\bF is invoked first. The function may use
3730 any of the shell facilities, including the c\bco\bom\bmp\bpg\bge\ben\bn builtin described
3731 below, to generate the matches. It must put the possible completions
3732 in the C\bCO\bOM\bMP\bPR\bRE\bEP\bPL\bLY\bY array variable, one per array element.
3733
3734 Next, any command specified with the -\b-C\bC option is invoked in an envi-
3735 ronment equivalent to command substitution. It should print a list of
3736 completions, one per line, to the standard output. Backslash may be
3737 used to escape a newline, if necessary.
3738
3739 After all of the possible completions are generated, any filter speci-
3740 fied with the -\b-X\bX option is applied to the list. The filter is a pat-
3741 tern as used for pathname expansion; a &\b& in the pattern is replaced
3742 with the text of the word being completed. A literal &\b& may be escaped
3743 with a backslash; the backslash is removed before attempting a match.
3744 Any completion that matches the pattern will be removed from the list.
3745 A leading !\b! negates the pattern; in this case any completion not match-
3746 ing the pattern will be removed. If the n\bno\boc\bca\bas\bse\bem\bma\bat\btc\bch\bh shell option is
3747 enabled, the match is performed without regard to the case of alpha-
3748 betic characters.
3749
3750 Finally, any prefix and suffix specified with the -\b-P\bP and -\b-S\bS options are
3751 added to each member of the completion list, and the result is returned
3752 to the readline completion code as the list of possible completions.
3753
3754 If the previously-applied actions do not generate any matches, and the
3755 -\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
3756 defined, directory name completion is attempted.
3757
3758 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
3759 was defined, directory name completion is attempted and any matches are
3760 added to the results of the other actions.
3761
3762 By default, if a compspec is found, whatever it generates is returned
3763 to the completion code as the full set of possible completions. The
3764 default b\bba\bas\bsh\bh completions are not attempted, and the readline default of
3765 filename completion is disabled. If the -\b-o\bo b\bba\bas\bsh\bhd\bde\bef\bfa\bau\bul\blt\bt option was sup-
3766 plied to c\bco\bom\bmp\bpl\ble\bet\bte\be when the compspec was defined, the b\bba\bas\bsh\bh default com-
3767 pletions are attempted if the compspec generates no matches. If the -\b-o\bo
3768 d\bde\bef\bfa\bau\bul\blt\bt option was supplied to c\bco\bom\bmp\bpl\ble\bet\bte\be when the compspec was defined,
3769 readline's default completion will be performed if the compspec (and,
3770 if attempted, the default b\bba\bas\bsh\bh completions) generate no matches.
3771
3772 When a compspec indicates that directory name completion is desired,
3773 the programmable completion functions force readline to append a slash
3774 to completed names which are symbolic links to directories, subject to
3775 the value of the m\bma\bar\brk\bk-\b-d\bdi\bir\bre\bec\bct\bto\bor\bri\bie\bes\bs readline variable, regardless of the
3776 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 readline variable.
3777
3778 There is some support for dynamically modifying completions. This is
3779 most useful when used in combination with a default completion speci-
3780 fied with c\bco\bom\bmp\bpl\ble\bet\bte\be -\b-D\bD. It's possible for shell functions executed as
3781 completion handlers to indicate that completion should be retried by
3782 returning an exit status of 124. If a shell function returns 124, and
3783 changes the compspec associated with the command on which completion is
3784 being attempted (supplied as the first argument when the function is
3785 executed), programmable completion restarts from the beginning, with an
3786 attempt to find a new compspec for that command. This allows a set of
3787 completions to be built dynamically as completion is attempted, rather
3788 than being loaded all at once.
3789
3790 For instance, assuming that there is a library of compspecs, each kept
3791 in a file corresponding to the name of the command, the following
3792 default completion function would load completions dynamically:
3793
3794 _completion_loader()
3795 {
3796 . "/etc/bash_completion.d/$1.sh" >/dev/null 2>&1 && return 124
3797 }
3798 complete -D -F _completion_loader -o bashdefault -o default
3799
3800
3801 H\bHI\bIS\bST\bTO\bOR\bRY\bY
3802 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
3803 provides access to the _\bc_\bo_\bm_\bm_\ba_\bn_\bd _\bh_\bi_\bs_\bt_\bo_\br_\by, the list of commands previously
3804 typed. The value of the H\bHI\bIS\bST\bTS\bSI\bIZ\bZE\bE variable is used as the number of
3805 commands to save in a history list. The text of the last H\bHI\bIS\bST\bTS\bSI\bIZ\bZE\bE com-
3806 mands (default 500) is saved. The shell stores each command in the
3807 history list prior to parameter and variable expansion (see E\bEX\bXP\bPA\bAN\bNS\bSI\bIO\bON\bN
3808 above) but after history expansion is performed, subject to the values
3809 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.
3810
3811 On startup, the history is initialized from the file named by the vari-
3812 able H\bHI\bIS\bST\bTF\bFI\bIL\bLE\bE (default _\b~_\b/_\b._\bb_\ba_\bs_\bh_\b__\bh_\bi_\bs_\bt_\bo_\br_\by). The file named by the value
3813 of H\bHI\bIS\bST\bTF\bFI\bIL\bLE\bE is truncated, if necessary, to contain no more than the
3814 number of lines specified by the value of H\bHI\bIS\bST\bTF\bFI\bIL\bLE\bES\bSI\bIZ\bZE\bE. If H\bHI\bIS\bST\bTF\bFI\bIL\bLE\bE-\b-
3815 S\bSI\bIZ\bZE\bE is unset, or set to null, a non-numeric value, or a numeric value
3816 less than zero, the history file is not truncated. When the history
3817 file is read, lines beginning with the history comment character fol-
3818 lowed immediately by a digit are interpreted as timestamps for the pre-
3819 ceding history line. These timestamps are optionally displayed depend-
3820 ing on the value of the H\bHI\bIS\bST\bTT\bTI\bIM\bME\bEF\bFO\bOR\bRM\bMA\bAT\bT variable. When a shell with
3821 history enabled exits, the last $\b$H\bHI\bIS\bST\bTS\bSI\bIZ\bZE\bE lines are copied from the
3822 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
3823 (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
3824 lines are appended to the history file, otherwise the history file is
3825 overwritten. If H\bHI\bIS\bST\bTF\bFI\bIL\bLE\bE is unset, or if the history file is
3826 unwritable, the history is not saved. If the H\bHI\bIS\bST\bTT\bTI\bIM\bME\bEF\bFO\bOR\bRM\bMA\bAT\bT variable
3827 is set, time stamps are written to the history file, marked with the
3828 history comment character, so they may be preserved across shell ses-
3829 sions. This uses the history comment character to distinguish time-
3830 stamps from other history lines. After saving the history, the history
3831 file is truncated to contain no more than H\bHI\bIS\bST\bTF\bFI\bIL\bLE\bES\bSI\bIZ\bZE\bE lines. If H\bHI\bIS\bST\bT-\b-
3832 F\bFI\bIL\bLE\bES\bSI\bIZ\bZE\bE is unset, or set to null, a non-numeric value, or a numeric
3833 value less than zero, the history file is not truncated.
3834
3835 The builtin command f\bfc\bc (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) may be used
3836 to list or edit and re-execute a portion of the history list. The h\bhi\bis\bs-\b-
3837 t\bto\bor\bry\by builtin may be used to display or modify the history list and
3838 manipulate the history file. When using command-line editing, search
3839 commands are available in each editing mode that provide access to the
3840 history list.
3841
3842 The shell allows control over which commands are saved on the history
3843 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 may be set to cause the
3844 shell to save only a subset of the commands entered. The c\bcm\bmd\bdh\bhi\bis\bst\bt shell
3845 option, if enabled, causes the shell to attempt to save each line of a
3846 multi-line command in the same history entry, adding semicolons where
3847 necessary to preserve syntactic correctness. The l\bli\bit\bth\bhi\bis\bst\bt shell option
3848 causes the shell to save the command with embedded newlines instead of
3849 semicolons. See the description of the s\bsh\bho\bop\bpt\bt builtin below under S\bSH\bHE\bEL\bLL\bL
3850 B\bBU\bUI\bIL\bLT\bTI\bIN\bN C\bCO\bOM\bMM\bMA\bAN\bND\bDS\bS for information on setting and unsetting shell
3851 options.
3852
3853 H\bHI\bIS\bST\bTO\bOR\bRY\bY E\bEX\bXP\bPA\bAN\bNS\bSI\bIO\bON\bN
3854 The shell supports a history expansion feature that is similar to the
3855 history expansion in c\bcs\bsh\bh.\b. This section describes what syntax features
3856 are available. This feature is enabled by default for interactive
3857 shells, and can be disabled using the +\b+H\bH option to the s\bse\bet\bt builtin com-
3858 mand (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
3859 perform history expansion by default.
3860
3861 History expansions introduce words from the history list into the input
3862 stream, making it easy to repeat commands, insert the arguments to a
3863 previous command into the current input line, or fix errors in previous
3864 commands quickly.
3865
3866 History expansion is performed immediately after a complete line is
3867 read, before the shell breaks it into words. It takes place in two
3868 parts. The first is to determine which line from the history list to
3869 use during substitution. The second is to select portions of that line
3870 for inclusion into the current one. The line selected from the history
3871 is the _\be_\bv_\be_\bn_\bt, and the portions of that line that are acted upon are
3872 _\bw_\bo_\br_\bd_\bs. Various _\bm_\bo_\bd_\bi_\bf_\bi_\be_\br_\bs are available to manipulate the selected
3873 words. The line is broken into words in the same fashion as when read-
3874 ing input, so that several _\bm_\be_\bt_\ba_\bc_\bh_\ba_\br_\ba_\bc_\bt_\be_\br-separated words surrounded by
3875 quotes are considered one word. History expansions are introduced by
3876 the appearance of the history expansion character, which is !\b! by
3877 default. Only backslash (\\b\) and single quotes can quote the history
3878 expansion character, but the history expansion character is also
3879 treated as quoted if it immediately precedes the closing double quote
3880 in a double-quoted string.
3881
3882 Several characters inhibit history expansion if found immediately fol-
3883 lowing the history expansion character, even if it is unquoted: space,
3884 tab, newline, carriage return, and =\b=. If the e\bex\bxt\btg\bgl\blo\bob\bb shell option is
3885 enabled, (\b( will also inhibit expansion.
3886
3887 Several shell options settable with the s\bsh\bho\bop\bpt\bt builtin may be used to
3888 tailor the behavior of history expansion. If the h\bhi\bis\bst\btv\bve\ber\bri\bif\bfy\by shell
3889 option is enabled (see the description of the s\bsh\bho\bop\bpt\bt builtin below), and
3890 r\bre\bea\bad\bdl\bli\bin\bne\be is being used, history substitutions are not immediately
3891 passed to the shell parser. Instead, the expanded line is reloaded
3892 into the r\bre\bea\bad\bdl\bli\bin\bne\be editing buffer for further modification. If r\bre\bea\bad\bdl\bli\bin\bne\be
3893 is being used, and the h\bhi\bis\bst\btr\bre\bee\bed\bdi\bit\bt shell option is enabled, a failed
3894 history substitution will be reloaded into the r\bre\bea\bad\bdl\bli\bin\bne\be editing buffer
3895 for correction. The -\b-p\bp option to the h\bhi\bis\bst\bto\bor\bry\by builtin command may be
3896 used to see what a history expansion will do before using it. The -\b-s\bs
3897 option to the h\bhi\bis\bst\bto\bor\bry\by builtin may be used to add commands to the end of
3898 the history list without actually executing them, so that they are
3899 available for subsequent recall.
3900
3901 The shell allows control of the various characters used by the history
3902 expansion mechanism (see the description of h\bhi\bis\bst\btc\bch\bha\bar\brs\bs above under S\bSh\bhe\bel\bll\bl
3903 V\bVa\bar\bri\bia\bab\bbl\ble\bes\bs). The shell uses the history comment character to mark his-
3904 tory timestamps when writing the history file.
3905
3906 E\bEv\bve\ben\bnt\bt D\bDe\bes\bsi\big\bgn\bna\bat\bto\bor\brs\bs
3907 An event designator is a reference to a command line entry in the his-
3908 tory list. Unless the reference is absolute, events are relative to
3909 the current position in the history list.
3910
3911 !\b! Start a history substitution, except when followed by a b\bbl\bla\ban\bnk\bk,
3912 newline, carriage return, = or ( (when the e\bex\bxt\btg\bgl\blo\bob\bb shell option
3913 is enabled using the s\bsh\bho\bop\bpt\bt builtin).
3914 !\b!_\bn Refer to command line _\bn.
3915 !\b!-\b-_\bn Refer to the current command minus _\bn.
3916 !\b!!\b! Refer to the previous command. This is a synonym for `!-1'.
3917 !\b!_\bs_\bt_\br_\bi_\bn_\bg
3918 Refer to the most recent command preceding the current position
3919 in the history list starting with _\bs_\bt_\br_\bi_\bn_\bg.
3920 !\b!?\b?_\bs_\bt_\br_\bi_\bn_\bg[\b[?\b?]\b]
3921 Refer to the most recent command preceding the current position
3922 in the history list containing _\bs_\bt_\br_\bi_\bn_\bg. The trailing ?\b? may be
3923 omitted if _\bs_\bt_\br_\bi_\bn_\bg is followed immediately by a newline.
3924 ^\b^_\bs_\bt_\br_\bi_\bn_\bg_\b1^\b^_\bs_\bt_\br_\bi_\bn_\bg_\b2^\b^
3925 Quick substitution. Repeat the previous command, replacing
3926 _\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/''
3927 (see M\bMo\bod\bdi\bif\bfi\bie\ber\brs\bs below).
3928 !\b!#\b# The entire command line typed so far.
3929
3930 W\bWo\bor\brd\bd D\bDe\bes\bsi\big\bgn\bna\bat\bto\bor\brs\bs
3931 Word designators are used to select desired words from the event. A :\b:
3932 separates the event specification from the word designator. It may be
3933 omitted if the word designator begins with a ^\b^, $\b$, *\b*, -\b-, or %\b%. Words
3934 are numbered from the beginning of the line, with the first word being
3935 denoted by 0 (zero). Words are inserted into the current line sepa-
3936 rated by single spaces.
3937
3938 0\b0 (\b(z\bze\ber\bro\bo)\b)
3939 The zeroth word. For the shell, this is the command word.
3940 _\bn The _\bnth word.
3941 ^\b^ The first argument. That is, word 1.
3942 $\b$ The last word. This is usually the last argument, but will
3943 expand to the zeroth word if there is only one word in the line.
3944 %\b% The word matched by the most recent `?_\bs_\bt_\br_\bi_\bn_\bg?' search.
3945 _\bx-\b-_\by A range of words; `-_\by' abbreviates `0-_\by'.
3946 *\b* All of the words but the zeroth. This is a synonym for `_\b1_\b-_\b$'.
3947 It is not an error to use *\b* if there is just one word in the
3948 event; the empty string is returned in that case.
3949 x\bx*\b* Abbreviates _\bx_\b-_\b$.
3950 x\bx-\b- Abbreviates _\bx_\b-_\b$ like x\bx*\b*, but omits the last word.
3951
3952 If a word designator is supplied without an event specification, the
3953 previous command is used as the event.
3954
3955 M\bMo\bod\bdi\bif\bfi\bie\ber\brs\bs
3956 After the optional word designator, there may appear a sequence of one
3957 or more of the following modifiers, each preceded by a `:'.
3958
3959 h\bh Remove a trailing filename component, leaving only the head.
3960 t\bt Remove all leading filename components, leaving the tail.
3961 r\br Remove a trailing suffix of the form _\b._\bx_\bx_\bx, leaving the basename.
3962 e\be Remove all but the trailing suffix.
3963 p\bp Print the new command but do not execute it.
3964 q\bq Quote the substituted words, escaping further substitutions.
3965 x\bx Quote the substituted words as with q\bq, but break into words at
3966 b\bbl\bla\ban\bnk\bks\bs and newlines.
3967 s\bs/\b/_\bo_\bl_\bd/\b/_\bn_\be_\bw/\b/
3968 Substitute _\bn_\be_\bw for the first occurrence of _\bo_\bl_\bd in the event
3969 line. Any delimiter can be used in place of /. The final
3970 delimiter is optional if it is the last character of the event
3971 line. The delimiter may be quoted in _\bo_\bl_\bd and _\bn_\be_\bw with a single
3972 backslash. If & appears in _\bn_\be_\bw, it is replaced by _\bo_\bl_\bd. A sin-
3973 gle backslash will quote the &. If _\bo_\bl_\bd is null, it is set to
3974 the last _\bo_\bl_\bd substituted, or, if no previous history substitu-
3975 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.
3976 &\b& Repeat the previous substitution.
3977 g\bg Cause changes to be applied over the entire event line. This is
3978 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&'.
3979 If used with `:\b:s\bs', any delimiter can be used in place of /, and
3980 the final delimiter is optional if it is the last character of
3981 the event line. An a\ba may be used as a synonym for g\bg.
3982 G\bG Apply the following `s\bs' modifier once to each word in the event
3983 line.
3984
3985 S\bSH\bHE\bEL\bLL\bL B\bBU\bUI\bIL\bLT\bTI\bIN\bN C\bCO\bOM\bMM\bMA\bAN\bND\bDS\bS
3986 Unless otherwise noted, each builtin command documented in this section
3987 as accepting options preceded by -\b- accepts -\b--\b- to signify the end of the
3988 options. The :\b:, t\btr\bru\bue\be, f\bfa\bal\bls\bse\be, and t\bte\bes\bst\bt builtins do not accept options
3989 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-
3990 t\bti\bin\bnu\bue\be, l\ble\bet\bt, and s\bsh\bhi\bif\bft\bt builtins accept and process arguments beginning
3991 with -\b- without requiring -\b--\b-. Other builtins that accept arguments but
3992 are not specified as accepting options interpret arguments beginning
3993 with -\b- as invalid options and require -\b--\b- to prevent this interpreta-
3994 tion.
3995 :\b: [_\ba_\br_\bg_\bu_\bm_\be_\bn_\bt_\bs]
3996 No effect; the command does nothing beyond expanding _\ba_\br_\bg_\bu_\bm_\be_\bn_\bt_\bs
3997 and performing any specified redirections. The return status is
3998 zero.
3999
4000 .\b. _\bf_\bi_\bl_\be_\bn_\ba_\bm_\be [_\ba_\br_\bg_\bu_\bm_\be_\bn_\bt_\bs]
4001 s\bso\bou\bur\brc\bce\be _\bf_\bi_\bl_\be_\bn_\ba_\bm_\be [_\ba_\br_\bg_\bu_\bm_\be_\bn_\bt_\bs]
4002 Read and execute commands from _\bf_\bi_\bl_\be_\bn_\ba_\bm_\be in the current shell
4003 environment and return the exit status of the last command exe-
4004 cuted from _\bf_\bi_\bl_\be_\bn_\ba_\bm_\be. If _\bf_\bi_\bl_\be_\bn_\ba_\bm_\be does not contain a slash,
4005 filenames in P\bPA\bAT\bTH\bH are used to find the directory containing
4006 _\bf_\bi_\bl_\be_\bn_\ba_\bm_\be. The file searched for in P\bPA\bAT\bTH\bH need not be executable.
4007 When b\bba\bas\bsh\bh is not in _\bp_\bo_\bs_\bi_\bx _\bm_\bo_\bd_\be, the current directory is
4008 searched if no file is found in P\bPA\bAT\bTH\bH. If the s\bso\bou\bur\brc\bce\bep\bpa\bat\bth\bh option
4009 to the s\bsh\bho\bop\bpt\bt builtin command is turned off, the P\bPA\bAT\bTH\bH is not
4010 searched. If any _\ba_\br_\bg_\bu_\bm_\be_\bn_\bt_\bs are supplied, they become the posi-
4011 tional parameters when _\bf_\bi_\bl_\be_\bn_\ba_\bm_\be is executed. Otherwise the
4012 positional parameters are unchanged. If the -\b-T\bT option is
4013 enabled, s\bso\bou\bur\brc\bce\be inherits any trap on D\bDE\bEB\bBU\bUG\bG; if it is not, any
4014 D\bDE\bEB\bBU\bUG\bG trap string is saved and restored around the call to
4015 s\bso\bou\bur\brc\bce\be, and s\bso\bou\bur\brc\bce\be unsets the D\bDE\bEB\bBU\bUG\bG trap while it executes. If
4016 -\b-T\bT is not set, and the sourced file changes the D\bDE\bEB\bBU\bUG\bG trap, the
4017 new value is retained when s\bso\bou\bur\brc\bce\be completes. The return status
4018 is the status of the last command exited within the script (0 if
4019 no commands are executed), and false if _\bf_\bi_\bl_\be_\bn_\ba_\bm_\be is not found or
4020 cannot be read.
4021
4022 a\bal\bli\bia\bas\bs [-\b-p\bp] [_\bn_\ba_\bm_\be[=_\bv_\ba_\bl_\bu_\be] ...]
4023 A\bAl\bli\bia\bas\bs with no arguments or with the -\b-p\bp option prints the list of
4024 aliases in the form a\bal\bli\bia\bas\bs _\bn_\ba_\bm_\be=_\bv_\ba_\bl_\bu_\be on standard output. When
4025 arguments are supplied, an alias is defined for each _\bn_\ba_\bm_\be whose
4026 _\bv_\ba_\bl_\bu_\be is given. A trailing space in _\bv_\ba_\bl_\bu_\be causes the next word
4027 to be checked for alias substitution when the alias is expanded.
4028 For each _\bn_\ba_\bm_\be in the argument list for which no _\bv_\ba_\bl_\bu_\be is sup-
4029 plied, the name and value of the alias is printed. A\bAl\bli\bia\bas\bs
4030 returns true unless a _\bn_\ba_\bm_\be is given for which no alias has been
4031 defined.
4032
4033 b\bbg\bg [_\bj_\bo_\bb_\bs_\bp_\be_\bc ...]
4034 Resume each suspended job _\bj_\bo_\bb_\bs_\bp_\be_\bc in the background, as if it
4035 had been started with &\b&. If _\bj_\bo_\bb_\bs_\bp_\be_\bc is not present, the shell's
4036 notion of the _\bc_\bu_\br_\br_\be_\bn_\bt _\bj_\bo_\bb is used. b\bbg\bg _\bj_\bo_\bb_\bs_\bp_\be_\bc returns 0 unless
4037 run when job control is disabled or, when run with job control
4038 enabled, any specified _\bj_\bo_\bb_\bs_\bp_\be_\bc was not found or was started
4039 without job control.
4040
4041 b\bbi\bin\bnd\bd [-\b-m\bm _\bk_\be_\by_\bm_\ba_\bp] [-\b-l\blp\bps\bsv\bvP\bPS\bSV\bVX\bX]
4042 b\bbi\bin\bnd\bd [-\b-m\bm _\bk_\be_\by_\bm_\ba_\bp] [-\b-q\bq _\bf_\bu_\bn_\bc_\bt_\bi_\bo_\bn] [-\b-u\bu _\bf_\bu_\bn_\bc_\bt_\bi_\bo_\bn] [-\b-r\br _\bk_\be_\by_\bs_\be_\bq]
4043 b\bbi\bin\bnd\bd [-\b-m\bm _\bk_\be_\by_\bm_\ba_\bp] -\b-f\bf _\bf_\bi_\bl_\be_\bn_\ba_\bm_\be
4044 b\bbi\bin\bnd\bd [-\b-m\bm _\bk_\be_\by_\bm_\ba_\bp] -\b-x\bx _\bk_\be_\by_\bs_\be_\bq:_\bs_\bh_\be_\bl_\bl_\b-_\bc_\bo_\bm_\bm_\ba_\bn_\bd
4045 b\bbi\bin\bnd\bd [-\b-m\bm _\bk_\be_\by_\bm_\ba_\bp] _\bk_\be_\by_\bs_\be_\bq:_\bf_\bu_\bn_\bc_\bt_\bi_\bo_\bn_\b-_\bn_\ba_\bm_\be
4046 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
4047 Display current r\bre\bea\bad\bdl\bli\bin\bne\be key and function bindings, bind a key
4048 sequence to a r\bre\bea\bad\bdl\bli\bin\bne\be function or macro, or set a r\bre\bea\bad\bdl\bli\bin\bne\be
4049 variable. Each non-option argument is a command as it would
4050 appear in _\b._\bi_\bn_\bp_\bu_\bt_\br_\bc, but each binding or command must be passed
4051 as a separate argument; e.g., '"\C-x\C-r": re-read-init-file'.
4052 Options, if supplied, have the following meanings:
4053 -\b-m\bm _\bk_\be_\by_\bm_\ba_\bp
4054 Use _\bk_\be_\by_\bm_\ba_\bp as the keymap to be affected by the subsequent
4055 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-
4056 _\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,
4057 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
4058 equivalent to _\be_\bm_\ba_\bc_\bs_\b-_\bs_\bt_\ba_\bn_\bd_\ba_\br_\bd.
4059 -\b-l\bl List the names of all r\bre\bea\bad\bdl\bli\bin\bne\be functions.
4060 -\b-p\bp Display r\bre\bea\bad\bdl\bli\bin\bne\be function names and bindings in such a
4061 way that they can be re-read.
4062 -\b-P\bP List current r\bre\bea\bad\bdl\bli\bin\bne\be function names and bindings.
4063 -\b-s\bs Display r\bre\bea\bad\bdl\bli\bin\bne\be key sequences bound to macros and the
4064 strings they output in such a way that they can be re-
4065 read.
4066 -\b-S\bS Display r\bre\bea\bad\bdl\bli\bin\bne\be key sequences bound to macros and the
4067 strings they output.
4068 -\b-v\bv Display r\bre\bea\bad\bdl\bli\bin\bne\be variable names and values in such a way
4069 that they can be re-read.
4070 -\b-V\bV List current r\bre\bea\bad\bdl\bli\bin\bne\be variable names and values.
4071 -\b-f\bf _\bf_\bi_\bl_\be_\bn_\ba_\bm_\be
4072 Read key bindings from _\bf_\bi_\bl_\be_\bn_\ba_\bm_\be.
4073 -\b-q\bq _\bf_\bu_\bn_\bc_\bt_\bi_\bo_\bn
4074 Query about which keys invoke the named _\bf_\bu_\bn_\bc_\bt_\bi_\bo_\bn.
4075 -\b-u\bu _\bf_\bu_\bn_\bc_\bt_\bi_\bo_\bn
4076 Unbind all keys bound to the named _\bf_\bu_\bn_\bc_\bt_\bi_\bo_\bn.
4077 -\b-r\br _\bk_\be_\by_\bs_\be_\bq
4078 Remove any current binding for _\bk_\be_\by_\bs_\be_\bq.
4079 -\b-x\bx _\bk_\be_\by_\bs_\be_\bq:\b:_\bs_\bh_\be_\bl_\bl_\b-_\bc_\bo_\bm_\bm_\ba_\bn_\bd
4080 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
4081 entered. When _\bs_\bh_\be_\bl_\bl_\b-_\bc_\bo_\bm_\bm_\ba_\bn_\bd is executed, the shell sets
4082 the R\bRE\bEA\bAD\bDL\bLI\bIN\bNE\bE_\b_L\bLI\bIN\bNE\bE variable to the contents of the r\bre\bea\bad\bd-\b-
4083 l\bli\bin\bne\be line buffer and the R\bRE\bEA\bAD\bDL\bLI\bIN\bNE\bE_\b_P\bPO\bOI\bIN\bNT\bT variable to the
4084 current location of the insertion point. If the executed
4085 command changes the value of R\bRE\bEA\bAD\bDL\bLI\bIN\bNE\bE_\b_L\bLI\bIN\bNE\bE or R\bRE\bEA\bAD\bD-\b-
4086 L\bLI\bIN\bNE\bE_\b_P\bPO\bOI\bIN\bNT\bT, those new values will be reflected in the
4087 editing state.
4088 -\b-X\bX List all key sequences bound to shell commands and the
4089 associated commands in a format that can be reused as
4090 input.
4091
4092 The return value is 0 unless an unrecognized option is given or
4093 an error occurred.
4094
4095 b\bbr\bre\bea\bak\bk [_\bn]
4096 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
4097 specified, break _\bn levels. _\bn must be >= 1. If _\bn is greater
4098 than the number of enclosing loops, all enclosing loops are
4099 exited. The return value is 0 unless _\bn is not greater than or
4100 equal to 1.
4101
4102 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]
4103 Execute the specified shell builtin, passing it _\ba_\br_\bg_\bu_\bm_\be_\bn_\bt_\bs, and
4104 return its exit status. This is useful when defining a function
4105 whose name is the same as a shell builtin, retaining the func-
4106 tionality of the builtin within the function. The c\bcd\bd builtin is
4107 commonly redefined this way. The return status is false if
4108 _\bs_\bh_\be_\bl_\bl_\b-_\bb_\bu_\bi_\bl_\bt_\bi_\bn is not a shell builtin command.
4109
4110 c\bca\bal\bll\ble\ber\br [_\be_\bx_\bp_\br]
4111 Returns the context of any active subroutine call (a shell func-
4112 tion or a script executed with the .\b. or s\bso\bou\bur\brc\bce\be builtins). With-
4113 out _\be_\bx_\bp_\br, c\bca\bal\bll\ble\ber\br displays the line number and source filename of
4114 the current subroutine call. If a non-negative integer is sup-
4115 plied as _\be_\bx_\bp_\br, c\bca\bal\bll\ble\ber\br displays the line number, subroutine name,
4116 and source file corresponding to that position in the current
4117 execution call stack. This extra information may be used, for
4118 example, to print a stack trace. The current frame is frame 0.
4119 The return value is 0 unless the shell is not executing a sub-
4120 routine call or _\be_\bx_\bp_\br does not correspond to a valid position in
4121 the call stack.
4122
4123 c\bcd\bd [-\b-L\bL|[-\b-P\bP [-\b-e\be]] [-@]] [_\bd_\bi_\br]
4124 Change the current directory to _\bd_\bi_\br. if _\bd_\bi_\br is not supplied,
4125 the value of the H\bHO\bOM\bME\bE shell variable is the default. Any addi-
4126 tional arguments following _\bd_\bi_\br are ignored. The variable C\bCD\bDP\bPA\bAT\bTH\bH
4127 defines the search path for the directory containing _\bd_\bi_\br: each
4128 directory name in C\bCD\bDP\bPA\bAT\bTH\bH is searched for _\bd_\bi_\br. Alternative
4129 directory names in C\bCD\bDP\bPA\bAT\bTH\bH are separated by a colon (:). A null
4130 directory name in C\bCD\bDP\bPA\bAT\bTH\bH is the same as the current directory,
4131 i.e., ``.\b.''. If _\bd_\bi_\br begins with a slash (/), then C\bCD\bDP\bPA\bAT\bTH\bH is not
4132 used. The -\b-P\bP option causes c\bcd\bd to use the physical directory
4133 structure by resolving symbolic links while traversing _\bd_\bi_\br and
4134 before processing instances of _\b._\b. in _\bd_\bi_\br (see also the -\b-P\bP option
4135 to the s\bse\bet\bt builtin command); the -\b-L\bL option forces symbolic links
4136 to be followed by resolving the link after processing instances
4137 of _\b._\b. in _\bd_\bi_\br. If _\b._\b. appears in _\bd_\bi_\br, it is processed by removing
4138 the immediately previous pathname component from _\bd_\bi_\br, back to a
4139 slash or the beginning of _\bd_\bi_\br. If the -\b-e\be option is supplied
4140 with -\b-P\bP, and the current working directory cannot be success-
4141 fully determined after a successful directory change, c\bcd\bd will
4142 return an unsuccessful status. On systems that support it, the
4143 -\b-@\b@ option presents the extended attributes associated with a
4144 file as a directory. An argument of -\b- is converted to $\b$O\bOL\bLD\bDP\bPW\bWD\bD
4145 before the directory change is attempted. If a non-empty direc-
4146 tory name from C\bCD\bDP\bPA\bAT\bTH\bH is used, or if -\b- is the first argument,
4147 and the directory change is successful, the absolute pathname of
4148 the new working directory is written to the standard output.
4149 The return value is true if the directory was successfully
4150 changed; false otherwise.
4151
4152 c\bco\bom\bmm\bma\ban\bnd\bd [-\b-p\bpV\bVv\bv] _\bc_\bo_\bm_\bm_\ba_\bn_\bd [_\ba_\br_\bg ...]
4153 Run _\bc_\bo_\bm_\bm_\ba_\bn_\bd with _\ba_\br_\bg_\bs suppressing the normal shell function
4154 lookup. Only builtin commands or commands found in the P\bPA\bAT\bTH\bH are
4155 executed. If the -\b-p\bp option is given, the search for _\bc_\bo_\bm_\bm_\ba_\bn_\bd is
4156 performed using a default value for P\bPA\bAT\bTH\bH that is guaranteed to
4157 find all of the standard utilities. If either the -\b-V\bV or -\b-v\bv
4158 option is supplied, a description of _\bc_\bo_\bm_\bm_\ba_\bn_\bd is printed. The -\b-v\bv
4159 option causes a single word indicating the command or filename
4160 used to invoke _\bc_\bo_\bm_\bm_\ba_\bn_\bd to be displayed; the -\b-V\bV option produces a
4161 more verbose description. If the -\b-V\bV or -\b-v\bv option is supplied,
4162 the exit status is 0 if _\bc_\bo_\bm_\bm_\ba_\bn_\bd was found, and 1 if not. If
4163 neither option is supplied and an error occurred or _\bc_\bo_\bm_\bm_\ba_\bn_\bd can-
4164 not be found, the exit status is 127. Otherwise, the exit sta-
4165 tus of the c\bco\bom\bmm\bma\ban\bnd\bd builtin is the exit status of _\bc_\bo_\bm_\bm_\ba_\bn_\bd.
4166
4167 c\bco\bom\bmp\bpg\bge\ben\bn [_\bo_\bp_\bt_\bi_\bo_\bn] [_\bw_\bo_\br_\bd]
4168 Generate possible completion matches for _\bw_\bo_\br_\bd according to the
4169 _\bo_\bp_\bt_\bi_\bo_\bns, which may be any option accepted by the c\bco\bom\bmp\bpl\ble\bet\bte\be
4170 builtin with the exception of -\b-p\bp and -\b-r\br, and write the matches
4171 to the standard output. When using the -\b-F\bF or -\b-C\bC options, the
4172 various shell variables set by the programmable completion
4173 facilities, while available, will not have useful values.
4174
4175 The matches will be generated in the same way as if the program-
4176 mable completion code had generated them directly from a comple-
4177 tion specification with the same flags. If _\bw_\bo_\br_\bd is specified,
4178 only those completions matching _\bw_\bo_\br_\bd will be displayed.
4179
4180 The return value is true unless an invalid option is supplied,
4181 or no matches were generated.
4182
4183 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\bE] [-\b-A\bA _\ba_\bc_\bt_\bi_\bo_\bn] [-\b-G\bG _\bg_\bl_\bo_\bb_\b-
4184 _\bp_\ba_\bt] [-\b-W\bW _\bw_\bo_\br_\bd_\bl_\bi_\bs_\bt] [-\b-F\bF _\bf_\bu_\bn_\bc_\bt_\bi_\bo_\bn] [-\b-C\bC _\bc_\bo_\bm_\bm_\ba_\bn_\bd]
4185 [-\b-X\bX _\bf_\bi_\bl_\bt_\be_\br_\bp_\ba_\bt] [-\b-P\bP _\bp_\br_\be_\bf_\bi_\bx] [-\b-S\bS _\bs_\bu_\bf_\bf_\bi_\bx] _\bn_\ba_\bm_\be [_\bn_\ba_\bm_\be _\b._\b._\b.]
4186 c\bco\bom\bmp\bpl\ble\bet\bte\be -\b-p\bpr\br [-\b-D\bDE\bE] [_\bn_\ba_\bm_\be ...]
4187 Specify how arguments to each _\bn_\ba_\bm_\be should be completed. If the
4188 -\b-p\bp option is supplied, or if no options are supplied, existing
4189 completion specifications are printed in a way that allows them
4190 to be reused as input. The -\b-r\br option removes a completion spec-
4191 ification for each _\bn_\ba_\bm_\be, or, if no _\bn_\ba_\bm_\bes are supplied, all com-
4192 pletion specifications. The -\b-D\bD option indicates that the
4193 remaining options and actions should apply to the ``default''
4194 command completion; that is, completion attempted on a command
4195 for which no completion has previously been defined. The -\b-E\bE
4196 option indicates that the remaining options and actions should
4197 apply to ``empty'' command completion; that is, completion
4198 attempted on a blank line.
4199
4200 The process of applying these completion specifications when
4201 word completion is attempted is described above under P\bPr\bro\bog\bgr\bra\bam\bm-\b-
4202 m\bma\bab\bbl\ble\be C\bCo\bom\bmp\bpl\ble\bet\bti\bio\bon\bn.
4203
4204 Other options, if specified, have the following meanings. The
4205 arguments to the -\b-G\bG, -\b-W\bW, and -\b-X\bX options (and, if necessary, the
4206 -\b-P\bP and -\b-S\bS options) should be quoted to protect them from expan-
4207 sion before the c\bco\bom\bmp\bpl\ble\bet\bte\be builtin is invoked.
4208 -\b-o\bo _\bc_\bo_\bm_\bp_\b-_\bo_\bp_\bt_\bi_\bo_\bn
4209 The _\bc_\bo_\bm_\bp_\b-_\bo_\bp_\bt_\bi_\bo_\bn controls several aspects of the comp-
4210 spec's behavior beyond the simple generation of comple-
4211 tions. _\bc_\bo_\bm_\bp_\b-_\bo_\bp_\bt_\bi_\bo_\bn may be one of:
4212 b\bba\bas\bsh\bhd\bde\bef\bfa\bau\bul\blt\bt
4213 Perform the rest of the default b\bba\bas\bsh\bh completions
4214 if the compspec generates no matches.
4215 d\bde\bef\bfa\bau\bul\blt\bt Use readline's default filename completion if
4216 the compspec generates no matches.
4217 d\bdi\bir\brn\bna\bam\bme\bes\bs
4218 Perform directory name completion if the comp-
4219 spec generates no matches.
4220 f\bfi\bil\ble\ben\bna\bam\bme\bes\bs
4221 Tell readline that the compspec generates file-
4222 names, so it can perform any filename-specific
4223 processing (like adding a slash to directory
4224 names, quoting special characters, or suppress-
4225 ing trailing spaces). Intended to be used with
4226 shell functions.
4227 n\bno\boq\bqu\buo\bot\bte\be Tell readline not to quote the completed words
4228 if they are filenames (quoting filenames is the
4229 default).
4230 n\bno\bos\bso\bor\brt\bt Tell readline not to sort the list of possible
4231 completions alphabetically.
4232 n\bno\bos\bsp\bpa\bac\bce\be Tell readline not to append a space (the
4233 default) to words completed at the end of the
4234 line.
4235 p\bpl\blu\bus\bsd\bdi\bir\brs\bs
4236 After any matches defined by the compspec are
4237 generated, directory name completion is
4238 attempted and any matches are added to the
4239 results of the other actions.
4240 -\b-A\bA _\ba_\bc_\bt_\bi_\bo_\bn
4241 The _\ba_\bc_\bt_\bi_\bo_\bn may be one of the following to generate a
4242 list of possible completions:
4243 a\bal\bli\bia\bas\bs Alias names. May also be specified as -\b-a\ba.
4244 a\bar\brr\bra\bay\byv\bva\bar\br
4245 Array variable names.
4246 b\bbi\bin\bnd\bdi\bin\bng\bg R\bRe\bea\bad\bdl\bli\bin\bne\be key binding names.
4247 b\bbu\bui\bil\blt\bti\bin\bn Names of shell builtin commands. May also be
4248 specified as -\b-b\bb.
4249 c\bco\bom\bmm\bma\ban\bnd\bd Command names. May also be specified as -\b-c\bc.
4250 d\bdi\bir\bre\bec\bct\bto\bor\bry\by
4251 Directory names. May also be specified as -\b-d\bd.
4252 d\bdi\bis\bsa\bab\bbl\ble\bed\bd
4253 Names of disabled shell builtins.
4254 e\ben\bna\bab\bbl\ble\bed\bd Names of enabled shell builtins.
4255 e\bex\bxp\bpo\bor\brt\bt Names of exported shell variables. May also be
4256 specified as -\b-e\be.
4257 f\bfi\bil\ble\be File names. May also be specified as -\b-f\bf.
4258 f\bfu\bun\bnc\bct\bti\bio\bon\bn
4259 Names of shell functions.
4260 g\bgr\bro\bou\bup\bp Group names. May also be specified as -\b-g\bg.
4261 h\bhe\bel\blp\bpt\bto\bop\bpi\bic\bc
4262 Help topics as accepted by the h\bhe\bel\blp\bp builtin.
4263 h\bho\bos\bst\btn\bna\bam\bme\be
4264 Hostnames, as taken from the file specified by
4265 the H\bHO\bOS\bST\bTF\bFI\bIL\bLE\bE shell variable.
4266 j\bjo\bob\bb Job names, if job control is active. May also
4267 be specified as -\b-j\bj.
4268 k\bke\bey\byw\bwo\bor\brd\bd Shell reserved words. May also be specified as
4269 -\b-k\bk.
4270 r\bru\bun\bnn\bni\bin\bng\bg Names of running jobs, if job control is active.
4271 s\bse\ber\brv\bvi\bic\bce\be Service names. May also be specified as -\b-s\bs.
4272 s\bse\bet\bto\bop\bpt\bt Valid arguments for the -\b-o\bo option to the s\bse\bet\bt
4273 builtin.
4274 s\bsh\bho\bop\bpt\bt Shell option names as accepted by the s\bsh\bho\bop\bpt\bt
4275 builtin.
4276 s\bsi\big\bgn\bna\bal\bl Signal names.
4277 s\bst\bto\bop\bpp\bpe\bed\bd Names of stopped jobs, if job control is active.
4278 u\bus\bse\ber\br User names. May also be specified as -\b-u\bu.
4279 v\bva\bar\bri\bia\bab\bbl\ble\be
4280 Names of all shell variables. May also be spec-
4281 ified as -\b-v\bv.
4282 -\b-C\bC _\bc_\bo_\bm_\bm_\ba_\bn_\bd
4283 _\bc_\bo_\bm_\bm_\ba_\bn_\bd is executed in a subshell environment, and its
4284 output is used as the possible completions.
4285 -\b-F\bF _\bf_\bu_\bn_\bc_\bt_\bi_\bo_\bn
4286 The shell function _\bf_\bu_\bn_\bc_\bt_\bi_\bo_\bn is executed in the current
4287 shell environment. When the function is executed, the
4288 first argument ($\b$1\b1) is the name of the command whose
4289 arguments are being completed, the second argument ($\b$2\b2)
4290 is the word being completed, and the third argument ($\b$3\b3)
4291 is the word preceding the word being completed on the
4292 current command line. When it finishes, the possible
4293 completions are retrieved from the value of the C\bCO\bOM\bMP\bPR\bRE\bE-\b-
4294 P\bPL\bLY\bY array variable.
4295 -\b-G\bG _\bg_\bl_\bo_\bb_\bp_\ba_\bt
4296 The pathname expansion pattern _\bg_\bl_\bo_\bb_\bp_\ba_\bt is expanded to
4297 generate the possible completions.
4298 -\b-P\bP _\bp_\br_\be_\bf_\bi_\bx
4299 _\bp_\br_\be_\bf_\bi_\bx is added at the beginning of each possible com-
4300 pletion after all other options have been applied.
4301 -\b-S\bS _\bs_\bu_\bf_\bf_\bi_\bx
4302 _\bs_\bu_\bf_\bf_\bi_\bx is appended to each possible completion after all
4303 other options have been applied.
4304 -\b-W\bW _\bw_\bo_\br_\bd_\bl_\bi_\bs_\bt
4305 The _\bw_\bo_\br_\bd_\bl_\bi_\bs_\bt is split using the characters in the I\bIF\bFS\bS
4306 special variable as delimiters, and each resultant word
4307 is expanded. The possible completions are the members
4308 of the resultant list which match the word being com-
4309 pleted.
4310 -\b-X\bX _\bf_\bi_\bl_\bt_\be_\br_\bp_\ba_\bt
4311 _\bf_\bi_\bl_\bt_\be_\br_\bp_\ba_\bt is a pattern as used for pathname expansion.
4312 It is applied to the list of possible completions gener-
4313 ated by the preceding options and arguments, and each
4314 completion matching _\bf_\bi_\bl_\bt_\be_\br_\bp_\ba_\bt is removed from the list.
4315 A leading !\b! in _\bf_\bi_\bl_\bt_\be_\br_\bp_\ba_\bt negates the pattern; in this
4316 case, any completion not matching _\bf_\bi_\bl_\bt_\be_\br_\bp_\ba_\bt is removed.
4317
4318 The return value is true unless an invalid option is supplied,
4319 an option other than -\b-p\bp or -\b-r\br is supplied without a _\bn_\ba_\bm_\be argu-
4320 ment, an attempt is made to remove a completion specification
4321 for a _\bn_\ba_\bm_\be for which no specification exists, or an error occurs
4322 adding a completion specification.
4323
4324 c\bco\bom\bmp\bpo\bop\bpt\bt [-\b-o\bo _\bo_\bp_\bt_\bi_\bo_\bn] [-\b-D\bDE\bE] [+\b+o\bo _\bo_\bp_\bt_\bi_\bo_\bn] [_\bn_\ba_\bm_\be]
4325 Modify completion options for each _\bn_\ba_\bm_\be according to the
4326 _\bo_\bp_\bt_\bi_\bo_\bns, or for the currently-executing completion if no _\bn_\ba_\bm_\bes
4327 are supplied. If no _\bo_\bp_\bt_\bi_\bo_\bns are given, display the completion
4328 options for each _\bn_\ba_\bm_\be or the current completion. The possible
4329 values of _\bo_\bp_\bt_\bi_\bo_\bn are those valid for the c\bco\bom\bmp\bpl\ble\bet\bte\be builtin
4330 described above. The -\b-D\bD option indicates that the remaining
4331 options should apply to the ``default'' command completion; that
4332 is, completion attempted on a command for which no completion
4333 has previously been defined. The -\b-E\bE option indicates that the
4334 remaining options should apply to ``empty'' command completion;
4335 that is, completion attempted on a blank line.
4336
4337 The return value is true unless an invalid option is supplied,
4338 an attempt is made to modify the options for a _\bn_\ba_\bm_\be for which no
4339 completion specification exists, or an output error occurs.
4340
4341 c\bco\bon\bnt\bti\bin\bnu\bue\be [_\bn]
4342 Resume the next iteration of the enclosing f\bfo\bor\br, w\bwh\bhi\bil\ble\be, u\bun\bnt\bti\bil\bl, or
4343 s\bse\bel\ble\bec\bct\bt loop. If _\bn is specified, resume at the _\bnth enclosing
4344 loop. _\bn must be >= 1. If _\bn is greater than the number of
4345 enclosing loops, the last enclosing loop (the ``top-level''
4346 loop) is resumed. The return value is 0 unless _\bn is not greater
4347 than or equal to 1.
4348
4349 d\bde\bec\bcl\bla\bar\bre\be [-\b-a\baA\bAf\bfF\bFg\bgi\bil\bln\bnr\brt\btu\bux\bx] [-\b-p\bp] [_\bn_\ba_\bm_\be[=_\bv_\ba_\bl_\bu_\be] ...]
4350 t\bty\byp\bpe\bes\bse\bet\bt [-\b-a\baA\bAf\bfF\bFg\bgi\bil\bln\bnr\brt\btu\bux\bx] [-\b-p\bp] [_\bn_\ba_\bm_\be[=_\bv_\ba_\bl_\bu_\be] ...]
4351 Declare variables and/or give them attributes. If no _\bn_\ba_\bm_\bes are
4352 given then display the values of variables. The -\b-p\bp option will
4353 display the attributes and values of each _\bn_\ba_\bm_\be. When -\b-p\bp is used
4354 with _\bn_\ba_\bm_\be arguments, additional options, other than -\b-f\bf and -\b-F\bF,
4355 are ignored. When -\b-p\bp is supplied without _\bn_\ba_\bm_\be arguments, it
4356 will display the attributes and values of all variables having
4357 the attributes specified by the additional options. If no other
4358 options are supplied with -\b-p\bp, d\bde\bec\bcl\bla\bar\bre\be will display the
4359 attributes and values of all shell variables. The -\b-f\bf option
4360 will restrict the display to shell functions. The -\b-F\bF option
4361 inhibits the display of function definitions; only the function
4362 name and attributes are printed. If the e\bex\bxt\btd\bde\beb\bbu\bug\bg shell option
4363 is enabled using s\bsh\bho\bop\bpt\bt, the source file name and line number
4364 where each _\bn_\ba_\bm_\be is defined are displayed as well. The -\b-F\bF option
4365 implies -\b-f\bf. The -\b-g\bg option forces variables to be created or
4366 modified at the global scope, even when d\bde\bec\bcl\bla\bar\bre\be is executed in a
4367 shell function. It is ignored in all other cases. The follow-
4368 ing options can be used to restrict output to variables with the
4369 specified attribute or to give variables attributes:
4370 -\b-a\ba Each _\bn_\ba_\bm_\be is an indexed array variable (see A\bAr\brr\bra\bay\bys\bs
4371 above).
4372 -\b-A\bA Each _\bn_\ba_\bm_\be is an associative array variable (see A\bAr\brr\bra\bay\bys\bs
4373 above).
4374 -\b-f\bf Use function names only.
4375 -\b-i\bi The variable is treated as an integer; arithmetic evalua-
4376 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
4377 the variable is assigned a value.
4378 -\b-l\bl When the variable is assigned a value, all upper-case
4379 characters are converted to lower-case. The upper-case
4380 attribute is disabled.
4381 -\b-n\bn Give each _\bn_\ba_\bm_\be the _\bn_\ba_\bm_\be_\br_\be_\bf attribute, making it a name
4382 reference to another variable. That other variable is
4383 defined by the value of _\bn_\ba_\bm_\be. All references, assign-
4384 ments, and attribute modifications to _\bn_\ba_\bm_\be, except for
4385 changing the -\b-n\bn attribute itself, are performed on the
4386 variable referenced by _\bn_\ba_\bm_\be's value. The nameref
4387 attribute cannot be applied to array variables.
4388 -\b-r\br Make _\bn_\ba_\bm_\bes readonly. These names cannot then be assigned
4389 values by subsequent assignment statements or unset.
4390 -\b-t\bt Give each _\bn_\ba_\bm_\be the _\bt_\br_\ba_\bc_\be attribute. Traced functions
4391 inherit the D\bDE\bEB\bBU\bUG\bG and R\bRE\bET\bTU\bUR\bRN\bN traps from the calling
4392 shell. The trace attribute has no special meaning for
4393 variables.
4394 -\b-u\bu When the variable is assigned a value, all lower-case
4395 characters are converted to upper-case. The lower-case
4396 attribute is disabled.
4397 -\b-x\bx Mark _\bn_\ba_\bm_\bes for export to subsequent commands via the
4398 environment.
4399
4400 Using `+' instead of `-' turns off the attribute instead, with
4401 the exceptions that +\b+a\ba may not be used to destroy an array vari-
4402 able and +\b+r\br will not remove the readonly attribute. When used
4403 in a function, d\bde\bec\bcl\bla\bar\bre\be and t\bty\byp\bpe\bes\bse\bet\bt make each _\bn_\ba_\bm_\be local, as with
4404 the l\blo\boc\bca\bal\bl command, unless the -\b-g\bg option is supplied. If a vari-
4405 able name is followed by =_\bv_\ba_\bl_\bu_\be, the value of the variable is
4406 set to _\bv_\ba_\bl_\bu_\be. When using -\b-a\ba or -\b-A\bA and the compound assignment
4407 syntax to create array variables, additional attributes do not
4408 take effect until subsequent assignments. The return value is 0
4409 unless an invalid option is encountered, an attempt is made to
4410 define a function using ``-f foo=bar'', an attempt is made to
4411 assign a value to a readonly variable, an attempt is made to
4412 assign a value to an array variable without using the compound
4413 assignment syntax (see A\bAr\brr\bra\bay\bys\bs above), one of the _\bn_\ba_\bm_\be_\bs is not a
4414 valid shell variable name, an attempt is made to turn off read-
4415 only status for a readonly variable, an attempt is made to turn
4416 off array status for an array variable, or an attempt is made to
4417 display a non-existent function with -\b-f\bf.
4418
4419 d\bdi\bir\brs\bs [\b[-\b-c\bcl\blp\bpv\bv]\b] [\b[+\b+_\bn]\b] [\b[-\b-_\bn]\b]
4420 Without options, displays the list of currently remembered
4421 directories. The default display is on a single line with
4422 directory names separated by spaces. Directories are added to
4423 the list with the p\bpu\bus\bsh\bhd\bd command; the p\bpo\bop\bpd\bd command removes
4424 entries from the list. The current directory is always the
4425 first directory in the stack.
4426 -\b-c\bc Clears the directory stack by deleting all of the
4427 entries.
4428 -\b-l\bl Produces a listing using full pathnames; the default
4429 listing format uses a tilde to denote the home directory.
4430 -\b-p\bp Print the directory stack with one entry per line.
4431 -\b-v\bv Print the directory stack with one entry per line, pre-
4432 fixing each entry with its index in the stack.
4433 +\b+_\bn Displays the _\bnth entry counting from the left of the list
4434 shown by d\bdi\bir\brs\bs when invoked without options, starting with
4435 zero.
4436 -\b-_\bn Displays the _\bnth entry counting from the right of the
4437 list shown by d\bdi\bir\brs\bs when invoked without options, starting
4438 with zero.
4439
4440 The return value is 0 unless an invalid option is supplied or _\bn
4441 indexes beyond the end of the directory stack.
4442
4443 d\bdi\bis\bso\bow\bwn\bn [-\b-a\bar\br] [-\b-h\bh] [_\bj_\bo_\bb_\bs_\bp_\be_\bc ...]
4444 Without options, remove each _\bj_\bo_\bb_\bs_\bp_\be_\bc from the table of active
4445 jobs. If _\bj_\bo_\bb_\bs_\bp_\be_\bc is not present, and neither the -\b-a\ba nor the -\b-r\br
4446 option is supplied, the _\bc_\bu_\br_\br_\be_\bn_\bt _\bj_\bo_\bb is used. If the -\b-h\bh option
4447 is given, each _\bj_\bo_\bb_\bs_\bp_\be_\bc is not removed from the table, but is
4448 marked so that S\bSI\bIG\bGH\bHU\bUP\bP is not sent to the job if the shell
4449 receives a S\bSI\bIG\bGH\bHU\bUP\bP. If no _\bj_\bo_\bb_\bs_\bp_\be_\bc is supplied, the -\b-a\ba option
4450 means to remove or mark all jobs; the -\b-r\br option without a _\bj_\bo_\bb_\b-
4451 _\bs_\bp_\be_\bc argument restricts operation to running jobs. The return
4452 value is 0 unless a _\bj_\bo_\bb_\bs_\bp_\be_\bc does not specify a valid job.
4453
4454 e\bec\bch\bho\bo [-\b-n\bne\beE\bE] [_\ba_\br_\bg ...]
4455 Output the _\ba_\br_\bgs, separated by spaces, followed by a newline.
4456 The return status is 0 unless a write error occurs. If -\b-n\bn is
4457 specified, the trailing newline is suppressed. If the -\b-e\be option
4458 is given, interpretation of the following backslash-escaped
4459 characters is enabled. The -\b-E\bE option disables the interpreta-
4460 tion of these escape characters, even on systems where they are
4461 interpreted by default. The x\bxp\bpg\bg_\b_e\bec\bch\bho\bo shell option may be used
4462 to dynamically determine whether or not e\bec\bch\bho\bo expands these
4463 escape characters by default. e\bec\bch\bho\bo does not interpret -\b--\b- to
4464 mean the end of options. e\bec\bch\bho\bo interprets the following escape
4465 sequences:
4466 \\b\a\ba alert (bell)
4467 \\b\b\bb backspace
4468 \\b\c\bc suppress further output
4469 \\b\e\be
4470 \\b\E\bE an escape character
4471 \\b\f\bf form feed
4472 \\b\n\bn new line
4473 \\b\r\br carriage return
4474 \\b\t\bt horizontal tab
4475 \\b\v\bv vertical tab
4476 \\b\\\b\ backslash
4477 \\b\0\b0_\bn_\bn_\bn the eight-bit character whose value is the octal value
4478 _\bn_\bn_\bn (zero to three octal digits)
4479 \\b\x\bx_\bH_\bH the eight-bit character whose value is the hexadecimal
4480 value _\bH_\bH (one or two hex digits)
4481 \\b\u\bu_\bH_\bH_\bH_\bH the Unicode (ISO/IEC 10646) character whose value is the
4482 hexadecimal value _\bH_\bH_\bH_\bH (one to four hex digits)
4483 \\b\U\bU_\bH_\bH_\bH_\bH_\bH_\bH_\bH_\bH
4484 the Unicode (ISO/IEC 10646) character whose value is the
4485 hexadecimal value _\bH_\bH_\bH_\bH_\bH_\bH_\bH_\bH (one to eight hex digits)
4486
4487 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 ...]
4488 Enable and disable builtin shell commands. Disabling a builtin
4489 allows a disk command which has the same name as a shell builtin
4490 to be executed without specifying a full pathname, even though
4491 the shell normally searches for builtins before disk commands.
4492 If -\b-n\bn is used, each _\bn_\ba_\bm_\be is disabled; otherwise, _\bn_\ba_\bm_\be_\bs are
4493 enabled. For example, to use the t\bte\bes\bst\bt binary found via the P\bPA\bAT\bTH\bH
4494 instead of the shell builtin version, run ``enable -n test''.
4495 The -\b-f\bf option means to load the new builtin command _\bn_\ba_\bm_\be from
4496 shared object _\bf_\bi_\bl_\be_\bn_\ba_\bm_\be, on systems that support dynamic loading.
4497 The -\b-d\bd option will delete a builtin previously loaded with -\b-f\bf.
4498 If no _\bn_\ba_\bm_\be arguments are given, or if the -\b-p\bp option is supplied,
4499 a list of shell builtins is printed. With no other option argu-
4500 ments, the list consists of all enabled shell builtins. If -\b-n\bn
4501 is supplied, only disabled builtins are printed. If -\b-a\ba is sup-
4502 plied, the list printed includes all builtins, with an indica-
4503 tion of whether or not each is enabled. If -\b-s\bs is supplied, the
4504 output is restricted to the POSIX _\bs_\bp_\be_\bc_\bi_\ba_\bl builtins. The return
4505 value is 0 unless a _\bn_\ba_\bm_\be is not a shell builtin or there is an
4506 error loading a new builtin from a shared object.
4507
4508 e\bev\bva\bal\bl [_\ba_\br_\bg ...]
4509 The _\ba_\br_\bgs are read and concatenated together into a single com-
4510 mand. This command is then read and executed by the shell, and
4511 its exit status is returned as the value of e\bev\bva\bal\bl. If there are
4512 no _\ba_\br_\bg_\bs, or only null arguments, e\bev\bva\bal\bl returns 0.
4513
4514 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]]
4515 If _\bc_\bo_\bm_\bm_\ba_\bn_\bd is specified, it replaces the shell. No new process
4516 is created. The _\ba_\br_\bg_\bu_\bm_\be_\bn_\bt_\bs become the arguments to _\bc_\bo_\bm_\bm_\ba_\bn_\bd. If
4517 the -\b-l\bl option is supplied, the shell places a dash at the begin-
4518 ning of the zeroth argument passed to _\bc_\bo_\bm_\bm_\ba_\bn_\bd. This is what
4519 _\bl_\bo_\bg_\bi_\bn(1) does. The -\b-c\bc option causes _\bc_\bo_\bm_\bm_\ba_\bn_\bd to be executed with
4520 an empty environment. If -\b-a\ba is supplied, the shell passes _\bn_\ba_\bm_\be
4521 as the zeroth argument to the executed command. If _\bc_\bo_\bm_\bm_\ba_\bn_\bd can-
4522 not be executed for some reason, a non-interactive shell exits,
4523 unless the e\bex\bxe\bec\bcf\bfa\bai\bil\bl shell option is enabled. In that case, it
4524 returns failure. An interactive shell returns failure if the
4525 file cannot be executed. If _\bc_\bo_\bm_\bm_\ba_\bn_\bd is not specified, any redi-
4526 rections take effect in the current shell, and the return status
4527 is 0. If there is a redirection error, the return status is 1.
4528
4529 e\bex\bxi\bit\bt [_\bn]
4530 Cause the shell to exit with a status of _\bn. If _\bn is omitted,
4531 the exit status is that of the last command executed. A trap on
4532 E\bEX\bXI\bIT\bT is executed before the shell terminates.
4533
4534 e\bex\bxp\bpo\bor\brt\bt [-\b-f\bfn\bn] [_\bn_\ba_\bm_\be[=_\bw_\bo_\br_\bd]] ...
4535 e\bex\bxp\bpo\bor\brt\bt -\b-p\bp
4536 The supplied _\bn_\ba_\bm_\be_\bs are marked for automatic export to the envi-
4537 ronment of subsequently executed commands. If the -\b-f\bf option is
4538 given, the _\bn_\ba_\bm_\be_\bs refer to functions. If no _\bn_\ba_\bm_\be_\bs are given, or
4539 if the -\b-p\bp option is supplied, a list of names of all exported
4540 variables is printed. The -\b-n\bn option causes the export property
4541 to be removed from each _\bn_\ba_\bm_\be. If a variable name is followed by
4542 =_\bw_\bo_\br_\bd, the value of the variable is set to _\bw_\bo_\br_\bd. e\bex\bxp\bpo\bor\brt\bt returns
4543 an exit status of 0 unless an invalid option is encountered, one
4544 of the _\bn_\ba_\bm_\be_\bs is not a valid shell variable name, or -\b-f\bf is sup-
4545 plied with a _\bn_\ba_\bm_\be that is not a function.
4546
4547 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]
4548 f\bfc\bc -\b-s\bs [_\bp_\ba_\bt=_\br_\be_\bp] [_\bc_\bm_\bd]
4549 The first form selects a range of commands from _\bf_\bi_\br_\bs_\bt to _\bl_\ba_\bs_\bt
4550 from the history list and displays or edits and re-executes
4551 them. _\bF_\bi_\br_\bs_\bt and _\bl_\ba_\bs_\bt may be specified as a string (to locate
4552 the last command beginning with that string) or as a number (an
4553 index into the history list, where a negative number is used as
4554 an offset from the current command number). If _\bl_\ba_\bs_\bt is not
4555 specified it is set to the current command for listing (so that
4556 ``fc -l -10'' prints the last 10 commands) and to _\bf_\bi_\br_\bs_\bt other-
4557 wise. If _\bf_\bi_\br_\bs_\bt is not specified it is set to the previous com-
4558 mand for editing and -16 for listing.
4559
4560 The -\b-n\bn option suppresses the command numbers when listing. The
4561 -\b-r\br option reverses the order of the commands. If the -\b-l\bl option
4562 is given, the commands are listed on standard output. Other-
4563 wise, the editor given by _\be_\bn_\ba_\bm_\be is invoked on a file containing
4564 those commands. If _\be_\bn_\ba_\bm_\be is not given, the value of the F\bFC\bCE\bED\bDI\bIT\bT
4565 variable is used, and the value of E\bED\bDI\bIT\bTO\bOR\bR if F\bFC\bCE\bED\bDI\bIT\bT is not set.
4566 If neither variable is set, _\bv_\bi is used. When editing is com-
4567 plete, the edited commands are echoed and executed.
4568
4569 In the second form, _\bc_\bo_\bm_\bm_\ba_\bn_\bd is re-executed after each instance
4570 of _\bp_\ba_\bt is replaced by _\br_\be_\bp. _\bC_\bo_\bm_\bm_\ba_\bn_\bd is intepreted the same as
4571 _\bf_\bi_\br_\bs_\bt above. A useful alias to use with this is ``r="fc -s"'',
4572 so that typing ``r cc'' runs the last command beginning with
4573 ``cc'' and typing ``r'' re-executes the last command.
4574
4575 If the first form is used, the return value is 0 unless an
4576 invalid option is encountered or _\bf_\bi_\br_\bs_\bt or _\bl_\ba_\bs_\bt specify history
4577 lines out of range. If the -\b-e\be option is supplied, the return
4578 value is the value of the last command executed or failure if an
4579 error occurs with the temporary file of commands. If the second
4580 form is used, the return status is that of the command re-exe-
4581 cuted, unless _\bc_\bm_\bd does not specify a valid history line, in
4582 which case f\bfc\bc returns failure.
4583
4584 f\bfg\bg [_\bj_\bo_\bb_\bs_\bp_\be_\bc]
4585 Resume _\bj_\bo_\bb_\bs_\bp_\be_\bc in the foreground, and make it the current job.
4586 If _\bj_\bo_\bb_\bs_\bp_\be_\bc is not present, the shell's notion of the _\bc_\bu_\br_\br_\be_\bn_\bt _\bj_\bo_\bb
4587 is used. The return value is that of the command placed into
4588 the foreground, or failure if run when job control is disabled
4589 or, when run with job control enabled, if _\bj_\bo_\bb_\bs_\bp_\be_\bc does not spec-
4590 ify a valid job or _\bj_\bo_\bb_\bs_\bp_\be_\bc specifies a job that was started
4591 without job control.
4592
4593 g\bge\bet\bto\bop\bpt\bts\bs _\bo_\bp_\bt_\bs_\bt_\br_\bi_\bn_\bg _\bn_\ba_\bm_\be [_\ba_\br_\bg_\bs]
4594 g\bge\bet\bto\bop\bpt\bts\bs is used by shell procedures to parse positional parame-
4595 ters. _\bo_\bp_\bt_\bs_\bt_\br_\bi_\bn_\bg contains the option characters to be recog-
4596 nized; if a character is followed by a colon, the option is
4597 expected to have an argument, which should be separated from it
4598 by white space. The colon and question mark characters may not
4599 be used as option characters. Each time it is invoked, g\bge\bet\bto\bop\bpt\bts\bs
4600 places the next option in the shell variable _\bn_\ba_\bm_\be, initializing
4601 _\bn_\ba_\bm_\be if it does not exist, and the index of the next argument to
4602 be processed into the variable O\bOP\bPT\bTI\bIN\bND\bD. O\bOP\bPT\bTI\bIN\bND\bD is initialized to
4603 1 each time the shell or a shell script is invoked. When an
4604 option requires an argument, g\bge\bet\bto\bop\bpt\bts\bs places that argument into
4605 the variable O\bOP\bPT\bTA\bAR\bRG\bG. The shell does not reset O\bOP\bPT\bTI\bIN\bND\bD automati-
4606 cally; it must be manually reset between multiple calls to
4607 g\bge\bet\bto\bop\bpt\bts\bs within the same shell invocation if a new set of parame-
4608 ters is to be used.
4609
4610 When the end of options is encountered, g\bge\bet\bto\bop\bpt\bts\bs exits with a
4611 return value greater than zero. O\bOP\bPT\bTI\bIN\bND\bD is set to the index of
4612 the first non-option argument, and _\bn_\ba_\bm_\be is set to ?.
4613
4614 g\bge\bet\bto\bop\bpt\bts\bs normally parses the positional parameters, but if more
4615 arguments are given in _\ba_\br_\bg_\bs, g\bge\bet\bto\bop\bpt\bts\bs parses those instead.
4616
4617 g\bge\bet\bto\bop\bpt\bts\bs can report errors in two ways. If the first character
4618 of _\bo_\bp_\bt_\bs_\bt_\br_\bi_\bn_\bg is a colon, _\bs_\bi_\bl_\be_\bn_\bt error reporting is used. In
4619 normal operation, diagnostic messages are printed when invalid
4620 options or missing option arguments are encountered. If the
4621 variable O\bOP\bPT\bTE\bER\bRR\bR is set to 0, no error messages will be dis-
4622 played, even if the first character of _\bo_\bp_\bt_\bs_\bt_\br_\bi_\bn_\bg is not a colon.
4623
4624 If an invalid option is seen, g\bge\bet\bto\bop\bpt\bts\bs places ? into _\bn_\ba_\bm_\be and, if
4625 not silent, prints an error message and unsets O\bOP\bPT\bTA\bAR\bRG\bG. If
4626 g\bge\bet\bto\bop\bpt\bts\bs is silent, the option character found is placed in
4627 O\bOP\bPT\bTA\bAR\bRG\bG and no diagnostic message is printed.
4628
4629 If a required argument is not found, and g\bge\bet\bto\bop\bpt\bts\bs is not silent,
4630 a question mark (?\b?) is placed in _\bn_\ba_\bm_\be, O\bOP\bPT\bTA\bAR\bRG\bG is unset, and a
4631 diagnostic message is printed. If g\bge\bet\bto\bop\bpt\bts\bs is silent, then a
4632 colon (:\b:) is placed in _\bn_\ba_\bm_\be and O\bOP\bPT\bTA\bAR\bRG\bG is set to the option
4633 character found.
4634
4635 g\bge\bet\bto\bop\bpt\bts\bs returns true if an option, specified or unspecified, is
4636 found. It returns false if the end of options is encountered or
4637 an error occurs.
4638
4639 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]
4640 Each time h\bha\bas\bsh\bh is invoked, the full pathname of the command _\bn_\ba_\bm_\be
4641 is determined by searching the directories in $\b$P\bPA\bAT\bTH\bH and remem-
4642 bered. Any previously-remembered pathname is discarded. If the
4643 -\b-p\bp option is supplied, no path search is performed, and _\bf_\bi_\bl_\be_\bn_\ba_\bm_\be
4644 is used as the full filename of the command. The -\b-r\br option
4645 causes the shell to forget all remembered locations. The -\b-d\bd
4646 option causes the shell to forget the remembered location of
4647 each _\bn_\ba_\bm_\be. If the -\b-t\bt option is supplied, the full pathname to
4648 which each _\bn_\ba_\bm_\be corresponds is printed. If multiple _\bn_\ba_\bm_\be argu-
4649 ments are supplied with -\b-t\bt, the _\bn_\ba_\bm_\be is printed before the
4650 hashed full pathname. The -\b-l\bl option causes output to be dis-
4651 played in a format that may be reused as input. If no arguments
4652 are given, or if only -\b-l\bl is supplied, information about remem-
4653 bered commands is printed. The return status is true unless a
4654 _\bn_\ba_\bm_\be is not found or an invalid option is supplied.
4655
4656 h\bhe\bel\blp\bp [-\b-d\bdm\bms\bs] [_\bp_\ba_\bt_\bt_\be_\br_\bn]
4657 Display helpful information about builtin commands. If _\bp_\ba_\bt_\bt_\be_\br_\bn
4658 is specified, h\bhe\bel\blp\bp gives detailed help on all commands matching
4659 _\bp_\ba_\bt_\bt_\be_\br_\bn; otherwise help for all the builtins and shell control
4660 structures is printed.
4661 -\b-d\bd Display a short description of each _\bp_\ba_\bt_\bt_\be_\br_\bn
4662 -\b-m\bm Display the description of each _\bp_\ba_\bt_\bt_\be_\br_\bn in a manpage-like
4663 format
4664 -\b-s\bs Display only a short usage synopsis for each _\bp_\ba_\bt_\bt_\be_\br_\bn
4665
4666 The return status is 0 unless no command matches _\bp_\ba_\bt_\bt_\be_\br_\bn.
4667
4668 h\bhi\bis\bst\bto\bor\bry\by [\b[_\bn]\b]
4669 h\bhi\bis\bst\bto\bor\bry\by -\b-c\bc
4670 h\bhi\bis\bst\bto\bor\bry\by -\b-d\bd _\bo_\bf_\bf_\bs_\be_\bt
4671 h\bhi\bis\bst\bto\bor\bry\by -\b-a\ban\bnr\brw\bw [_\bf_\bi_\bl_\be_\bn_\ba_\bm_\be]
4672 h\bhi\bis\bst\bto\bor\bry\by -\b-p\bp _\ba_\br_\bg [_\ba_\br_\bg _\b._\b._\b.]
4673 h\bhi\bis\bst\bto\bor\bry\by -\b-s\bs _\ba_\br_\bg [_\ba_\br_\bg _\b._\b._\b.]
4674 With no options, display the command history list with line num-
4675 bers. Lines listed with a *\b* have been modified. An argument of
4676 _\bn lists only the last _\bn lines. If the shell variable H\bHI\bIS\bST\bTT\bTI\bIM\bME\bE-\b-
4677 F\bFO\bOR\bRM\bMA\bAT\bT is set and not null, it is used as a format string for
4678 _\bs_\bt_\br_\bf_\bt_\bi_\bm_\be(3) to display the time stamp associated with each dis-
4679 played history entry. No intervening blank is printed between
4680 the formatted time stamp and the history line. If _\bf_\bi_\bl_\be_\bn_\ba_\bm_\be is
4681 supplied, it is used as the name of the history file; if not,
4682 the value of H\bHI\bIS\bST\bTF\bFI\bIL\bLE\bE is used. Options, if supplied, have the
4683 following meanings:
4684 -\b-c\bc Clear the history list by deleting all the entries.
4685 -\b-d\bd _\bo_\bf_\bf_\bs_\be_\bt
4686 Delete the history entry at position _\bo_\bf_\bf_\bs_\be_\bt.
4687 -\b-a\ba Append the ``new'' history lines to the history file.
4688 These are history lines entered since the beginning of
4689 the current b\bba\bas\bsh\bh session, but not already appended to the
4690 history file.
4691 -\b-n\bn Read the history lines not already read from the history
4692 file into the current history list. These are lines
4693 appended to the history file since the beginning of the
4694 current b\bba\bas\bsh\bh session.
4695 -\b-r\br Read the contents of the history file and append them to
4696 the current history list.
4697 -\b-w\bw Write the current history list to the history file, over-
4698 writing the history file's contents.
4699 -\b-p\bp Perform history substitution on the following _\ba_\br_\bg_\bs and
4700 display the result on the standard output. Does not
4701 store the results in the history list. Each _\ba_\br_\bg must be
4702 quoted to disable normal history expansion.
4703 -\b-s\bs Store the _\ba_\br_\bg_\bs in the history list as a single entry.
4704 The last command in the history list is removed before
4705 the _\ba_\br_\bg_\bs are added.
4706
4707 If the H\bHI\bIS\bST\bTT\bTI\bIM\bME\bEF\bFO\bOR\bRM\bMA\bAT\bT variable is set, the time stamp informa-
4708 tion associated with each history entry is written to the his-
4709 tory file, marked with the history comment character. When the
4710 history file is read, lines beginning with the history comment
4711 character followed immediately by a digit are interpreted as
4712 timestamps for the previous history line. The return value is 0
4713 unless an invalid option is encountered, an error occurs while
4714 reading or writing the history file, an invalid _\bo_\bf_\bf_\bs_\be_\bt is sup-
4715 plied as an argument to -\b-d\bd, or the history expansion supplied as
4716 an argument to -\b-p\bp fails.
4717
4718 j\bjo\bob\bbs\bs [-\b-l\bln\bnp\bpr\brs\bs] [ _\bj_\bo_\bb_\bs_\bp_\be_\bc ... ]
4719 j\bjo\bob\bbs\bs -\b-x\bx _\bc_\bo_\bm_\bm_\ba_\bn_\bd [ _\ba_\br_\bg_\bs ... ]
4720 The first form lists the active jobs. The options have the fol-
4721 lowing meanings:
4722 -\b-l\bl List process IDs in addition to the normal information.
4723 -\b-n\bn Display information only about jobs that have changed
4724 status since the user was last notified of their status.
4725 -\b-p\bp List only the process ID of the job's process group
4726 leader.
4727 -\b-r\br Display only running jobs.
4728 -\b-s\bs Display only stopped jobs.
4729
4730 If _\bj_\bo_\bb_\bs_\bp_\be_\bc is given, output is restricted to information about
4731 that job. The return status is 0 unless an invalid option is
4732 encountered or an invalid _\bj_\bo_\bb_\bs_\bp_\be_\bc is supplied.
4733
4734 If the -\b-x\bx option is supplied, j\bjo\bob\bbs\bs replaces any _\bj_\bo_\bb_\bs_\bp_\be_\bc found in
4735 _\bc_\bo_\bm_\bm_\ba_\bn_\bd or _\ba_\br_\bg_\bs with the corresponding process group ID, and
4736 executes _\bc_\bo_\bm_\bm_\ba_\bn_\bd passing it _\ba_\br_\bg_\bs, returning its exit status.
4737
4738 k\bki\bil\bll\bl [-\b-s\bs _\bs_\bi_\bg_\bs_\bp_\be_\bc | -\b-n\bn _\bs_\bi_\bg_\bn_\bu_\bm | -\b-_\bs_\bi_\bg_\bs_\bp_\be_\bc] [_\bp_\bi_\bd | _\bj_\bo_\bb_\bs_\bp_\be_\bc] ...
4739 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]
4740 Send the signal named by _\bs_\bi_\bg_\bs_\bp_\be_\bc or _\bs_\bi_\bg_\bn_\bu_\bm to the processes
4741 named by _\bp_\bi_\bd or _\bj_\bo_\bb_\bs_\bp_\be_\bc. _\bs_\bi_\bg_\bs_\bp_\be_\bc is either a case-insensitive
4742 signal name such as S\bSI\bIG\bGK\bKI\bIL\bLL\bL (with or without the S\bSI\bIG\bG prefix) or
4743 a signal number; _\bs_\bi_\bg_\bn_\bu_\bm is a signal number. If _\bs_\bi_\bg_\bs_\bp_\be_\bc is not
4744 present, then S\bSI\bIG\bGT\bTE\bER\bRM\bM is assumed. An argument of -\b-l\bl lists the
4745 signal names. If any arguments are supplied when -\b-l\bl is given,
4746 the names of the signals corresponding to the arguments are
4747 listed, and the return status is 0. The _\be_\bx_\bi_\bt_\b__\bs_\bt_\ba_\bt_\bu_\bs argument to
4748 -\b-l\bl is a number specifying either a signal number or the exit
4749 status of a process terminated by a signal. The -\b-L\bL option is
4750 equivalent to -\b-l\bl. k\bki\bil\bll\bl returns true if at least one signal was
4751 successfully sent, or false if an error occurs or an invalid
4752 option is encountered.
4753
4754 l\ble\bet\bt _\ba_\br_\bg [_\ba_\br_\bg ...]
4755 Each _\ba_\br_\bg is an arithmetic expression to be evaluated (see A\bAR\bRI\bIT\bTH\bH-\b-
4756 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
4757 returns 1; 0 is returned otherwise.
4758
4759 l\blo\boc\bca\bal\bl [_\bo_\bp_\bt_\bi_\bo_\bn] [_\bn_\ba_\bm_\be[=_\bv_\ba_\bl_\bu_\be] ... | - ]
4760 For each argument, a local variable named _\bn_\ba_\bm_\be is created, and
4761 assigned _\bv_\ba_\bl_\bu_\be. The _\bo_\bp_\bt_\bi_\bo_\bn can be any of the options accepted
4762 by d\bde\bec\bcl\bla\bar\bre\be. When l\blo\boc\bca\bal\bl is used within a function, it causes the
4763 variable _\bn_\ba_\bm_\be to have a visible scope restricted to that func-
4764 tion and its children. If _\bn_\ba_\bm_\be is -, the set of shell options
4765 is made local to the function in which l\blo\boc\bca\bal\bl is invoked: shell
4766 options changed using the s\bse\bet\bt builtin inside the function are
4767 restored to their original values when the function returns.
4768 With no operands, l\blo\boc\bca\bal\bl writes a list of local variables to the
4769 standard output. It is an error to use l\blo\boc\bca\bal\bl when not within a
4770 function. The return status is 0 unless l\blo\boc\bca\bal\bl is used outside a
4771 function, an invalid _\bn_\ba_\bm_\be is supplied, or _\bn_\ba_\bm_\be is a readonly
4772 variable.
4773
4774 l\blo\bog\bgo\bou\but\bt Exit a login shell.
4775
4776 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
4777 _\bc_\ba_\bl_\bl_\bb_\ba_\bc_\bk] [-\b-c\bc _\bq_\bu_\ba_\bn_\bt_\bu_\bm] [_\ba_\br_\br_\ba_\by]
4778 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
4779 _\bc_\ba_\bl_\bl_\bb_\ba_\bc_\bk] [-\b-c\bc _\bq_\bu_\ba_\bn_\bt_\bu_\bm] [_\ba_\br_\br_\ba_\by]
4780 Read lines from the standard input into the indexed array vari-
4781 able _\ba_\br_\br_\ba_\by, or from file descriptor _\bf_\bd if the -\b-u\bu option is sup-
4782 plied. The variable M\bMA\bAP\bPF\bFI\bIL\bLE\bE is the default _\ba_\br_\br_\ba_\by. Options, if
4783 supplied, have the following meanings:
4784 -\b-d\bd The first character of _\bd_\be_\bl_\bi_\bm is used to terminate each
4785 input line, rather than newline.
4786 -\b-n\bn Copy at most _\bc_\bo_\bu_\bn_\bt lines. If _\bc_\bo_\bu_\bn_\bt is 0, all lines are
4787 copied.
4788 -\b-O\bO Begin assigning to _\ba_\br_\br_\ba_\by at index _\bo_\br_\bi_\bg_\bi_\bn. The default
4789 index is 0.
4790 -\b-s\bs Discard the first _\bc_\bo_\bu_\bn_\bt lines read.
4791 -\b-t\bt Remove a trailing _\bd_\be_\bl_\bi_\bm (default newline) from each line
4792 read.
4793 -\b-u\bu Read lines from file descriptor _\bf_\bd instead of the stan-
4794 dard input.
4795 -\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
4796 -\b-c\bc option specifies _\bq_\bu_\ba_\bn_\bt_\bu_\bm.
4797 -\b-c\bc Specify the number of lines read between each call to
4798 _\bc_\ba_\bl_\bl_\bb_\ba_\bc_\bk.
4799
4800 If -\b-C\bC is specified without -\b-c\bc, the default quantum is 5000.
4801 When _\bc_\ba_\bl_\bl_\bb_\ba_\bc_\bk is evaluated, it is supplied the index of the next
4802 array element to be assigned and the line to be assigned to that
4803 element as additional arguments. _\bc_\ba_\bl_\bl_\bb_\ba_\bc_\bk is evaluated after
4804 the line is read but before the array element is assigned.
4805
4806 If not supplied with an explicit origin, m\bma\bap\bpf\bfi\bil\ble\be will clear
4807 _\ba_\br_\br_\ba_\by before assigning to it.
4808
4809 m\bma\bap\bpf\bfi\bil\ble\be returns successfully unless an invalid option or option
4810 argument is supplied, _\ba_\br_\br_\ba_\by is invalid or unassignable, or if
4811 _\ba_\br_\br_\ba_\by is not an indexed array.
4812
4813 p\bpo\bop\bpd\bd [-n\bn] [+_\bn] [-_\bn]
4814 Removes entries from the directory stack. With no arguments,
4815 removes the top directory from the stack, and performs a c\bcd\bd to
4816 the new top directory. Arguments, if supplied, have the follow-
4817 ing meanings:
4818 -\b-n\bn Suppresses the normal change of directory when removing
4819 directories from the stack, so that only the stack is
4820 manipulated.
4821 +\b+_\bn Removes the _\bnth entry counting from the left of the list
4822 shown by d\bdi\bir\brs\bs, starting with zero. For example: ``popd
4823 +0'' removes the first directory, ``popd +1'' the second.
4824 -\b-_\bn Removes the _\bnth entry counting from the right of the list
4825 shown by d\bdi\bir\brs\bs, starting with zero. For example: ``popd
4826 -0'' removes the last directory, ``popd -1'' the next to
4827 last.
4828
4829 If the p\bpo\bop\bpd\bd command is successful, a d\bdi\bir\brs\bs is performed as well,
4830 and the return status is 0. p\bpo\bop\bpd\bd returns false if an invalid
4831 option is encountered, the directory stack is empty, a non-exis-
4832 tent directory stack entry is specified, or the directory change
4833 fails.
4834
4835 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]
4836 Write the formatted _\ba_\br_\bg_\bu_\bm_\be_\bn_\bt_\bs to the standard output under the
4837 control of the _\bf_\bo_\br_\bm_\ba_\bt. The -\b-v\bv option causes the output to be
4838 assigned to the variable _\bv_\ba_\br rather than being printed to the
4839 standard output.
4840
4841 The _\bf_\bo_\br_\bm_\ba_\bt is a character string which contains three types of
4842 objects: plain characters, which are simply copied to standard
4843 output, character escape sequences, which are converted and
4844 copied to the standard output, and format specifications, each
4845 of which causes printing of the next successive _\ba_\br_\bg_\bu_\bm_\be_\bn_\bt. In
4846 addition to the standard _\bp_\br_\bi_\bn_\bt_\bf(1) format specifications, p\bpr\bri\bin\bnt\btf\bf
4847 interprets the following extensions:
4848 %\b%b\bb causes p\bpr\bri\bin\bnt\btf\bf to expand backslash escape sequences in the
4849 corresponding _\ba_\br_\bg_\bu_\bm_\be_\bn_\bt (except that \\b\c\bc terminates output,
4850 backslashes in \\b\'\b', \\b\"\b", and \\b\?\b? are not removed, and octal
4851 escapes beginning with \\b\0\b0 may contain up to four digits).
4852 %\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
4853 format that can be reused as shell input.
4854 %\b%(\b(_\bd_\ba_\bt_\be_\bf_\bm_\bt)\b)T\bT
4855 causes p\bpr\bri\bin\bnt\btf\bf to output the date-time string resulting
4856 from using _\bd_\ba_\bt_\be_\bf_\bm_\bt as a format string for _\bs_\bt_\br_\bf_\bt_\bi_\bm_\be(3).
4857 The corresponding _\ba_\br_\bg_\bu_\bm_\be_\bn_\bt is an integer representing the
4858 number of seconds since the epoch. Two special argument
4859 values may be used: -1 represents the current time, and
4860 -2 represents the time the shell was invoked. If no
4861 argument is specified, conversion behaves as if -1 had
4862 been given. This is an exception to the usual p\bpr\bri\bin\bnt\btf\bf
4863 behavior.
4864
4865 Arguments to non-string format specifiers are treated as C con-
4866 stants, except that a leading plus or minus sign is allowed, and
4867 if the leading character is a single or double quote, the value
4868 is the ASCII value of the following character.
4869
4870 The _\bf_\bo_\br_\bm_\ba_\bt is reused as necessary to consume all of the _\ba_\br_\bg_\bu_\b-
4871 _\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,
4872 the extra format specifications behave as if a zero value or
4873 null string, as appropriate, had been supplied. The return
4874 value is zero on success, non-zero on failure.
4875
4876 p\bpu\bus\bsh\bhd\bd [-\b-n\bn] [+_\bn] [-_\bn]
4877 p\bpu\bus\bsh\bhd\bd [-\b-n\bn] [_\bd_\bi_\br]
4878 Adds a directory to the top of the directory stack, or rotates
4879 the stack, making the new top of the stack the current working
4880 directory. With no arguments, p\bpu\bus\bsh\bhd\bd exchanges the top two
4881 directories and returns 0, unless the directory stack is empty.
4882 Arguments, if supplied, have the following meanings:
4883 -\b-n\bn Suppresses the normal change of directory when rotating
4884 or adding directories to the stack, so that only the
4885 stack is manipulated.
4886 +\b+_\bn Rotates the stack so that the _\bnth directory (counting
4887 from the left of the list shown by d\bdi\bir\brs\bs, starting with
4888 zero) is at the top.
4889 -\b-_\bn Rotates the stack so that the _\bnth directory (counting
4890 from the right of the list shown by d\bdi\bir\brs\bs, starting with
4891 zero) is at the top.
4892 _\bd_\bi_\br Adds _\bd_\bi_\br to the directory stack at the top, making it the
4893 new current working directory as if it had been supplied
4894 as the argument to the c\bcd\bd builtin.
4895
4896 If the p\bpu\bus\bsh\bhd\bd command is successful, a d\bdi\bir\brs\bs is performed as well.
4897 If the first form is used, p\bpu\bus\bsh\bhd\bd returns 0 unless the cd to _\bd_\bi_\br
4898 fails. With the second form, p\bpu\bus\bsh\bhd\bd returns 0 unless the direc-
4899 tory stack is empty, a non-existent directory stack element is
4900 specified, or the directory change to the specified new current
4901 directory fails.
4902
4903 p\bpw\bwd\bd [-\b-L\bLP\bP]
4904 Print the absolute pathname of the current working directory.
4905 The pathname printed contains no symbolic links if the -\b-P\bP option
4906 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
4907 is enabled. If the -\b-L\bL option is used, the pathname printed may
4908 contain symbolic links. The return status is 0 unless an error
4909 occurs while reading the name of the current directory or an
4910 invalid option is supplied.
4911
4912 r\bre\bea\bad\bd [-\b-e\ber\brs\bs] [-\b-a\ba _\ba_\bn_\ba_\bm_\be] [-\b-d\bd _\bd_\be_\bl_\bi_\bm] [-\b-i\bi _\bt_\be_\bx_\bt] [-\b-n\bn _\bn_\bc_\bh_\ba_\br_\bs] [-\b-N\bN _\bn_\bc_\bh_\ba_\br_\bs] [-\b-p\bp
4913 _\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 ...]
4914 One line is read from the standard input, or from the file
4915 descriptor _\bf_\bd supplied as an argument to the -\b-u\bu option, and the
4916 first word is assigned to the first _\bn_\ba_\bm_\be, the second word to the
4917 second _\bn_\ba_\bm_\be, and so on, with leftover words and their interven-
4918 ing separators assigned to the last _\bn_\ba_\bm_\be. If there are fewer
4919 words read from the input stream than names, the remaining names
4920 are assigned empty values. The characters in I\bIF\bFS\bS are used to
4921 split the line into words using the same rules the shell uses
4922 for expansion (described above under W\bWo\bor\brd\bd S\bSp\bpl\bli\bit\btt\bti\bin\bng\bg). The back-
4923 slash character (\\b\) may be used to remove any special meaning
4924 for the next character read and for line continuation. Options,
4925 if supplied, have the following meanings:
4926 -\b-a\ba _\ba_\bn_\ba_\bm_\be
4927 The words are assigned to sequential indices of the array
4928 variable _\ba_\bn_\ba_\bm_\be, starting at 0. _\ba_\bn_\ba_\bm_\be is unset before any
4929 new values are assigned. Other _\bn_\ba_\bm_\be arguments are
4930 ignored.
4931 -\b-d\bd _\bd_\be_\bl_\bi_\bm
4932 The first character of _\bd_\be_\bl_\bi_\bm is used to terminate the
4933 input line, rather than newline.
4934 -\b-e\be If the standard input is coming from a terminal, r\bre\bea\bad\bdl\bli\bin\bne\be
4935 (see R\bRE\bEA\bAD\bDL\bLI\bIN\bNE\bE above) is used to obtain the line. Read-
4936 line uses the current (or default, if line editing was
4937 not previously active) editing settings.
4938 -\b-i\bi _\bt_\be_\bx_\bt
4939 If r\bre\bea\bad\bdl\bli\bin\bne\be is being used to read the line, _\bt_\be_\bx_\bt is
4940 placed into the editing buffer before editing begins.
4941 -\b-n\bn _\bn_\bc_\bh_\ba_\br_\bs
4942 r\bre\bea\bad\bd returns after reading _\bn_\bc_\bh_\ba_\br_\bs characters rather than
4943 waiting for a complete line of input, but honors a delim-
4944 iter if fewer than _\bn_\bc_\bh_\ba_\br_\bs characters are read before the
4945 delimiter.
4946 -\b-N\bN _\bn_\bc_\bh_\ba_\br_\bs
4947 r\bre\bea\bad\bd returns after reading exactly _\bn_\bc_\bh_\ba_\br_\bs characters
4948 rather than waiting for a complete line of input, unless
4949 EOF is encountered or r\bre\bea\bad\bd times out. Delimiter charac-
4950 ters encountered in the input are not treated specially
4951 and do not cause r\bre\bea\bad\bd to return until _\bn_\bc_\bh_\ba_\br_\bs characters
4952 are read. The result is not split on the characters in
4953 I\bIF\bFS\bS; the intent is that the variable is assigned exactly
4954 the characters read (with the exception of backslash; see
4955 the -\b-r\br option below).
4956 -\b-p\bp _\bp_\br_\bo_\bm_\bp_\bt
4957 Display _\bp_\br_\bo_\bm_\bp_\bt on standard error, without a trailing new-
4958 line, before attempting to read any input. The prompt is
4959 displayed only if input is coming from a terminal.
4960 -\b-r\br Backslash does not act as an escape character. The back-
4961 slash is considered to be part of the line. In particu-
4962 lar, a backslash-newline pair may not be used as a line
4963 continuation.
4964 -\b-s\bs Silent mode. If input is coming from a terminal, charac-
4965 ters are not echoed.
4966 -\b-t\bt _\bt_\bi_\bm_\be_\bo_\bu_\bt
4967 Cause r\bre\bea\bad\bd to time out and return failure if a complete
4968 line of input (or a specified number of characters) is
4969 not read within _\bt_\bi_\bm_\be_\bo_\bu_\bt seconds. _\bt_\bi_\bm_\be_\bo_\bu_\bt may be a deci-
4970 mal number with a fractional portion following the deci-
4971 mal point. This option is only effective if r\bre\bea\bad\bd is
4972 reading input from a terminal, pipe, or other special
4973 file; it has no effect when reading from regular files.
4974 If r\bre\bea\bad\bd times out, r\bre\bea\bad\bd saves any partial input read into
4975 the specified variable _\bn_\ba_\bm_\be. If _\bt_\bi_\bm_\be_\bo_\bu_\bt is 0, r\bre\bea\bad\bd
4976 returns immediately, without trying to read any data.
4977 The exit status is 0 if input is available on the speci-
4978 fied file descriptor, non-zero otherwise. The exit sta-
4979 tus is greater than 128 if the timeout is exceeded.
4980 -\b-u\bu _\bf_\bd Read input from file descriptor _\bf_\bd.
4981
4982 If no _\bn_\ba_\bm_\be_\bs are supplied, the line read is assigned to the vari-
4983 able R\bRE\bEP\bPL\bLY\bY. The exit status is zero, unless end-of-file is
4984 encountered, r\bre\bea\bad\bd times out (in which case the status is greater
4985 than 128), a variable assignment error (such as assigning to a
4986 readonly variable) occurs, or an invalid file descriptor is sup-
4987 plied as the argument to -\b-u\bu.
4988
4989 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] ...]
4990 The given _\bn_\ba_\bm_\be_\bs are marked readonly; the values of these _\bn_\ba_\bm_\be_\bs
4991 may not be changed by subsequent assignment. If the -\b-f\bf option
4992 is supplied, the functions corresponding to the _\bn_\ba_\bm_\be_\bs are so
4993 marked. The -\b-a\ba option restricts the variables to indexed
4994 arrays; the -\b-A\bA option restricts the variables to associative
4995 arrays. If both options are supplied, -\b-A\bA takes precedence. If
4996 no _\bn_\ba_\bm_\be arguments are given, or if the -\b-p\bp option is supplied, a
4997 list of all readonly names is printed. The other options may be
4998 used to restrict the output to a subset of the set of readonly
4999 names. The -\b-p\bp option causes output to be displayed in a format
5000 that may be reused as input. If a variable name is followed by
5001 =_\bw_\bo_\br_\bd, the value of the variable is set to _\bw_\bo_\br_\bd. The return
5002 status is 0 unless an invalid option is encountered, one of the
5003 _\bn_\ba_\bm_\be_\bs is not a valid shell variable name, or -\b-f\bf is supplied with
5004 a _\bn_\ba_\bm_\be that is not a function.
5005
5006 r\bre\bet\btu\bur\brn\bn [_\bn]
5007 Causes a function to stop executing and return the value speci-
5008 fied by _\bn to its caller. If _\bn is omitted, the return status is
5009 that of the last command executed in the function body. If
5010 r\bre\bet\btu\bur\brn\bn is executed by a trap handler, the last command used to
5011 determine the status is the last command executed before the
5012 trap handler. if r\bre\bet\btu\bur\brn\bn is executed during a D\bDE\bEB\bBU\bUG\bG trap, the
5013 last command used to determine the status is the last command
5014 executed by the trap handler before r\bre\bet\btu\bur\brn\bn was invoked. If
5015 r\bre\bet\btu\bur\brn\bn is used outside a function, but during execution of a
5016 script by the .\b. (s\bso\bou\bur\brc\bce\be) command, it causes the shell to stop
5017 executing that script and return either _\bn or the exit status of
5018 the last command executed within the script as the exit status
5019 of the script. If _\bn is supplied, the return value is its least
5020 significant 8 bits. The return status is non-zero if r\bre\bet\btu\bur\brn\bn is
5021 supplied a non-numeric argument, or is used outside a function
5022 and not during execution of a script by .\b. or s\bso\bou\bur\brc\bce\be. Any com-
5023 mand associated with the R\bRE\bET\bTU\bUR\bRN\bN trap is executed before execu-
5024 tion resumes after the function or script.
5025
5026 s\bse\bet\bt [-\b--\b-a\bab\bbe\bef\bfh\bhk\bkm\bmn\bnp\bpt\btu\buv\bvx\bxB\bBC\bCE\bEH\bHP\bPT\bT] [-\b-o\bo _\bo_\bp_\bt_\bi_\bo_\bn_\b-_\bn_\ba_\bm_\be] [_\ba_\br_\bg ...]
5027 s\bse\bet\bt [+\b+a\bab\bbe\bef\bfh\bhk\bkm\bmn\bnp\bpt\btu\buv\bvx\bxB\bBC\bCE\bEH\bHP\bPT\bT] [+\b+o\bo _\bo_\bp_\bt_\bi_\bo_\bn_\b-_\bn_\ba_\bm_\be] [_\ba_\br_\bg ...]
5028 Without options, the name and value of each shell variable are
5029 displayed in a format that can be reused as input for setting or
5030 resetting the currently-set variables. Read-only variables can-
5031 not be reset. In _\bp_\bo_\bs_\bi_\bx mode, only shell variables are listed.
5032 The output is sorted according to the current locale. When
5033 options are specified, they set or unset shell attributes. Any
5034 arguments remaining after option processing are treated as val-
5035 ues for the positional parameters and are assigned, in order, to
5036 $\b$1\b1, $\b$2\b2, .\b..\b..\b. $\b$_\bn. Options, if specified, have the following
5037 meanings:
5038 -\b-a\ba Each variable or function that is created or modified is
5039 given the export attribute and marked for export to the
5040 environment of subsequent commands.
5041 -\b-b\bb Report the status of terminated background jobs immedi-
5042 ately, rather than before the next primary prompt. This
5043 is effective only when job control is enabled.
5044 -\b-e\be Exit immediately if a _\bp_\bi_\bp_\be_\bl_\bi_\bn_\be (which may consist of a
5045 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
5046 (see S\bSH\bHE\bEL\bLL\bL G\bGR\bRA\bAM\bMM\bMA\bAR\bR above), exits with a non-zero status.
5047 The shell does not exit if the command that fails is
5048 part of the command list immediately following a w\bwh\bhi\bil\ble\be
5049 or u\bun\bnt\bti\bil\bl keyword, part of the test following the i\bif\bf or
5050 e\bel\bli\bif\bf reserved words, part of any command executed in a
5051 &\b&&\b& or |\b||\b| list except the command following the final &\b&&\b&
5052 or |\b||\b|, any command in a pipeline but the last, or if the
5053 command's return value is being inverted with !\b!. If a
5054 compound command other than a subshell returns a non-
5055 zero status because a command failed while -\b-e\be was being
5056 ignored, the shell does not exit. A trap on E\bER\bRR\bR, if
5057 set, is executed before the shell exits. This option
5058 applies to the shell environment and each subshell envi-
5059 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
5060 above), and may cause subshells to exit before executing
5061 all the commands in the subshell.
5062
5063 If a compound command or shell function executes in a
5064 context where -\b-e\be is being ignored, none of the commands
5065 executed within the compound command or function body
5066 will be affected by the -\b-e\be setting, even if -\b-e\be is set
5067 and a command returns a failure status. If a compound
5068 command or shell function sets -\b-e\be while executing in a
5069 context where -\b-e\be is ignored, that setting will not have
5070 any effect until the compound command or the command
5071 containing the function call completes.
5072 -\b-f\bf Disable pathname expansion.
5073 -\b-h\bh Remember the location of commands as they are looked up
5074 for execution. This is enabled by default.
5075 -\b-k\bk All arguments in the form of assignment statements are
5076 placed in the environment for a command, not just those
5077 that precede the command name.
5078 -\b-m\bm Monitor mode. Job control is enabled. This option is
5079 on by default for interactive shells on systems that
5080 support it (see J\bJO\bOB\bB C\bCO\bON\bNT\bTR\bRO\bOL\bL above). All processes run
5081 in a separate process group. When a background job com-
5082 pletes, the shell prints a line containing its exit sta-
5083 tus.
5084 -\b-n\bn Read commands but do not execute them. This may be used
5085 to check a shell script for syntax errors. This is
5086 ignored by interactive shells.
5087 -\b-o\bo _\bo_\bp_\bt_\bi_\bo_\bn_\b-_\bn_\ba_\bm_\be
5088 The _\bo_\bp_\bt_\bi_\bo_\bn_\b-_\bn_\ba_\bm_\be can be one of the following:
5089 a\bal\bll\ble\bex\bxp\bpo\bor\brt\bt
5090 Same as -\b-a\ba.
5091 b\bbr\bra\bac\bce\bee\bex\bxp\bpa\ban\bnd\bd
5092 Same as -\b-B\bB.
5093 e\bem\bma\bac\bcs\bs Use an emacs-style command line editing inter-
5094 face. This is enabled by default when the shell
5095 is interactive, unless the shell is started with
5096 the -\b--\b-n\bno\boe\bed\bdi\bit\bti\bin\bng\bg option. This also affects the
5097 editing interface used for r\bre\bea\bad\bd -\b-e\be.
5098 e\ber\brr\bre\bex\bxi\bit\bt Same as -\b-e\be.
5099 e\ber\brr\brt\btr\bra\bac\bce\be
5100 Same as -\b-E\bE.
5101 f\bfu\bun\bnc\bct\btr\bra\bac\bce\be
5102 Same as -\b-T\bT.
5103 h\bha\bas\bsh\bha\bal\bll\bl Same as -\b-h\bh.
5104 h\bhi\bis\bst\bte\bex\bxp\bpa\ban\bnd\bd
5105 Same as -\b-H\bH.
5106 h\bhi\bis\bst\bto\bor\bry\by Enable command history, as described above under
5107 H\bHI\bIS\bST\bTO\bOR\bRY\bY. This option is on by default in inter-
5108 active shells.
5109 i\big\bgn\bno\bor\bre\bee\beo\bof\bf
5110 The effect is as if the shell command
5111 ``IGNOREEOF=10'' had been executed (see S\bSh\bhe\bel\bll\bl
5112 V\bVa\bar\bri\bia\bab\bbl\ble\bes\bs above).
5113 k\bke\bey\byw\bwo\bor\brd\bd Same as -\b-k\bk.
5114 m\bmo\bon\bni\bit\bto\bor\br Same as -\b-m\bm.
5115 n\bno\boc\bcl\blo\bob\bbb\bbe\ber\br
5116 Same as -\b-C\bC.
5117 n\bno\boe\bex\bxe\bec\bc Same as -\b-n\bn.
5118 n\bno\bog\bgl\blo\bob\bb Same as -\b-f\bf.
5119 n\bno\bol\blo\bog\bg Currently ignored.
5120 n\bno\bot\bti\bif\bfy\by Same as -\b-b\bb.
5121 n\bno\bou\bun\bns\bse\bet\bt Same as -\b-u\bu.
5122 o\bon\bne\bec\bcm\bmd\bd Same as -\b-t\bt.
5123 p\bph\bhy\bys\bsi\bic\bca\bal\bl
5124 Same as -\b-P\bP.
5125 p\bpi\bip\bpe\bef\bfa\bai\bil\bl
5126 If set, the return value of a pipeline is the
5127 value of the last (rightmost) command to exit
5128 with a non-zero status, or zero if all commands
5129 in the pipeline exit successfully. This option
5130 is disabled by default.
5131 p\bpo\bos\bsi\bix\bx Change the behavior of b\bba\bas\bsh\bh where the default
5132 operation differs from the POSIX standard to
5133 match the standard (_\bp_\bo_\bs_\bi_\bx _\bm_\bo_\bd_\be). See S\bSE\bEE\bE A\bAL\bLS\bSO\bO
5134 below for a reference to a document that details
5135 how posix mode affects bash's behavior.
5136 p\bpr\bri\biv\bvi\bil\ble\beg\bge\bed\bd
5137 Same as -\b-p\bp.
5138 v\bve\ber\brb\bbo\bos\bse\be Same as -\b-v\bv.
5139 v\bvi\bi Use a vi-style command line editing interface.
5140 This also affects the editing interface used for
5141 r\bre\bea\bad\bd -\b-e\be.
5142 x\bxt\btr\bra\bac\bce\be Same as -\b-x\bx.
5143 If -\b-o\bo is supplied with no _\bo_\bp_\bt_\bi_\bo_\bn_\b-_\bn_\ba_\bm_\be, the values of the
5144 current options are printed. If +\b+o\bo is supplied with no
5145 _\bo_\bp_\bt_\bi_\bo_\bn_\b-_\bn_\ba_\bm_\be, a series of s\bse\bet\bt commands to recreate the
5146 current option settings is displayed on the standard
5147 output.
5148 -\b-p\bp Turn on _\bp_\br_\bi_\bv_\bi_\bl_\be_\bg_\be_\bd mode. In this mode, the $\b$E\bEN\bNV\bV and
5149 $\b$B\bBA\bAS\bSH\bH_\b_E\bEN\bNV\bV files are not processed, shell functions are
5150 not inherited from the environment, and the S\bSH\bHE\bEL\bLL\bLO\bOP\bPT\bTS\bS,
5151 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
5152 appear in the environment, are ignored. If the shell is
5153 started with the effective user (group) id not equal to
5154 the real user (group) id, and the -\b-p\bp option is not sup-
5155 plied, these actions are taken and the effective user id
5156 is set to the real user id. If the -\b-p\bp option is sup-
5157 plied at startup, the effective user id is not reset.
5158 Turning this option off causes the effective user and
5159 group ids to be set to the real user and group ids.
5160 -\b-t\bt Exit after reading and executing one command.
5161 -\b-u\bu Treat unset variables and parameters other than the spe-
5162 cial parameters "@" and "*" as an error when performing
5163 parameter expansion. If expansion is attempted on an
5164 unset variable or parameter, the shell prints an error
5165 message, and, if not interactive, exits with a non-zero
5166 status.
5167 -\b-v\bv Print shell input lines as they are read.
5168 -\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
5169 command, s\bse\bel\ble\bec\bct\bt command, or arithmetic f\bfo\bor\br command, dis-
5170 play the expanded value of P\bPS\bS4\b4, followed by the command
5171 and its expanded arguments or associated word list.
5172 -\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
5173 above). This is on by default.
5174 -\b-C\bC If set, b\bba\bas\bsh\bh does not overwrite an existing file with
5175 the >\b>, >\b>&\b&, and <\b<>\b> redirection operators. This may be
5176 overridden when creating output files by using the redi-
5177 rection operator >\b>|\b| instead of >\b>.
5178 -\b-E\bE If set, any trap on E\bER\bRR\bR is inherited by shell functions,
5179 command substitutions, and commands executed in a sub-
5180 shell environment. The E\bER\bRR\bR trap is normally not inher-
5181 ited in such cases.
5182 -\b-H\bH Enable !\b! style history substitution. This option is on
5183 by default when the shell is interactive.
5184 -\b-P\bP If set, the shell does not resolve symbolic links when
5185 executing commands such as c\bcd\bd that change the current
5186 working directory. It uses the physical directory
5187 structure instead. By default, b\bba\bas\bsh\bh follows the logical
5188 chain of directories when performing commands which
5189 change the current directory.
5190 -\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
5191 shell functions, command substitutions, and commands
5192 executed in a subshell environment. The D\bDE\bEB\bBU\bUG\bG and
5193 R\bRE\bET\bTU\bUR\bRN\bN traps are normally not inherited in such cases.
5194 -\b--\b- If no arguments follow this option, then the positional
5195 parameters are unset. Otherwise, the positional parame-
5196 ters are set to the _\ba_\br_\bgs, even if some of them begin
5197 with a -\b-.
5198 -\b- Signal the end of options, cause all remaining _\ba_\br_\bgs to
5199 be assigned to the positional parameters. The -\b-x\bx and -\b-v\bv
5200 options are turned off. If there are no _\ba_\br_\bgs, the posi-
5201 tional parameters remain unchanged.
5202
5203 The options are off by default unless otherwise noted. Using +
5204 rather than - causes these options to be turned off. The
5205 options can also be specified as arguments to an invocation of
5206 the shell. The current set of options may be found in $\b$-\b-. The
5207 return status is always true unless an invalid option is encoun-
5208 tered.
5209
5210 s\bsh\bhi\bif\bft\bt [_\bn]
5211 The positional parameters from _\bn+1 ... are renamed to $\b$1\b1 .\b..\b..\b..\b.
5212 Parameters represented by the numbers $\b$#\b# down to $\b$#\b#-_\bn+1 are
5213 unset. _\bn must be a non-negative number less than or equal to
5214 $\b$#\b#. If _\bn is 0, no parameters are changed. If _\bn is not given,
5215 it is assumed to be 1. If _\bn is greater than $\b$#\b#, the positional
5216 parameters are not changed. The return status is greater than
5217 zero if _\bn is greater than $\b$#\b# or less than zero; otherwise 0.
5218
5219 s\bsh\bho\bop\bpt\bt [-\b-p\bpq\bqs\bsu\bu] [-\b-o\bo] [_\bo_\bp_\bt_\bn_\ba_\bm_\be ...]
5220 Toggle the values of settings controlling optional shell behav-
5221 ior. The settings can be either those listed below, or, if the
5222 -\b-o\bo option is used, those available with the -\b-o\bo option to the s\bse\bet\bt
5223 builtin command. With no options, or with the -\b-p\bp option, a list
5224 of all settable options is displayed, with an indication of
5225 whether or not each is set. The -\b-p\bp option causes output to be
5226 displayed in a form that may be reused as input. Other options
5227 have the following meanings:
5228 -\b-s\bs Enable (set) each _\bo_\bp_\bt_\bn_\ba_\bm_\be.
5229 -\b-u\bu Disable (unset) each _\bo_\bp_\bt_\bn_\ba_\bm_\be.
5230 -\b-q\bq Suppresses normal output (quiet mode); the return status
5231 indicates whether the _\bo_\bp_\bt_\bn_\ba_\bm_\be is set or unset. If multi-
5232 ple _\bo_\bp_\bt_\bn_\ba_\bm_\be arguments are given with -\b-q\bq, the return sta-
5233 tus is zero if all _\bo_\bp_\bt_\bn_\ba_\bm_\be_\bs are enabled; non-zero other-
5234 wise.
5235 -\b-o\bo Restricts the values of _\bo_\bp_\bt_\bn_\ba_\bm_\be to be those defined for
5236 the -\b-o\bo option to the s\bse\bet\bt builtin.
5237
5238 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
5239 shows only those options which are set or unset, respectively.
5240 Unless otherwise noted, the s\bsh\bho\bop\bpt\bt options are disabled (unset)
5241 by default.
5242
5243 The return status when listing options is zero if all _\bo_\bp_\bt_\bn_\ba_\bm_\be_\bs
5244 are enabled, non-zero otherwise. When setting or unsetting
5245 options, the return status is zero unless an _\bo_\bp_\bt_\bn_\ba_\bm_\be is not a
5246 valid shell option.
5247
5248 The list of s\bsh\bho\bop\bpt\bt options is:
5249
5250 a\bau\but\bto\boc\bcd\bd If set, a command name that is the name of a directory
5251 is executed as if it were the argument to the c\bcd\bd com-
5252 mand. This option is only used by interactive shells.
5253 c\bcd\bda\bab\bbl\ble\be_\b_v\bva\bar\brs\bs
5254 If set, an argument to the c\bcd\bd builtin command that is
5255 not a directory is assumed to be the name of a variable
5256 whose value is the directory to change to.
5257 c\bcd\bds\bsp\bpe\bel\bll\bl If set, minor errors in the spelling of a directory com-
5258 ponent in a c\bcd\bd command will be corrected. The errors
5259 checked for are transposed characters, a missing charac-
5260 ter, and one character too many. If a correction is
5261 found, the corrected filename is printed, and the com-
5262 mand proceeds. This option is only used by interactive
5263 shells.
5264 c\bch\bhe\bec\bck\bkh\bha\bas\bsh\bh
5265 If set, b\bba\bas\bsh\bh checks that a command found in the hash ta-
5266 ble exists before trying to execute it. If a hashed
5267 command no longer exists, a normal path search is per-
5268 formed.
5269 c\bch\bhe\bec\bck\bkj\bjo\bob\bbs\bs
5270 If set, b\bba\bas\bsh\bh lists the status of any stopped and running
5271 jobs before exiting an interactive shell. If any jobs
5272 are running, this causes the exit to be deferred until a
5273 second exit is attempted without an intervening command
5274 (see J\bJO\bOB\bB C\bCO\bON\bNT\bTR\bRO\bOL\bL above). The shell always postpones
5275 exiting if any jobs are stopped.
5276 c\bch\bhe\bec\bck\bkw\bwi\bin\bns\bsi\biz\bze\be
5277 If set, b\bba\bas\bsh\bh checks the window size after each command
5278 and, if necessary, updates the values of L\bLI\bIN\bNE\bES\bS and C\bCO\bOL\bL-\b-
5279 U\bUM\bMN\bNS\bS.
5280 c\bcm\bmd\bdh\bhi\bis\bst\bt If set, b\bba\bas\bsh\bh attempts to save all lines of a multiple-
5281 line command in the same history entry. This allows
5282 easy re-editing of multi-line commands.
5283 c\bco\bom\bmp\bpa\bat\bt3\b31\b1
5284 If set, b\bba\bas\bsh\bh changes its behavior to that of version 3.1
5285 with respect to quoted arguments to the [\b[[\b[ conditional
5286 command's =\b=~\b~ operator and locale-specific string compar-
5287 ison when using the [\b[[\b[ conditional command's <\b< and >\b>
5288 operators. Bash versions prior to bash-4.1 use ASCII
5289 collation and _\bs_\bt_\br_\bc_\bm_\bp(3); bash-4.1 and later use the cur-
5290 rent locale's collation sequence and _\bs_\bt_\br_\bc_\bo_\bl_\bl(3).
5291 c\bco\bom\bmp\bpa\bat\bt3\b32\b2
5292 If set, b\bba\bas\bsh\bh changes its behavior to that of version 3.2
5293 with respect to locale-specific string comparison when
5294 using the [\b[[\b[ conditional command's <\b< and >\b> operators
5295 (see previous item).
5296 c\bco\bom\bmp\bpa\bat\bt4\b40\b0
5297 If set, b\bba\bas\bsh\bh changes its behavior to that of version 4.0
5298 with respect to locale-specific string comparison when
5299 using the [\b[[\b[ conditional command's <\b< and >\b> operators
5300 (see description of c\bco\bom\bmp\bpa\bat\bt3\b31\b1) and the effect of inter-
5301 rupting a command list. Bash versions 4.0 and later
5302 interrupt the list as if the shell received the inter-
5303 rupt; previous versions continue with the next command
5304 in the list.
5305 c\bco\bom\bmp\bpa\bat\bt4\b41\b1
5306 If set, b\bba\bas\bsh\bh, when in _\bp_\bo_\bs_\bi_\bx mode, treats a single quote
5307 in a double-quoted parameter expansion as a special
5308 character. The single quotes must match (an even num-
5309 ber) and the characters between the single quotes are
5310 considered quoted. This is the behavior of posix mode
5311 through version 4.1. The default bash behavior remains
5312 as in previous versions.
5313 c\bco\bom\bmp\bpa\bat\bt4\b42\b2
5314 If set, b\bba\bas\bsh\bh does not process the replacement string in
5315 the pattern substitution word expansion using quote
5316 removal.
5317 c\bco\bom\bmp\bpa\bat\bt4\b43\b3
5318 If set, b\bba\bas\bsh\bh does not print a warning message if an
5319 attempt is made to use a quoted compound array assign-
5320 ment as an argument to d\bde\bec\bcl\bla\bar\bre\be, and makes word expansion
5321 errors non-fatal errors that cause the current command
5322 to fail (the default behavior is to make them fatal
5323 errors that cause the shell to exit).
5324 c\bco\bom\bmp\bpl\ble\bet\bte\be_\b_f\bfu\bul\bll\blq\bqu\buo\bot\bte\be
5325 If set, b\bba\bas\bsh\bh quotes all shell metacharacters in file-
5326 names and directory names when performing completion.
5327 If not set, b\bba\bas\bsh\bh removes metacharacters such as the dol-
5328 lar sign from the set of characters that will be quoted
5329 in completed filenames when these metacharacters appear
5330 in shell variable references in words to be completed.
5331 This means that dollar signs in variable names that
5332 expand to directories will not be quoted; however, any
5333 dollar signs appearing in filenames will not be quoted,
5334 either. This is active only when bash is using back-
5335 slashes to quote completed filenames. This variable is
5336 set by default, which is the default bash behavior in
5337 versions through 4.2.
5338 d\bdi\bir\bre\bex\bxp\bpa\ban\bnd\bd
5339 If set, b\bba\bas\bsh\bh replaces directory names with the results
5340 of word expansion when performing filename completion.
5341 This changes the contents of the readline editing buf-
5342 fer. If not set, b\bba\bas\bsh\bh attempts to preserve what the
5343 user typed.
5344 d\bdi\bir\brs\bsp\bpe\bel\bll\bl
5345 If set, b\bba\bas\bsh\bh attempts spelling correction on directory
5346 names during word completion if the directory name ini-
5347 tially supplied does not exist.
5348 d\bdo\bot\btg\bgl\blo\bob\bb If set, b\bba\bas\bsh\bh includes filenames beginning with a `.' in
5349 the results of pathname expansion.
5350 e\bex\bxe\bec\bcf\bfa\bai\bil\bl
5351 If set, a non-interactive shell will not exit if it can-
5352 not execute the file specified as an argument to the
5353 e\bex\bxe\bec\bc builtin command. An interactive shell does not
5354 exit if e\bex\bxe\bec\bc fails.
5355 e\bex\bxp\bpa\ban\bnd\bd_\b_a\bal\bli\bia\bas\bse\bes\bs
5356 If set, aliases are expanded as described above under
5357 A\bAL\bLI\bIA\bAS\bSE\bES\bS. This option is enabled by default for interac-
5358 tive shells.
5359 e\bex\bxt\btd\bde\beb\bbu\bug\bg
5360 If set, behavior intended for use by debuggers is
5361 enabled:
5362 1\b1.\b. The -\b-F\bF option to the d\bde\bec\bcl\bla\bar\bre\be builtin displays the
5363 source file name and line number corresponding to
5364 each function name supplied as an argument.
5365 2\b2.\b. If the command run by the D\bDE\bEB\bBU\bUG\bG trap returns a
5366 non-zero value, the next command is skipped and
5367 not executed.
5368 3\b3.\b. If the command run by the D\bDE\bEB\bBU\bUG\bG trap returns a
5369 value of 2, and the shell is executing in a sub-
5370 routine (a shell function or a shell script exe-
5371 cuted by the .\b. or s\bso\bou\bur\brc\bce\be builtins), the shell
5372 simulates a call to r\bre\bet\btu\bur\brn\bn.
5373 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
5374 in their descriptions above.
5375 5\b5.\b. Function tracing is enabled: command substitu-
5376 tion, shell functions, and subshells invoked with
5377 (\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.
5378 6\b6.\b. Error tracing is enabled: command substitution,
5379 shell functions, and subshells invoked with (\b(
5380 _\bc_\bo_\bm_\bm_\ba_\bn_\bd )\b) inherit the E\bER\bRR\bR trap.
5381 e\bex\bxt\btg\bgl\blo\bob\bb If set, the extended pattern matching features described
5382 above under P\bPa\bat\bth\bhn\bna\bam\bme\be E\bEx\bxp\bpa\ban\bns\bsi\bio\bon\bn are enabled.
5383 e\bex\bxt\btq\bqu\buo\bot\bte\be
5384 If set, $\b$'_\bs_\bt_\br_\bi_\bn_\bg' and $\b$"_\bs_\bt_\br_\bi_\bn_\bg" quoting is performed
5385 within $\b${\b{_\bp_\ba_\br_\ba_\bm_\be_\bt_\be_\br}\b} expansions enclosed in double
5386 quotes. This option is enabled by default.
5387 f\bfa\bai\bil\blg\bgl\blo\bob\bb
5388 If set, patterns which fail to match filenames during
5389 pathname expansion result in an expansion error.
5390 f\bfo\bor\brc\bce\be_\b_f\bfi\big\bgn\bno\bor\bre\be
5391 If set, the suffixes specified by the F\bFI\bIG\bGN\bNO\bOR\bRE\bE shell
5392 variable cause words to be ignored when performing word
5393 completion even if the ignored words are the only possi-
5394 ble completions. See S\bSH\bHE\bEL\bLL\bL V\bVA\bAR\bRI\bIA\bAB\bBL\bLE\bES\bS above for a
5395 description of F\bFI\bIG\bGN\bNO\bOR\bRE\bE. This option is enabled by
5396 default.
5397 g\bgl\blo\bob\bba\bas\bsc\bci\bii\bir\bra\ban\bng\bge\bes\bs
5398 If set, range expressions used in pattern matching
5399 bracket expressions (see P\bPa\bat\btt\bte\ber\brn\bn M\bMa\bat\btc\bch\bhi\bin\bng\bg above) behave
5400 as if in the traditional C locale when performing com-
5401 parisons. That is, the current locale's collating
5402 sequence is not taken into account, so b\bb will not col-
5403 late between A\bA and B\bB, and upper-case and lower-case
5404 ASCII characters will collate together.
5405 g\bgl\blo\bob\bbs\bst\bta\bar\br
5406 If set, the pattern *\b**\b* used in a pathname expansion con-
5407 text will match all files and zero or more directories
5408 and subdirectories. If the pattern is followed by a /\b/,
5409 only directories and subdirectories match.
5410 g\bgn\bnu\bu_\b_e\ber\brr\brf\bfm\bmt\bt
5411 If set, shell error messages are written in the standard
5412 GNU error message format.
5413 h\bhi\bis\bst\bta\bap\bpp\bpe\ben\bnd\bd
5414 If set, the history list is appended to the file named
5415 by the value of the H\bHI\bIS\bST\bTF\bFI\bIL\bLE\bE variable when the shell
5416 exits, rather than overwriting the file.
5417 h\bhi\bis\bst\btr\bre\bee\bed\bdi\bit\bt
5418 If set, and r\bre\bea\bad\bdl\bli\bin\bne\be is being used, a user is given the
5419 opportunity to re-edit a failed history substitution.
5420 h\bhi\bis\bst\btv\bve\ber\bri\bif\bfy\by
5421 If set, and r\bre\bea\bad\bdl\bli\bin\bne\be is being used, the results of his-
5422 tory substitution are not immediately passed to the
5423 shell parser. Instead, the resulting line is loaded
5424 into the r\bre\bea\bad\bdl\bli\bin\bne\be editing buffer, allowing further modi-
5425 fication.
5426 h\bho\bos\bst\btc\bco\bom\bmp\bpl\ble\bet\bte\be
5427 If set, and r\bre\bea\bad\bdl\bli\bin\bne\be is being used, b\bba\bas\bsh\bh will attempt to
5428 perform hostname completion when a word containing a @\b@
5429 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
5430 above). This is enabled by default.
5431 h\bhu\bup\bpo\bon\bne\bex\bxi\bit\bt
5432 If set, b\bba\bas\bsh\bh will send S\bSI\bIG\bGH\bHU\bUP\bP to all jobs when an inter-
5433 active login shell exits.
5434 i\bin\bnt\bte\ber\bra\bac\bct\bti\biv\bve\be_\b_c\bco\bom\bmm\bme\ben\bnt\bts\bs
5435 If set, allow a word beginning with #\b# to cause that word
5436 and all remaining characters on that line to be ignored
5437 in an interactive shell (see C\bCO\bOM\bMM\bME\bEN\bNT\bTS\bS above). This
5438 option is enabled by default.
5439 l\bla\bas\bst\btp\bpi\bip\bpe\be
5440 If set, and job control is not active, the shell runs
5441 the last command of a pipeline not executed in the back-
5442 ground in the current shell environment.
5443 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
5444 commands are saved to the history with embedded newlines
5445 rather than using semicolon separators where possible.
5446 l\blo\bog\bgi\bin\bn_\b_s\bsh\bhe\bel\bll\bl
5447 The shell sets this option if it is started as a login
5448 shell (see I\bIN\bNV\bVO\bOC\bCA\bAT\bTI\bIO\bON\bN above). The value may not be
5449 changed.
5450 m\bma\bai\bil\blw\bwa\bar\brn\bn
5451 If set, and a file that b\bba\bas\bsh\bh is checking for mail has
5452 been accessed since the last time it was checked, the
5453 message ``The mail in _\bm_\ba_\bi_\bl_\bf_\bi_\bl_\be has been read'' is dis-
5454 played.
5455 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
5456 If set, and r\bre\bea\bad\bdl\bli\bin\bne\be is being used, b\bba\bas\bsh\bh will not
5457 attempt to search the P\bPA\bAT\bTH\bH for possible completions when
5458 completion is attempted on an empty line.
5459 n\bno\boc\bca\bas\bse\beg\bgl\blo\bob\bb
5460 If set, b\bba\bas\bsh\bh matches filenames in a case-insensitive
5461 fashion when performing pathname expansion (see P\bPa\bat\bth\bhn\bna\bam\bme\be
5462 E\bEx\bxp\bpa\ban\bns\bsi\bio\bon\bn above).
5463 n\bno\boc\bca\bas\bse\bem\bma\bat\btc\bch\bh
5464 If set, b\bba\bas\bsh\bh matches patterns in a case-insensitive
5465 fashion when performing matching while executing c\bca\bas\bse\be or
5466 [\b[[\b[ conditional commands, when performing pattern substi-
5467 tution word expansions, or when filtering possible com-
5468 pletions as part of programmable completion.
5469 n\bnu\bul\bll\blg\bgl\blo\bob\bb
5470 If set, b\bba\bas\bsh\bh allows patterns which match no files (see
5471 P\bPa\bat\bth\bhn\bna\bam\bme\be E\bEx\bxp\bpa\ban\bns\bsi\bio\bon\bn above) to expand to a null string,
5472 rather than themselves.
5473 p\bpr\bro\bog\bgc\bco\bom\bmp\bp
5474 If set, the programmable completion facilities (see P\bPr\bro\bo-\b-
5475 g\bgr\bra\bam\bmm\bma\bab\bbl\ble\be C\bCo\bom\bmp\bpl\ble\bet\bti\bio\bon\bn above) are enabled. This option is
5476 enabled by default.
5477 p\bpr\bro\bom\bmp\bpt\btv\bva\bar\brs\bs
5478 If set, prompt strings undergo parameter expansion, com-
5479 mand substitution, arithmetic expansion, and quote
5480 removal after being expanded as described in P\bPR\bRO\bOM\bMP\bPT\bTI\bIN\bNG\bG
5481 above. This option is enabled by default.
5482 r\bre\bes\bst\btr\bri\bic\bct\bte\bed\bd_\b_s\bsh\bhe\bel\bll\bl
5483 The shell sets this option if it is started in
5484 restricted mode (see R\bRE\bES\bST\bTR\bRI\bIC\bCT\bTE\bED\bD S\bSH\bHE\bEL\bLL\bL below). The value
5485 may not be changed. This is not reset when the startup
5486 files are executed, allowing the startup files to dis-
5487 cover whether or not a shell is restricted.
5488 s\bsh\bhi\bif\bft\bt_\b_v\bve\ber\brb\bbo\bos\bse\be
5489 If set, the s\bsh\bhi\bif\bft\bt builtin prints an error message when
5490 the shift count exceeds the number of positional parame-
5491 ters.
5492 s\bso\bou\bur\brc\bce\bep\bpa\bat\bth\bh
5493 If set, the s\bso\bou\bur\brc\bce\be (.\b.) builtin uses the value of P\bPA\bAT\bTH\bH to
5494 find the directory containing the file supplied as an
5495 argument. This option is enabled by default.
5496 x\bxp\bpg\bg_\b_e\bec\bch\bho\bo
5497 If set, the e\bec\bch\bho\bo builtin expands backslash-escape
5498 sequences by default.
5499
5500 s\bsu\bus\bsp\bpe\ben\bnd\bd [-\b-f\bf]
5501 Suspend the execution of this shell until it receives a S\bSI\bIG\bGC\bCO\bON\bNT\bT
5502 signal. A login shell cannot be suspended; the -\b-f\bf option can be
5503 used to override this and force the suspension. The return sta-
5504 tus is 0 unless the shell is a login shell and -\b-f\bf is not sup-
5505 plied, or if job control is not enabled.
5506
5507 t\bte\bes\bst\bt _\be_\bx_\bp_\br
5508 [\b[ _\be_\bx_\bp_\br ]\b]
5509 Return a status of 0 (true) or 1 (false) depending on the evalu-
5510 ation of the conditional expression _\be_\bx_\bp_\br. Each operator and op-
5511 erand must be a separate argument. Expressions are composed of
5512 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.
5513 t\bte\bes\bst\bt does not accept any options, nor does it accept and ignore
5514 an argument of -\b--\b- as signifying the end of options.
5515
5516 Expressions may be combined using the following operators,
5517 listed in decreasing order of precedence. The evaluation
5518 depends on the number of arguments; see below. Operator prece-
5519 dence is used when there are five or more arguments.
5520 !\b! _\be_\bx_\bp_\br True if _\be_\bx_\bp_\br is false.
5521 (\b( _\be_\bx_\bp_\br )\b)
5522 Returns the value of _\be_\bx_\bp_\br. This may be used to override
5523 the normal precedence of operators.
5524 _\be_\bx_\bp_\br_\b1 -a\ba _\be_\bx_\bp_\br_\b2
5525 True if both _\be_\bx_\bp_\br_\b1 and _\be_\bx_\bp_\br_\b2 are true.
5526 _\be_\bx_\bp_\br_\b1 -o\bo _\be_\bx_\bp_\br_\b2
5527 True if either _\be_\bx_\bp_\br_\b1 or _\be_\bx_\bp_\br_\b2 is true.
5528
5529 t\bte\bes\bst\bt and [\b[ evaluate conditional expressions using a set of rules
5530 based on the number of arguments.
5531
5532 0 arguments
5533 The expression is false.
5534 1 argument
5535 The expression is true if and only if the argument is not
5536 null.
5537 2 arguments
5538 If the first argument is !\b!, the expression is true if and
5539 only if the second argument is null. If the first argu-
5540 ment is one of the unary conditional operators listed
5541 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
5542 true if the unary test is true. If the first argument is
5543 not a valid unary conditional operator, the expression is
5544 false.
5545 3 arguments
5546 The following conditions are applied in the order listed.
5547 If the second argument is one of the binary conditional
5548 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
5549 result of the expression is the result of the binary test
5550 using the first and third arguments as operands. The -\b-a\ba
5551 and -\b-o\bo operators are considered binary operators when
5552 there are three arguments. If the first argument is !\b!,
5553 the value is the negation of the two-argument test using
5554 the second and third arguments. If the first argument is
5555 exactly (\b( and the third argument is exactly )\b), the result
5556 is the one-argument test of the second argument. Other-
5557 wise, the expression is false.
5558 4 arguments
5559 If the first argument is !\b!, the result is the negation of
5560 the three-argument expression composed of the remaining
5561 arguments. Otherwise, the expression is parsed and eval-
5562 uated according to precedence using the rules listed
5563 above.
5564 5 or more arguments
5565 The expression is parsed and evaluated according to
5566 precedence using the rules listed above.
5567
5568 When used with t\bte\bes\bst\bt or [\b[, the <\b< and >\b> operators sort lexico-
5569 graphically using ASCII ordering.
5570
5571 t\bti\bim\bme\bes\bs Print the accumulated user and system times for the shell and
5572 for processes run from the shell. The return status is 0.
5573
5574 t\btr\bra\bap\bp [-\b-l\blp\bp] [[_\ba_\br_\bg] _\bs_\bi_\bg_\bs_\bp_\be_\bc ...]
5575 The command _\ba_\br_\bg is to be read and executed when the shell
5576 receives signal(s) _\bs_\bi_\bg_\bs_\bp_\be_\bc. If _\ba_\br_\bg is absent (and there is a
5577 single _\bs_\bi_\bg_\bs_\bp_\be_\bc) or -\b-, each specified signal is reset to its
5578 original disposition (the value it had upon entrance to the
5579 shell). If _\ba_\br_\bg is the null string the signal specified by each
5580 _\bs_\bi_\bg_\bs_\bp_\be_\bc is ignored by the shell and by the commands it invokes.
5581 If _\ba_\br_\bg is not present and -\b-p\bp has been supplied, then the trap
5582 commands associated with each _\bs_\bi_\bg_\bs_\bp_\be_\bc are displayed. If no
5583 arguments are supplied or if only -\b-p\bp is given, t\btr\bra\bap\bp prints the
5584 list of commands associated with each signal. The -\b-l\bl option
5585 causes the shell to print a list of signal names and their cor-
5586 responding numbers. Each _\bs_\bi_\bg_\bs_\bp_\be_\bc is either a signal name
5587 defined in <_\bs_\bi_\bg_\bn_\ba_\bl_\b._\bh>, or a signal number. Signal names are
5588 case insensitive and the S\bSI\bIG\bG prefix is optional.
5589
5590 If a _\bs_\bi_\bg_\bs_\bp_\be_\bc is E\bEX\bXI\bIT\bT (0) the command _\ba_\br_\bg is executed on exit
5591 from the shell. If a _\bs_\bi_\bg_\bs_\bp_\be_\bc is D\bDE\bEB\bBU\bUG\bG, the command _\ba_\br_\bg is exe-
5592 cuted before every _\bs_\bi_\bm_\bp_\bl_\be _\bc_\bo_\bm_\bm_\ba_\bn_\bd, _\bf_\bo_\br command, _\bc_\ba_\bs_\be command,
5593 _\bs_\be_\bl_\be_\bc_\bt command, every arithmetic _\bf_\bo_\br command, and before the
5594 first command executes in a shell function (see S\bSH\bHE\bEL\bLL\bL G\bGR\bRA\bAM\bMM\bMA\bAR\bR
5595 above). Refer to the description of the e\bex\bxt\btd\bde\beb\bbu\bug\bg option to the
5596 s\bsh\bho\bop\bpt\bt builtin for details of its effect on the D\bDE\bEB\bBU\bUG\bG trap. If a
5597 _\bs_\bi_\bg_\bs_\bp_\be_\bc is R\bRE\bET\bTU\bUR\bRN\bN, the command _\ba_\br_\bg is executed each time a shell
5598 function or a script executed with the .\b. or s\bso\bou\bur\brc\bce\be builtins fin-
5599 ishes executing.
5600
5601 If a _\bs_\bi_\bg_\bs_\bp_\be_\bc is E\bER\bRR\bR, the command _\ba_\br_\bg is executed whenever a a
5602 pipeline (which may consist of a single simple command), a list,
5603 or a compound command returns a non-zero exit status, subject to
5604 the following conditions. The E\bER\bRR\bR trap is not executed if the
5605 failed command is part of the command list immediately following
5606 a w\bwh\bhi\bil\ble\be or u\bun\bnt\bti\bil\bl keyword, part of the test in an _\bi_\bf statement,
5607 part of a command executed in a &\b&&\b& or |\b||\b| list except the command
5608 following the final &\b&&\b& or |\b||\b|, any command in a pipeline but the
5609 last, or if the command's return value is being inverted using
5610 !\b!. These are the same conditions obeyed by the e\ber\brr\bre\bex\bxi\bit\bt (-\b-e\be)
5611 option.
5612
5613 Signals ignored upon entry to the shell cannot be trapped or
5614 reset. Trapped signals that are not being ignored are reset to
5615 their original values in a subshell or subshell environment when
5616 one is created. The return status is false if any _\bs_\bi_\bg_\bs_\bp_\be_\bc is
5617 invalid; otherwise t\btr\bra\bap\bp returns true.
5618
5619 t\bty\byp\bpe\be [-\b-a\baf\bft\btp\bpP\bP] _\bn_\ba_\bm_\be [_\bn_\ba_\bm_\be ...]
5620 With no options, indicate how each _\bn_\ba_\bm_\be would be interpreted if
5621 used as a command name. If the -\b-t\bt option is used, t\bty\byp\bpe\be prints a
5622 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
5623 _\bf_\bi_\bl_\be if _\bn_\ba_\bm_\be is an alias, shell reserved word, function,
5624 builtin, or disk file, respectively. If the _\bn_\ba_\bm_\be is not found,
5625 then nothing is printed, and an exit status of false is
5626 returned. If the -\b-p\bp option is used, t\bty\byp\bpe\be either returns the
5627 name of the disk file that would be executed if _\bn_\ba_\bm_\be were speci-
5628 fied as a command name, or nothing if ``type -t name'' would not
5629 return _\bf_\bi_\bl_\be. The -\b-P\bP option forces a P\bPA\bAT\bTH\bH search for each _\bn_\ba_\bm_\be,
5630 even if ``type -t name'' would not return _\bf_\bi_\bl_\be. If a command is
5631 hashed, -\b-p\bp and -\b-P\bP print the hashed value, which is not necessar-
5632 ily the file that appears first in P\bPA\bAT\bTH\bH. If the -\b-a\ba option is
5633 used, t\bty\byp\bpe\be prints all of the places that contain an executable
5634 named _\bn_\ba_\bm_\be. This includes aliases and functions, if and only if
5635 the -\b-p\bp option is not also used. The table of hashed commands is
5636 not consulted when using -\b-a\ba. The -\b-f\bf option suppresses shell
5637 function lookup, as with the c\bco\bom\bmm\bma\ban\bnd\bd builtin. t\bty\byp\bpe\be returns true
5638 if all of the arguments are found, false if any are not found.
5639
5640 u\bul\bli\bim\bmi\bit\bt [-\b-H\bHS\bSa\bab\bbc\bcd\bde\bef\bfi\bik\bkl\blm\bmn\bnp\bpq\bqr\brs\bst\btu\buv\bvx\bxP\bPT\bT [_\bl_\bi_\bm_\bi_\bt]]
5641 Provides control over the resources available to the shell and
5642 to processes started by it, on systems that allow such control.
5643 The -\b-H\bH and -\b-S\bS options specify that the hard or soft limit is set
5644 for the given resource. A hard limit cannot be increased by a
5645 non-root user once it is set; a soft limit may be increased up
5646 to the value of the hard limit. If neither -\b-H\bH nor -\b-S\bS is speci-
5647 fied, both the soft and hard limits are set. The value of _\bl_\bi_\bm_\bi_\bt
5648 can be a number in the unit specified for the resource or one of
5649 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
5650 current hard limit, the current soft limit, and no limit,
5651 respectively. If _\bl_\bi_\bm_\bi_\bt is omitted, the current value of the
5652 soft limit of the resource is printed, unless the -\b-H\bH option is
5653 given. When more than one resource is specified, the limit name
5654 and unit are printed before the value. Other options are inter-
5655 preted as follows:
5656 -\b-a\ba All current limits are reported
5657 -\b-b\bb The maximum socket buffer size
5658 -\b-c\bc The maximum size of core files created
5659 -\b-d\bd The maximum size of a process's data segment
5660 -\b-e\be The maximum scheduling priority ("nice")
5661 -\b-f\bf The maximum size of files written by the shell and its
5662 children
5663 -\b-i\bi The maximum number of pending signals
5664 -\b-k\bk The maximum number of kqueues that may be allocated
5665 -\b-l\bl The maximum size that may be locked into memory
5666 -\b-m\bm The maximum resident set size (many systems do not honor
5667 this limit)
5668 -\b-n\bn The maximum number of open file descriptors (most systems
5669 do not allow this value to be set)
5670 -\b-p\bp The pipe size in 512-byte blocks (this may not be set)
5671 -\b-q\bq The maximum number of bytes in POSIX message queues
5672 -\b-r\br The maximum real-time scheduling priority
5673 -\b-s\bs The maximum stack size
5674 -\b-t\bt The maximum amount of cpu time in seconds
5675 -\b-u\bu The maximum number of processes available to a single
5676 user
5677 -\b-v\bv The maximum amount of virtual memory available to the
5678 shell and, on some systems, to its children
5679 -\b-x\bx The maximum number of file locks
5680 -\b-P\bP The maximum number of pseudoterminals
5681 -\b-T\bT The maximum number of threads
5682
5683 If _\bl_\bi_\bm_\bi_\bt is given, and the -\b-a\ba option is not used, _\bl_\bi_\bm_\bi_\bt is the
5684 new value of the specified resource. If no option is given,
5685 then -\b-f\bf is assumed. Values are in 1024-byte increments, except
5686 for -\b-t\bt, which is in seconds; -\b-p\bp, which is in units of 512-byte
5687 blocks; -\b-P\bP, -\b-T\bT, -\b-b\bb, -\b-k\bk, -\b-n\bn, and -\b-u\bu, which are unscaled values;
5688 and, when in Posix mode, -\b-c\bc and -\b-f\bf, which are in 512-byte incre-
5689 ments. The return status is 0 unless an invalid option or argu-
5690 ment is supplied, or an error occurs while setting a new limit.
5691
5692 u\bum\bma\bas\bsk\bk [-\b-p\bp] [-\b-S\bS] [_\bm_\bo_\bd_\be]
5693 The user file-creation mask is set to _\bm_\bo_\bd_\be. If _\bm_\bo_\bd_\be begins with
5694 a digit, it is interpreted as an octal number; otherwise it is
5695 interpreted as a symbolic mode mask similar to that accepted by
5696 _\bc_\bh_\bm_\bo_\bd(1). If _\bm_\bo_\bd_\be is omitted, the current value of the mask is
5697 printed. The -\b-S\bS option causes the mask to be printed in sym-
5698 bolic form; the default output is an octal number. If the -\b-p\bp
5699 option is supplied, and _\bm_\bo_\bd_\be is omitted, the output is in a form
5700 that may be reused as input. The return status is 0 if the mode
5701 was successfully changed or if no _\bm_\bo_\bd_\be argument was supplied,
5702 and false otherwise.
5703
5704 u\bun\bna\bal\bli\bia\bas\bs [-a\ba] [_\bn_\ba_\bm_\be ...]
5705 Remove each _\bn_\ba_\bm_\be from the list of defined aliases. If -\b-a\ba is
5706 supplied, all alias definitions are removed. The return value
5707 is true unless a supplied _\bn_\ba_\bm_\be is not a defined alias.
5708
5709 u\bun\bns\bse\bet\bt [-f\bfv\bv] [-n\bn] [_\bn_\ba_\bm_\be ...]
5710 For each _\bn_\ba_\bm_\be, remove the corresponding variable or function.
5711 If the -\b-v\bv option is given, each _\bn_\ba_\bm_\be refers to a shell variable,
5712 and that variable is removed. Read-only variables may not be
5713 unset. If -\b-f\bf is specified, each _\bn_\ba_\bm_\be refers to a shell func-
5714 tion, and the function definition is removed. If the -\b-n\bn option
5715 is supplied, and _\bn_\ba_\bm_\be is a variable with the _\bn_\ba_\bm_\be_\br_\be_\bf attribute,
5716 _\bn_\ba_\bm_\be will be unset rather than the variable it references. -\b-n\bn
5717 has no effect if the -\b-f\bf option is supplied. If no options are
5718 supplied, each _\bn_\ba_\bm_\be refers to a variable; if there is no vari-
5719 able by that name, any function with that name is unset. Each
5720 unset variable or function is removed from the environment
5721 passed to subsequent commands. If any of C\bCO\bOM\bMP\bP_\b_W\bWO\bOR\bRD\bDB\bBR\bRE\bEA\bAK\bKS\bS, R\bRA\bAN\bN-\b-
5722 D\bDO\bOM\bM, S\bSE\bEC\bCO\bON\bND\bDS\bS, L\bLI\bIN\bNE\bEN\bNO\bO, H\bHI\bIS\bST\bTC\bCM\bMD\bD, F\bFU\bUN\bNC\bCN\bNA\bAM\bME\bE, G\bGR\bRO\bOU\bUP\bPS\bS, or D\bDI\bIR\bRS\bST\bTA\bAC\bCK\bK are
5723 unset, they lose their special properties, even if they are sub-
5724 sequently reset. The exit status is true unless a _\bn_\ba_\bm_\be is read-
5725 only.
5726
5727 w\bwa\bai\bit\bt [-\b-n\bn] [_\bn _\b._\b._\b.]
5728 Wait for each specified child process and return its termination
5729 status. Each _\bn may be a process ID or a job specification; if a
5730 job spec is given, all processes in that job's pipeline are
5731 waited for. If _\bn is not given, all currently active child pro-
5732 cesses are waited for, and the return status is zero. If the -\b-n\bn
5733 option is supplied, w\bwa\bai\bit\bt waits for any job to terminate and
5734 returns its exit status. If _\bn specifies a non-existent process
5735 or job, the return status is 127. Otherwise, the return status
5736 is the exit status of the last process or job waited for.
5737
5738 R\bRE\bES\bST\bTR\bRI\bIC\bCT\bTE\bED\bD S\bSH\bHE\bEL\bLL\bL
5739 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
5740 invocation, the shell becomes restricted. A restricted shell is used
5741 to set up an environment more controlled than the standard shell. It
5742 behaves identically to b\bba\bas\bsh\bh with the exception that the following are
5743 disallowed or not performed:
5744
5745 +\bo changing directories with c\bcd\bd
5746
5747 +\bo setting or unsetting the values of S\bSH\bHE\bEL\bLL\bL, P\bPA\bAT\bTH\bH, E\bEN\bNV\bV, or B\bBA\bAS\bSH\bH_\b_E\bEN\bNV\bV
5748
5749 +\bo specifying command names containing /\b/
5750
5751 +\bo specifying a filename containing a /\b/ as an argument to the .\b.
5752 builtin command
5753
5754 +\bo specifying a filename containing a slash as an argument to the
5755 -\b-p\bp option to the h\bha\bas\bsh\bh builtin command
5756
5757 +\bo importing function definitions from the shell environment at
5758 startup
5759
5760 +\bo parsing the value of S\bSH\bHE\bEL\bLL\bLO\bOP\bPT\bTS\bS from the shell environment at
5761 startup
5762
5763 +\bo redirecting output using the >, >|, <>, >&, &>, and >> redirect-
5764 ion operators
5765
5766 +\bo using the e\bex\bxe\bec\bc builtin command to replace the shell with another
5767 command
5768
5769 +\bo adding or deleting builtin commands with the -\b-f\bf and -\b-d\bd options
5770 to the e\ben\bna\bab\bbl\ble\be builtin command
5771
5772 +\bo using the e\ben\bna\bab\bbl\ble\be builtin command to enable disabled shell
5773 builtins
5774
5775 +\bo specifying the -\b-p\bp option to the c\bco\bom\bmm\bma\ban\bnd\bd builtin command
5776
5777 +\bo turning off restricted mode with s\bse\bet\bt +\b+r\br or s\bse\bet\bt +\b+o\bo r\bre\bes\bst\btr\bri\bic\bct\bte\bed\bd.
5778
5779 These restrictions are enforced after any startup files are read.
5780
5781 When a command that is found to be a shell script is executed (see C\bCO\bOM\bM-\b-
5782 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
5783 spawned to execute the script.
5784
5785 S\bSE\bEE\bE A\bAL\bLS\bSO\bO
5786 _\bB_\ba_\bs_\bh _\bR_\be_\bf_\be_\br_\be_\bn_\bc_\be _\bM_\ba_\bn_\bu_\ba_\bl, Brian Fox and Chet Ramey
5787 _\bT_\bh_\be _\bG_\bn_\bu _\bR_\be_\ba_\bd_\bl_\bi_\bn_\be _\bL_\bi_\bb_\br_\ba_\br_\by, Brian Fox and Chet Ramey
5788 _\bT_\bh_\be _\bG_\bn_\bu _\bH_\bi_\bs_\bt_\bo_\br_\by _\bL_\bi_\bb_\br_\ba_\br_\by, Brian Fox and Chet Ramey
5789 _\bP_\bo_\br_\bt_\ba_\bb_\bl_\be _\bO_\bp_\be_\br_\ba_\bt_\bi_\bn_\bg _\bS_\by_\bs_\bt_\be_\bm _\bI_\bn_\bt_\be_\br_\bf_\ba_\bc_\be _\b(_\bP_\bO_\bS_\bI_\bX_\b) _\bP_\ba_\br_\bt _\b2_\b: _\bS_\bh_\be_\bl_\bl _\ba_\bn_\bd _\bU_\bt_\bi_\bl_\bi_\b-
5790 _\bt_\bi_\be_\bs, IEEE --
5791 http://pubs.opengroup.org/onlinepubs/9699919799/
5792 http://tiswww.case.edu/~chet/bash/POSIX -- a description of posix mode
5793 _\bs_\bh(1), _\bk_\bs_\bh(1), _\bc_\bs_\bh(1)
5794 _\be_\bm_\ba_\bc_\bs(1), _\bv_\bi(1)
5795 _\br_\be_\ba_\bd_\bl_\bi_\bn_\be(3)
5796
5797 F\bFI\bIL\bLE\bES\bS
5798 _\b/_\bb_\bi_\bn_\b/_\bb_\ba_\bs_\bh
5799 The b\bba\bas\bsh\bh executable
5800 _\b/_\be_\bt_\bc_\b/_\bp_\br_\bo_\bf_\bi_\bl_\be
5801 The systemwide initialization file, executed for login shells
5802 _\b~_\b/_\b._\bb_\ba_\bs_\bh_\b__\bp_\br_\bo_\bf_\bi_\bl_\be
5803 The personal initialization file, executed for login shells
5804 _\b~_\b/_\b._\bb_\ba_\bs_\bh_\br_\bc
5805 The individual per-interactive-shell startup file
5806 _\b~_\b/_\b._\bb_\ba_\bs_\bh_\b__\bl_\bo_\bg_\bo_\bu_\bt
5807 The individual login shell cleanup file, executed when a login
5808 shell exits
5809 _\b~_\b/_\b._\bi_\bn_\bp_\bu_\bt_\br_\bc
5810 Individual _\br_\be_\ba_\bd_\bl_\bi_\bn_\be initialization file
5811
5812 A\bAU\bUT\bTH\bHO\bOR\bRS\bS
5813 Brian Fox, Free Software Foundation
5814 bfox@gnu.org
5815
5816 Chet Ramey, Case Western Reserve University
5817 chet.ramey@case.edu
5818
5819 B\bBU\bUG\bG R\bRE\bEP\bPO\bOR\bRT\bTS\bS
5820 If you find a bug in b\bba\bas\bsh\bh,\b, you should report it. But first, you should
5821 make sure that it really is a bug, and that it appears in the latest
5822 version of b\bba\bas\bsh\bh. The latest version is always available from
5823 _\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/.
5824
5825 Once you have determined that a bug actually exists, use the _\bb_\ba_\bs_\bh_\bb_\bu_\bg
5826 command to submit a bug report. If you have a fix, you are encouraged
5827 to mail that as well! Suggestions and `philosophical' bug reports may
5828 be mailed to _\bb_\bu_\bg_\b-_\bb_\ba_\bs_\bh_\b@_\bg_\bn_\bu_\b._\bo_\br_\bg or posted to the Usenet newsgroup
5829 g\bgn\bnu\bu.\b.b\bba\bas\bsh\bh.\b.b\bbu\bug\bg.
5830
5831 ALL bug reports should include:
5832
5833 The version number of b\bba\bas\bsh\bh
5834 The hardware and operating system
5835 The compiler used to compile
5836 A description of the bug behaviour
5837 A short script or `recipe' which exercises the bug
5838
5839 _\bb_\ba_\bs_\bh_\bb_\bu_\bg inserts the first three items automatically into the template
5840 it provides for filing a bug report.
5841
5842 Comments and bug reports concerning this manual page should be directed
5843 to _\bc_\bh_\be_\bt_\b._\br_\ba_\bm_\be_\by_\b@_\bc_\ba_\bs_\be_\b._\be_\bd_\bu.
5844
5845 B\bBU\bUG\bGS\bS
5846 It's too big and too slow.
5847
5848 There are some subtle differences between b\bba\bas\bsh\bh and traditional versions
5849 of s\bsh\bh, mostly because of the P\bPO\bOS\bSI\bIX\bX specification.
5850
5851 Aliases are confusing in some uses.
5852
5853 Shell builtin commands and functions are not stoppable/restartable.
5854
5855 Compound commands and command sequences of the form `a ; b ; c' are not
5856 handled gracefully when process suspension is attempted. When a
5857 process is stopped, the shell immediately executes the next command in
5858 the sequence. It suffices to place the sequence of commands between
5859 parentheses to force it into a subshell, which may be stopped as a
5860 unit.
5861
5862 Array variables may not (yet) be exported.
5863
5864 There may be only one active coprocess at a time.
5865
5866
5867
5868 GNU Bash 4.4 2015 October 2 BASH(1)