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