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