]> git.ipfire.org Git - thirdparty/bash.git/blob - doc/builtins.0
Bash-4.2 distribution sources and documentation
[thirdparty/bash.git] / doc / builtins.0
1 BASH_BUILTINS(1) BASH_BUILTINS(1)
2
3
4
5 N\bNA\bAM\bME\bE
6 bash, :, ., [, alias, bg, bind, break, builtin, caller, cd, command,
7 compgen, complete, compopt, continue, declare, dirs, disown, echo,
8 enable, eval, exec, exit, export, false, fc, fg, getopts, hash, help,
9 history, jobs, kill, let, local, logout, mapfile, popd, printf, pushd,
10 pwd, read, readonly, return, set, shift, shopt, source, suspend, test,
11 times, trap, true, type, typeset, ulimit, umask, unalias, unset, wait -
12 bash built-in commands, see b\bba\bas\bsh\bh(1)
13
14 B\bBA\bAS\bSH\bH B\bBU\bUI\bIL\bLT\bTI\bIN\bN C\bCO\bOM\bMM\bMA\bAN\bND\bDS\bS
15 Unless otherwise noted, each builtin command documented in this section
16 as accepting options preceded by -\b- accepts -\b--\b- to signify the end of the
17 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
18 and do not treat -\b--\b- specially. The e\bex\bxi\bit\bt, l\blo\bog\bgo\bou\but\bt, b\bbr\bre\bea\bak\bk, c\bco\bon\bnt\bti\bin\bnu\bue\be, l\ble\bet\bt,
19 and s\bsh\bhi\bif\bft\bt builtins accept and process arguments beginning with -\b- with-
20 out requiring -\b--\b-. Other builtins that accept arguments but are not
21 specified as accepting options interpret arguments beginning with -\b- as
22 invalid options and require -\b--\b- to prevent this interpretation.
23 :\b: [_\ba_\br_\bg_\bu_\bm_\be_\bn_\bt_\bs]
24 No effect; the command does nothing beyond expanding _\ba_\br_\bg_\bu_\bm_\be_\bn_\bt_\bs
25 and performing any specified redirections. A zero exit code is
26 returned.
27
28 .\b. _\bf_\bi_\bl_\be_\bn_\ba_\bm_\be [_\ba_\br_\bg_\bu_\bm_\be_\bn_\bt_\bs]
29 s\bso\bou\bur\brc\bce\be _\bf_\bi_\bl_\be_\bn_\ba_\bm_\be [_\ba_\br_\bg_\bu_\bm_\be_\bn_\bt_\bs]
30 Read and execute commands from _\bf_\bi_\bl_\be_\bn_\ba_\bm_\be in the current shell
31 environment and return the exit status of the last command exe-
32 cuted from _\bf_\bi_\bl_\be_\bn_\ba_\bm_\be. If _\bf_\bi_\bl_\be_\bn_\ba_\bm_\be does not contain a slash, file
33 names in P\bPA\bAT\bTH\bH are used to find the directory containing _\bf_\bi_\bl_\be_\b-
34 _\bn_\ba_\bm_\be. The file searched for in P\bPA\bAT\bTH\bH need not be executable.
35 When b\bba\bas\bsh\bh is not in _\bp_\bo_\bs_\bi_\bx _\bm_\bo_\bd_\be, the current directory is
36 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
37 to the s\bsh\bho\bop\bpt\bt builtin command is turned off, the P\bPA\bAT\bTH\bH is not
38 searched. If any _\ba_\br_\bg_\bu_\bm_\be_\bn_\bt_\bs are supplied, they become the posi-
39 tional parameters when _\bf_\bi_\bl_\be_\bn_\ba_\bm_\be is executed. Otherwise the
40 positional parameters are unchanged. The return status is the
41 status of the last command exited within the script (0 if no
42 commands are executed), and false if _\bf_\bi_\bl_\be_\bn_\ba_\bm_\be is not found or
43 cannot be read.
44
45 a\bal\bli\bia\bas\bs [-\b-p\bp] [_\bn_\ba_\bm_\be[=_\bv_\ba_\bl_\bu_\be] ...]
46 A\bAl\bli\bia\bas\bs with no arguments or with the -\b-p\bp option prints the list of
47 aliases in the form a\bal\bli\bia\bas\bs _\bn_\ba_\bm_\be=_\bv_\ba_\bl_\bu_\be on standard output. When
48 arguments are supplied, an alias is defined for each _\bn_\ba_\bm_\be whose
49 _\bv_\ba_\bl_\bu_\be is given. A trailing space in _\bv_\ba_\bl_\bu_\be causes the next word
50 to be checked for alias substitution when the alias is expanded.
51 For each _\bn_\ba_\bm_\be in the argument list for which no _\bv_\ba_\bl_\bu_\be is sup-
52 plied, the name and value of the alias is printed. A\bAl\bli\bia\bas\bs
53 returns true unless a _\bn_\ba_\bm_\be is given for which no alias has been
54 defined.
55
56 b\bbg\bg [_\bj_\bo_\bb_\bs_\bp_\be_\bc ...]
57 Resume each suspended job _\bj_\bo_\bb_\bs_\bp_\be_\bc in the background, as if it
58 had been started with &\b&. If _\bj_\bo_\bb_\bs_\bp_\be_\bc is not present, the shell's
59 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
60 run when job control is disabled or, when run with job control
61 enabled, any specified _\bj_\bo_\bb_\bs_\bp_\be_\bc was not found or was started
62 without job control.
63
64 b\bbi\bin\bnd\bd [-\b-m\bm _\bk_\be_\by_\bm_\ba_\bp] [-\b-l\blp\bps\bsv\bvP\bPS\bSV\bV]
65 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]
66 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
67 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
68 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
69 b\bbi\bin\bnd\bd _\br_\be_\ba_\bd_\bl_\bi_\bn_\be_\b-_\bc_\bo_\bm_\bm_\ba_\bn_\bd
70 Display current r\bre\bea\bad\bdl\bli\bin\bne\be key and function bindings, bind a key
71 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
72 variable. Each non-option argument is a command as it would
73 appear in _\b._\bi_\bn_\bp_\bu_\bt_\br_\bc, but each binding or command must be passed
74 as a separate argument; e.g., '"\C-x\C-r": re-read-init-file'.
75 Options, if supplied, have the following meanings:
76 -\b-m\bm _\bk_\be_\by_\bm_\ba_\bp
77 Use _\bk_\be_\by_\bm_\ba_\bp as the keymap to be affected by the subsequent
78 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-
79 _\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,
80 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
81 equivalent to _\be_\bm_\ba_\bc_\bs_\b-_\bs_\bt_\ba_\bn_\bd_\ba_\br_\bd.
82 -\b-l\bl List the names of all r\bre\bea\bad\bdl\bli\bin\bne\be functions.
83 -\b-p\bp Display r\bre\bea\bad\bdl\bli\bin\bne\be function names and bindings in such a
84 way that they can be re-read.
85 -\b-P\bP List current r\bre\bea\bad\bdl\bli\bin\bne\be function names and bindings.
86 -\b-s\bs Display r\bre\bea\bad\bdl\bli\bin\bne\be key sequences bound to macros and the
87 strings they output in such a way that they can be re-
88 read.
89 -\b-S\bS Display r\bre\bea\bad\bdl\bli\bin\bne\be key sequences bound to macros and the
90 strings they output.
91 -\b-v\bv Display r\bre\bea\bad\bdl\bli\bin\bne\be variable names and values in such a way
92 that they can be re-read.
93 -\b-V\bV List current r\bre\bea\bad\bdl\bli\bin\bne\be variable names and values.
94 -\b-f\bf _\bf_\bi_\bl_\be_\bn_\ba_\bm_\be
95 Read key bindings from _\bf_\bi_\bl_\be_\bn_\ba_\bm_\be.
96 -\b-q\bq _\bf_\bu_\bn_\bc_\bt_\bi_\bo_\bn
97 Query about which keys invoke the named _\bf_\bu_\bn_\bc_\bt_\bi_\bo_\bn.
98 -\b-u\bu _\bf_\bu_\bn_\bc_\bt_\bi_\bo_\bn
99 Unbind all keys bound to the named _\bf_\bu_\bn_\bc_\bt_\bi_\bo_\bn.
100 -\b-r\br _\bk_\be_\by_\bs_\be_\bq
101 Remove any current binding for _\bk_\be_\by_\bs_\be_\bq.
102 -\b-x\bx _\bk_\be_\by_\bs_\be_\bq:\b:_\bs_\bh_\be_\bl_\bl_\b-_\bc_\bo_\bm_\bm_\ba_\bn_\bd
103 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
104 entered. When _\bs_\bh_\be_\bl_\bl_\b-_\bc_\bo_\bm_\bm_\ba_\bn_\bd is executed, the shell sets
105 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-
106 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
107 current location of the insertion point. If the executed
108 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-
109 L\bLI\bIN\bNE\bE_\b_P\bPO\bOI\bIN\bNT\bT, those new values will be reflected in the
110 editing state.
111
112 The return value is 0 unless an unrecognized option is given or
113 an error occurred.
114
115 b\bbr\bre\bea\bak\bk [_\bn]
116 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
117 specified, break _\bn levels. _\bn must be >= 1. If _\bn is greater
118 than the number of enclosing loops, all enclosing loops are
119 exited. The return value is 0 unless _\bn is not greater than or
120 equal to 1.
121
122 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]
123 Execute the specified shell builtin, passing it _\ba_\br_\bg_\bu_\bm_\be_\bn_\bt_\bs, and
124 return its exit status. This is useful when defining a function
125 whose name is the same as a shell builtin, retaining the func-
126 tionality of the builtin within the function. The c\bcd\bd builtin is
127 commonly redefined this way. The return status is false if
128 _\bs_\bh_\be_\bl_\bl_\b-_\bb_\bu_\bi_\bl_\bt_\bi_\bn is not a shell builtin command.
129
130 c\bca\bal\bll\ble\ber\br [_\be_\bx_\bp_\br]
131 Returns the context of any active subroutine call (a shell func-
132 tion or a script executed with the .\b. or s\bso\bou\bur\brc\bce\be builtins). With-
133 out _\be_\bx_\bp_\br, c\bca\bal\bll\ble\ber\br displays the line number and source filename of
134 the current subroutine call. If a non-negative integer is sup-
135 plied as _\be_\bx_\bp_\br, c\bca\bal\bll\ble\ber\br displays the line number, subroutine name,
136 and source file corresponding to that position in the current
137 execution call stack. This extra information may be used, for
138 example, to print a stack trace. The current frame is frame 0.
139 The return value is 0 unless the shell is not executing a sub-
140 routine call or _\be_\bx_\bp_\br does not correspond to a valid position in
141 the call stack.
142
143 c\bcd\bd [-\b-L\bL|[-\b-P\bP [-\b-e\be]]] [_\bd_\bi_\br]
144 Change the current directory to _\bd_\bi_\br. The variable H\bHO\bOM\bME\bE is the
145 default _\bd_\bi_\br. The variable C\bCD\bDP\bPA\bAT\bTH\bH defines the search path for
146 the directory containing _\bd_\bi_\br. Alternative directory names in
147 C\bCD\bDP\bPA\bAT\bTH\bH are separated by a colon (:). A null directory name in
148 C\bCD\bDP\bPA\bAT\bTH\bH is the same as the current directory, i.e., ``.\b.''. If
149 _\bd_\bi_\br begins with a slash (/), then C\bCD\bDP\bPA\bAT\bTH\bH is not used. The -\b-P\bP
150 option says to use the physical directory structure instead of
151 following symbolic links (see also the -\b-P\bP option to the s\bse\bet\bt
152 builtin command); the -\b-L\bL option forces symbolic links to be fol-
153 lowed. If the -\b-e\be option is supplied with -\b-P\bP, and the current
154 working directory cannot be successfully determined after a suc-
155 cessful directory change, c\bcd\bd will return an unsuccessful status.
156 An argument of -\b- is equivalent to $\b$O\bOL\bLD\bDP\bPW\bWD\bD. If a non-empty
157 directory name from C\bCD\bDP\bPA\bAT\bTH\bH is used, or if -\b- is the first argu-
158 ment, and the directory change is successful, the absolute path-
159 name of the new working directory is written to the standard
160 output. The return value is true if the directory was success-
161 fully changed; false otherwise.
162
163 c\bco\bom\bmm\bma\ban\bnd\bd [-\b-p\bpV\bVv\bv] _\bc_\bo_\bm_\bm_\ba_\bn_\bd [_\ba_\br_\bg ...]
164 Run _\bc_\bo_\bm_\bm_\ba_\bn_\bd with _\ba_\br_\bg_\bs suppressing the normal shell function
165 lookup. Only builtin commands or commands found in the P\bPA\bAT\bTH\bH are
166 executed. If the -\b-p\bp option is given, the search for _\bc_\bo_\bm_\bm_\ba_\bn_\bd is
167 performed using a default value for P\bPA\bAT\bTH\bH that is guaranteed to
168 find all of the standard utilities. If either the -\b-V\bV or -\b-v\bv
169 option is supplied, a description of _\bc_\bo_\bm_\bm_\ba_\bn_\bd is printed. The -\b-v\bv
170 option causes a single word indicating the command or file name
171 used to invoke _\bc_\bo_\bm_\bm_\ba_\bn_\bd to be displayed; the -\b-V\bV option produces a
172 more verbose description. If the -\b-V\bV or -\b-v\bv option is supplied,
173 the exit status is 0 if _\bc_\bo_\bm_\bm_\ba_\bn_\bd was found, and 1 if not. If
174 neither option is supplied and an error occurred or _\bc_\bo_\bm_\bm_\ba_\bn_\bd can-
175 not be found, the exit status is 127. Otherwise, the exit sta-
176 tus of the c\bco\bom\bmm\bma\ban\bnd\bd builtin is the exit status of _\bc_\bo_\bm_\bm_\ba_\bn_\bd.
177
178 c\bco\bom\bmp\bpg\bge\ben\bn [_\bo_\bp_\bt_\bi_\bo_\bn] [_\bw_\bo_\br_\bd]
179 Generate possible completion matches for _\bw_\bo_\br_\bd according to the
180 _\bo_\bp_\bt_\bi_\bo_\bns, which may be any option accepted by the c\bco\bom\bmp\bpl\ble\bet\bte\be
181 builtin with the exception of -\b-p\bp and -\b-r\br, and write the matches
182 to the standard output. When using the -\b-F\bF or -\b-C\bC options, the
183 various shell variables set by the programmable completion
184 facilities, while available, will not have useful values.
185
186 The matches will be generated in the same way as if the pro-
187 grammable completion code had generated them directly from a
188 completion specification with the same flags. If _\bw_\bo_\br_\bd is speci-
189 fied, only those completions matching _\bw_\bo_\br_\bd will be displayed.
190
191 The return value is true unless an invalid option is supplied,
192 or no matches were generated.
193
194 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-
195 _\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]
196 [-\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.]
197 c\bco\bom\bmp\bpl\ble\bet\bte\be -\b-p\bpr\br [-\b-D\bDE\bE] [_\bn_\ba_\bm_\be ...]
198 Specify how arguments to each _\bn_\ba_\bm_\be should be completed. If the
199 -\b-p\bp option is supplied, or if no options are supplied, existing
200 completion specifications are printed in a way that allows them
201 to be reused as input. The -\b-r\br option removes a completion spec-
202 ification for each _\bn_\ba_\bm_\be, or, if no _\bn_\ba_\bm_\bes are supplied, all com-
203 pletion specifications. The -\b-D\bD option indicates that the
204 remaining options and actions should apply to the ``default''
205 command completion; that is, completion attempted on a command
206 for which no completion has previously been defined. The -\b-E\bE
207 option indicates that the remaining options and actions should
208 apply to ``empty'' command completion; that is, completion
209 attempted on a blank line.
210
211 The process of applying these completion specifications when
212 word completion is attempted is described above under P\bPr\bro\bo-\b-
213 g\bgr\bra\bam\bmm\bma\bab\bbl\ble\be C\bCo\bom\bmp\bpl\ble\bet\bti\bio\bon\bn.
214
215 Other options, if specified, have the following meanings. The
216 arguments to the -\b-G\bG, -\b-W\bW, and -\b-X\bX options (and, if necessary, the
217 -\b-P\bP and -\b-S\bS options) should be quoted to protect them from expan-
218 sion before the c\bco\bom\bmp\bpl\ble\bet\bte\be builtin is invoked.
219 -\b-o\bo _\bc_\bo_\bm_\bp_\b-_\bo_\bp_\bt_\bi_\bo_\bn
220 The _\bc_\bo_\bm_\bp_\b-_\bo_\bp_\bt_\bi_\bo_\bn controls several aspects of the comp-
221 spec's behavior beyond the simple generation of comple-
222 tions. _\bc_\bo_\bm_\bp_\b-_\bo_\bp_\bt_\bi_\bo_\bn may be one of:
223 b\bba\bas\bsh\bhd\bde\bef\bfa\bau\bul\blt\bt
224 Perform the rest of the default b\bba\bas\bsh\bh completions
225 if the compspec generates no matches.
226 d\bde\bef\bfa\bau\bul\blt\bt Use readline's default filename completion if
227 the compspec generates no matches.
228 d\bdi\bir\brn\bna\bam\bme\bes\bs
229 Perform directory name completion if the comp-
230 spec generates no matches.
231 f\bfi\bil\ble\ben\bna\bam\bme\bes\bs
232 Tell readline that the compspec generates file-
233 names, so it can perform any filename-specific
234 processing (like adding a slash to directory
235 names, quoting special characters, or suppress-
236 ing trailing spaces). Intended to be used with
237 shell functions.
238 n\bno\bos\bsp\bpa\bac\bce\be Tell readline not to append a space (the
239 default) to words completed at the end of the
240 line.
241 p\bpl\blu\bus\bsd\bdi\bir\brs\bs
242 After any matches defined by the compspec are
243 generated, directory name completion is
244 attempted and any matches are added to the
245 results of the other actions.
246 -\b-A\bA _\ba_\bc_\bt_\bi_\bo_\bn
247 The _\ba_\bc_\bt_\bi_\bo_\bn may be one of the following to generate a
248 list of possible completions:
249 a\bal\bli\bia\bas\bs Alias names. May also be specified as -\b-a\ba.
250 a\bar\brr\bra\bay\byv\bva\bar\br
251 Array variable names.
252 b\bbi\bin\bnd\bdi\bin\bng\bg R\bRe\bea\bad\bdl\bli\bin\bne\be key binding names.
253 b\bbu\bui\bil\blt\bti\bin\bn Names of shell builtin commands. May also be
254 specified as -\b-b\bb.
255 c\bco\bom\bmm\bma\ban\bnd\bd Command names. May also be specified as -\b-c\bc.
256 d\bdi\bir\bre\bec\bct\bto\bor\bry\by
257 Directory names. May also be specified as -\b-d\bd.
258 d\bdi\bis\bsa\bab\bbl\ble\bed\bd
259 Names of disabled shell builtins.
260 e\ben\bna\bab\bbl\ble\bed\bd Names of enabled shell builtins.
261 e\bex\bxp\bpo\bor\brt\bt Names of exported shell variables. May also be
262 specified as -\b-e\be.
263 f\bfi\bil\ble\be File names. May also be specified as -\b-f\bf.
264 f\bfu\bun\bnc\bct\bti\bio\bon\bn
265 Names of shell functions.
266 g\bgr\bro\bou\bup\bp Group names. May also be specified as -\b-g\bg.
267 h\bhe\bel\blp\bpt\bto\bop\bpi\bic\bc
268 Help topics as accepted by the h\bhe\bel\blp\bp builtin.
269 h\bho\bos\bst\btn\bna\bam\bme\be
270 Hostnames, as taken from the file specified by
271 the H\bHO\bOS\bST\bTF\bFI\bIL\bLE\bE shell variable.
272 j\bjo\bob\bb Job names, if job control is active. May also
273 be specified as -\b-j\bj.
274 k\bke\bey\byw\bwo\bor\brd\bd Shell reserved words. May also be specified as
275 -\b-k\bk.
276 r\bru\bun\bnn\bni\bin\bng\bg Names of running jobs, if job control is active.
277 s\bse\ber\brv\bvi\bic\bce\be Service names. May also be specified as -\b-s\bs.
278 s\bse\bet\bto\bop\bpt\bt Valid arguments for the -\b-o\bo option to the s\bse\bet\bt
279 builtin.
280 s\bsh\bho\bop\bpt\bt Shell option names as accepted by the s\bsh\bho\bop\bpt\bt
281 builtin.
282 s\bsi\big\bgn\bna\bal\bl Signal names.
283 s\bst\bto\bop\bpp\bpe\bed\bd Names of stopped jobs, if job control is active.
284 u\bus\bse\ber\br User names. May also be specified as -\b-u\bu.
285 v\bva\bar\bri\bia\bab\bbl\ble\be
286 Names of all shell variables. May also be spec-
287 ified as -\b-v\bv.
288 -\b-C\bC _\bc_\bo_\bm_\bm_\ba_\bn_\bd
289 _\bc_\bo_\bm_\bm_\ba_\bn_\bd is executed in a subshell environment, and its
290 output is used as the possible completions.
291 -\b-F\bF _\bf_\bu_\bn_\bc_\bt_\bi_\bo_\bn
292 The shell function _\bf_\bu_\bn_\bc_\bt_\bi_\bo_\bn is executed in the current
293 shell environment. When it finishes, the possible com-
294 pletions are retrieved from the value of the C\bCO\bOM\bMP\bPR\bRE\bEP\bPL\bLY\bY
295 array variable.
296 -\b-G\bG _\bg_\bl_\bo_\bb_\bp_\ba_\bt
297 The pathname expansion pattern _\bg_\bl_\bo_\bb_\bp_\ba_\bt is expanded to
298 generate the possible completions.
299 -\b-P\bP _\bp_\br_\be_\bf_\bi_\bx
300 _\bp_\br_\be_\bf_\bi_\bx is added at the beginning of each possible com-
301 pletion after all other options have been applied.
302 -\b-S\bS _\bs_\bu_\bf_\bf_\bi_\bx
303 _\bs_\bu_\bf_\bf_\bi_\bx is appended to each possible completion after all
304 other options have been applied.
305 -\b-W\bW _\bw_\bo_\br_\bd_\bl_\bi_\bs_\bt
306 The _\bw_\bo_\br_\bd_\bl_\bi_\bs_\bt is split using the characters in the I\bIF\bFS\bS
307 special variable as delimiters, and each resultant word
308 is expanded. The possible completions are the members
309 of the resultant list which match the word being com-
310 pleted.
311 -\b-X\bX _\bf_\bi_\bl_\bt_\be_\br_\bp_\ba_\bt
312 _\bf_\bi_\bl_\bt_\be_\br_\bp_\ba_\bt is a pattern as used for pathname expansion.
313 It is applied to the list of possible completions gener-
314 ated by the preceding options and arguments, and each
315 completion matching _\bf_\bi_\bl_\bt_\be_\br_\bp_\ba_\bt is removed from the list.
316 A leading !\b! in _\bf_\bi_\bl_\bt_\be_\br_\bp_\ba_\bt negates the pattern; in this
317 case, any completion not matching _\bf_\bi_\bl_\bt_\be_\br_\bp_\ba_\bt is removed.
318
319 The return value is true unless an invalid option is supplied,
320 an option other than -\b-p\bp or -\b-r\br is supplied without a _\bn_\ba_\bm_\be argu-
321 ment, an attempt is made to remove a completion specification
322 for a _\bn_\ba_\bm_\be for which no specification exists, or an error occurs
323 adding a completion specification.
324
325 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]
326 Modify completion options for each _\bn_\ba_\bm_\be according to the
327 _\bo_\bp_\bt_\bi_\bo_\bns, or for the currently-executing completion if no _\bn_\ba_\bm_\bes
328 are supplied. If no _\bo_\bp_\bt_\bi_\bo_\bns are given, display the completion
329 options for each _\bn_\ba_\bm_\be or the current completion. The possible
330 values of _\bo_\bp_\bt_\bi_\bo_\bn are those valid for the c\bco\bom\bmp\bpl\ble\bet\bte\be builtin
331 described above. The -\b-D\bD option indicates that the remaining
332 options should apply to the ``default'' command completion; that
333 is, completion attempted on a command for which no completion
334 has previously been defined. The -\b-E\bE option indicates that the
335 remaining options should apply to ``empty'' command completion;
336 that is, completion attempted on a blank line.
337
338 The return value is true unless an invalid option is supplied,
339 an attempt is made to modify the options for a _\bn_\ba_\bm_\be for which no
340 completion specification exists, or an output error occurs.
341
342 c\bco\bon\bnt\bti\bin\bnu\bue\be [_\bn]
343 Resume the next iteration of the enclosing f\bfo\bor\br, w\bwh\bhi\bil\ble\be, u\bun\bnt\bti\bil\bl, or
344 s\bse\bel\ble\bec\bct\bt loop. If _\bn is specified, resume at the _\bnth enclosing
345 loop. _\bn must be >= 1. If _\bn is greater than the number of
346 enclosing loops, the last enclosing loop (the ``top-level''
347 loop) is resumed. The return value is 0 unless _\bn is not greater
348 than or equal to 1.
349
350 d\bde\bec\bcl\bla\bar\bre\be [-\b-a\baA\bAf\bfF\bFg\bgi\bil\blr\brt\btu\bux\bx] [-\b-p\bp] [_\bn_\ba_\bm_\be[=_\bv_\ba_\bl_\bu_\be] ...]
351 t\bty\byp\bpe\bes\bse\bet\bt [-\b-a\baA\bAf\bfF\bFg\bgi\bil\blr\brt\btu\bux\bx] [-\b-p\bp] [_\bn_\ba_\bm_\be[=_\bv_\ba_\bl_\bu_\be] ...]
352 Declare variables and/or give them attributes. If no _\bn_\ba_\bm_\bes are
353 given then display the values of variables. The -\b-p\bp option will
354 display the attributes and values of each _\bn_\ba_\bm_\be. When -\b-p\bp is used
355 with _\bn_\ba_\bm_\be arguments, additional options are ignored. When -\b-p\bp is
356 supplied without _\bn_\ba_\bm_\be arguments, it will display the attributes
357 and values of all variables having the attributes specified by
358 the additional options. If no other options are supplied with
359 -\b-p\bp, d\bde\bec\bcl\bla\bar\bre\be will display the attributes and values of all shell
360 variables. The -\b-f\bf option will restrict the display to shell
361 functions. The -\b-F\bF option inhibits the display of function defi-
362 nitions; only the function name and attributes are printed. If
363 the e\bex\bxt\btd\bde\beb\bbu\bug\bg shell option is enabled using s\bsh\bho\bop\bpt\bt, the source
364 file name and line number where the function is defined are dis-
365 played as well. The -\b-F\bF option implies -\b-f\bf. The -\b-g\bg option forces
366 variables to be created or modified at the global scope, even
367 when d\bde\bec\bcl\bla\bar\bre\be is executed in a shell function. It is ignored in
368 all other cases. The following options can be used to restrict
369 output to variables with the specified attribute or to give
370 variables attributes:
371 -\b-a\ba Each _\bn_\ba_\bm_\be is an indexed array variable (see A\bAr\brr\bra\bay\bys\bs
372 above).
373 -\b-A\bA Each _\bn_\ba_\bm_\be is an associative array variable (see A\bAr\brr\bra\bay\bys\bs
374 above).
375 -\b-f\bf Use function names only.
376 -\b-i\bi The variable is treated as an integer; arithmetic evalua-
377 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
378 the variable is assigned a value.
379 -\b-l\bl When the variable is assigned a value, all upper-case
380 characters are converted to lower-case. The upper-case
381 attribute is disabled.
382 -\b-r\br Make _\bn_\ba_\bm_\bes readonly. These names cannot then be assigned
383 values by subsequent assignment statements or unset.
384 -\b-t\bt Give each _\bn_\ba_\bm_\be the _\bt_\br_\ba_\bc_\be attribute. Traced functions
385 inherit the D\bDE\bEB\bBU\bUG\bG and R\bRE\bET\bTU\bUR\bRN\bN traps from the calling
386 shell. The trace attribute has no special meaning for
387 variables.
388 -\b-u\bu When the variable is assigned a value, all lower-case
389 characters are converted to upper-case. The lower-case
390 attribute is disabled.
391 -\b-x\bx Mark _\bn_\ba_\bm_\bes for export to subsequent commands via the
392 environment.
393
394 Using `+' instead of `-' turns off the attribute instead, with
395 the exceptions that +\b+a\ba may not be used to destroy an array vari-
396 able and +\b+r\br will not remove the readonly attribute. When used
397 in a function, makes each _\bn_\ba_\bm_\be local, as with the l\blo\boc\bca\bal\bl command,
398 unless the -\b-g\bgP\bP o\bop\bpt\bti\bio\bon\bn i\bis\bs s\bsu\bup\bpp\bpl\bli\bie\bed\bd,\b, I\bIf\bf a\ba v\bva\bar\bri\bia\bab\bbl\ble\be n\bna\bam\bme\be i\bis\bs f\bfo\bol\bl-\b-
399 l\blo\bow\bwe\bed\bd b\bby\by =\b=_\bv_\ba_\bl_\bu_\be,\b, t\bth\bhe\be v\bva\bal\blu\bue\be o\bof\bf t\bth\bhe\be v\bva\bar\bri\bia\bab\bbl\ble\be i\bis\bs s\bse\bet\bt t\bto\bo _\bv_\ba_\bl_\bu_\be.\b. T\bTh\bhe\be
400 r\bre\bet\btu\bur\brn\bn v\bva\bal\blu\bue\be i\bis\bs 0\b0 u\bun\bnl\ble\bes\bss\bs a\ban\bn i\bin\bnv\bva\bal\bli\bid\bd o\bop\bpt\bti\bio\bon\bn i\bis\bs e\ben\bnc\bco\bou\bun\bnt\bte\ber\bre\bed\bd,\b, a\ban\bn
401 a\bat\btt\bte\bem\bmp\bpt\bt i\bis\bs m\bma\bad\bde\be t\bto\bo d\bde\bef\bfi\bin\bne\be a\ba f\bfu\bun\bnc\bct\bti\bio\bon\bn u\bus\bsi\bin\bng\bg `\b``\b`-\b-f\bf f\bfo\boo\bo=\b=b\bba\bar\br'\b''\b',\b, a\ban\bn
402 a\bat\btt\bte\bem\bmp\bpt\bt i\bis\bs m\bma\bad\bde\be t\bto\bo a\bas\bss\bsi\big\bgn\bn a\ba v\bva\bal\blu\bue\be t\bto\bo a\ba r\bre\bea\bad\bdo\bon\bnl\bly\by v\bva\bar\bri\bia\bab\bbl\ble\be,\b, a\ban\bn
403 a\bat\btt\bte\bem\bmp\bpt\bt i\bis\bs m\bma\bad\bde\be t\bto\bo a\bas\bss\bsi\big\bgn\bn a\ba v\bva\bal\blu\bue\be t\bto\bo a\ban\bn a\bar\brr\bra\bay\by v\bva\bar\bri\bia\bab\bbl\ble\be w\bwi\bit\bth\bho\bou\but\bt
404 u\bus\bsi\bin\bng\bg t\bth\bhe\be c\bco\bom\bmp\bpo\bou\bun\bnd\bd a\bas\bss\bsi\big\bgn\bnm\bme\ben\bnt\bt s\bsy\byn\bnt\bta\bax\bx (\b(s\bse\bee\be A\bAr\brr\bra\bay\bys\bs above), one of
405 the _\bn_\ba_\bm_\be_\bs is not a valid shell variable name, an attempt is made
406 to turn off readonly status for a readonly variable, an attempt
407 is made to turn off array status for an array variable, or an
408 attempt is made to display a non-existent function with -\b-f\bf.
409
410 d\bdi\bir\brs\bs [\b[+\b+_\bn]\b] [\b[-\b-_\bn]\b] [\b[-\b-c\bcl\blp\bpv\bv]\b]
411 Without options, displays the list of currently remembered
412 directories. The default display is on a single line with
413 directory names separated by spaces. Directories are added to
414 the list with the p\bpu\bus\bsh\bhd\bd command; the p\bpo\bop\bpd\bd command removes
415 entries from the list.
416 +\b+_\bn Displays the _\bnth entry counting from the left of the list
417 shown by d\bdi\bir\brs\bs when invoked without options, starting with
418 zero.
419 -\b-_\bn Displays the _\bnth entry counting from the right of the
420 list shown by d\bdi\bir\brs\bs when invoked without options, starting
421 with zero.
422 -\b-c\bc Clears the directory stack by deleting all of the
423 entries.
424 -\b-l\bl Produces a longer listing; the default listing format
425 uses a tilde to denote the home directory.
426 -\b-p\bp Print the directory stack with one entry per line.
427 -\b-v\bv Print the directory stack with one entry per line, pre-
428 fixing each entry with its index in the stack.
429
430 The return value is 0 unless an invalid option is supplied or _\bn
431 indexes beyond the end of the directory stack.
432
433 d\bdi\bis\bso\bow\bwn\bn [-\b-a\bar\br] [-\b-h\bh] [_\bj_\bo_\bb_\bs_\bp_\be_\bc ...]
434 Without options, each _\bj_\bo_\bb_\bs_\bp_\be_\bc is removed from the table of
435 active jobs. If _\bj_\bo_\bb_\bs_\bp_\be_\bc is not present, and neither -\b-a\ba nor -\b-r\br
436 is supplied, the shell's notion of the _\bc_\bu_\br_\br_\be_\bn_\bt _\bj_\bo_\bb is used. If
437 the -\b-h\bh option is given, each _\bj_\bo_\bb_\bs_\bp_\be_\bc is not removed from the ta-
438 ble, but is marked so that S\bSI\bIG\bGH\bHU\bUP\bP is not sent to the job if the
439 shell receives a S\bSI\bIG\bGH\bHU\bUP\bP. If no _\bj_\bo_\bb_\bs_\bp_\be_\bc is present, and neither
440 the -\b-a\ba nor the -\b-r\br option is supplied, the _\bc_\bu_\br_\br_\be_\bn_\bt _\bj_\bo_\bb is used.
441 If no _\bj_\bo_\bb_\bs_\bp_\be_\bc is supplied, the -\b-a\ba option means to remove or mark
442 all jobs; the -\b-r\br option without a _\bj_\bo_\bb_\bs_\bp_\be_\bc argument restricts
443 operation to running jobs. The return value is 0 unless a _\bj_\bo_\bb_\b-
444 _\bs_\bp_\be_\bc does not specify a valid job.
445
446 e\bec\bch\bho\bo [-\b-n\bne\beE\bE] [_\ba_\br_\bg ...]
447 Output the _\ba_\br_\bgs, separated by spaces, followed by a newline.
448 The return status is always 0. If -\b-n\bn is specified, the trailing
449 newline is suppressed. If the -\b-e\be option is given, interpreta-
450 tion of the following backslash-escaped characters is enabled.
451 The -\b-E\bE option disables the interpretation of these escape char-
452 acters, even on systems where they are interpreted by default.
453 The x\bxp\bpg\bg_\b_e\bec\bch\bho\bo shell option may be used to dynamically determine
454 whether or not e\bec\bch\bho\bo expands these escape characters by default.
455 e\bec\bch\bho\bo does not interpret -\b--\b- to mean the end of options. e\bec\bch\bho\bo
456 interprets the following escape sequences:
457 \\b\a\ba alert (bell)
458 \\b\b\bb backspace
459 \\b\c\bc suppress further output
460 \\b\e\be
461 \\b\E\bE an escape character
462 \\b\f\bf form feed
463 \\b\n\bn new line
464 \\b\r\br carriage return
465 \\b\t\bt horizontal tab
466 \\b\v\bv vertical tab
467 \\b\\\b\ backslash
468 \\b\0\b0_\bn_\bn_\bn the eight-bit character whose value is the octal value
469 _\bn_\bn_\bn (zero to three octal digits)
470 \\b\x\bx_\bH_\bH the eight-bit character whose value is the hexadecimal
471 value _\bH_\bH (one or two hex digits)
472 \\b\u\bu_\bH_\bH_\bH_\bH the Unicode (ISO/IEC 10646) character whose value is the
473 hexadecimal value _\bH_\bH_\bH_\bH (one to four hex digits)
474 \\b\U\bU_\bH_\bH_\bH_\bH_\bH_\bH_\bH_\bH
475 the Unicode (ISO/IEC 10646) character whose value is the
476 hexadecimal value _\bH_\bH_\bH_\bH_\bH_\bH_\bH_\bH (one to eight hex digits)
477
478 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 ...]
479 Enable and disable builtin shell commands. Disabling a builtin
480 allows a disk command which has the same name as a shell builtin
481 to be executed without specifying a full pathname, even though
482 the shell normally searches for builtins before disk commands.
483 If -\b-n\bn is used, each _\bn_\ba_\bm_\be is disabled; otherwise, _\bn_\ba_\bm_\be_\bs are
484 enabled. For example, to use the t\bte\bes\bst\bt binary found via the P\bPA\bAT\bTH\bH
485 instead of the shell builtin version, run ``enable -n test''.
486 The -\b-f\bf option means to load the new builtin command _\bn_\ba_\bm_\be from
487 shared object _\bf_\bi_\bl_\be_\bn_\ba_\bm_\be, on systems that support dynamic loading.
488 The -\b-d\bd option will delete a builtin previously loaded with -\b-f\bf.
489 If no _\bn_\ba_\bm_\be arguments are given, or if the -\b-p\bp option is supplied,
490 a list of shell builtins is printed. With no other option argu-
491 ments, the list consists of all enabled shell builtins. If -\b-n\bn
492 is supplied, only disabled builtins are printed. If -\b-a\ba is sup-
493 plied, the list printed includes all builtins, with an indica-
494 tion of whether or not each is enabled. If -\b-s\bs is supplied, the
495 output is restricted to the POSIX _\bs_\bp_\be_\bc_\bi_\ba_\bl builtins. The return
496 value is 0 unless a _\bn_\ba_\bm_\be is not a shell builtin or there is an
497 error loading a new builtin from a shared object.
498
499 e\bev\bva\bal\bl [_\ba_\br_\bg ...]
500 The _\ba_\br_\bgs are read and concatenated together into a single com-
501 mand. This command is then read and executed by the shell, and
502 its exit status is returned as the value of e\bev\bva\bal\bl. If there are
503 no _\ba_\br_\bg_\bs, or only null arguments, e\bev\bva\bal\bl returns 0.
504
505 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]]
506 If _\bc_\bo_\bm_\bm_\ba_\bn_\bd is specified, it replaces the shell. No new process
507 is created. The _\ba_\br_\bg_\bu_\bm_\be_\bn_\bt_\bs become the arguments to _\bc_\bo_\bm_\bm_\ba_\bn_\bd. If
508 the -\b-l\bl option is supplied, the shell places a dash at the begin-
509 ning of the zeroth argument passed to _\bc_\bo_\bm_\bm_\ba_\bn_\bd. This is what
510 _\bl_\bo_\bg_\bi_\bn(1) does. The -\b-c\bc option causes _\bc_\bo_\bm_\bm_\ba_\bn_\bd to be executed with
511 an empty environment. If -\b-a\ba is supplied, the shell passes _\bn_\ba_\bm_\be
512 as the zeroth argument to the executed command. If _\bc_\bo_\bm_\bm_\ba_\bn_\bd can-
513 not be executed for some reason, a non-interactive shell exits,
514 unless the shell option e\bex\bxe\bec\bcf\bfa\bai\bil\bl is enabled, in which case it
515 returns failure. An interactive shell returns failure if the
516 file cannot be executed. If _\bc_\bo_\bm_\bm_\ba_\bn_\bd is not specified, any redi-
517 rections take effect in the current shell, and the return status
518 is 0. If there is a redirection error, the return status is 1.
519
520 e\bex\bxi\bit\bt [_\bn]
521 Cause the shell to exit with a status of _\bn. If _\bn is omitted,
522 the exit status is that of the last command executed. A trap on
523 E\bEX\bXI\bIT\bT is executed before the shell terminates.
524
525 e\bex\bxp\bpo\bor\brt\bt [-\b-f\bfn\bn] [_\bn_\ba_\bm_\be[=_\bw_\bo_\br_\bd]] ...
526 e\bex\bxp\bpo\bor\brt\bt -\b-p\bp
527 The supplied _\bn_\ba_\bm_\be_\bs are marked for automatic export to the envi-
528 ronment of subsequently executed commands. If the -\b-f\bf option is
529 given, the _\bn_\ba_\bm_\be_\bs refer to functions. If no _\bn_\ba_\bm_\be_\bs are given, or
530 if the -\b-p\bp option is supplied, a list of all names that are
531 exported in this shell is printed. The -\b-n\bn option causes the
532 export property to be removed from each _\bn_\ba_\bm_\be. If a variable
533 name is followed by =_\bw_\bo_\br_\bd, the value of the variable is set to
534 _\bw_\bo_\br_\bd. e\bex\bxp\bpo\bor\brt\bt returns an exit status of 0 unless an invalid
535 option is encountered, one of the _\bn_\ba_\bm_\be_\bs is not a valid shell
536 variable name, or -\b-f\bf is supplied with a _\bn_\ba_\bm_\be that is not a func-
537 tion.
538
539 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]
540 f\bfc\bc -\b-s\bs [_\bp_\ba_\bt=_\br_\be_\bp] [_\bc_\bm_\bd]
541 Fix Command. In the first form, a range of commands from _\bf_\bi_\br_\bs_\bt
542 to _\bl_\ba_\bs_\bt is selected from the history list. _\bF_\bi_\br_\bs_\bt and _\bl_\ba_\bs_\bt may
543 be specified as a string (to locate the last command beginning
544 with that string) or as a number (an index into the history
545 list, where a negative number is used as an offset from the cur-
546 rent command number). If _\bl_\ba_\bs_\bt is not specified it is set to the
547 current command for listing (so that ``fc -l -10'' prints the
548 last 10 commands) and to _\bf_\bi_\br_\bs_\bt otherwise. If _\bf_\bi_\br_\bs_\bt is not spec-
549 ified it is set to the previous command for editing and -16 for
550 listing.
551
552 The -\b-n\bn option suppresses the command numbers when listing. The
553 -\b-r\br option reverses the order of the commands. If the -\b-l\bl option
554 is given, the commands are listed on standard output. Other-
555 wise, the editor given by _\be_\bn_\ba_\bm_\be is invoked on a file containing
556 those commands. If _\be_\bn_\ba_\bm_\be is not given, the value of the F\bFC\bCE\bED\bDI\bIT\bT
557 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.
558 If neither variable is set, is used. When editing is complete,
559 the edited commands are echoed and executed.
560
561 In the second form, _\bc_\bo_\bm_\bm_\ba_\bn_\bd is re-executed after each instance
562 of _\bp_\ba_\bt is replaced by _\br_\be_\bp. A useful alias to use with this is
563 ``r="fc -s"'', so that typing ``r cc'' runs the last command
564 beginning with ``cc'' and typing ``r'' re-executes the last com-
565 mand.
566
567 If the first form is used, the return value is 0 unless an
568 invalid option is encountered or _\bf_\bi_\br_\bs_\bt or _\bl_\ba_\bs_\bt specify history
569 lines out of range. If the -\b-e\be option is supplied, the return
570 value is the value of the last command executed or failure if an
571 error occurs with the temporary file of commands. If the second
572 form is used, the return status is that of the command re-exe-
573 cuted, unless _\bc_\bm_\bd does not specify a valid history line, in
574 which case f\bfc\bc returns failure.
575
576 f\bfg\bg [_\bj_\bo_\bb_\bs_\bp_\be_\bc]
577 Resume _\bj_\bo_\bb_\bs_\bp_\be_\bc in the foreground, and make it the current job.
578 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
579 is used. The return value is that of the command placed into
580 the foreground, or failure if run when job control is disabled
581 or, when run with job control enabled, if _\bj_\bo_\bb_\bs_\bp_\be_\bc does not spec-
582 ify a valid job or _\bj_\bo_\bb_\bs_\bp_\be_\bc specifies a job that was started
583 without job control.
584
585 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]
586 g\bge\bet\bto\bop\bpt\bts\bs is used by shell procedures to parse positional parame-
587 ters. _\bo_\bp_\bt_\bs_\bt_\br_\bi_\bn_\bg contains the option characters to be recog-
588 nized; if a character is followed by a colon, the option is
589 expected to have an argument, which should be separated from it
590 by white space. The colon and question mark characters may not
591 be used as option characters. Each time it is invoked, g\bge\bet\bto\bop\bpt\bts\bs
592 places the next option in the shell variable _\bn_\ba_\bm_\be, initializing
593 _\bn_\ba_\bm_\be if it does not exist, and the index of the next argument to
594 be processed into the variable O\bOP\bPT\bTI\bIN\bND\bD. O\bOP\bPT\bTI\bIN\bND\bD is initialized to
595 1 each time the shell or a shell script is invoked. When an
596 option requires an argument, g\bge\bet\bto\bop\bpt\bts\bs places that argument into
597 the variable O\bOP\bPT\bTA\bAR\bRG\bG. The shell does not reset O\bOP\bPT\bTI\bIN\bND\bD automati-
598 cally; it must be manually reset between multiple calls to
599 g\bge\bet\bto\bop\bpt\bts\bs within the same shell invocation if a new set of parame-
600 ters is to be used.
601
602 When the end of options is encountered, g\bge\bet\bto\bop\bpt\bts\bs exits with a
603 return value greater than zero. O\bOP\bPT\bTI\bIN\bND\bD is set to the index of
604 the first non-option argument, and _\bn_\ba_\bm_\be is set to ?.
605
606 g\bge\bet\bto\bop\bpt\bts\bs normally parses the positional parameters, but if more
607 arguments are given in _\ba_\br_\bg_\bs, g\bge\bet\bto\bop\bpt\bts\bs parses those instead.
608
609 g\bge\bet\bto\bop\bpt\bts\bs can report errors in two ways. If the first character
610 of _\bo_\bp_\bt_\bs_\bt_\br_\bi_\bn_\bg is a colon, _\bs_\bi_\bl_\be_\bn_\bt error reporting is used. In
611 normal operation diagnostic messages are printed when invalid
612 options or missing option arguments are encountered. If the
613 variable O\bOP\bPT\bTE\bER\bRR\bR is set to 0, no error messages will be dis-
614 played, even if the first character of _\bo_\bp_\bt_\bs_\bt_\br_\bi_\bn_\bg is not a colon.
615
616 If an invalid option is seen, g\bge\bet\bto\bop\bpt\bts\bs places ? into _\bn_\ba_\bm_\be and, if
617 not silent, prints an error message and unsets O\bOP\bPT\bTA\bAR\bRG\bG. If
618 g\bge\bet\bto\bop\bpt\bts\bs is silent, the option character found is placed in
619 O\bOP\bPT\bTA\bAR\bRG\bG and no diagnostic message is printed.
620
621 If a required argument is not found, and g\bge\bet\bto\bop\bpt\bts\bs is not silent,
622 a question mark (?\b?) is placed in _\bn_\ba_\bm_\be, O\bOP\bPT\bTA\bAR\bRG\bG is unset, and a
623 diagnostic message is printed. If g\bge\bet\bto\bop\bpt\bts\bs is silent, then a
624 colon (:\b:) is placed in _\bn_\ba_\bm_\be and O\bOP\bPT\bTA\bAR\bRG\bG is set to the option
625 character found.
626
627 g\bge\bet\bto\bop\bpt\bts\bs returns true if an option, specified or unspecified, is
628 found. It returns false if the end of options is encountered or
629 an error occurs.
630
631 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]
632 Each time h\bha\bas\bsh\bh is invoked, the full pathname of the command _\bn_\ba_\bm_\be
633 is determined by searching the directories in $\b$P\bPA\bAT\bTH\bH and remem-
634 bered. Any previously-remembered pathname is discarded. If the
635 -\b-p\bp option is supplied, no path search is performed, and _\bf_\bi_\bl_\be_\bn_\ba_\bm_\be
636 is used as the full file name of the command. The -\b-r\br option
637 causes the shell to forget all remembered locations. The -\b-d\bd
638 option causes the shell to forget the remembered location of
639 each _\bn_\ba_\bm_\be. If the -\b-t\bt option is supplied, the full pathname to
640 which each _\bn_\ba_\bm_\be corresponds is printed. If multiple _\bn_\ba_\bm_\be argu-
641 ments are supplied with -\b-t\bt, the _\bn_\ba_\bm_\be is printed before the
642 hashed full pathname. The -\b-l\bl option causes output to be dis-
643 played in a format that may be reused as input. If no arguments
644 are given, or if only -\b-l\bl is supplied, information about remem-
645 bered commands is printed. The return status is true unless a
646 _\bn_\ba_\bm_\be is not found or an invalid option is supplied.
647
648 h\bhe\bel\blp\bp [-\b-d\bdm\bms\bs] [_\bp_\ba_\bt_\bt_\be_\br_\bn]
649 Display helpful information about builtin commands. If _\bp_\ba_\bt_\bt_\be_\br_\bn
650 is specified, h\bhe\bel\blp\bp gives detailed help on all commands matching
651 _\bp_\ba_\bt_\bt_\be_\br_\bn; otherwise help for all the builtins and shell control
652 structures is printed.
653 -\b-d\bd Display a short description of each _\bp_\ba_\bt_\bt_\be_\br_\bn
654 -\b-m\bm Display the description of each _\bp_\ba_\bt_\bt_\be_\br_\bn in a manpage-like
655 format
656 -\b-s\bs Display only a short usage synopsis for each _\bp_\ba_\bt_\bt_\be_\br_\bn
657 The return status is 0 unless no command matches _\bp_\ba_\bt_\bt_\be_\br_\bn.
658
659 h\bhi\bis\bst\bto\bor\bry\by [\b[_\bn]\b]
660 h\bhi\bis\bst\bto\bor\bry\by -\b-c\bc
661 h\bhi\bis\bst\bto\bor\bry\by -\b-d\bd _\bo_\bf_\bf_\bs_\be_\bt
662 h\bhi\bis\bst\bto\bor\bry\by -\b-a\ban\bnr\brw\bw [_\bf_\bi_\bl_\be_\bn_\ba_\bm_\be]
663 h\bhi\bis\bst\bto\bor\bry\by -\b-p\bp _\ba_\br_\bg [_\ba_\br_\bg _\b._\b._\b.]
664 h\bhi\bis\bst\bto\bor\bry\by -\b-s\bs _\ba_\br_\bg [_\ba_\br_\bg _\b._\b._\b.]
665 With no options, display the command history list with line num-
666 bers. Lines listed with a *\b* have been modified. An argument of
667 _\bn lists only the last _\bn lines. If the shell variable H\bHI\bIS\bST\bTT\bTI\bIM\bME\bE-\b-
668 F\bFO\bOR\bRM\bMA\bAT\bT is set and not null, it is used as a format string for
669 _\bs_\bt_\br_\bf_\bt_\bi_\bm_\be(3) to display the time stamp associated with each dis-
670 played history entry. No intervening blank is printed between
671 the formatted time stamp and the history line. If _\bf_\bi_\bl_\be_\bn_\ba_\bm_\be is
672 supplied, it is used as the name of the history file; if not,
673 the value of H\bHI\bIS\bST\bTF\bFI\bIL\bLE\bE is used. Options, if supplied, have the
674 following meanings:
675 -\b-c\bc Clear the history list by deleting all the entries.
676 -\b-d\bd _\bo_\bf_\bf_\bs_\be_\bt
677 Delete the history entry at position _\bo_\bf_\bf_\bs_\be_\bt.
678 -\b-a\ba Append the ``new'' history lines (history lines entered
679 since the beginning of the current b\bba\bas\bsh\bh session) to the
680 history file.
681 -\b-n\bn Read the history lines not already read from the history
682 file into the current history list. These are lines
683 appended to the history file since the beginning of the
684 current b\bba\bas\bsh\bh session.
685 -\b-r\br Read the contents of the history file and use them as the
686 current history.
687 -\b-w\bw Write the current history to the history file, overwrit-
688 ing the history file's contents.
689 -\b-p\bp Perform history substitution on the following _\ba_\br_\bg_\bs and
690 display the result on the standard output. Does not
691 store the results in the history list. Each _\ba_\br_\bg must be
692 quoted to disable normal history expansion.
693 -\b-s\bs Store the _\ba_\br_\bg_\bs in the history list as a single entry.
694 The last command in the history list is removed before
695 the _\ba_\br_\bg_\bs are added.
696
697 If the H\bHI\bIS\bST\bTT\bTI\bIM\bME\bEF\bFO\bOR\bRM\bMA\bAT\bT variable is set, the time stamp informa-
698 tion associated with each history entry is written to the his-
699 tory file, marked with the history comment character. When the
700 history file is read, lines beginning with the history comment
701 character followed immediately by a digit are interpreted as
702 timestamps for the previous history line. The return value is 0
703 unless an invalid option is encountered, an error occurs while
704 reading or writing the history file, an invalid _\bo_\bf_\bf_\bs_\be_\bt is sup-
705 plied as an argument to -\b-d\bd, or the history expansion supplied as
706 an argument to -\b-p\bp fails.
707
708 j\bjo\bob\bbs\bs [-\b-l\bln\bnp\bpr\brs\bs] [ _\bj_\bo_\bb_\bs_\bp_\be_\bc ... ]
709 j\bjo\bob\bbs\bs -\b-x\bx _\bc_\bo_\bm_\bm_\ba_\bn_\bd [ _\ba_\br_\bg_\bs ... ]
710 The first form lists the active jobs. The options have the fol-
711 lowing meanings:
712 -\b-l\bl List process IDs in addition to the normal information.
713 -\b-n\bn Display information only about jobs that have changed
714 status since the user was last notified of their status.
715 -\b-p\bp List only the process ID of the job's process group
716 leader.
717 -\b-r\br Restrict output to running jobs.
718 -\b-s\bs Restrict output to stopped jobs.
719
720 If _\bj_\bo_\bb_\bs_\bp_\be_\bc is given, output is restricted to information about
721 that job. The return status is 0 unless an invalid option is
722 encountered or an invalid _\bj_\bo_\bb_\bs_\bp_\be_\bc is supplied.
723
724 If the -\b-x\bx option is supplied, j\bjo\bob\bbs\bs replaces any _\bj_\bo_\bb_\bs_\bp_\be_\bc found in
725 _\bc_\bo_\bm_\bm_\ba_\bn_\bd or _\ba_\br_\bg_\bs with the corresponding process group ID, and
726 executes _\bc_\bo_\bm_\bm_\ba_\bn_\bd passing it _\ba_\br_\bg_\bs, returning its exit status.
727
728 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] ...
729 k\bki\bil\bll\bl -\b-l\bl [_\bs_\bi_\bg_\bs_\bp_\be_\bc | _\be_\bx_\bi_\bt_\b__\bs_\bt_\ba_\bt_\bu_\bs]
730 Send the signal named by _\bs_\bi_\bg_\bs_\bp_\be_\bc or _\bs_\bi_\bg_\bn_\bu_\bm to the processes
731 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
732 signal name such as S\bSI\bIG\bGK\bKI\bIL\bLL\bL (with or without the S\bSI\bIG\bG prefix) or
733 a signal number; _\bs_\bi_\bg_\bn_\bu_\bm is a signal number. If _\bs_\bi_\bg_\bs_\bp_\be_\bc is not
734 present, then S\bSI\bIG\bGT\bTE\bER\bRM\bM is assumed. An argument of -\b-l\bl lists the
735 signal names. If any arguments are supplied when -\b-l\bl is given,
736 the names of the signals corresponding to the arguments are
737 listed, and the return status is 0. The _\be_\bx_\bi_\bt_\b__\bs_\bt_\ba_\bt_\bu_\bs argument to
738 -\b-l\bl is a number specifying either a signal number or the exit
739 status of a process terminated by a signal. k\bki\bil\bll\bl returns true
740 if at least one signal was successfully sent, or false if an
741 error occurs or an invalid option is encountered.
742
743 l\ble\bet\bt _\ba_\br_\bg [_\ba_\br_\bg ...]
744 Each _\ba_\br_\bg is an arithmetic expression to be evaluated (see A\bAR\bRI\bIT\bTH\bH-\b-
745 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
746 returns 1; 0 is returned otherwise.
747
748 l\blo\boc\bca\bal\bl [_\bo_\bp_\bt_\bi_\bo_\bn] [_\bn_\ba_\bm_\be[=_\bv_\ba_\bl_\bu_\be] ...]
749 For each argument, a local variable named _\bn_\ba_\bm_\be is created, and
750 assigned _\bv_\ba_\bl_\bu_\be. The _\bo_\bp_\bt_\bi_\bo_\bn can be any of the options accepted
751 by d\bde\bec\bcl\bla\bar\bre\be. When l\blo\boc\bca\bal\bl is used within a function, it causes the
752 variable _\bn_\ba_\bm_\be to have a visible scope restricted to that func-
753 tion and its children. With no operands, l\blo\boc\bca\bal\bl writes a list of
754 local variables to the standard output. It is an error to use
755 l\blo\boc\bca\bal\bl when not within a function. The return status is 0 unless
756 l\blo\boc\bca\bal\bl is used outside a function, an invalid _\bn_\ba_\bm_\be is supplied,
757 or _\bn_\ba_\bm_\be is a readonly variable.
758
759 l\blo\bog\bgo\bou\but\bt Exit a login shell.
760
761 m\bma\bap\bpf\bfi\bil\ble\be [-\b-n\bn _\bc_\bo_\bu_\bn_\bt] [-\b-O\bO _\bo_\br_\bi_\bg_\bi_\bn] [-\b-s\bs _\bc_\bo_\bu_\bn_\bt] [-\b-t\bt] [-\b-u\bu _\bf_\bd] [-\b-C\bC _\bc_\ba_\bl_\bl_\bb_\ba_\bc_\bk]
762 [-\b-c\bc _\bq_\bu_\ba_\bn_\bt_\bu_\bm] [_\ba_\br_\br_\ba_\by]
763 r\bre\bea\bad\bda\bar\brr\bra\bay\by [-\b-n\bn _\bc_\bo_\bu_\bn_\bt] [-\b-O\bO _\bo_\br_\bi_\bg_\bi_\bn] [-\b-s\bs _\bc_\bo_\bu_\bn_\bt] [-\b-t\bt] [-\b-u\bu _\bf_\bd] [-\b-C\bC _\bc_\ba_\bl_\bl_\bb_\ba_\bc_\bk]
764 [-\b-c\bc _\bq_\bu_\ba_\bn_\bt_\bu_\bm] [_\ba_\br_\br_\ba_\by]
765 Read lines from the standard input into the indexed array vari-
766 able _\ba_\br_\br_\ba_\by, or from file descriptor _\bf_\bd if the -\b-u\bu option is sup-
767 plied. The variable M\bMA\bAP\bPF\bFI\bIL\bLE\bE is the default _\ba_\br_\br_\ba_\by. Options, if
768 supplied, have the following meanings:
769 -\b-n\bn Copy at most _\bc_\bo_\bu_\bn_\bt lines. If _\bc_\bo_\bu_\bn_\bt is 0, all lines are
770 copied.
771 -\b-O\bO Begin assigning to _\ba_\br_\br_\ba_\by at index _\bo_\br_\bi_\bg_\bi_\bn. The default
772 index is 0.
773 -\b-s\bs Discard the first _\bc_\bo_\bu_\bn_\bt lines read.
774 -\b-t\bt Remove a trailing newline from each line read.
775 -\b-u\bu Read lines from file descriptor _\bf_\bd instead of the stan-
776 dard input.
777 -\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
778 -\b-c\bc option specifies _\bq_\bu_\ba_\bn_\bt_\bu_\bm.
779 -\b-c\bc Specify the number of lines read between each call to
780 _\bc_\ba_\bl_\bl_\bb_\ba_\bc_\bk.
781
782 If -\b-C\bC is specified without -\b-c\bc, the default quantum is 5000.
783 When _\bc_\ba_\bl_\bl_\bb_\ba_\bc_\bk is evaluated, it is supplied the index of the next
784 array element to be assigned and the line to be assigned to that
785 element as additional arguments. _\bc_\ba_\bl_\bl_\bb_\ba_\bc_\bk is evaluated after
786 the line is read but before the array element is assigned.
787
788 If not supplied with an explicit origin, m\bma\bap\bpf\bfi\bil\ble\be will clear
789 _\ba_\br_\br_\ba_\by before assigning to it.
790
791 m\bma\bap\bpf\bfi\bil\ble\be returns successfully unless an invalid option or option
792 argument is supplied, _\ba_\br_\br_\ba_\by is invalid or unassignable, or if
793 _\ba_\br_\br_\ba_\by is not an indexed array.
794
795 p\bpo\bop\bpd\bd [-n\bn] [+_\bn] [-_\bn]
796 Removes entries from the directory stack. With no arguments,
797 removes the top directory from the stack, and performs a c\bcd\bd to
798 the new top directory. Arguments, if supplied, have the follow-
799 ing meanings:
800 -\b-n\bn Suppresses the normal change of directory when removing
801 directories from the stack, so that only the stack is
802 manipulated.
803 +\b+_\bn Removes the _\bnth entry counting from the left of the list
804 shown by d\bdi\bir\brs\bs, starting with zero. For example: ``popd
805 +0'' removes the first directory, ``popd +1'' the second.
806 -\b-_\bn Removes the _\bnth entry counting from the right of the list
807 shown by d\bdi\bir\brs\bs, starting with zero. For example: ``popd
808 -0'' removes the last directory, ``popd -1'' the next to
809 last.
810
811 If the p\bpo\bop\bpd\bd command is successful, a d\bdi\bir\brs\bs is performed as well,
812 and the return status is 0. p\bpo\bop\bpd\bd returns false if an invalid
813 option is encountered, the directory stack is empty, a non-exis-
814 tent directory stack entry is specified, or the directory change
815 fails.
816
817 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]
818 Write the formatted _\ba_\br_\bg_\bu_\bm_\be_\bn_\bt_\bs to the standard output under the
819 control of the _\bf_\bo_\br_\bm_\ba_\bt. The -\b-v\bv option causes the output to be
820 assigned to the variable _\bv_\ba_\br rather than being printed to the
821 standard output.
822
823 The _\bf_\bo_\br_\bm_\ba_\bt is a character string which contains three types of
824 objects: plain characters, which are simply copied to standard
825 output, character escape sequences, which are converted and
826 copied to the standard output, and format specifications, each
827 of which causes printing of the next successive _\ba_\br_\bg_\bu_\bm_\be_\bn_\bt. In
828 addition to the standard _\bp_\br_\bi_\bn_\bt_\bf(1) format specifications, p\bpr\bri\bin\bnt\btf\bf
829 interprets the following extensions:
830 %\b%b\bb causes p\bpr\bri\bin\bnt\btf\bf to expand backslash escape sequences in the
831 corresponding _\ba_\br_\bg_\bu_\bm_\be_\bn_\bt (except that \\b\c\bc terminates output,
832 backslashes in \\b\'\b', \\b\"\b", and \\b\?\b? are not removed, and octal
833 escapes beginning with \\b\0\b0 may contain up to four digits).
834 %\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
835 format that can be reused as shell input.
836 %\b%(\b(_\bd_\ba_\bt_\be_\bf_\bm_\bt)\b)T\bT
837 causes p\bpr\bri\bin\bnt\btf\bf to output the date-time string resulting
838 from using _\bd_\ba_\bt_\be_\bf_\bm_\bt as a format string for _\bs_\bt_\br_\bf_\bt_\bi_\bm_\be(3).
839 The corresponding _\ba_\br_\bg_\bu_\bm_\be_\bn_\bt is an integer representing the
840 number of seconds since the epoch. Two special argument
841 values may be used: -1 represents the current time, and
842 -2 represents the time the shell was invoked.
843
844 Arguments to non-string format specifiers are treated as C con-
845 stants, except that a leading plus or minus sign is allowed, and
846 if the leading character is a single or double quote, the value
847 is the ASCII value of the following character.
848
849 The _\bf_\bo_\br_\bm_\ba_\bt is reused as necessary to consume all of the _\ba_\br_\bg_\bu_\b-
850 _\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,
851 the extra format specifications behave as if a zero value or
852 null string, as appropriate, had been supplied. The return
853 value is zero on success, non-zero on failure.
854
855 p\bpu\bus\bsh\bhd\bd [-\b-n\bn] [+_\bn] [-_\bn]
856 p\bpu\bus\bsh\bhd\bd [-\b-n\bn] [_\bd_\bi_\br]
857 Adds a directory to the top of the directory stack, or rotates
858 the stack, making the new top of the stack the current working
859 directory. With no arguments, exchanges the top two directories
860 and returns 0, unless the directory stack is empty. Arguments,
861 if supplied, have the following meanings:
862 -\b-n\bn Suppresses the normal change of directory when adding
863 directories to the stack, so that only the stack is
864 manipulated.
865 +\b+_\bn Rotates the stack so that the _\bnth directory (counting
866 from the left of the list shown by d\bdi\bir\brs\bs, starting with
867 zero) is at the top.
868 -\b-_\bn Rotates the stack so that the _\bnth directory (counting
869 from the right of the list shown by d\bdi\bir\brs\bs, starting with
870 zero) is at the top.
871 _\bd_\bi_\br Adds _\bd_\bi_\br to the directory stack at the top, making it the
872 new current working directory.
873
874 If the p\bpu\bus\bsh\bhd\bd command is successful, a d\bdi\bir\brs\bs is performed as well.
875 If the first form is used, p\bpu\bus\bsh\bhd\bd returns 0 unless the cd to _\bd_\bi_\br
876 fails. With the second form, p\bpu\bus\bsh\bhd\bd returns 0 unless the direc-
877 tory stack is empty, a non-existent directory stack element is
878 specified, or the directory change to the specified new current
879 directory fails.
880
881 p\bpw\bwd\bd [-\b-L\bLP\bP]
882 Print the absolute pathname of the current working directory.
883 The pathname printed contains no symbolic links if the -\b-P\bP option
884 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
885 is enabled. If the -\b-L\bL option is used, the pathname printed may
886 contain symbolic links. The return status is 0 unless an error
887 occurs while reading the name of the current directory or an
888 invalid option is supplied.
889
890 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
891 _\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 ...]
892 One line is read from the standard input, or from the file
893 descriptor _\bf_\bd supplied as an argument to the -\b-u\bu option, and the
894 first word is assigned to the first _\bn_\ba_\bm_\be, the second word to the
895 second _\bn_\ba_\bm_\be, and so on, with leftover words and their interven-
896 ing separators assigned to the last _\bn_\ba_\bm_\be. If there are fewer
897 words read from the input stream than names, the remaining names
898 are assigned empty values. The characters in I\bIF\bFS\bS are used to
899 split the line into words. The backslash character (\\b\) may be
900 used to remove any special meaning for the next character read
901 and for line continuation. Options, if supplied, have the fol-
902 lowing meanings:
903 -\b-a\ba _\ba_\bn_\ba_\bm_\be
904 The words are assigned to sequential indices of the array
905 variable _\ba_\bn_\ba_\bm_\be, starting at 0. _\ba_\bn_\ba_\bm_\be is unset before any
906 new values are assigned. Other _\bn_\ba_\bm_\be arguments are
907 ignored.
908 -\b-d\bd _\bd_\be_\bl_\bi_\bm
909 The first character of _\bd_\be_\bl_\bi_\bm is used to terminate the
910 input line, rather than newline.
911 -\b-e\be If the standard input is coming from a terminal, r\bre\bea\bad\bdl\bli\bin\bne\be
912 (see R\bRE\bEA\bAD\bDL\bLI\bIN\bNE\bE above) is used to obtain the line. Read-
913 line uses the current (or default, if line editing was
914 not previously active) editing settings.
915 -\b-i\bi _\bt_\be_\bx_\bt
916 If r\bre\bea\bad\bdl\bli\bin\bne\be is being used to read the line, _\bt_\be_\bx_\bt is
917 placed into the editing buffer before editing begins.
918 -\b-n\bn _\bn_\bc_\bh_\ba_\br_\bs
919 r\bre\bea\bad\bd returns after reading _\bn_\bc_\bh_\ba_\br_\bs characters rather than
920 waiting for a complete line of input, but honor a delim-
921 iter if fewer than _\bn_\bc_\bh_\ba_\br_\bs characters are read before the
922 delimiter.
923 -\b-N\bN _\bn_\bc_\bh_\ba_\br_\bs
924 r\bre\bea\bad\bd returns after reading exactly _\bn_\bc_\bh_\ba_\br_\bs characters
925 rather than waiting for a complete line of input, unless
926 EOF is encountered or r\bre\bea\bad\bd times out. Delimiter charac-
927 ters encountered in the input are not treated specially
928 and do not cause r\bre\bea\bad\bd to return until _\bn_\bc_\bh_\ba_\br_\bs characters
929 are read.
930 -\b-p\bp _\bp_\br_\bo_\bm_\bp_\bt
931 Display _\bp_\br_\bo_\bm_\bp_\bt on standard error, without a trailing new-
932 line, before attempting to read any input. The prompt is
933 displayed only if input is coming from a terminal.
934 -\b-r\br Backslash does not act as an escape character. The back-
935 slash is considered to be part of the line. In particu-
936 lar, a backslash-newline pair may not be used as a line
937 continuation.
938 -\b-s\bs Silent mode. If input is coming from a terminal, charac-
939 ters are not echoed.
940 -\b-t\bt _\bt_\bi_\bm_\be_\bo_\bu_\bt
941 Cause r\bre\bea\bad\bd to time out and return failure if a complete
942 line of input is not read within _\bt_\bi_\bm_\be_\bo_\bu_\bt seconds. _\bt_\bi_\bm_\be_\b-
943 _\bo_\bu_\bt may be a decimal number with a fractional portion
944 following the decimal point. This option is only effec-
945 tive if r\bre\bea\bad\bd is reading input from a terminal, pipe, or
946 other special file; it has no effect when reading from
947 regular files. If _\bt_\bi_\bm_\be_\bo_\bu_\bt is 0, r\bre\bea\bad\bd returns success if
948 input is available on the specified file descriptor,
949 failure otherwise. The exit status is greater than 128
950 if the timeout is exceeded.
951 -\b-u\bu _\bf_\bd Read input from file descriptor _\bf_\bd.
952
953 If no _\bn_\ba_\bm_\be_\bs are supplied, the line read is assigned to the vari-
954 able R\bRE\bEP\bPL\bLY\bY. The return code is zero, unless end-of-file is
955 encountered, r\bre\bea\bad\bd times out (in which case the return code is
956 greater than 128), or an invalid file descriptor is supplied as
957 the argument to -\b-u\bu.
958
959 r\bre\bea\bad\bdo\bon\bnl\bly\by [-\b-a\baA\bAp\bpf\bf] [_\bn_\ba_\bm_\be[=_\bw_\bo_\br_\bd] ...]
960 The given _\bn_\ba_\bm_\be_\bs are marked readonly; the values of these _\bn_\ba_\bm_\be_\bs
961 may not be changed by subsequent assignment. If the -\b-f\bf option
962 is supplied, the functions corresponding to the _\bn_\ba_\bm_\be_\bs are so
963 marked. The -\b-a\ba option restricts the variables to indexed
964 arrays; the -\b-A\bA option restricts the variables to associative
965 arrays. If no _\bn_\ba_\bm_\be arguments are given, or if the -\b-p\bp option is
966 supplied, a list of all readonly names is printed. The -\b-p\bp
967 option causes output to be displayed in a format that may be
968 reused as input. If a variable name is followed by =_\bw_\bo_\br_\bd, the
969 value of the variable is set to _\bw_\bo_\br_\bd. The return status is 0
970 unless an invalid option is encountered, one of the _\bn_\ba_\bm_\be_\bs is not
971 a valid shell variable name, or -\b-f\bf is supplied with a _\bn_\ba_\bm_\be that
972 is not a function.
973
974 r\bre\bet\btu\bur\brn\bn [_\bn]
975 Causes a function to exit with the return value specified by _\bn.
976 If _\bn is omitted, the return status is that of the last command
977 executed in the function body. If used outside a function, but
978 during execution of a script by the .\b. (s\bso\bou\bur\brc\bce\be) command, it
979 causes the shell to stop executing that script and return either
980 _\bn or the exit status of the last command executed within the
981 script as the exit status of the script. If used outside a
982 function and not during execution of a script by .\b., the return
983 status is false. Any command associated with the R\bRE\bET\bTU\bUR\bRN\bN trap is
984 executed before execution resumes after the function or script.
985
986 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 ...]
987 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 ...]
988 Without options, the name and value of each shell variable are
989 displayed in a format that can be reused as input for setting or
990 resetting the currently-set variables. Read-only variables can-
991 not be reset. In _\bp_\bo_\bs_\bi_\bx _\bm_\bo_\bd_\be, only shell variables are listed.
992 The output is sorted according to the current locale. When
993 options are specified, they set or unset shell attributes. Any
994 arguments remaining after option processing are treated as val-
995 ues for the positional parameters and are assigned, in order, to
996 $\b$1\b1, $\b$2\b2, .\b..\b..\b. $\b$_\bn. Options, if specified, have the following
997 meanings:
998 -\b-a\ba Automatically mark variables and functions which are
999 modified or created for export to the environment of
1000 subsequent commands.
1001 -\b-b\bb Report the status of terminated background jobs immedi-
1002 ately, rather than before the next primary prompt. This
1003 is effective only when job control is enabled.
1004 -\b-e\be Exit immediately if a _\bp_\bi_\bp_\be_\bl_\bi_\bn_\be (which may consist of a
1005 single _\bs_\bi_\bm_\bp_\bl_\be _\bc_\bo_\bm_\bm_\ba_\bn_\bd), a _\bs_\bu_\bb_\bs_\bh_\be_\bl_\bl command enclosed in
1006 parentheses, or one of the commands executed as part of
1007 a command list enclosed by braces (see S\bSH\bHE\bEL\bLL\bL G\bGR\bRA\bAM\bMM\bMA\bAR\bR
1008 above) exits with a non-zero status. The shell does not
1009 exit if the command that fails is part of the command
1010 list immediately following a w\bwh\bhi\bil\ble\be or u\bun\bnt\bti\bil\bl keyword,
1011 part of the test following the i\bif\bf or e\bel\bli\bif\bf reserved
1012 words, part of any command executed in a &\b&&\b& or |\b||\b| list
1013 except the command following the final &\b&&\b& or |\b||\b|, any
1014 command in a pipeline but the last, or if the command's
1015 return value is being inverted with !\b!. A trap on E\bER\bRR\bR,
1016 if set, is executed before the shell exits. This option
1017 applies to the shell environment and each subshell envi-
1018 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
1019 above), and may cause subshells to exit before executing
1020 all the commands in the subshell.
1021 -\b-f\bf Disable pathname expansion.
1022 -\b-h\bh Remember the location of commands as they are looked up
1023 for execution. This is enabled by default.
1024 -\b-k\bk All arguments in the form of assignment statements are
1025 placed in the environment for a command, not just those
1026 that precede the command name.
1027 -\b-m\bm Monitor mode. Job control is enabled. This option is
1028 on by default for interactive shells on systems that
1029 support it (see J\bJO\bOB\bB C\bCO\bON\bNT\bTR\bRO\bOL\bL above). Background pro-
1030 cesses run in a separate process group and a line con-
1031 taining their exit status is printed upon their comple-
1032 tion.
1033 -\b-n\bn Read commands but do not execute them. This may be used
1034 to check a shell script for syntax errors. This is
1035 ignored by interactive shells.
1036 -\b-o\bo _\bo_\bp_\bt_\bi_\bo_\bn_\b-_\bn_\ba_\bm_\be
1037 The _\bo_\bp_\bt_\bi_\bo_\bn_\b-_\bn_\ba_\bm_\be can be one of the following:
1038 a\bal\bll\ble\bex\bxp\bpo\bor\brt\bt
1039 Same as -\b-a\ba.
1040 b\bbr\bra\bac\bce\bee\bex\bxp\bpa\ban\bnd\bd
1041 Same as -\b-B\bB.
1042 e\bem\bma\bac\bcs\bs Use an emacs-style command line editing inter-
1043 face. This is enabled by default when the shell
1044 is interactive, unless the shell is started with
1045 the -\b--\b-n\bno\boe\bed\bdi\bit\bti\bin\bng\bg option. This also affects the
1046 editing interface used for r\bre\bea\bad\bd -\b-e\be.
1047 e\ber\brr\bre\bex\bxi\bit\bt Same as -\b-e\be.
1048 e\ber\brr\brt\btr\bra\bac\bce\be
1049 Same as -\b-E\bE.
1050 f\bfu\bun\bnc\bct\btr\bra\bac\bce\be
1051 Same as -\b-T\bT.
1052 h\bha\bas\bsh\bha\bal\bll\bl Same as -\b-h\bh.
1053 h\bhi\bis\bst\bte\bex\bxp\bpa\ban\bnd\bd
1054 Same as -\b-H\bH.
1055 h\bhi\bis\bst\bto\bor\bry\by Enable command history, as described above under
1056 H\bHI\bIS\bST\bTO\bOR\bRY\bY. This option is on by default in inter-
1057 active shells.
1058 i\big\bgn\bno\bor\bre\bee\beo\bof\bf
1059 The effect is as if the shell command
1060 ``IGNOREEOF=10'' had been executed (see S\bSh\bhe\bel\bll\bl
1061 V\bVa\bar\bri\bia\bab\bbl\ble\bes\bs above).
1062 k\bke\bey\byw\bwo\bor\brd\bd Same as -\b-k\bk.
1063 m\bmo\bon\bni\bit\bto\bor\br Same as -\b-m\bm.
1064 n\bno\boc\bcl\blo\bob\bbb\bbe\ber\br
1065 Same as -\b-C\bC.
1066 n\bno\boe\bex\bxe\bec\bc Same as -\b-n\bn.
1067 n\bno\bog\bgl\blo\bob\bb Same as -\b-f\bf.
1068 n\bno\bol\blo\bog\bg Currently ignored.
1069 n\bno\bot\bti\bif\bfy\by Same as -\b-b\bb.
1070 n\bno\bou\bun\bns\bse\bet\bt Same as -\b-u\bu.
1071 o\bon\bne\bec\bcm\bmd\bd Same as -\b-t\bt.
1072 p\bph\bhy\bys\bsi\bic\bca\bal\bl
1073 Same as -\b-P\bP.
1074 p\bpi\bip\bpe\bef\bfa\bai\bil\bl
1075 If set, the return value of a pipeline is the
1076 value of the last (rightmost) command to exit
1077 with a non-zero status, or zero if all commands
1078 in the pipeline exit successfully. This option
1079 is disabled by default.
1080 p\bpo\bos\bsi\bix\bx Change the behavior of b\bba\bas\bsh\bh where the default
1081 operation differs from the POSIX standard to
1082 match the standard (_\bp_\bo_\bs_\bi_\bx _\bm_\bo_\bd_\be).
1083 p\bpr\bri\biv\bvi\bil\ble\beg\bge\bed\bd
1084 Same as -\b-p\bp.
1085 v\bve\ber\brb\bbo\bos\bse\be Same as -\b-v\bv.
1086 v\bvi\bi Use a vi-style command line editing interface.
1087 This also affects the editing interface used for
1088 r\bre\bea\bad\bd -\b-e\be.
1089 x\bxt\btr\bra\bac\bce\be Same as -\b-x\bx.
1090 If -\b-o\bo is supplied with no _\bo_\bp_\bt_\bi_\bo_\bn_\b-_\bn_\ba_\bm_\be, the values of the
1091 current options are printed. If +\b+o\bo is supplied with no
1092 _\bo_\bp_\bt_\bi_\bo_\bn_\b-_\bn_\ba_\bm_\be, a series of s\bse\bet\bt commands to recreate the
1093 current option settings is displayed on the standard
1094 output.
1095 -\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
1096 $\b$B\bBA\bAS\bSH\bH_\b_E\bEN\bNV\bV files are not processed, shell functions are
1097 not inherited from the environment, and the S\bSH\bHE\bEL\bLL\bLO\bOP\bPT\bTS\bS,
1098 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
1099 appear in the environment, are ignored. If the shell is
1100 started with the effective user (group) id not equal to
1101 the real user (group) id, and the -\b-p\bp option is not sup-
1102 plied, these actions are taken and the effective user id
1103 is set to the real user id. If the -\b-p\bp option is sup-
1104 plied at startup, the effective user id is not reset.
1105 Turning this option off causes the effective user and
1106 group ids to be set to the real user and group ids.
1107 -\b-t\bt Exit after reading and executing one command.
1108 -\b-u\bu Treat unset variables and parameters other than the spe-
1109 cial parameters "@" and "*" as an error when performing
1110 parameter expansion. If expansion is attempted on an
1111 unset variable or parameter, the shell prints an error
1112 message, and, if not interactive, exits with a non-zero
1113 status.
1114 -\b-v\bv Print shell input lines as they are read.
1115 -\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
1116 command, s\bse\bel\ble\bec\bct\bt command, or arithmetic f\bfo\bor\br command, dis-
1117 play the expanded value of P\bPS\bS4\b4, followed by the command
1118 and its expanded arguments or associated word list.
1119 -\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
1120 above). This is on by default.
1121 -\b-C\bC If set, b\bba\bas\bsh\bh does not overwrite an existing file with
1122 the >\b>, >\b>&\b&, and <\b<>\b> redirection operators. This may be
1123 overridden when creating output files by using the redi-
1124 rection operator >\b>|\b| instead of >\b>.
1125 -\b-E\bE If set, any trap on E\bER\bRR\bR is inherited by shell functions,
1126 command substitutions, and commands executed in a sub-
1127 shell environment. The E\bER\bRR\bR trap is normally not inher-
1128 ited in such cases.
1129 -\b-H\bH Enable !\b! style history substitution. This option is on
1130 by default when the shell is interactive.
1131 -\b-P\bP If set, the shell does not follow symbolic links when
1132 executing commands such as c\bcd\bd that change the current
1133 working directory. It uses the physical directory
1134 structure instead. By default, b\bba\bas\bsh\bh follows the logical
1135 chain of directories when performing commands which
1136 change the current directory.
1137 -\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
1138 shell functions, command substitutions, and commands
1139 executed in a subshell environment. The D\bDE\bEB\bBU\bUG\bG and
1140 R\bRE\bET\bTU\bUR\bRN\bN traps are normally not inherited in such cases.
1141 -\b--\b- If no arguments follow this option, then the positional
1142 parameters are unset. Otherwise, the positional parame-
1143 ters are set to the _\ba_\br_\bgs, even if some of them begin
1144 with a -\b-.
1145 -\b- Signal the end of options, cause all remaining _\ba_\br_\bgs to
1146 be assigned to the positional parameters. The -\b-x\bx and -\b-v\bv
1147 options are turned off. If there are no _\ba_\br_\bgs, the posi-
1148 tional parameters remain unchanged.
1149
1150 The options are off by default unless otherwise noted. Using +
1151 rather than - causes these options to be turned off. The
1152 options can also be specified as arguments to an invocation of
1153 the shell. The current set of options may be found in $\b$-\b-. The
1154 return status is always true unless an invalid option is encoun-
1155 tered.
1156
1157 s\bsh\bhi\bif\bft\bt [_\bn]
1158 The positional parameters from _\bn+1 ... are renamed to $\b$1\b1 .\b..\b..\b..\b.
1159 Parameters represented by the numbers $\b$#\b# down to $\b$#\b#-_\bn+1 are
1160 unset. _\bn must be a non-negative number less than or equal to
1161 $\b$#\b#. If _\bn is 0, no parameters are changed. If _\bn is not given,
1162 it is assumed to be 1. If _\bn is greater than $\b$#\b#, the positional
1163 parameters are not changed. The return status is greater than
1164 zero if _\bn is greater than $\b$#\b# or less than zero; otherwise 0.
1165
1166 s\bsh\bho\bop\bpt\bt [-\b-p\bpq\bqs\bsu\bu] [-\b-o\bo] [_\bo_\bp_\bt_\bn_\ba_\bm_\be ...]
1167 Toggle the values of variables controlling optional shell behav-
1168 ior. With no options, or with the -\b-p\bp option, a list of all set-
1169 table options is displayed, with an indication of whether or not
1170 each is set. The -\b-p\bp option causes output to be displayed in a
1171 form that may be reused as input. Other options have the fol-
1172 lowing meanings:
1173 -\b-s\bs Enable (set) each _\bo_\bp_\bt_\bn_\ba_\bm_\be.
1174 -\b-u\bu Disable (unset) each _\bo_\bp_\bt_\bn_\ba_\bm_\be.
1175 -\b-q\bq Suppresses normal output (quiet mode); the return status
1176 indicates whether the _\bo_\bp_\bt_\bn_\ba_\bm_\be is set or unset. If multi-
1177 ple _\bo_\bp_\bt_\bn_\ba_\bm_\be arguments are given with -\b-q\bq, the return sta-
1178 tus is zero if all _\bo_\bp_\bt_\bn_\ba_\bm_\be_\bs are enabled; non-zero other-
1179 wise.
1180 -\b-o\bo Restricts the values of _\bo_\bp_\bt_\bn_\ba_\bm_\be to be those defined for
1181 the -\b-o\bo option to the s\bse\bet\bt builtin.
1182
1183 If either -\b-s\bs or -\b-u\bu is used with no _\bo_\bp_\bt_\bn_\ba_\bm_\be arguments, the dis-
1184 play is limited to those options which are set or unset, respec-
1185 tively. Unless otherwise noted, the s\bsh\bho\bop\bpt\bt options are disabled
1186 (unset) by default.
1187
1188 The return status when listing options is zero if all _\bo_\bp_\bt_\bn_\ba_\bm_\be_\bs
1189 are enabled, non-zero otherwise. When setting or unsetting
1190 options, the return status is zero unless an _\bo_\bp_\bt_\bn_\ba_\bm_\be is not a
1191 valid shell option.
1192
1193 The list of s\bsh\bho\bop\bpt\bt options is:
1194
1195 a\bau\but\bto\boc\bcd\bd If set, a command name that is the name of a directory
1196 is executed as if it were the argument to the c\bcd\bd com-
1197 mand. This option is only used by interactive shells.
1198 c\bcd\bda\bab\bbl\ble\be_\b_v\bva\bar\brs\bs
1199 If set, an argument to the c\bcd\bd builtin command that is
1200 not a directory is assumed to be the name of a variable
1201 whose value is the directory to change to.
1202 c\bcd\bds\bsp\bpe\bel\bll\bl If set, minor errors in the spelling of a directory com-
1203 ponent in a c\bcd\bd command will be corrected. The errors
1204 checked for are transposed characters, a missing charac-
1205 ter, and one character too many. If a correction is
1206 found, the corrected file name is printed, and the com-
1207 mand proceeds. This option is only used by interactive
1208 shells.
1209 c\bch\bhe\bec\bck\bkh\bha\bas\bsh\bh
1210 If set, b\bba\bas\bsh\bh checks that a command found in the hash ta-
1211 ble exists before trying to execute it. If a hashed
1212 command no longer exists, a normal path search is per-
1213 formed.
1214 c\bch\bhe\bec\bck\bkj\bjo\bob\bbs\bs
1215 If set, b\bba\bas\bsh\bh lists the status of any stopped and running
1216 jobs before exiting an interactive shell. If any jobs
1217 are running, this causes the exit to be deferred until a
1218 second exit is attempted without an intervening command
1219 (see J\bJO\bOB\bB C\bCO\bON\bNT\bTR\bRO\bOL\bL above). The shell always postpones
1220 exiting if any jobs are stopped.
1221 c\bch\bhe\bec\bck\bkw\bwi\bin\bns\bsi\biz\bze\be
1222 If set, b\bba\bas\bsh\bh checks the window size after each command
1223 and, if necessary, updates the values of L\bLI\bIN\bNE\bES\bS and C\bCO\bOL\bL-\b-
1224 U\bUM\bMN\bNS\bS.
1225 c\bcm\bmd\bdh\bhi\bis\bst\bt If set, b\bba\bas\bsh\bh attempts to save all lines of a multiple-
1226 line command in the same history entry. This allows
1227 easy re-editing of multi-line commands.
1228 c\bco\bom\bmp\bpa\bat\bt3\b31\b1
1229 If set, b\bba\bas\bsh\bh changes its behavior to that of version 3.1
1230 with respect to quoted arguments to the [\b[[\b[ conditional
1231 command's =\b=~\b~ operator.
1232 c\bco\bom\bmp\bpa\bat\bt3\b32\b2
1233 If set, b\bba\bas\bsh\bh changes its behavior to that of version 3.2
1234 with respect to locale-specific string comparison when
1235 using the [\b[[\b[ conditional command's <\b< and >\b> operators.
1236 Bash versions prior to bash-4.1 use ASCII collation and
1237 _\bs_\bt_\br_\bc_\bm_\bp(3); bash-4.1 and later use the current locale's
1238 collation sequence and _\bs_\bt_\br_\bc_\bo_\bl_\bl(3).
1239 c\bco\bom\bmp\bpa\bat\bt4\b40\b0
1240 If set, b\bba\bas\bsh\bh changes its behavior to that of version 4.0
1241 with respect to locale-specific string comparison when
1242 using the [\b[[\b[ conditional command's <\b< and >\b> operators
1243 (see previous item) and the effect of interrupting a
1244 command list.
1245 c\bco\bom\bmp\bpa\bat\bt4\b41\b1
1246 @item compat41 If set, b\bba\bas\bsh\bh, when in posix mode, treats
1247 a single quote in a double-quoted parameter expansion as
1248 a special character. The single quotes must match (an
1249 even number) and the characters between the single
1250 quotes are considered quoted. This is the behavior of
1251 posix mode through version 4.1. The default bash behav-
1252 ior remains as in previous versions.
1253 d\bdi\bir\brs\bsp\bpe\bel\bll\bl
1254 If set, b\bba\bas\bsh\bh attempts spelling correction on directory
1255 names during word completion if the directory name ini-
1256 tially supplied does not exist.
1257 d\bdo\bot\btg\bgl\blo\bob\bb If set, b\bba\bas\bsh\bh includes filenames beginning with a `.' in
1258 the results of pathname expansion.
1259 e\bex\bxe\bec\bcf\bfa\bai\bil\bl
1260 If set, a non-interactive shell will not exit if it can-
1261 not execute the file specified as an argument to the
1262 e\bex\bxe\bec\bc builtin command. An interactive shell does not
1263 exit if e\bex\bxe\bec\bc fails.
1264 e\bex\bxp\bpa\ban\bnd\bd_\b_a\bal\bli\bia\bas\bse\bes\bs
1265 If set, aliases are expanded as described above under
1266 A\bAL\bLI\bIA\bAS\bSE\bES\bS. This option is enabled by default for interac-
1267 tive shells.
1268 e\bex\bxt\btd\bde\beb\bbu\bug\bg
1269 If set, behavior intended for use by debuggers is
1270 enabled:
1271 1\b1.\b. The -\b-F\bF option to the d\bde\bec\bcl\bla\bar\bre\be builtin displays the
1272 source file name and line number corresponding to
1273 each function name supplied as an argument.
1274 2\b2.\b. If the command run by the D\bDE\bEB\bBU\bUG\bG trap returns a
1275 non-zero value, the next command is skipped and
1276 not executed.
1277 3\b3.\b. If the command run by the D\bDE\bEB\bBU\bUG\bG trap returns a
1278 value of 2, and the shell is executing in a sub-
1279 routine (a shell function or a shell script exe-
1280 cuted by the .\b. or s\bso\bou\bur\brc\bce\be builtins), a call to
1281 r\bre\bet\btu\bur\brn\bn is simulated.
1282 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
1283 in their descriptions above.
1284 5\b5.\b. Function tracing is enabled: command substitu-
1285 tion, shell functions, and subshells invoked with
1286 (\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.
1287 6\b6.\b. Error tracing is enabled: command substitution,
1288 shell functions, and subshells invoked with (\b(
1289 _\bc_\bo_\bm_\bm_\ba_\bn_\bd )\b) inherit the E\bER\bRR\bR trap.
1290 e\bex\bxt\btg\bgl\blo\bob\bb If set, the extended pattern matching features described
1291 above under P\bPa\bat\bth\bhn\bna\bam\bme\be E\bEx\bxp\bpa\ban\bns\bsi\bio\bon\bn are enabled.
1292 e\bex\bxt\btq\bqu\buo\bot\bte\be
1293 If set, $\b$'_\bs_\bt_\br_\bi_\bn_\bg' and $\b$"_\bs_\bt_\br_\bi_\bn_\bg" quoting is performed
1294 within $\b${\b{_\bp_\ba_\br_\ba_\bm_\be_\bt_\be_\br}\b} expansions enclosed in double
1295 quotes. This option is enabled by default.
1296 f\bfa\bai\bil\blg\bgl\blo\bob\bb
1297 If set, patterns which fail to match filenames during
1298 pathname expansion result in an expansion error.
1299 f\bfo\bor\brc\bce\be_\b_f\bfi\big\bgn\bno\bor\bre\be
1300 If set, the suffixes specified by the F\bFI\bIG\bGN\bNO\bOR\bRE\bE shell
1301 variable cause words to be ignored when performing word
1302 completion even if the ignored words are the only possi-
1303 ble completions. See S\bSH\bHE\bEL\bLL\bL V\bVA\bAR\bRI\bIA\bAB\bBL\bLE\bES\bS above for a
1304 description of F\bFI\bIG\bGN\bNO\bOR\bRE\bE. This option is enabled by
1305 default.
1306 g\bgl\blo\bob\bbs\bst\bta\bar\br
1307 If set, the pattern *\b**\b* used in a pathname expansion con-
1308 text will match a files and zero or more directories and
1309 subdirectories. If the pattern is followed by a /\b/, only
1310 directories and subdirectories match.
1311 g\bgn\bnu\bu_\b_e\ber\brr\brf\bfm\bmt\bt
1312 If set, shell error messages are written in the standard
1313 GNU error message format.
1314 h\bhi\bis\bst\bta\bap\bpp\bpe\ben\bnd\bd
1315 If set, the history list is appended to the file named
1316 by the value of the H\bHI\bIS\bST\bTF\bFI\bIL\bLE\bE variable when the shell
1317 exits, rather than overwriting the file.
1318 h\bhi\bis\bst\btr\bre\bee\bed\bdi\bit\bt
1319 If set, and r\bre\bea\bad\bdl\bli\bin\bne\be is being used, a user is given the
1320 opportunity to re-edit a failed history substitution.
1321 h\bhi\bis\bst\btv\bve\ber\bri\bif\bfy\by
1322 If set, and r\bre\bea\bad\bdl\bli\bin\bne\be is being used, the results of his-
1323 tory substitution are not immediately passed to the
1324 shell parser. Instead, the resulting line is loaded
1325 into the r\bre\bea\bad\bdl\bli\bin\bne\be editing buffer, allowing further modi-
1326 fication.
1327 h\bho\bos\bst\btc\bco\bom\bmp\bpl\ble\bet\bte\be
1328 If set, and r\bre\bea\bad\bdl\bli\bin\bne\be is being used, b\bba\bas\bsh\bh will attempt to
1329 perform hostname completion when a word containing a @\b@
1330 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
1331 above). This is enabled by default.
1332 h\bhu\bup\bpo\bon\bne\bex\bxi\bit\bt
1333 If set, b\bba\bas\bsh\bh will send S\bSI\bIG\bGH\bHU\bUP\bP to all jobs when an inter-
1334 active login shell exits.
1335 i\bin\bnt\bte\ber\bra\bac\bct\bti\biv\bve\be_\b_c\bco\bom\bmm\bme\ben\bnt\bts\bs
1336 If set, allow a word beginning with #\b# to cause that word
1337 and all remaining characters on that line to be ignored
1338 in an interactive shell (see C\bCO\bOM\bMM\bME\bEN\bNT\bTS\bS above). This
1339 option is enabled by default.
1340 l\bla\bas\bst\btp\bpi\bip\bpe\be
1341 If set, and job control is not active, the shell runs
1342 the last command of a pipeline not executed in the back-
1343 ground in the current shell environment.
1344 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
1345 commands are saved to the history with embedded newlines
1346 rather than using semicolon separators where possible.
1347 l\blo\bog\bgi\bin\bn_\b_s\bsh\bhe\bel\bll\bl
1348 The shell sets this option if it is started as a login
1349 shell (see I\bIN\bNV\bVO\bOC\bCA\bAT\bTI\bIO\bON\bN above). The value may not be
1350 changed.
1351 m\bma\bai\bil\blw\bwa\bar\brn\bn
1352 If set, and a file that b\bba\bas\bsh\bh is checking for mail has
1353 been accessed since the last time it was checked, the
1354 message ``The mail in _\bm_\ba_\bi_\bl_\bf_\bi_\bl_\be has been read'' is dis-
1355 played.
1356 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
1357 If set, and r\bre\bea\bad\bdl\bli\bin\bne\be is being used, b\bba\bas\bsh\bh will not
1358 attempt to search the P\bPA\bAT\bTH\bH for possible completions when
1359 completion is attempted on an empty line.
1360 n\bno\boc\bca\bas\bse\beg\bgl\blo\bob\bb
1361 If set, b\bba\bas\bsh\bh matches filenames in a case-insensitive
1362 fashion when performing pathname expansion (see P\bPa\bat\bth\bhn\bna\bam\bme\be
1363 E\bEx\bxp\bpa\ban\bns\bsi\bio\bon\bn above).
1364 n\bno\boc\bca\bas\bse\bem\bma\bat\btc\bch\bh
1365 If set, b\bba\bas\bsh\bh matches patterns in a case-insensitive
1366 fashion when performing matching while executing c\bca\bas\bse\be or
1367 [\b[[\b[ conditional commands.
1368 n\bnu\bul\bll\blg\bgl\blo\bob\bb
1369 If set, b\bba\bas\bsh\bh allows patterns which match no files (see
1370 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,
1371 rather than themselves.
1372 p\bpr\bro\bog\bgc\bco\bom\bmp\bp
1373 If set, the programmable completion facilities (see P\bPr\bro\bo-\b-
1374 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
1375 enabled by default.
1376 p\bpr\bro\bom\bmp\bpt\btv\bva\bar\brs\bs
1377 If set, prompt strings undergo parameter expansion, com-
1378 mand substitution, arithmetic expansion, and quote
1379 removal after being expanded as described in P\bPR\bRO\bOM\bMP\bPT\bTI\bIN\bNG\bG
1380 above. This option is enabled by default.
1381 r\bre\bes\bst\btr\bri\bic\bct\bte\bed\bd_\b_s\bsh\bhe\bel\bll\bl
1382 The shell sets this option if it is started in
1383 restricted mode (see R\bRE\bES\bST\bTR\bRI\bIC\bCT\bTE\bED\bD S\bSH\bHE\bEL\bLL\bL below). The value
1384 may not be changed. This is not reset when the startup
1385 files are executed, allowing the startup files to dis-
1386 cover whether or not a shell is restricted.
1387 s\bsh\bhi\bif\bft\bt_\b_v\bve\ber\brb\bbo\bos\bse\be
1388 If set, the s\bsh\bhi\bif\bft\bt builtin prints an error message when
1389 the shift count exceeds the number of positional parame-
1390 ters.
1391 s\bso\bou\bur\brc\bce\bep\bpa\bat\bth\bh
1392 If set, the s\bso\bou\bur\brc\bce\be (.\b.) builtin uses the value of P\bPA\bAT\bTH\bH to
1393 find the directory containing the file supplied as an
1394 argument. This option is enabled by default.
1395 x\bxp\bpg\bg_\b_e\bec\bch\bho\bo
1396 If set, the e\bec\bch\bho\bo builtin expands backslash-escape
1397 sequences by default.
1398 s\bsu\bus\bsp\bpe\ben\bnd\bd [-\b-f\bf]
1399 Suspend the execution of this shell until it receives a S\bSI\bIG\bGC\bCO\bON\bNT\bT
1400 signal. A login shell cannot be suspended; the -\b-f\bf option can be
1401 used to override this and force the suspension. The return sta-
1402 tus is 0 unless the shell is a login shell and -\b-f\bf is not sup-
1403 plied, or if job control is not enabled.
1404 t\bte\bes\bst\bt _\be_\bx_\bp_\br
1405 [\b[ _\be_\bx_\bp_\br ]\b]
1406 Return a status of 0 or 1 depending on the evaluation of the
1407 conditional expression _\be_\bx_\bp_\br. Each operator and operand must be
1408 a separate argument. Expressions are composed of the primaries
1409 described above under C\bCO\bON\bND\bDI\bIT\bTI\bIO\bON\bNA\bAL\bL E\bEX\bXP\bPR\bRE\bES\bSS\bSI\bIO\bON\bNS\bS. t\bte\bes\bst\bt does not
1410 accept any options, nor does it accept and ignore an argument of
1411 -\b--\b- as signifying the end of options.
1412
1413 Expressions may be combined using the following operators,
1414 listed in decreasing order of precedence. The evaluation
1415 depends on the number of arguments; see below. Operator prece-
1416 dence is used when there are five or more arguments.
1417 !\b! _\be_\bx_\bp_\br True if _\be_\bx_\bp_\br is false.
1418 (\b( _\be_\bx_\bp_\br )\b)
1419 Returns the value of _\be_\bx_\bp_\br. This may be used to override
1420 the normal precedence of operators.
1421 _\be_\bx_\bp_\br_\b1 -a\ba _\be_\bx_\bp_\br_\b2
1422 True if both _\be_\bx_\bp_\br_\b1 and _\be_\bx_\bp_\br_\b2 are true.
1423 _\be_\bx_\bp_\br_\b1 -o\bo _\be_\bx_\bp_\br_\b2
1424 True if either _\be_\bx_\bp_\br_\b1 or _\be_\bx_\bp_\br_\b2 is true.
1425
1426 t\bte\bes\bst\bt and [\b[ evaluate conditional expressions using a set of rules
1427 based on the number of arguments.
1428
1429 0 arguments
1430 The expression is false.
1431 1 argument
1432 The expression is true if and only if the argument is not
1433 null.
1434 2 arguments
1435 If the first argument is !\b!, the expression is true if and
1436 only if the second argument is null. If the first argu-
1437 ment is one of the unary conditional operators listed
1438 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
1439 true if the unary test is true. If the first argument is
1440 not a valid unary conditional operator, the expression is
1441 false.
1442 3 arguments
1443 The following conditions are applied in the order listed.
1444 If the second argument is one of the binary conditional
1445 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
1446 result of the expression is the result of the binary test
1447 using the first and third arguments as operands. The -\b-a\ba
1448 and -\b-o\bo operators are considered binary operators when
1449 there are three arguments. If the first argument is !\b!,
1450 the value is the negation of the two-argument test using
1451 the second and third arguments. If the first argument is
1452 exactly (\b( and the third argument is exactly )\b), the result
1453 is the one-argument test of the second argument. Other-
1454 wise, the expression is false.
1455 4 arguments
1456 If the first argument is !\b!, the result is the negation of
1457 the three-argument expression composed of the remaining
1458 arguments. Otherwise, the expression is parsed and eval-
1459 uated according to precedence using the rules listed
1460 above.
1461 5 or more arguments
1462 The expression is parsed and evaluated according to
1463 precedence using the rules listed above.
1464
1465 When used with t\bte\bes\bst\bt or [\b[, the <\b< and >\b> operators sort lexico-
1466 graphically using ASCII ordering.
1467
1468 t\bti\bim\bme\bes\bs Print the accumulated user and system times for the shell and
1469 for processes run from the shell. The return status is 0.
1470
1471 t\btr\bra\bap\bp [-\b-l\blp\bp] [[_\ba_\br_\bg] _\bs_\bi_\bg_\bs_\bp_\be_\bc ...]
1472 The command _\ba_\br_\bg is to be read and executed when the shell
1473 receives signal(s) _\bs_\bi_\bg_\bs_\bp_\be_\bc. If _\ba_\br_\bg is absent (and there is a
1474 single _\bs_\bi_\bg_\bs_\bp_\be_\bc) or -\b-, each specified signal is reset to its
1475 original disposition (the value it had upon entrance to the
1476 shell). If _\ba_\br_\bg is the null string the signal specified by each
1477 _\bs_\bi_\bg_\bs_\bp_\be_\bc is ignored by the shell and by the commands it invokes.
1478 If _\ba_\br_\bg is not present and -\b-p\bp has been supplied, then the trap
1479 commands associated with each _\bs_\bi_\bg_\bs_\bp_\be_\bc are displayed. If no
1480 arguments are supplied or if only -\b-p\bp is given, t\btr\bra\bap\bp prints the
1481 list of commands associated with each signal. The -\b-l\bl option
1482 causes the shell to print a list of signal names and their cor-
1483 responding numbers. Each _\bs_\bi_\bg_\bs_\bp_\be_\bc is either a signal name
1484 defined in <_\bs_\bi_\bg_\bn_\ba_\bl_\b._\bh>, or a signal number. Signal names are
1485 case insensitive and the S\bSI\bIG\bG prefix is optional.
1486
1487 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
1488 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-
1489 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,
1490 _\bs_\be_\bl_\be_\bc_\bt command, every arithmetic _\bf_\bo_\br command, and before the
1491 first command executes in a shell function (see S\bSH\bHE\bEL\bLL\bL G\bGR\bRA\bAM\bMM\bMA\bAR\bR
1492 above). Refer to the description of the e\bex\bxt\btd\bde\beb\bbu\bug\bg option to the
1493 s\bsh\bho\bop\bpt\bt builtin for details of its effect on the D\bDE\bEB\bBU\bUG\bG trap. If a
1494 _\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
1495 function or a script executed with the .\b. or s\bso\bou\bur\brc\bce\be builtins fin-
1496 ishes executing.
1497
1498 If a _\bs_\bi_\bg_\bs_\bp_\be_\bc is E\bER\bRR\bR, the command _\ba_\br_\bg is executed whenever a sim-
1499 ple command has a non-zero exit status, subject to the following
1500 conditions. The E\bER\bRR\bR trap is not executed if the failed command
1501 is part of the command list immediately following a w\bwh\bhi\bil\ble\be or
1502 u\bun\bnt\bti\bil\bl keyword, part of the test in an _\bi_\bf statement, part of a
1503 command executed in a &\b&&\b& or |\b||\b| list, or if the command's return
1504 value is being inverted via !\b!. These are the same conditions
1505 obeyed by the e\ber\brr\bre\bex\bxi\bit\bt option.
1506
1507 Signals ignored upon entry to the shell cannot be trapped or
1508 reset. Trapped signals that are not being ignored are reset to
1509 their original values in a subshell or subshell environment when
1510 one is created. The return status is false if any _\bs_\bi_\bg_\bs_\bp_\be_\bc is
1511 invalid; otherwise t\btr\bra\bap\bp returns true.
1512
1513 t\bty\byp\bpe\be [-\b-a\baf\bft\btp\bpP\bP] _\bn_\ba_\bm_\be [_\bn_\ba_\bm_\be ...]
1514 With no options, indicate how each _\bn_\ba_\bm_\be would be interpreted if
1515 used as a command name. If the -\b-t\bt option is used, t\bty\byp\bpe\be prints a
1516 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
1517 _\bf_\bi_\bl_\be if _\bn_\ba_\bm_\be is an alias, shell reserved word, function,
1518 builtin, or disk file, respectively. If the _\bn_\ba_\bm_\be is not found,
1519 then nothing is printed, and an exit status of false is
1520 returned. If the -\b-p\bp option is used, t\bty\byp\bpe\be either returns the
1521 name of the disk file that would be executed if _\bn_\ba_\bm_\be were speci-
1522 fied as a command name, or nothing if ``type -t name'' would not
1523 return _\bf_\bi_\bl_\be. The -\b-P\bP option forces a P\bPA\bAT\bTH\bH search for each _\bn_\ba_\bm_\be,
1524 even if ``type -t name'' would not return _\bf_\bi_\bl_\be. If a command is
1525 hashed, -\b-p\bp and -\b-P\bP print the hashed value, not necessarily the
1526 file that appears first in P\bPA\bAT\bTH\bH. If the -\b-a\ba option is used, t\bty\byp\bpe\be
1527 prints all of the places that contain an executable named _\bn_\ba_\bm_\be.
1528 This includes aliases and functions, if and only if the -\b-p\bp
1529 option is not also used. The table of hashed commands is not
1530 consulted when using -\b-a\ba. The -\b-f\bf option suppresses shell func-
1531 tion lookup, as with the c\bco\bom\bmm\bma\ban\bnd\bd builtin. t\bty\byp\bpe\be returns true if
1532 all of the arguments are found, false if any are not found.
1533
1534 u\bul\bli\bim\bmi\bit\bt [-\b-H\bHS\bST\bTa\bab\bbc\bcd\bde\bef\bfi\bil\blm\bmn\bnp\bpq\bqr\brs\bst\btu\buv\bvx\bx [_\bl_\bi_\bm_\bi_\bt]]
1535 Provides control over the resources available to the shell and
1536 to processes started by it, on systems that allow such control.
1537 The -\b-H\bH and -\b-S\bS options specify that the hard or soft limit is set
1538 for the given resource. A hard limit cannot be increased by a
1539 non-root user once it is set; a soft limit may be increased up
1540 to the value of the hard limit. If neither -\b-H\bH nor -\b-S\bS is speci-
1541 fied, both the soft and hard limits are set. The value of _\bl_\bi_\bm_\bi_\bt
1542 can be a number in the unit specified for the resource or one of
1543 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
1544 current hard limit, the current soft limit, and no limit,
1545 respectively. If _\bl_\bi_\bm_\bi_\bt is omitted, the current value of the
1546 soft limit of the resource is printed, unless the -\b-H\bH option is
1547 given. When more than one resource is specified, the limit name
1548 and unit are printed before the value. Other options are inter-
1549 preted as follows:
1550 -\b-a\ba All current limits are reported
1551 -\b-b\bb The maximum socket buffer size
1552 -\b-c\bc The maximum size of core files created
1553 -\b-d\bd The maximum size of a process's data segment
1554 -\b-e\be The maximum scheduling priority ("nice")
1555 -\b-f\bf The maximum size of files written by the shell and its
1556 children
1557 -\b-i\bi The maximum number of pending signals
1558 -\b-l\bl The maximum size that may be locked into memory
1559 -\b-m\bm The maximum resident set size (many systems do not honor
1560 this limit)
1561 -\b-n\bn The maximum number of open file descriptors (most systems
1562 do not allow this value to be set)
1563 -\b-p\bp The pipe size in 512-byte blocks (this may not be set)
1564 -\b-q\bq The maximum number of bytes in POSIX message queues
1565 -\b-r\br The maximum real-time scheduling priority
1566 -\b-s\bs The maximum stack size
1567 -\b-t\bt The maximum amount of cpu time in seconds
1568 -\b-u\bu The maximum number of processes available to a single
1569 user
1570 -\b-v\bv The maximum amount of virtual memory available to the
1571 shell and, on some systems, to its children
1572 -\b-x\bx The maximum number of file locks
1573 -\b-T\bT The maximum number of threads
1574
1575 If _\bl_\bi_\bm_\bi_\bt is given, it is the new value of the specified resource
1576 (the -\b-a\ba option is display only). If no option is given, then -\b-f\bf
1577 is assumed. Values are in 1024-byte increments, except for -\b-t\bt,
1578 which is in seconds, -\b-p\bp, which is in units of 512-byte blocks,
1579 and -\b-T\bT, -\b-b\bb, -\b-n\bn, and -\b-u\bu, which are unscaled values. The return
1580 status is 0 unless an invalid option or argument is supplied, or
1581 an error occurs while setting a new limit.
1582
1583 u\bum\bma\bas\bsk\bk [-\b-p\bp] [-\b-S\bS] [_\bm_\bo_\bd_\be]
1584 The user file-creation mask is set to _\bm_\bo_\bd_\be. If _\bm_\bo_\bd_\be begins with
1585 a digit, it is interpreted as an octal number; otherwise it is
1586 interpreted as a symbolic mode mask similar to that accepted by
1587 _\bc_\bh_\bm_\bo_\bd(1). If _\bm_\bo_\bd_\be is omitted, the current value of the mask is
1588 printed. The -\b-S\bS option causes the mask to be printed in sym-
1589 bolic form; the default output is an octal number. If the -\b-p\bp
1590 option is supplied, and _\bm_\bo_\bd_\be is omitted, the output is in a form
1591 that may be reused as input. The return status is 0 if the mode
1592 was successfully changed or if no _\bm_\bo_\bd_\be argument was supplied,
1593 and false otherwise.
1594
1595 u\bun\bna\bal\bli\bia\bas\bs [-a\ba] [_\bn_\ba_\bm_\be ...]
1596 Remove each _\bn_\ba_\bm_\be from the list of defined aliases. If -\b-a\ba is
1597 supplied, all alias definitions are removed. The return value
1598 is true unless a supplied _\bn_\ba_\bm_\be is not a defined alias.
1599
1600 u\bun\bns\bse\bet\bt [-f\bfv\bv] [_\bn_\ba_\bm_\be ...]
1601 For each _\bn_\ba_\bm_\be, remove the corresponding variable or function.
1602 If no options are supplied, or the -\b-v\bv option is given, each _\bn_\ba_\bm_\be
1603 refers to a shell variable. Read-only variables may not be
1604 unset. If -\b-f\bf is specified, each _\bn_\ba_\bm_\be refers to a shell func-
1605 tion, and the function definition is removed. Each unset vari-
1606 able or function is removed from the environment passed to sub-
1607 sequent commands. If any of C\bCO\bOM\bMP\bP_\b_W\bWO\bOR\bRD\bDB\bBR\bRE\bEA\bAK\bKS\bS, R\bRA\bAN\bND\bDO\bOM\bM, S\bSE\bEC\bCO\bON\bND\bDS\bS,
1608 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 unset, they
1609 lose their special properties, even if they are subsequently
1610 reset. The exit status is true unless a _\bn_\ba_\bm_\be is readonly.
1611
1612 w\bwa\bai\bit\bt [_\bn _\b._\b._\b.]
1613 Wait for each specified process and return its termination sta-
1614 tus. Each _\bn may be a process ID or a job specification; if a
1615 job spec is given, all processes in that job's pipeline are
1616 waited for. If _\bn is not given, all currently active child pro-
1617 cesses are waited for, and the return status is zero. If _\bn
1618 specifies a non-existent process or job, the return status is
1619 127. Otherwise, the return status is the exit status of the
1620 last process or job waited for.
1621
1622 S\bSE\bEE\bE A\bAL\bLS\bSO\bO
1623 bash(1), sh(1)
1624
1625
1626
1627 GNU Bash-4.0 2004 Apr 20 BASH_BUILTINS(1)