6 bash - GNU Bourne-Again SHell
8 S
\bSY
\bYN
\bNO
\bOP
\bPS
\bSI
\bIS
\bS
9 b
\bba
\bas
\bsh
\bh [options] [file]
11 C
\bCO
\bOP
\bPY
\bYR
\bRI
\bIG
\bGH
\bHT
\bT
12 Bash is Copyright (C) 1989-2010 by the Free Software Foundation, Inc.
14 D
\bDE
\bES
\bSC
\bCR
\bRI
\bIP
\bPT
\bTI
\bIO
\bON
\bN
15 B
\bBa
\bas
\bsh
\bh is an s
\bsh
\bh-compatible command language interpreter that executes
16 commands read from the standard input or from a file. B
\bBa
\bas
\bsh
\bh also incor-
17 porates useful features from the _
\bK_
\bo_
\br_
\bn and _
\bC shells (k
\bks
\bsh
\bh and c
\bcs
\bsh
\bh).
19 B
\bBa
\bas
\bsh
\bh is intended to be a conformant implementation of the Shell and
20 Utilities portion of the IEEE POSIX specification (IEEE Standard
21 1003.1). B
\bBa
\bas
\bsh
\bh can be configured to be POSIX-conformant by default.
23 O
\bOP
\bPT
\bTI
\bIO
\bON
\bNS
\bS
24 All of the single-character shell options documented in the descrip-
25 tion of the s
\bse
\bet
\bt builtin command can be used as options when the shell
26 is invoked. In addition, b
\bba
\bas
\bsh
\bh interprets the following options when it
29 -
\b-c
\bc _
\bs_
\bt_
\br_
\bi_
\bn_
\bg If the -
\b-c
\bc option is present, then commands are read from
30 _
\bs_
\bt_
\br_
\bi_
\bn_
\bg. If there are arguments after the _
\bs_
\bt_
\br_
\bi_
\bn_
\bg, they are
31 assigned to the positional parameters, starting with $
\b$0
\b0.
32 -
\b-i
\bi If the -
\b-i
\bi option is present, the shell is _
\bi_
\bn_
\bt_
\be_
\br_
\ba_
\bc_
\bt_
\bi_
\bv_
\be.
33 -
\b-l
\bl Make b
\bba
\bas
\bsh
\bh act as if it had been invoked as a login shell (see
34 I
\bIN
\bNV
\bVO
\bOC
\bCA
\bAT
\bTI
\bIO
\bON
\bN below).
35 -
\b-r
\br If the -
\b-r
\br option is present, the shell becomes _
\br_
\be_
\bs_
\bt_
\br_
\bi_
\bc_
\bt_
\be_
\bd
36 (see R
\bRE
\bES
\bST
\bTR
\bRI
\bIC
\bCT
\bTE
\bED
\bD S
\bSH
\bHE
\bEL
\bLL
\bL below).
37 -
\b-s
\bs If the -
\b-s
\bs option is present, or if no arguments remain after
38 option processing, then commands are read from the standard
39 input. This option allows the positional parameters to be
40 set when invoking an interactive shell.
41 -
\b-D
\bD A list of all double-quoted strings preceded by $
\b$ is printed
42 on the standard output. These are the strings that are sub-
43 ject to language translation when the current locale is not C
\bC
44 or P
\bPO
\bOS
\bSI
\bIX
\bX. This implies the -
\b-n
\bn option; no commands will be
46 [
\b[-
\b-+
\b+]
\b]O
\bO [
\b[_
\bs_
\bh_
\bo_
\bp_
\bt_
\b__
\bo_
\bp_
\bt_
\bi_
\bo_
\bn]
\b]
47 _
\bs_
\bh_
\bo_
\bp_
\bt_
\b__
\bo_
\bp_
\bt_
\bi_
\bo_
\bn is one of the shell options accepted by the
48 s
\bsh
\bho
\bop
\bpt
\bt builtin (see S
\bSH
\bHE
\bEL
\bLL
\bL B
\bBU
\bUI
\bIL
\bLT
\bTI
\bIN
\bN C
\bCO
\bOM
\bMM
\bMA
\bAN
\bND
\bDS
\bS below). If
49 _
\bs_
\bh_
\bo_
\bp_
\bt_
\b__
\bo_
\bp_
\bt_
\bi_
\bo_
\bn is present, -
\b-O
\bO sets the value of that option; +
\b+O
\bO
50 unsets it. If _
\bs_
\bh_
\bo_
\bp_
\bt_
\b__
\bo_
\bp_
\bt_
\bi_
\bo_
\bn is not supplied, the names and
51 values of the shell options accepted by s
\bsh
\bho
\bop
\bpt
\bt are printed on
52 the standard output. If the invocation option is +
\b+O
\bO, the
53 output is displayed in a format that may be reused as input.
54 -
\b--
\b- A -
\b--
\b- signals the end of options and disables further option
55 processing. Any arguments after the -
\b--
\b- are treated as file-
56 names and arguments. An argument of -
\b- is equivalent to -
\b--
\b-.
58 B
\bBa
\bas
\bsh
\bh also interprets a number of multi-character options. These
59 options must appear on the command line before the single-character
60 options to be recognized.
62 -
\b--
\b-d
\bde
\beb
\bbu
\bug
\bgg
\bge
\ber
\br
63 Arrange for the debugger profile to be executed before the shell
64 starts. Turns on extended debugging mode (see the description
65 of the e
\bex
\bxt
\btd
\bde
\beb
\bbu
\bug
\bg option to the s
\bsh
\bho
\bop
\bpt
\bt builtin below).
66 -
\b--
\b-d
\bdu
\bum
\bmp
\bp-
\b-p
\bpo
\bo-
\b-s
\bst
\btr
\bri
\bin
\bng
\bgs
\bs
67 Equivalent to -
\b-D
\bD, but the output is in the GNU _
\bg_
\be_
\bt_
\bt_
\be_
\bx_
\bt p
\bpo
\bo (por-
68 table object) file format.
69 -
\b--
\b-d
\bdu
\bum
\bmp
\bp-
\b-s
\bst
\btr
\bri
\bin
\bng
\bgs
\bs
70 Equivalent to -
\b-D
\bD.
71 -
\b--
\b-h
\bhe
\bel
\blp
\bp Display a usage message on standard output and exit success-
73 -
\b--
\b-i
\bin
\bni
\bit
\bt-
\b-f
\bfi
\bil
\ble
\be _
\bf_
\bi_
\bl_
\be
74 -
\b--
\b-r
\brc
\bcf
\bfi
\bil
\ble
\be _
\bf_
\bi_
\bl_
\be
75 Execute commands from _
\bf_
\bi_
\bl_
\be instead of the standard personal ini-
76 tialization file _
\b~_
\b/_
\b._
\bb_
\ba_
\bs_
\bh_
\br_
\bc if the shell is interactive (see
77 I
\bIN
\bNV
\bVO
\bOC
\bCA
\bAT
\bTI
\bIO
\bON
\bN below).
79 -
\b--
\b-l
\blo
\bog
\bgi
\bin
\bn
80 Equivalent to -
\b-l
\bl.
82 -
\b--
\b-n
\bno
\boe
\bed
\bdi
\bit
\bti
\bin
\bng
\bg
83 Do not use the GNU r
\bre
\bea
\bad
\bdl
\bli
\bin
\bne
\be library to read command lines when
84 the shell is interactive.
86 -
\b--
\b-n
\bno
\bop
\bpr
\bro
\bof
\bfi
\bil
\ble
\be
87 Do not read either the system-wide startup file _
\b/_
\be_
\bt_
\bc_
\b/_
\bp_
\br_
\bo_
\bf_
\bi_
\bl_
\be or
88 any of the personal initialization files _
\b~_
\b/_
\b._
\bb_
\ba_
\bs_
\bh_
\b__
\bp_
\br_
\bo_
\bf_
\bi_
\bl_
\be,
89 _
\b~_
\b/_
\b._
\bb_
\ba_
\bs_
\bh_
\b__
\bl_
\bo_
\bg_
\bi_
\bn, or _
\b~_
\b/_
\b._
\bp_
\br_
\bo_
\bf_
\bi_
\bl_
\be. By default, b
\bba
\bas
\bsh
\bh reads these
90 files when it is invoked as a login shell (see I
\bIN
\bNV
\bVO
\bOC
\bCA
\bAT
\bTI
\bIO
\bON
\bN
93 -
\b--
\b-n
\bno
\bor
\brc
\bc Do not read and execute the personal initialization file
94 _
\b~_
\b/_
\b._
\bb_
\ba_
\bs_
\bh_
\br_
\bc if the shell is interactive. This option is on by
95 default if the shell is invoked as s
\bsh
\bh.
97 -
\b--
\b-p
\bpo
\bos
\bsi
\bix
\bx
98 Change the behavior of b
\bba
\bas
\bsh
\bh where the default operation differs
99 from the POSIX standard to match the standard (_
\bp_
\bo_
\bs_
\bi_
\bx _
\bm_
\bo_
\bd_
\be).
101 -
\b--
\b-r
\bre
\bes
\bst
\btr
\bri
\bic
\bct
\bte
\bed
\bd
102 The shell becomes restricted (see R
\bRE
\bES
\bST
\bTR
\bRI
\bIC
\bCT
\bTE
\bED
\bD S
\bSH
\bHE
\bEL
\bLL
\bL below).
104 -
\b--
\b-v
\bve
\ber
\brb
\bbo
\bos
\bse
\be
105 Equivalent to -
\b-v
\bv.
107 -
\b--
\b-v
\bve
\ber
\brs
\bsi
\bio
\bon
\bn
108 Show version information for this instance of b
\bba
\bas
\bsh
\bh on the stan-
109 dard output and exit successfully.
111 A
\bAR
\bRG
\bGU
\bUM
\bME
\bEN
\bNT
\bTS
\bS
112 If arguments remain after option processing, and neither the -
\b-c
\bc nor the
113 -
\b-s
\bs option has been supplied, the first argument is assumed to be the
114 name of a file containing shell commands. If b
\bba
\bas
\bsh
\bh is invoked in this
115 fashion, $
\b$0
\b0 is set to the name of the file, and the positional parame-
116 ters are set to the remaining arguments. B
\bBa
\bas
\bsh
\bh reads and executes com-
117 mands from this file, then exits. B
\bBa
\bas
\bsh
\bh's exit status is the exit sta-
118 tus of the last command executed in the script. If no commands are
119 executed, the exit status is 0. An attempt is first made to open the
120 file in the current directory, and, if no file is found, then the shell
121 searches the directories in P
\bPA
\bAT
\bTH
\bH for the script.
123 I
\bIN
\bNV
\bVO
\bOC
\bCA
\bAT
\bTI
\bIO
\bON
\bN
124 A _
\bl_
\bo_
\bg_
\bi_
\bn _
\bs_
\bh_
\be_
\bl_
\bl is one whose first character of argument zero is a -
\b-, or
125 one started with the -
\b--
\b-l
\blo
\bog
\bgi
\bin
\bn option.
127 An _
\bi_
\bn_
\bt_
\be_
\br_
\ba_
\bc_
\bt_
\bi_
\bv_
\be shell is one started without non-option arguments and
128 without the -
\b-c
\bc option whose standard input and error are both connected
129 to terminals (as determined by _
\bi_
\bs_
\ba_
\bt_
\bt_
\by(3)), or one started with the -
\b-i
\bi
130 option. P
\bPS
\bS1
\b1 is set and $
\b$-
\b- includes i
\bi if b
\bba
\bas
\bsh
\bh is interactive, allowing
131 a shell script or a startup file to test this state.
133 The following paragraphs describe how b
\bba
\bas
\bsh
\bh executes its startup files.
134 If any of the files exist but cannot be read, b
\bba
\bas
\bsh
\bh reports an error.
135 Tildes are expanded in file names as described below under T
\bTi
\bil
\bld
\bde
\be E
\bEx
\bxp
\bpa
\ban
\bn-
\b-
136 s
\bsi
\bio
\bon
\bn in the E
\bEX
\bXP
\bPA
\bAN
\bNS
\bSI
\bIO
\bON
\bN section.
138 When b
\bba
\bas
\bsh
\bh is invoked as an interactive login shell, or as a non-inter-
139 active shell with the -
\b--
\b-l
\blo
\bog
\bgi
\bin
\bn option, it first reads and executes com-
140 mands from the file _
\b/_
\be_
\bt_
\bc_
\b/_
\bp_
\br_
\bo_
\bf_
\bi_
\bl_
\be, if that file exists. After reading
141 that file, it looks for _
\b~_
\b/_
\b._
\bb_
\ba_
\bs_
\bh_
\b__
\bp_
\br_
\bo_
\bf_
\bi_
\bl_
\be, _
\b~_
\b/_
\b._
\bb_
\ba_
\bs_
\bh_
\b__
\bl_
\bo_
\bg_
\bi_
\bn, and _
\b~_
\b/_
\b._
\bp_
\br_
\bo_
\bf_
\bi_
\bl_
\be,
142 in that order, and reads and executes commands from the first one that
143 exists and is readable. The -
\b--
\b-n
\bno
\bop
\bpr
\bro
\bof
\bfi
\bil
\ble
\be option may be used when the
144 shell is started to inhibit this behavior.
146 When a login shell exits, b
\bba
\bas
\bsh
\bh reads and executes commands from the
147 file _
\b~_
\b/_
\b._
\bb_
\ba_
\bs_
\bh_
\b__
\bl_
\bo_
\bg_
\bo_
\bu_
\bt, if it exists.
149 When an interactive shell that is not a login shell is started, b
\bba
\bas
\bsh
\bh
150 reads and executes commands from _
\b~_
\b/_
\b._
\bb_
\ba_
\bs_
\bh_
\br_
\bc, if that file exists. This
151 may be inhibited by using the -
\b--
\b-n
\bno
\bor
\brc
\bc option. The -
\b--
\b-r
\brc
\bcf
\bfi
\bil
\ble
\be _
\bf_
\bi_
\bl_
\be option
152 will force b
\bba
\bas
\bsh
\bh to read and execute commands from _
\bf_
\bi_
\bl_
\be instead of
153 _
\b~_
\b/_
\b._
\bb_
\ba_
\bs_
\bh_
\br_
\bc.
155 When b
\bba
\bas
\bsh
\bh is started non-interactively, to run a shell script, for
156 example, it looks for the variable B
\bBA
\bAS
\bSH
\bH_
\b_E
\bEN
\bNV
\bV in the environment, expands
157 its value if it appears there, and uses the expanded value as the name
158 of a file to read and execute. B
\bBa
\bas
\bsh
\bh behaves as if the following com-
160 if [ -n "$BASH_ENV" ]; then . "$BASH_ENV"; fi
161 but the value of the P
\bPA
\bAT
\bTH
\bH variable is not used to search for the file
164 If b
\bba
\bas
\bsh
\bh is invoked with the name s
\bsh
\bh, it tries to mimic the startup
165 behavior of historical versions of s
\bsh
\bh as closely as possible, while
166 conforming to the POSIX standard as well. When invoked as an interac-
167 tive login shell, or a non-interactive shell with the -
\b--
\b-l
\blo
\bog
\bgi
\bin
\bn option,
168 it first attempts to read and execute commands from _
\b/_
\be_
\bt_
\bc_
\b/_
\bp_
\br_
\bo_
\bf_
\bi_
\bl_
\be and
169 _
\b~_
\b/_
\b._
\bp_
\br_
\bo_
\bf_
\bi_
\bl_
\be, in that order. The -
\b--
\b-n
\bno
\bop
\bpr
\bro
\bof
\bfi
\bil
\ble
\be option may be used to
170 inhibit this behavior. When invoked as an interactive shell with the
171 name s
\bsh
\bh, b
\bba
\bas
\bsh
\bh looks for the variable E
\bEN
\bNV
\bV, expands its value if it is
172 defined, and uses the expanded value as the name of a file to read and
173 execute. Since a shell invoked as s
\bsh
\bh does not attempt to read and exe-
174 cute commands from any other startup files, the -
\b--
\b-r
\brc
\bcf
\bfi
\bil
\ble
\be option has no
175 effect. A non-interactive shell invoked with the name s
\bsh
\bh does not
176 attempt to read any other startup files. When invoked as s
\bsh
\bh, b
\bba
\bas
\bsh
\bh
177 enters _
\bp_
\bo_
\bs_
\bi_
\bx mode after the startup files are read.
179 When b
\bba
\bas
\bsh
\bh is started in _
\bp_
\bo_
\bs_
\bi_
\bx mode, as with the -
\b--
\b-p
\bpo
\bos
\bsi
\bix
\bx command line
180 option, it follows the POSIX standard for startup files. In this mode,
181 interactive shells expand the E
\bEN
\bNV
\bV variable and commands are read and
182 executed from the file whose name is the expanded value. No other
183 startup files are read.
185 B
\bBa
\bas
\bsh
\bh attempts to determine when it is being run with its standard input
186 connected to a network connection, as when executed by the remote shell
187 daemon, usually _
\br_
\bs_
\bh_
\bd, or the secure shell daemon _
\bs_
\bs_
\bh_
\bd. If b
\bba
\bas
\bsh
\bh deter-
188 mines it is being run in this fashion, it reads and executes commands
189 from _
\b~_
\b/_
\b._
\bb_
\ba_
\bs_
\bh_
\br_
\bc, if that file exists and is readable. It will not do
190 this if invoked as s
\bsh
\bh. The -
\b--
\b-n
\bno
\bor
\brc
\bc option may be used to inhibit this
191 behavior, and the -
\b--
\b-r
\brc
\bcf
\bfi
\bil
\ble
\be option may be used to force another file to
192 be read, but _
\br_
\bs_
\bh_
\bd does not generally invoke the shell with those
193 options or allow them to be specified.
195 If the shell is started with the effective user (group) id not equal to
196 the real user (group) id, and the -
\b-p
\bp option is not supplied, no startup
197 files are read, shell functions are not inherited from the environment,
198 the S
\bSH
\bHE
\bEL
\bLL
\bLO
\bOP
\bPT
\bTS
\bS, B
\bBA
\bAS
\bSH
\bHO
\bOP
\bPT
\bTS
\bS, C
\bCD
\bDP
\bPA
\bAT
\bTH
\bH, and G
\bGL
\bLO
\bOB
\bBI
\bIG
\bGN
\bNO
\bOR
\bRE
\bE variables, if they
199 appear in the environment, are ignored, and the effective user id is
200 set to the real user id. If the -
\b-p
\bp option is supplied at invocation,
201 the startup behavior is the same, but the effective user id is not
204 D
\bDE
\bEF
\bFI
\bIN
\bNI
\bIT
\bTI
\bIO
\bON
\bNS
\bS
205 The following definitions are used throughout the rest of this docu-
207 b
\bbl
\bla
\ban
\bnk
\bk A space or tab.
208 w
\bwo
\bor
\brd
\bd A sequence of characters considered as a single unit by the
209 shell. Also known as a t
\bto
\bok
\bke
\ben
\bn.
210 n
\bna
\bam
\bme
\be A _
\bw_
\bo_
\br_
\bd consisting only of alphanumeric characters and under-
211 scores, and beginning with an alphabetic character or an under-
212 score. Also referred to as an i
\bid
\bde
\ben
\bnt
\bti
\bif
\bfi
\bie
\ber
\br.
213 m
\bme
\bet
\bta
\bac
\bch
\bha
\bar
\bra
\bac
\bct
\bte
\ber
\br
214 A character that, when unquoted, separates words. One of the
216 |
\b| &
\b& ;
\b; (
\b( )
\b) <
\b< >
\b> s
\bsp
\bpa
\bac
\bce
\be t
\bta
\bab
\bb
217 c
\bco
\bon
\bnt
\btr
\bro
\bol
\bl o
\bop
\bpe
\ber
\bra
\bat
\bto
\bor
\br
218 A _
\bt_
\bo_
\bk_
\be_
\bn that performs a control function. It is one of the fol-
220 |
\b||
\b| &
\b& &
\b&&
\b& ;
\b; ;
\b;;
\b; (
\b( )
\b) |
\b| |
\b|&
\b& <
\b<n
\bne
\bew
\bwl
\bli
\bin
\bne
\be>
\b>
222 R
\bRE
\bES
\bSE
\bER
\bRV
\bVE
\bED
\bD W
\bWO
\bOR
\bRD
\bDS
\bS
223 _
\bR_
\be_
\bs_
\be_
\br_
\bv_
\be_
\bd _
\bw_
\bo_
\br_
\bd_
\bs are words that have a special meaning to the shell. The
224 following words are recognized as reserved when unquoted and either the
225 first word of a simple command (see S
\bSH
\bHE
\bEL
\bLL
\bL G
\bGR
\bRA
\bAM
\bMM
\bMA
\bAR
\bR below) or the third
226 word of a c
\bca
\bas
\bse
\be or f
\bfo
\bor
\br command:
228 !
\b! c
\bca
\bas
\bse
\be d
\bdo
\bo d
\bdo
\bon
\bne
\be e
\bel
\bli
\bif
\bf e
\bel
\bls
\bse
\be e
\bes
\bsa
\bac
\bc f
\bfi
\bi f
\bfo
\bor
\br f
\bfu
\bun
\bnc
\bct
\bti
\bio
\bon
\bn i
\bif
\bf i
\bin
\bn s
\bse
\bel
\ble
\bec
\bct
\bt t
\bth
\bhe
\ben
\bn u
\bun
\bnt
\bti
\bil
\bl
229 w
\bwh
\bhi
\bil
\ble
\be {
\b{ }
\b} t
\bti
\bim
\bme
\be [
\b[[
\b[ ]
\b]]
\b]
231 S
\bSH
\bHE
\bEL
\bLL
\bL G
\bGR
\bRA
\bAM
\bMM
\bMA
\bAR
\bR
232 S
\bSi
\bim
\bmp
\bpl
\ble
\be C
\bCo
\bom
\bmm
\bma
\ban
\bnd
\bds
\bs
233 A _
\bs_
\bi_
\bm_
\bp_
\bl_
\be _
\bc_
\bo_
\bm_
\bm_
\ba_
\bn_
\bd is a sequence of optional variable assignments fol-
234 lowed by b
\bbl
\bla
\ban
\bnk
\bk-separated words and redirections, and terminated by a
235 _
\bc_
\bo_
\bn_
\bt_
\br_
\bo_
\bl _
\bo_
\bp_
\be_
\br_
\ba_
\bt_
\bo_
\br. The first word specifies the command to be executed,
236 and is passed as argument zero. The remaining words are passed as
237 arguments to the invoked command.
239 The return value of a _
\bs_
\bi_
\bm_
\bp_
\bl_
\be _
\bc_
\bo_
\bm_
\bm_
\ba_
\bn_
\bd is its exit status, or 128+_
\bn if
240 the command is terminated by signal _
\bn.
242 P
\bPi
\bip
\bpe
\bel
\bli
\bin
\bne
\bes
\bs
243 A _
\bp_
\bi_
\bp_
\be_
\bl_
\bi_
\bn_
\be is a sequence of one or more commands separated by one of
244 the control operators |
\b| or |
\b|&
\b&. The format for a pipeline is:
246 [t
\bti
\bim
\bme
\be [-
\b-p
\bp]] [ ! ] _
\bc_
\bo_
\bm_
\bm_
\ba_
\bn_
\bd [ [|
\b|||
\b|&
\b&] _
\bc_
\bo_
\bm_
\bm_
\ba_
\bn_
\bd_
\b2 ... ]
248 The standard output of _
\bc_
\bo_
\bm_
\bm_
\ba_
\bn_
\bd is connected via a pipe to the standard
249 input of _
\bc_
\bo_
\bm_
\bm_
\ba_
\bn_
\bd_
\b2. This connection is performed before any redirec-
250 tions specified by the command (see R
\bRE
\bED
\bDI
\bIR
\bRE
\bEC
\bCT
\bTI
\bIO
\bON
\bN below). If |
\b|&
\b& is used,
251 the standard error of _
\bc_
\bo_
\bm_
\bm_
\ba_
\bn_
\bd is connected to _
\bc_
\bo_
\bm_
\bm_
\ba_
\bn_
\bd_
\b2's standard input
252 through the pipe; it is shorthand for 2
\b2>
\b>&
\b&1
\b1 |
\b|. This implicit redirect-
253 ion of the standard error is performed after any redirections specified
256 The return status of a pipeline is the exit status of the last command,
257 unless the p
\bpi
\bip
\bpe
\bef
\bfa
\bai
\bil
\bl option is enabled. If p
\bpi
\bip
\bpe
\bef
\bfa
\bai
\bil
\bl is enabled, the
258 pipeline's return status is the value of the last (rightmost) command
259 to exit with a non-zero status, or zero if all commands exit success-
260 fully. If the reserved word !
\b! precedes a pipeline, the exit status of
261 that pipeline is the logical negation of the exit status as described
262 above. The shell waits for all commands in the pipeline to terminate
263 before returning a value.
265 If the t
\bti
\bim
\bme
\be reserved word precedes a pipeline, the elapsed as well as
266 user and system time consumed by its execution are reported when the
267 pipeline terminates. The -
\b-p
\bp option changes the output format to that
268 specified by POSIX. When the shell is in _
\bp_
\bo_
\bs_
\bi_
\bx _
\bm_
\bo_
\bd_
\be, it does not rec-
269 ognize t
\bti
\bim
\bme
\be as a reserved word if the next token begins with a `-'.
270 The T
\bTI
\bIM
\bME
\bEF
\bFO
\bOR
\bRM
\bMA
\bAT
\bT variable may be set to a format string that specifies
271 how the timing information should be displayed; see the description of
272 T
\bTI
\bIM
\bME
\bEF
\bFO
\bOR
\bRM
\bMA
\bAT
\bT under S
\bSh
\bhe
\bel
\bll
\bl V
\bVa
\bar
\bri
\bia
\bab
\bbl
\ble
\bes
\bs below.
274 When the shell is in _
\bp_
\bo_
\bs_
\bi_
\bx _
\bm_
\bo_
\bd_
\be, t
\bti
\bim
\bme
\be may be followed by a newline. In
275 this case, the shell displays the total user and system time consumed
276 by the shell and its children. The T
\bTI
\bIM
\bME
\bEF
\bFO
\bOR
\bRM
\bMA
\bAT
\bT variable may be used to
277 specify the format of the time information.
279 Each command in a pipeline is executed as a separate process (i.e., in
283 A _
\bl_
\bi_
\bs_
\bt is a sequence of one or more pipelines separated by one of the
284 operators ;
\b;, &
\b&, &
\b&&
\b&, or |
\b||
\b|, and optionally terminated by one of ;
\b;, &
\b&, or
285 <
\b<n
\bne
\bew
\bwl
\bli
\bin
\bne
\be>
\b>.
287 Of these list operators, &
\b&&
\b& and |
\b||
\b| have equal precedence, followed by ;
\b;
288 and &
\b&, which have equal precedence.
290 A sequence of one or more newlines may appear in a _
\bl_
\bi_
\bs_
\bt instead of a
291 semicolon to delimit commands.
293 If a command is terminated by the control operator &
\b&, the shell exe-
294 cutes the command in the _
\bb_
\ba_
\bc_
\bk_
\bg_
\br_
\bo_
\bu_
\bn_
\bd in a subshell. The shell does not
295 wait for the command to finish, and the return status is 0. Commands
296 separated by a ;
\b; are executed sequentially; the shell waits for each
297 command to terminate in turn. The return status is the exit status of
298 the last command executed.
300 AND and OR lists are sequences of one of more pipelines separated by
301 the &
\b&&
\b& and |
\b||
\b| control operators, respectively. AND and OR lists are
302 executed with left associativity. An AND list has the form
304 _
\bc_
\bo_
\bm_
\bm_
\ba_
\bn_
\bd_
\b1 &
\b&&
\b& _
\bc_
\bo_
\bm_
\bm_
\ba_
\bn_
\bd_
\b2
306 _
\bc_
\bo_
\bm_
\bm_
\ba_
\bn_
\bd_
\b2 is executed if, and only if, _
\bc_
\bo_
\bm_
\bm_
\ba_
\bn_
\bd_
\b1 returns an exit status
309 An OR list has the form
311 _
\bc_
\bo_
\bm_
\bm_
\ba_
\bn_
\bd_
\b1 |
\b||
\b| _
\bc_
\bo_
\bm_
\bm_
\ba_
\bn_
\bd_
\b2
314 _
\bc_
\bo_
\bm_
\bm_
\ba_
\bn_
\bd_
\b2 is executed if and only if _
\bc_
\bo_
\bm_
\bm_
\ba_
\bn_
\bd_
\b1 returns a non-zero exit
315 status. The return status of AND and OR lists is the exit status of
316 the last command executed in the list.
318 C
\bCo
\bom
\bmp
\bpo
\bou
\bun
\bnd
\bd C
\bCo
\bom
\bmm
\bma
\ban
\bnd
\bds
\bs
319 A _
\bc_
\bo_
\bm_
\bp_
\bo_
\bu_
\bn_
\bd _
\bc_
\bo_
\bm_
\bm_
\ba_
\bn_
\bd is one of the following:
321 (_
\bl_
\bi_
\bs_
\bt) _
\bl_
\bi_
\bs_
\bt is executed in a subshell environment (see C
\bCO
\bOM
\bMM
\bMA
\bAN
\bND
\bD E
\bEX
\bXE
\bEC
\bCU
\bU-
\b-
322 T
\bTI
\bIO
\bON
\bN E
\bEN
\bNV
\bVI
\bIR
\bRO
\bON
\bNM
\bME
\bEN
\bNT
\bT below). Variable assignments and builtin com-
323 mands that affect the shell's environment do not remain in
324 effect after the command completes. The return status is the
325 exit status of _
\bl_
\bi_
\bs_
\bt.
327 { _
\bl_
\bi_
\bs_
\bt; }
328 _
\bl_
\bi_
\bs_
\bt is simply executed in the current shell environment. _
\bl_
\bi_
\bs_
\bt
329 must be terminated with a newline or semicolon. This is known
330 as a _
\bg_
\br_
\bo_
\bu_
\bp _
\bc_
\bo_
\bm_
\bm_
\ba_
\bn_
\bd. The return status is the exit status of
331 _
\bl_
\bi_
\bs_
\bt. Note that unlike the metacharacters (
\b( and )
\b), {
\b{ and }
\b} are
332 _
\br_
\be_
\bs_
\be_
\br_
\bv_
\be_
\bd _
\bw_
\bo_
\br_
\bd_
\bs and must occur where a reserved word is permitted
333 to be recognized. Since they do not cause a word break, they
334 must be separated from _
\bl_
\bi_
\bs_
\bt by whitespace or another shell
337 ((_
\be_
\bx_
\bp_
\br_
\be_
\bs_
\bs_
\bi_
\bo_
\bn))
338 The _
\be_
\bx_
\bp_
\br_
\be_
\bs_
\bs_
\bi_
\bo_
\bn is evaluated according to the rules described
339 below under A
\bAR
\bRI
\bIT
\bTH
\bHM
\bME
\bET
\bTI
\bIC
\bC E
\bEV
\bVA
\bAL
\bLU
\bUA
\bAT
\bTI
\bIO
\bON
\bN. If the value of the expres-
340 sion is non-zero, the return status is 0; otherwise the return
341 status is 1. This is exactly equivalent to l
\ble
\bet
\bt "
\b"_
\be_
\bx_
\bp_
\br_
\be_
\bs_
\bs_
\bi_
\bo_
\bn"
\b".
343 [
\b[[
\b[ _
\be_
\bx_
\bp_
\br_
\be_
\bs_
\bs_
\bi_
\bo_
\bn ]
\b]]
\b]
344 Return a status of 0 or 1 depending on the evaluation of the
345 conditional expression _
\be_
\bx_
\bp_
\br_
\be_
\bs_
\bs_
\bi_
\bo_
\bn. Expressions are composed of
346 the primaries described below under C
\bCO
\bON
\bND
\bDI
\bIT
\bTI
\bIO
\bON
\bNA
\bAL
\bL E
\bEX
\bXP
\bPR
\bRE
\bES
\bSS
\bSI
\bIO
\bON
\bNS
\bS.
347 Word splitting and pathname expansion are not performed on the
348 words between the [
\b[[
\b[ and ]
\b]]
\b]; tilde expansion, parameter and
349 variable expansion, arithmetic expansion, command substitution,
350 process substitution, and quote removal are performed. Condi-
351 tional operators such as -
\b-f
\bf must be unquoted to be recognized as
354 When used with [
\b[[
\b[, the <
\b< and >
\b> operators sort lexicographically
355 using the current locale.
357 When the =
\b==
\b= and !
\b!=
\b= operators are used, the string to the right
358 of the operator is considered a pattern and matched according to
359 the rules described below under P
\bPa
\bat
\btt
\bte
\ber
\brn
\bn M
\bMa
\bat
\btc
\bch
\bhi
\bin
\bng
\bg. If the shell
360 option n
\bno
\boc
\bca
\bas
\bse
\bem
\bma
\bat
\btc
\bch
\bh is enabled, the match is performed without
361 regard to the case of alphabetic characters. The return value
362 is 0 if the string matches (=
\b==
\b=) or does not match (!
\b!=
\b=) the pat-
363 tern, and 1 otherwise. Any part of the pattern may be quoted to
364 force it to be matched as a string.
366 An additional binary operator, =
\b=~
\b~, is available, with the same
367 precedence as =
\b==
\b= and !
\b!=
\b=. When it is used, the string to the
368 right of the operator is considered an extended regular expres-
369 sion and matched accordingly (as in _
\br_
\be_
\bg_
\be_
\bx(3)). The return value
370 is 0 if the string matches the pattern, and 1 otherwise. If the
371 regular expression is syntactically incorrect, the conditional
372 expression's return value is 2. If the shell option n
\bno
\boc
\bca
\bas
\bse
\bem
\bma
\bat
\btc
\bch
\bh
373 is enabled, the match is performed without regard to the case of
374 alphabetic characters. Any part of the pattern may be quoted to
375 force it to be matched as a string. Substrings matched by
376 parenthesized subexpressions within the regular expression are
377 saved in the array variable B
\bBA
\bAS
\bSH
\bH_
\b_R
\bRE
\bEM
\bMA
\bAT
\bTC
\bCH
\bH. The element of
378 B
\bBA
\bAS
\bSH
\bH_
\b_R
\bRE
\bEM
\bMA
\bAT
\bTC
\bCH
\bH with index 0 is the portion of the string matching
379 the entire regular expression. The element of B
\bBA
\bAS
\bSH
\bH_
\b_R
\bRE
\bEM
\bMA
\bAT
\bTC
\bCH
\bH with
380 index _
\bn is the portion of the string matching the _
\bnth parenthe-
383 Expressions may be combined using the following operators,
384 listed in decreasing order of precedence:
386 (
\b( _
\be_
\bx_
\bp_
\br_
\be_
\bs_
\bs_
\bi_
\bo_
\bn )
\b)
387 Returns the value of _
\be_
\bx_
\bp_
\br_
\be_
\bs_
\bs_
\bi_
\bo_
\bn. This may be used to
388 override the normal precedence of operators.
389 !
\b! _
\be_
\bx_
\bp_
\br_
\be_
\bs_
\bs_
\bi_
\bo_
\bn
390 True if _
\be_
\bx_
\bp_
\br_
\be_
\bs_
\bs_
\bi_
\bo_
\bn is false.
391 _
\be_
\bx_
\bp_
\br_
\be_
\bs_
\bs_
\bi_
\bo_
\bn_
\b1 &
\b&&
\b& _
\be_
\bx_
\bp_
\br_
\be_
\bs_
\bs_
\bi_
\bo_
\bn_
\b2
392 True if both _
\be_
\bx_
\bp_
\br_
\be_
\bs_
\bs_
\bi_
\bo_
\bn_
\b1 and _
\be_
\bx_
\bp_
\br_
\be_
\bs_
\bs_
\bi_
\bo_
\bn_
\b2 are true.
393 _
\be_
\bx_
\bp_
\br_
\be_
\bs_
\bs_
\bi_
\bo_
\bn_
\b1 |
\b||
\b| _
\be_
\bx_
\bp_
\br_
\be_
\bs_
\bs_
\bi_
\bo_
\bn_
\b2
394 True if either _
\be_
\bx_
\bp_
\br_
\be_
\bs_
\bs_
\bi_
\bo_
\bn_
\b1 or _
\be_
\bx_
\bp_
\br_
\be_
\bs_
\bs_
\bi_
\bo_
\bn_
\b2 is true.
396 The &
\b&&
\b& and |
\b||
\b| operators do not evaluate _
\be_
\bx_
\bp_
\br_
\be_
\bs_
\bs_
\bi_
\bo_
\bn_
\b2 if the value
397 of _
\be_
\bx_
\bp_
\br_
\be_
\bs_
\bs_
\bi_
\bo_
\bn_
\b1 is sufficient to determine the return value of
398 the entire conditional expression.
400 f
\bfo
\bor
\br _
\bn_
\ba_
\bm_
\be [ [ i
\bin
\bn [ _
\bw_
\bo_
\br_
\bd _
\b._
\b._
\b. ] ] ; ] d
\bdo
\bo _
\bl_
\bi_
\bs_
\bt ; d
\bdo
\bon
\bne
\be
401 The list of words following i
\bin
\bn is expanded, generating a list of
402 items. The variable _
\bn_
\ba_
\bm_
\be is set to each element of this list in
403 turn, and _
\bl_
\bi_
\bs_
\bt is executed each time. If the i
\bin
\bn _
\bw_
\bo_
\br_
\bd is omit-
404 ted, the f
\bfo
\bor
\br command executes _
\bl_
\bi_
\bs_
\bt once for each positional
405 parameter that is set (see P
\bPA
\bAR
\bRA
\bAM
\bME
\bET
\bTE
\bER
\bRS
\bS below). The return status
406 is the exit status of the last command that executes. If the
407 expansion of the items following i
\bin
\bn results in an empty list, no
408 commands are executed, and the return status is 0.
410 f
\bfo
\bor
\br (( _
\be_
\bx_
\bp_
\br_
\b1 ; _
\be_
\bx_
\bp_
\br_
\b2 ; _
\be_
\bx_
\bp_
\br_
\b3 )) ; d
\bdo
\bo _
\bl_
\bi_
\bs_
\bt ; d
\bdo
\bon
\bne
\be
411 First, the arithmetic expression _
\be_
\bx_
\bp_
\br_
\b1 is evaluated according to
412 the rules described below under A
\bAR
\bRI
\bIT
\bTH
\bHM
\bME
\bET
\bTI
\bIC
\bC E
\bEV
\bVA
\bAL
\bLU
\bUA
\bAT
\bTI
\bIO
\bON
\bN. The
413 arithmetic expression _
\be_
\bx_
\bp_
\br_
\b2 is then evaluated repeatedly until
414 it evaluates to zero. Each time _
\be_
\bx_
\bp_
\br_
\b2 evaluates to a non-zero
415 value, _
\bl_
\bi_
\bs_
\bt is executed and the arithmetic expression _
\be_
\bx_
\bp_
\br_
\b3 is
416 evaluated. If any expression is omitted, it behaves as if it
417 evaluates to 1. The return value is the exit status of the last
418 command in _
\bl_
\bi_
\bs_
\bt that is executed, or false if any of the expres-
421 s
\bse
\bel
\ble
\bec
\bct
\bt _
\bn_
\ba_
\bm_
\be [ i
\bin
\bn _
\bw_
\bo_
\br_
\bd ] ; d
\bdo
\bo _
\bl_
\bi_
\bs_
\bt ; d
\bdo
\bon
\bne
\be
422 The list of words following i
\bin
\bn is expanded, generating a list of
423 items. The set of expanded words is printed on the standard
424 error, each preceded by a number. If the i
\bin
\bn _
\bw_
\bo_
\br_
\bd is omitted,
425 the positional parameters are printed (see P
\bPA
\bAR
\bRA
\bAM
\bME
\bET
\bTE
\bER
\bRS
\bS below).
426 The P
\bPS
\bS3
\b3 prompt is then displayed and a line read from the stan-
427 dard input. If the line consists of a number corresponding to
428 one of the displayed words, then the value of _
\bn_
\ba_
\bm_
\be is set to
429 that word. If the line is empty, the words and prompt are dis-
430 played again. If EOF is read, the command completes. Any other
431 value read causes _
\bn_
\ba_
\bm_
\be to be set to null. The line read is
432 saved in the variable R
\bRE
\bEP
\bPL
\bLY
\bY. The _
\bl_
\bi_
\bs_
\bt is executed after each
433 selection until a b
\bbr
\bre
\bea
\bak
\bk command is executed. The exit status of
434 s
\bse
\bel
\ble
\bec
\bct
\bt is the exit status of the last command executed in _
\bl_
\bi_
\bs_
\bt,
435 or zero if no commands were executed.
437 c
\bca
\bas
\bse
\be _
\bw_
\bo_
\br_
\bd i
\bin
\bn [ [(] _
\bp_
\ba_
\bt_
\bt_
\be_
\br_
\bn [ |
\b| _
\bp_
\ba_
\bt_
\bt_
\be_
\br_
\bn ] ... ) _
\bl_
\bi_
\bs_
\bt ;; ] ... e
\bes
\bsa
\bac
\bc
438 A c
\bca
\bas
\bse
\be command first expands _
\bw_
\bo_
\br_
\bd, and tries to match it against
439 each _
\bp_
\ba_
\bt_
\bt_
\be_
\br_
\bn in turn, using the same matching rules as for path-
440 name expansion (see P
\bPa
\bat
\bth
\bhn
\bna
\bam
\bme
\be E
\bEx
\bxp
\bpa
\ban
\bns
\bsi
\bio
\bon
\bn below). The _
\bw_
\bo_
\br_
\bd is
441 expanded using tilde expansion, parameter and variable expan-
442 sion, arithmetic substitution, command substitution, process
443 substitution and quote removal. Each _
\bp_
\ba_
\bt_
\bt_
\be_
\br_
\bn examined is
444 expanded using tilde expansion, parameter and variable expan-
445 sion, arithmetic substitution, command substitution, and process
446 substitution. If the shell option n
\bno
\boc
\bca
\bas
\bse
\bem
\bma
\bat
\btc
\bch
\bh is enabled, the
447 match is performed without regard to the case of alphabetic
448 characters. When a match is found, the corresponding _
\bl_
\bi_
\bs_
\bt is
449 executed. If the ;
\b;;
\b; operator is used, no subsequent matches are
450 attempted after the first pattern match. Using ;
\b;&
\b& in place of
451 ;
\b;;
\b; causes execution to continue with the _
\bl_
\bi_
\bs_
\bt associated with
452 the next set of patterns. Using ;
\b;;
\b;&
\b& in place of ;
\b;;
\b; causes the
453 shell to test the next pattern list in the statement, if any,
454 and execute any associated _
\bl_
\bi_
\bs_
\bt on a successful match. The exit
455 status is zero if no pattern matches. Otherwise, it is the exit
456 status of the last command executed in _
\bl_
\bi_
\bs_
\bt.
458 i
\bif
\bf _
\bl_
\bi_
\bs_
\bt; t
\bth
\bhe
\ben
\bn _
\bl_
\bi_
\bs_
\bt_
\b; [ e
\bel
\bli
\bif
\bf _
\bl_
\bi_
\bs_
\bt; t
\bth
\bhe
\ben
\bn _
\bl_
\bi_
\bs_
\bt; ] ... [ e
\bel
\bls
\bse
\be _
\bl_
\bi_
\bs_
\bt; ] f
\bfi
\bi
459 The i
\bif
\bf _
\bl_
\bi_
\bs_
\bt is executed. If its exit status is zero, the t
\bth
\bhe
\ben
\bn
460 _
\bl_
\bi_
\bs_
\bt is executed. Otherwise, each e
\bel
\bli
\bif
\bf _
\bl_
\bi_
\bs_
\bt is executed in
461 turn, and if its exit status is zero, the corresponding t
\bth
\bhe
\ben
\bn
462 _
\bl_
\bi_
\bs_
\bt is executed and the command completes. Otherwise, the e
\bel
\bls
\bse
\be
463 _
\bl_
\bi_
\bs_
\bt is executed, if present. The exit status is the exit sta-
464 tus of the last command executed, or zero if no condition tested
467 w
\bwh
\bhi
\bil
\ble
\be _
\bl_
\bi_
\bs_
\bt_
\b-_
\b1; d
\bdo
\bo _
\bl_
\bi_
\bs_
\bt_
\b-_
\b2; d
\bdo
\bon
\bne
\be
468 u
\bun
\bnt
\bti
\bil
\bl _
\bl_
\bi_
\bs_
\bt_
\b-_
\b1; d
\bdo
\bo _
\bl_
\bi_
\bs_
\bt_
\b-_
\b2; d
\bdo
\bon
\bne
\be
469 The w
\bwh
\bhi
\bil
\ble
\be command continuously executes the list _
\bl_
\bi_
\bs_
\bt_
\b-_
\b2 as long
470 as the last command in the list _
\bl_
\bi_
\bs_
\bt_
\b-_
\b1 returns an exit status of
471 zero. The u
\bun
\bnt
\bti
\bil
\bl command is identical to the w
\bwh
\bhi
\bil
\ble
\be command,
472 except that the test is negated; _
\bl_
\bi_
\bs_
\bt_
\b-_
\b2 is executed as long as
473 the last command in _
\bl_
\bi_
\bs_
\bt_
\b-_
\b1 returns a non-zero exit status. The
474 exit status of the w
\bwh
\bhi
\bil
\ble
\be and u
\bun
\bnt
\bti
\bil
\bl commands is the exit status
475 of the last command executed in _
\bl_
\bi_
\bs_
\bt_
\b-_
\b2, or zero if none was exe-
478 C
\bCo
\bop
\bpr
\bro
\boc
\bce
\bes
\bss
\bse
\bes
\bs
479 A _
\bc_
\bo_
\bp_
\br_
\bo_
\bc_
\be_
\bs_
\bs is a shell command preceded by the c
\bco
\bop
\bpr
\bro
\boc
\bc reserved word. A
480 coprocess is executed asynchronously in a subshell, as if the command
481 had been terminated with the &
\b& control operator, with a two-way pipe
482 established between the executing shell and the coprocess.
484 The format for a coprocess is:
486 c
\bco
\bop
\bpr
\bro
\boc
\bc [_
\bN_
\bA_
\bM_
\bE] _
\bc_
\bo_
\bm_
\bm_
\ba_
\bn_
\bd [_
\br_
\be_
\bd_
\bi_
\br_
\be_
\bc_
\bt_
\bi_
\bo_
\bn_
\bs]
488 This creates a coprocess named _
\bN_
\bA_
\bM_
\bE. If _
\bN_
\bA_
\bM_
\bE is not supplied, the
489 default name is _
\bC_
\bO_
\bP_
\bR_
\bO_
\bC. _
\bN_
\bA_
\bM_
\bE must not be supplied if _
\bc_
\bo_
\bm_
\bm_
\ba_
\bn_
\bd is a _
\bs_
\bi_
\bm_
\b-
490 _
\bp_
\bl_
\be _
\bc_
\bo_
\bm_
\bm_
\ba_
\bn_
\bd (see above); otherwise, it is interpreted as the first word
491 of the simple command. When the coproc is executed, the shell creates
492 an array variable (see A
\bAr
\brr
\bra
\bay
\bys
\bs below) named _
\bN_
\bA_
\bM_
\bE in the context of the
493 executing shell. The standard output of _
\bc_
\bo_
\bm_
\bm_
\ba_
\bn_
\bd is connected via a
494 pipe to a file descriptor in the executing shell, and that file
495 descriptor is assigned to _
\bN_
\bA_
\bM_
\bE[0]. The standard input of _
\bc_
\bo_
\bm_
\bm_
\ba_
\bn_
\bd is
496 connected via a pipe to a file descriptor in the executing shell, and
497 that file descriptor is assigned to _
\bN_
\bA_
\bM_
\bE[1]. This pipe is established
498 before any redirections specified by the command (see R
\bRE
\bED
\bDI
\bIR
\bRE
\bEC
\bCT
\bTI
\bIO
\bON
\bN
499 below). The file descriptors can be utilized as arguments to shell
500 commands and redirections using standard word expansions. The process
501 ID of the shell spawned to execute the coprocess is available as the
502 value of the variable _
\bN_
\bA_
\bM_
\bE_PID. The w
\bwa
\bai
\bit
\bt builtin command may be used
503 to wait for the coprocess to terminate.
505 The return status of a coprocess is the exit status of _
\bc_
\bo_
\bm_
\bm_
\ba_
\bn_
\bd.
507 S
\bSh
\bhe
\bel
\bll
\bl F
\bFu
\bun
\bnc
\bct
\bti
\bio
\bon
\bn D
\bDe
\bef
\bfi
\bin
\bni
\bit
\bti
\bio
\bon
\bns
\bs
508 A shell function is an object that is called like a simple command and
509 executes a compound command with a new set of positional parameters.
510 Shell functions are declared as follows:
512 _
\bn_
\ba_
\bm_
\be () _
\bc_
\bo_
\bm_
\bp_
\bo_
\bu_
\bn_
\bd_
\b-_
\bc_
\bo_
\bm_
\bm_
\ba_
\bn_
\bd [_
\br_
\be_
\bd_
\bi_
\br_
\be_
\bc_
\bt_
\bi_
\bo_
\bn]
513 f
\bfu
\bun
\bnc
\bct
\bti
\bio
\bon
\bn _
\bn_
\ba_
\bm_
\be [()] _
\bc_
\bo_
\bm_
\bp_
\bo_
\bu_
\bn_
\bd_
\b-_
\bc_
\bo_
\bm_
\bm_
\ba_
\bn_
\bd [_
\br_
\be_
\bd_
\bi_
\br_
\be_
\bc_
\bt_
\bi_
\bo_
\bn]
514 This defines a function named _
\bn_
\ba_
\bm_
\be. The reserved word f
\bfu
\bun
\bnc
\bct
\bti
\bio
\bon
\bn
515 is optional. If the f
\bfu
\bun
\bnc
\bct
\bti
\bio
\bon
\bn reserved word is supplied, the
516 parentheses are optional. The _
\bb_
\bo_
\bd_
\by of the function is the com-
517 pound command _
\bc_
\bo_
\bm_
\bp_
\bo_
\bu_
\bn_
\bd_
\b-_
\bc_
\bo_
\bm_
\bm_
\ba_
\bn_
\bd (see C
\bCo
\bom
\bmp
\bpo
\bou
\bun
\bnd
\bd C
\bCo
\bom
\bmm
\bma
\ban
\bnd
\bds
\bs above).
518 That command is usually a _
\bl_
\bi_
\bs_
\bt of commands between { and }, but
519 may be any command listed under C
\bCo
\bom
\bmp
\bpo
\bou
\bun
\bnd
\bd C
\bCo
\bom
\bmm
\bma
\ban
\bnd
\bds
\bs above. _
\bc_
\bo_
\bm_
\b-
520 _
\bp_
\bo_
\bu_
\bn_
\bd_
\b-_
\bc_
\bo_
\bm_
\bm_
\ba_
\bn_
\bd is executed whenever _
\bn_
\ba_
\bm_
\be is specified as the name
521 of a simple command. Any redirections (see R
\bRE
\bED
\bDI
\bIR
\bRE
\bEC
\bCT
\bTI
\bIO
\bON
\bN below)
522 specified when a function is defined are performed when the
523 function is executed. The exit status of a function definition
524 is zero unless a syntax error occurs or a readonly function with
525 the same name already exists. When executed, the exit status of
526 a function is the exit status of the last command executed in
527 the body. (See F
\bFU
\bUN
\bNC
\bCT
\bTI
\bIO
\bON
\bNS
\bS below.)
529 C
\bCO
\bOM
\bMM
\bME
\bEN
\bNT
\bTS
\bS
530 In a non-interactive shell, or an interactive shell in which the i
\bin
\bnt
\bte
\ber
\br-
\b-
531 a
\bac
\bct
\bti
\biv
\bve
\be_
\b_c
\bco
\bom
\bmm
\bme
\ben
\bnt
\bts
\bs option to the s
\bsh
\bho
\bop
\bpt
\bt builtin is enabled (see S
\bSH
\bHE
\bEL
\bLL
\bL
532 B
\bBU
\bUI
\bIL
\bLT
\bTI
\bIN
\bN C
\bCO
\bOM
\bMM
\bMA
\bAN
\bND
\bDS
\bS below), a word beginning with #
\b# causes that word and
533 all remaining characters on that line to be ignored. An interactive
534 shell without the i
\bin
\bnt
\bte
\ber
\bra
\bac
\bct
\bti
\biv
\bve
\be_
\b_c
\bco
\bom
\bmm
\bme
\ben
\bnt
\bts
\bs option enabled does not allow
535 comments. The i
\bin
\bnt
\bte
\ber
\bra
\bac
\bct
\bti
\biv
\bve
\be_
\b_c
\bco
\bom
\bmm
\bme
\ben
\bnt
\bts
\bs option is on by default in interac-
538 Q
\bQU
\bUO
\bOT
\bTI
\bIN
\bNG
\bG
539 _
\bQ_
\bu_
\bo_
\bt_
\bi_
\bn_
\bg is used to remove the special meaning of certain characters or
540 words to the shell. Quoting can be used to disable special treatment
541 for special characters, to prevent reserved words from being recognized
542 as such, and to prevent parameter expansion.
544 Each of the _
\bm_
\be_
\bt_
\ba_
\bc_
\bh_
\ba_
\br_
\ba_
\bc_
\bt_
\be_
\br_
\bs listed above under D
\bDE
\bEF
\bFI
\bIN
\bNI
\bIT
\bTI
\bIO
\bON
\bNS
\bS has special
545 meaning to the shell and must be quoted if it is to represent itself.
547 When the command history expansion facilities are being used (see H
\bHI
\bIS
\bS-
\b-
548 T
\bTO
\bOR
\bRY
\bY E
\bEX
\bXP
\bPA
\bAN
\bNS
\bSI
\bIO
\bON
\bN below), the _
\bh_
\bi_
\bs_
\bt_
\bo_
\br_
\by _
\be_
\bx_
\bp_
\ba_
\bn_
\bs_
\bi_
\bo_
\bn character, usually !
\b!, must
549 be quoted to prevent history expansion.
551 There are three quoting mechanisms: the _
\be_
\bs_
\bc_
\ba_
\bp_
\be _
\bc_
\bh_
\ba_
\br_
\ba_
\bc_
\bt_
\be_
\br, single
552 quotes, and double quotes.
554 A non-quoted backslash (\
\b\) is the _
\be_
\bs_
\bc_
\ba_
\bp_
\be _
\bc_
\bh_
\ba_
\br_
\ba_
\bc_
\bt_
\be_
\br. It preserves the
555 literal value of the next character that follows, with the exception of
556 <newline>. If a \
\b\<newline> pair appears, and the backslash is not
557 itself quoted, the \
\b\<newline> is treated as a line continuation (that
558 is, it is removed from the input stream and effectively ignored).
560 Enclosing characters in single quotes preserves the literal value of
561 each character within the quotes. A single quote may not occur between
562 single quotes, even when preceded by a backslash.
564 Enclosing characters in double quotes preserves the literal value of
565 all characters within the quotes, with the exception of $
\b$, `
\b`, \
\b\, and,
566 when history expansion is enabled, !
\b!. The characters $
\b$ and `
\b` retain
567 their special meaning within double quotes. The backslash retains its
568 special meaning only when followed by one of the following characters:
569 $
\b$, `
\b`, "
\b", \
\b\, or <
\b<n
\bne
\bew
\bwl
\bli
\bin
\bne
\be>
\b>. A double quote may be quoted within double
570 quotes by preceding it with a backslash. If enabled, history expansion
571 will be performed unless an !
\b! appearing in double quotes is escaped
572 using a backslash. The backslash preceding the !
\b! is not removed.
574 The special parameters *
\b* and @
\b@ have special meaning when in double
575 quotes (see P
\bPA
\bAR
\bRA
\bAM
\bME
\bET
\bTE
\bER
\bRS
\bS below).
577 Words of the form $
\b$'_
\bs_
\bt_
\br_
\bi_
\bn_
\bg' are treated specially. The word expands to
578 _
\bs_
\bt_
\br_
\bi_
\bn_
\bg, with backslash-escaped characters replaced as specified by the
579 ANSI C standard. Backslash escape sequences, if present, are decoded
581 \
\b\a
\ba alert (bell)
584 \
\b\E
\bE an escape character
587 \
\b\r
\br carriage return
588 \
\b\t
\bt horizontal tab
589 \
\b\v
\bv vertical tab
591 \
\b\'
\b' single quote
592 \
\b\"
\b" double quote
593 \
\b\_
\bn_
\bn_
\bn the eight-bit character whose value is the octal value
594 _
\bn_
\bn_
\bn (one to three digits)
595 \
\b\x
\bx_
\bH_
\bH the eight-bit character whose value is the hexadecimal
596 value _
\bH_
\bH (one or two hex digits)
597 \
\b\u
\bu_
\bH_
\bH_
\bH_
\bH the Unicode (ISO/IEC 10646) character whose value is the
598 hexadecimal value _
\bH_
\bH_
\bH_
\bH (one to four hex digits)
599 \
\b\U
\bU_
\bH_
\bH_
\bH_
\bH_
\bH_
\bH_
\bH_
\bH
600 the Unicode (ISO/IEC 10646) character whose value is the
601 hexadecimal value _
\bH_
\bH_
\bH_
\bH_
\bH_
\bH_
\bH_
\bH (one to eight hex digits)
602 \
\b\c
\bc_
\bx a control-_
\bx character
604 The expanded result is single-quoted, as if the dollar sign had not
607 A double-quoted string preceded by a dollar sign ($
\b$"_
\bs_
\bt_
\br_
\bi_
\bn_
\bg") will cause
608 the string to be translated according to the current locale. If the
609 current locale is C
\bC or P
\bPO
\bOS
\bSI
\bIX
\bX, the dollar sign is ignored. If the
610 string is translated and replaced, the replacement is double-quoted.
612 P
\bPA
\bAR
\bRA
\bAM
\bME
\bET
\bTE
\bER
\bRS
\bS
613 A _
\bp_
\ba_
\br_
\ba_
\bm_
\be_
\bt_
\be_
\br is an entity that stores values. It can be a _
\bn_
\ba_
\bm_
\be, a num-
614 ber, or one of the special characters listed below under S
\bSp
\bpe
\bec
\bci
\bia
\bal
\bl P
\bPa
\bar
\bra
\bam
\bm-
\b-
615 e
\bet
\bte
\ber
\brs
\bs. A _
\bv_
\ba_
\br_
\bi_
\ba_
\bb_
\bl_
\be is a parameter denoted by a _
\bn_
\ba_
\bm_
\be. A variable has a
616 _
\bv_
\ba_
\bl_
\bu_
\be and zero or more _
\ba_
\bt_
\bt_
\br_
\bi_
\bb_
\bu_
\bt_
\be_
\bs. Attributes are assigned using the
617 d
\bde
\bec
\bcl
\bla
\bar
\bre
\be builtin command (see d
\bde
\bec
\bcl
\bla
\bar
\bre
\be below in S
\bSH
\bHE
\bEL
\bLL
\bL B
\bBU
\bUI
\bIL
\bLT
\bTI
\bIN
\bN C
\bCO
\bOM
\bMM
\bMA
\bAN
\bND
\bDS
\bS).
619 A parameter is set if it has been assigned a value. The null string is
620 a valid value. Once a variable is set, it may be unset only by using
621 the u
\bun
\bns
\bse
\bet
\bt builtin command (see S
\bSH
\bHE
\bEL
\bLL
\bL B
\bBU
\bUI
\bIL
\bLT
\bTI
\bIN
\bN C
\bCO
\bOM
\bMM
\bMA
\bAN
\bND
\bDS
\bS below).
623 A _
\bv_
\ba_
\br_
\bi_
\ba_
\bb_
\bl_
\be may be assigned to by a statement of the form
625 _
\bn_
\ba_
\bm_
\be=[_
\bv_
\ba_
\bl_
\bu_
\be]
627 If _
\bv_
\ba_
\bl_
\bu_
\be is not given, the variable is assigned the null string. All
628 _
\bv_
\ba_
\bl_
\bu_
\be_
\bs undergo tilde expansion, parameter and variable expansion, com-
629 mand substitution, arithmetic expansion, and quote removal (see E
\bEX
\bXP
\bPA
\bAN
\bN-
\b-
630 S
\bSI
\bIO
\bON
\bN below). If the variable has its i
\bin
\bnt
\bte
\beg
\bge
\ber
\br attribute set, then _
\bv_
\ba_
\bl_
\bu_
\be
631 is evaluated as an arithmetic expression even if the $((...)) expansion
632 is not used (see A
\bAr
\bri
\bit
\bth
\bhm
\bme
\bet
\bti
\bic
\bc E
\bEx
\bxp
\bpa
\ban
\bns
\bsi
\bio
\bon
\bn below). Word splitting is not
633 performed, with the exception of "
\b"$
\b$@
\b@"
\b" as explained below under S
\bSp
\bpe
\bec
\bci
\bia
\bal
\bl
634 P
\bPa
\bar
\bra
\bam
\bme
\bet
\bte
\ber
\brs
\bs. Pathname expansion is not performed. Assignment state-
635 ments may also appear as arguments to the a
\bal
\bli
\bia
\bas
\bs, d
\bde
\bec
\bcl
\bla
\bar
\bre
\be, t
\bty
\byp
\bpe
\bes
\bse
\bet
\bt,
636 e
\bex
\bxp
\bpo
\bor
\brt
\bt, r
\bre
\bea
\bad
\bdo
\bon
\bnl
\bly
\by, and l
\blo
\boc
\bca
\bal
\bl builtin commands.
638 In the context where an assignment statement is assigning a value to a
639 shell variable or array index, the += operator can be used to append to
640 or add to the variable's previous value. When += is applied to a vari-
641 able for which the _
\bi_
\bn_
\bt_
\be_
\bg_
\be_
\br attribute has been set, _
\bv_
\ba_
\bl_
\bu_
\be is evaluated
642 as an arithmetic expression and added to the variable's current value,
643 which is also evaluated. When += is applied to an array variable using
644 compound assignment (see A
\bAr
\brr
\bra
\bay
\bys
\bs below), the variable's value is not
645 unset (as it is when using =), and new values are appended to the array
646 beginning at one greater than the array's maximum index (for indexed
647 arrays) or added as additional key-value pairs in an associative array.
648 When applied to a string-valued variable, _
\bv_
\ba_
\bl_
\bu_
\be is expanded and
649 appended to the variable's value.
651 P
\bPo
\bos
\bsi
\bit
\bti
\bio
\bon
\bna
\bal
\bl P
\bPa
\bar
\bra
\bam
\bme
\bet
\bte
\ber
\brs
\bs
652 A _
\bp_
\bo_
\bs_
\bi_
\bt_
\bi_
\bo_
\bn_
\ba_
\bl _
\bp_
\ba_
\br_
\ba_
\bm_
\be_
\bt_
\be_
\br is a parameter denoted by one or more digits,
653 other than the single digit 0. Positional parameters are assigned from
654 the shell's arguments when it is invoked, and may be reassigned using
655 the s
\bse
\bet
\bt builtin command. Positional parameters may not be assigned to
656 with assignment statements. The positional parameters are temporarily
657 replaced when a shell function is executed (see F
\bFU
\bUN
\bNC
\bCT
\bTI
\bIO
\bON
\bNS
\bS below).
659 When a positional parameter consisting of more than a single digit is
660 expanded, it must be enclosed in braces (see E
\bEX
\bXP
\bPA
\bAN
\bNS
\bSI
\bIO
\bON
\bN below).
662 S
\bSp
\bpe
\bec
\bci
\bia
\bal
\bl P
\bPa
\bar
\bra
\bam
\bme
\bet
\bte
\ber
\brs
\bs
663 The shell treats several parameters specially. These parameters may
664 only be referenced; assignment to them is not allowed.
665 *
\b* Expands to the positional parameters, starting from one. When
666 the expansion occurs within double quotes, it expands to a sin-
667 gle word with the value of each parameter separated by the first
668 character of the I
\bIF
\bFS
\bS special variable. That is, "$
\b$*
\b*" is equiva-
669 lent to "$
\b$1
\b1_
\bc$
\b$2
\b2_
\bc.
\b..
\b..
\b.", where _
\bc is the first character of the value
670 of the I
\bIF
\bFS
\bS variable. If I
\bIF
\bFS
\bS is unset, the parameters are sepa-
671 rated by spaces. If I
\bIF
\bFS
\bS is null, the parameters are joined
672 without intervening separators.
673 @
\b@ Expands to the positional parameters, starting from one. When
674 the expansion occurs within double quotes, each parameter
675 expands to a separate word. That is, "$
\b$@
\b@" is equivalent to "$
\b$1
\b1"
676 "$
\b$2
\b2" ... If the double-quoted expansion occurs within a word,
677 the expansion of the first parameter is joined with the begin-
678 ning part of the original word, and the expansion of the last
679 parameter is joined with the last part of the original word.
680 When there are no positional parameters, "$
\b$@
\b@" and $
\b$@
\b@ expand to
681 nothing (i.e., they are removed).
682 #
\b# Expands to the number of positional parameters in decimal.
683 ?
\b? Expands to the exit status of the most recently executed fore-
685 -
\b- Expands to the current option flags as specified upon invoca-
686 tion, by the s
\bse
\bet
\bt builtin command, or those set by the shell
687 itself (such as the -
\b-i
\bi option).
688 $
\b$ Expands to the process ID of the shell. In a () subshell, it
689 expands to the process ID of the current shell, not the sub-
691 !
\b! Expands to the process ID of the most recently executed back-
692 ground (asynchronous) command.
693 0
\b0 Expands to the name of the shell or shell script. This is set
694 at shell initialization. If b
\bba
\bas
\bsh
\bh is invoked with a file of com-
695 mands, $
\b$0
\b0 is set to the name of that file. If b
\bba
\bas
\bsh
\bh is started
696 with the -
\b-c
\bc option, then $
\b$0
\b0 is set to the first argument after
697 the string to be executed, if one is present. Otherwise, it is
698 set to the file name used to invoke b
\bba
\bas
\bsh
\bh, as given by argument
700 _
\b_ At shell startup, set to the absolute pathname used to invoke
701 the shell or shell script being executed as passed in the envi-
702 ronment or argument list. Subsequently, expands to the last
703 argument to the previous command, after expansion. Also set to
704 the full pathname used to invoke each command executed and
705 placed in the environment exported to that command. When check-
706 ing mail, this parameter holds the name of the mail file cur-
707 rently being checked.
709 S
\bSh
\bhe
\bel
\bll
\bl V
\bVa
\bar
\bri
\bia
\bab
\bbl
\ble
\bes
\bs
710 The following variables are set by the shell:
712 B
\bBA
\bAS
\bSH
\bH Expands to the full file name used to invoke this instance of
714 B
\bBA
\bAS
\bSH
\bHO
\bOP
\bPT
\bTS
\bS
715 A colon-separated list of enabled shell options. Each word in
716 the list is a valid argument for the -
\b-s
\bs option to the s
\bsh
\bho
\bop
\bpt
\bt
717 builtin command (see S
\bSH
\bHE
\bEL
\bLL
\bL B
\bBU
\bUI
\bIL
\bLT
\bTI
\bIN
\bN C
\bCO
\bOM
\bMM
\bMA
\bAN
\bND
\bDS
\bS below). The options
718 appearing in B
\bBA
\bAS
\bSH
\bHO
\bOP
\bPT
\bTS
\bS are those reported as _
\bo_
\bn by s
\bsh
\bho
\bop
\bpt
\bt. If
719 this variable is in the environment when b
\bba
\bas
\bsh
\bh starts up, each
720 shell option in the list will be enabled before reading any
721 startup files. This variable is read-only.
722 B
\bBA
\bAS
\bSH
\bHP
\bPI
\bID
\bD
723 Expands to the process ID of the current b
\bba
\bas
\bsh
\bh process. This
724 differs from $
\b$$
\b$ under certain circumstances, such as subshells
725 that do not require b
\bba
\bas
\bsh
\bh to be re-initialized.
726 B
\bBA
\bAS
\bSH
\bH_
\b_A
\bAL
\bLI
\bIA
\bAS
\bSE
\bES
\bS
727 An associative array variable whose members correspond to the
728 internal list of aliases as maintained by the a
\bal
\bli
\bia
\bas
\bs builtin.
729 Elements added to this array appear in the alias list; unsetting
730 array elements cause aliases to be removed from the alias list.
731 B
\bBA
\bAS
\bSH
\bH_
\b_A
\bAR
\bRG
\bGC
\bC
732 An array variable whose values are the number of parameters in
733 each frame of the current b
\bba
\bas
\bsh
\bh execution call stack. The number
734 of parameters to the current subroutine (shell function or
735 script executed with .
\b. or s
\bso
\bou
\bur
\brc
\bce
\be) is at the top of the stack.
736 When a subroutine is executed, the number of parameters passed
737 is pushed onto B
\bBA
\bAS
\bSH
\bH_
\b_A
\bAR
\bRG
\bGC
\bC. The shell sets B
\bBA
\bAS
\bSH
\bH_
\b_A
\bAR
\bRG
\bGC
\bC only when in
738 extended debugging mode (see the description of the e
\bex
\bxt
\btd
\bde
\beb
\bbu
\bug
\bg
739 option to the s
\bsh
\bho
\bop
\bpt
\bt builtin below)
740 B
\bBA
\bAS
\bSH
\bH_
\b_A
\bAR
\bRG
\bGV
\bV
741 An array variable containing all of the parameters in the cur-
742 rent b
\bba
\bas
\bsh
\bh execution call stack. The final parameter of the last
743 subroutine call is at the top of the stack; the first parameter
744 of the initial call is at the bottom. When a subroutine is exe-
745 cuted, the parameters supplied are pushed onto B
\bBA
\bAS
\bSH
\bH_
\b_A
\bAR
\bRG
\bGV
\bV. The
746 shell sets B
\bBA
\bAS
\bSH
\bH_
\b_A
\bAR
\bRG
\bGV
\bV only when in extended debugging mode (see
747 the description of the e
\bex
\bxt
\btd
\bde
\beb
\bbu
\bug
\bg option to the s
\bsh
\bho
\bop
\bpt
\bt builtin
749 B
\bBA
\bAS
\bSH
\bH_
\b_C
\bCM
\bMD
\bDS
\bS
750 An associative array variable whose members correspond to the
751 internal hash table of commands as maintained by the h
\bha
\bas
\bsh
\bh
752 builtin. Elements added to this array appear in the hash table;
753 unsetting array elements cause commands to be removed from the
755 B
\bBA
\bAS
\bSH
\bH_
\b_C
\bCO
\bOM
\bMM
\bMA
\bAN
\bND
\bD
756 The command currently being executed or about to be executed,
757 unless the shell is executing a command as the result of a trap,
758 in which case it is the command executing at the time of the
760 B
\bBA
\bAS
\bSH
\bH_
\b_E
\bEX
\bXE
\bEC
\bCU
\bUT
\bTI
\bIO
\bON
\bN_
\b_S
\bST
\bTR
\bRI
\bIN
\bNG
\bG
761 The command argument to the -
\b-c
\bc invocation option.
762 B
\bBA
\bAS
\bSH
\bH_
\b_L
\bLI
\bIN
\bNE
\bEN
\bNO
\bO
763 An array variable whose members are the line numbers in source
764 files where each corresponding member of F
\bFU
\bUN
\bNC
\bCN
\bNA
\bAM
\bME
\bE was invoked.
765 $
\b${
\b{B
\bBA
\bAS
\bSH
\bH_
\b_L
\bLI
\bIN
\bNE
\bEN
\bNO
\bO[
\b[_
\b$_
\bi]
\b]}
\b} is the line number in the source file
766 ($
\b${
\b{B
\bBA
\bAS
\bSH
\bH_
\b_S
\bSO
\bOU
\bUR
\bRC
\bCE
\bE[
\b[_
\b$_
\bi_
\b+_
\b1]
\b]}
\b}) where $
\b${
\b{F
\bFU
\bUN
\bNC
\bCN
\bNA
\bAM
\bME
\bE[
\b[_
\b$_
\bi]
\b]}
\b} was called (or
767 $
\b${
\b{B
\bBA
\bAS
\bSH
\bH_
\b_L
\bLI
\bIN
\bNE
\bEN
\bNO
\bO[
\b[_
\b$_
\bi_
\b-_
\b1]
\b]}
\b} if referenced within another shell func-
768 tion). Use L
\bLI
\bIN
\bNE
\bEN
\bNO
\bO to obtain the current line number.
769 B
\bBA
\bAS
\bSH
\bH_
\b_R
\bRE
\bEM
\bMA
\bAT
\bTC
\bCH
\bH
770 An array variable whose members are assigned by the =
\b=~
\b~ binary
771 operator to the [
\b[[
\b[ conditional command. The element with index
772 0 is the portion of the string matching the entire regular
773 expression. The element with index _
\bn is the portion of the
774 string matching the _
\bnth parenthesized subexpression. This vari-
776 B
\bBA
\bAS
\bSH
\bH_
\b_S
\bSO
\bOU
\bUR
\bRC
\bCE
\bE
777 An array variable whose members are the source filenames where
778 the corresponding shell function names in the F
\bFU
\bUN
\bNC
\bCN
\bNA
\bAM
\bME
\bE array
779 variable are defined. The shell function $
\b${
\b{F
\bFU
\bUN
\bNC
\bCN
\bNA
\bAM
\bME
\bE[
\b[_
\b$_
\bi]
\b]}
\b} is
780 defined in the file $
\b${
\b{B
\bBA
\bAS
\bSH
\bH_
\b_S
\bSO
\bOU
\bUR
\bRC
\bCE
\bE[
\b[_
\b$_
\bi]
\b]}
\b} and called from
781 $
\b${
\b{B
\bBA
\bAS
\bSH
\bH_
\b_S
\bSO
\bOU
\bUR
\bRC
\bCE
\bE[
\b[_
\b$_
\bi_
\b+_
\b1]
\b]}
\b}.
782 B
\bBA
\bAS
\bSH
\bH_
\b_S
\bSU
\bUB
\bBS
\bSH
\bHE
\bEL
\bLL
\bL
783 Incremented by one each time a subshell or subshell environment
784 is spawned. The initial value is 0.
785 B
\bBA
\bAS
\bSH
\bH_
\b_V
\bVE
\bER
\bRS
\bSI
\bIN
\bNF
\bFO
\bO
786 A readonly array variable whose members hold version information
787 for this instance of b
\bba
\bas
\bsh
\bh. The values assigned to the array
788 members are as follows:
789 B
\bBA
\bAS
\bSH
\bH_
\b_V
\bVE
\bER
\bRS
\bSI
\bIN
\bNF
\bFO
\bO[
\b[0]
\b] The major version number (the _
\br_
\be_
\bl_
\be_
\ba_
\bs_
\be).
790 B
\bBA
\bAS
\bSH
\bH_
\b_V
\bVE
\bER
\bRS
\bSI
\bIN
\bNF
\bFO
\bO[
\b[1]
\b] The minor version number (the _
\bv_
\be_
\br_
\bs_
\bi_
\bo_
\bn).
791 B
\bBA
\bAS
\bSH
\bH_
\b_V
\bVE
\bER
\bRS
\bSI
\bIN
\bNF
\bFO
\bO[
\b[2]
\b] The patch level.
792 B
\bBA
\bAS
\bSH
\bH_
\b_V
\bVE
\bER
\bRS
\bSI
\bIN
\bNF
\bFO
\bO[
\b[3]
\b] The build version.
793 B
\bBA
\bAS
\bSH
\bH_
\b_V
\bVE
\bER
\bRS
\bSI
\bIN
\bNF
\bFO
\bO[
\b[4]
\b] The release status (e.g., _
\bb_
\be_
\bt_
\ba_
\b1).
794 B
\bBA
\bAS
\bSH
\bH_
\b_V
\bVE
\bER
\bRS
\bSI
\bIN
\bNF
\bFO
\bO[
\b[5]
\b] The value of M
\bMA
\bAC
\bCH
\bHT
\bTY
\bYP
\bPE
\bE.
796 B
\bBA
\bAS
\bSH
\bH_
\b_V
\bVE
\bER
\bRS
\bSI
\bIO
\bON
\bN
797 Expands to a string describing the version of this instance of
800 C
\bCO
\bOM
\bMP
\bP_
\b_C
\bCW
\bWO
\bOR
\bRD
\bD
801 An index into $
\b${
\b{C
\bCO
\bOM
\bMP
\bP_
\b_W
\bWO
\bOR
\bRD
\bDS
\bS}
\b} of the word containing the current
802 cursor position. This variable is available only in shell func-
803 tions invoked by the programmable completion facilities (see
804 P
\bPr
\bro
\bog
\bgr
\bra
\bam
\bmm
\bma
\bab
\bbl
\ble
\be C
\bCo
\bom
\bmp
\bpl
\ble
\bet
\bti
\bio
\bon
\bn below).
806 C
\bCO
\bOM
\bMP
\bP_
\b_K
\bKE
\bEY
\bY
807 The key (or final key of a key sequence) used to invoke the cur-
808 rent completion function.
810 C
\bCO
\bOM
\bMP
\bP_
\b_L
\bLI
\bIN
\bNE
\bE
811 The current command line. This variable is available only in
812 shell functions and external commands invoked by the pro-
813 grammable completion facilities (see P
\bPr
\bro
\bog
\bgr
\bra
\bam
\bmm
\bma
\bab
\bbl
\ble
\be C
\bCo
\bom
\bmp
\bpl
\ble
\bet
\bti
\bio
\bon
\bn
816 C
\bCO
\bOM
\bMP
\bP_
\b_P
\bPO
\bOI
\bIN
\bNT
\bT
817 The index of the current cursor position relative to the begin-
818 ning of the current command. If the current cursor position is
819 at the end of the current command, the value of this variable is
820 equal to $
\b${
\b{#
\b#C
\bCO
\bOM
\bMP
\bP_
\b_L
\bLI
\bIN
\bNE
\bE}
\b}. This variable is available only in
821 shell functions and external commands invoked by the pro-
822 grammable completion facilities (see P
\bPr
\bro
\bog
\bgr
\bra
\bam
\bmm
\bma
\bab
\bbl
\ble
\be C
\bCo
\bom
\bmp
\bpl
\ble
\bet
\bti
\bio
\bon
\bn
825 C
\bCO
\bOM
\bMP
\bP_
\b_T
\bTY
\bYP
\bPE
\bE
826 Set to an integer value corresponding to the type of completion
827 attempted that caused a completion function to be called: _
\bT_
\bA_
\bB,
828 for normal completion, _
\b?, for listing completions after succes-
829 sive tabs, _
\b!, for listing alternatives on partial word comple-
830 tion, _
\b@, to list completions if the word is not unmodified, or
831 _
\b%, for menu completion. This variable is available only in
832 shell functions and external commands invoked by the pro-
833 grammable completion facilities (see P
\bPr
\bro
\bog
\bgr
\bra
\bam
\bmm
\bma
\bab
\bbl
\ble
\be C
\bCo
\bom
\bmp
\bpl
\ble
\bet
\bti
\bio
\bon
\bn
836 C
\bCO
\bOM
\bMP
\bP_
\b_W
\bWO
\bOR
\bRD
\bDB
\bBR
\bRE
\bEA
\bAK
\bKS
\bS
837 The set of characters that the r
\bre
\bea
\bad
\bdl
\bli
\bin
\bne
\be library treats as word
838 separators when performing word completion. If C
\bCO
\bOM
\bMP
\bP_
\b_W
\bWO
\bOR
\bRD
\bDB
\bBR
\bRE
\bEA
\bAK
\bKS
\bS
839 is unset, it loses its special properties, even if it is subse-
842 C
\bCO
\bOM
\bMP
\bP_
\b_W
\bWO
\bOR
\bRD
\bDS
\bS
843 An array variable (see A
\bAr
\brr
\bra
\bay
\bys
\bs below) consisting of the individ-
844 ual words in the current command line. The line is split into
845 words as r
\bre
\bea
\bad
\bdl
\bli
\bin
\bne
\be would split it, using C
\bCO
\bOM
\bMP
\bP_
\b_W
\bWO
\bOR
\bRD
\bDB
\bBR
\bRE
\bEA
\bAK
\bKS
\bS as
846 described above. This variable is available only in shell func-
847 tions invoked by the programmable completion facilities (see
848 P
\bPr
\bro
\bog
\bgr
\bra
\bam
\bmm
\bma
\bab
\bbl
\ble
\be C
\bCo
\bom
\bmp
\bpl
\ble
\bet
\bti
\bio
\bon
\bn below).
850 C
\bCO
\bOP
\bPR
\bRO
\bOC
\bC An array variable (see A
\bAr
\brr
\bra
\bay
\bys
\bs below) created to hold the file
851 descriptors for output from and input to an unnamed coprocess
852 (see C
\bCo
\bop
\bpr
\bro
\boc
\bce
\bes
\bss
\bse
\bes
\bs above).
854 D
\bDI
\bIR
\bRS
\bST
\bTA
\bAC
\bCK
\bK
855 An array variable (see A
\bAr
\brr
\bra
\bay
\bys
\bs below) containing the current con-
856 tents of the directory stack. Directories appear in the stack
857 in the order they are displayed by the d
\bdi
\bir
\brs
\bs builtin. Assigning
858 to members of this array variable may be used to modify directo-
859 ries already in the stack, but the p
\bpu
\bus
\bsh
\bhd
\bd and p
\bpo
\bop
\bpd
\bd builtins must
860 be used to add and remove directories. Assignment to this vari-
861 able will not change the current directory. If D
\bDI
\bIR
\bRS
\bST
\bTA
\bAC
\bCK
\bK is
862 unset, it loses its special properties, even if it is subse-
865 E
\bEU
\bUI
\bID
\bD Expands to the effective user ID of the current user, initial-
866 ized at shell startup. This variable is readonly.
868 F
\bFU
\bUN
\bNC
\bCN
\bNA
\bAM
\bME
\bE
869 An array variable containing the names of all shell functions
870 currently in the execution call stack. The element with index 0
871 is the name of any currently-executing shell function. The bot-
872 tom-most element (the one with the highest index) is "main".
873 This variable exists only when a shell function is executing.
874 Assignments to F
\bFU
\bUN
\bNC
\bCN
\bNA
\bAM
\bME
\bE have no effect and return an error sta-
875 tus. If F
\bFU
\bUN
\bNC
\bCN
\bNA
\bAM
\bME
\bE is unset, it loses its special properties,
876 even if it is subsequently reset.
878 This variable can be used with B
\bBA
\bAS
\bSH
\bH_
\b_L
\bLI
\bIN
\bNE
\bEN
\bNO
\bO and B
\bBA
\bAS
\bSH
\bH_
\b_S
\bSO
\bOU
\bUR
\bRC
\bCE
\bE.
879 Each element of F
\bFU
\bUN
\bNC
\bCN
\bNA
\bAM
\bME
\bE has corresponding elements in
880 B
\bBA
\bAS
\bSH
\bH_
\b_L
\bLI
\bIN
\bNE
\bEN
\bNO
\bO and B
\bBA
\bAS
\bSH
\bH_
\b_S
\bSO
\bOU
\bUR
\bRC
\bCE
\bE to describe the call stack. For
881 instance, $
\b${
\b{F
\bFU
\bUN
\bNC
\bCN
\bNA
\bAM
\bME
\bE[
\b[_
\b$_
\bi]
\b]}
\b} was called from the file
882 $
\b${
\b{B
\bBA
\bAS
\bSH
\bH_
\b_S
\bSO
\bOU
\bUR
\bRC
\bCE
\bE[
\b[_
\b$_
\bi_
\b+_
\b1]
\b]}
\b} at line number $
\b${
\b{B
\bBA
\bAS
\bSH
\bH_
\b_L
\bLI
\bIN
\bNE
\bEN
\bNO
\bO[
\b[_
\b$_
\bi]
\b]}
\b}. The
883 c
\bca
\bal
\bll
\ble
\ber
\br builtin displays the current call stack using this infor-
886 G
\bGR
\bRO
\bOU
\bUP
\bPS
\bS An array variable containing the list of groups of which the
887 current user is a member. Assignments to G
\bGR
\bRO
\bOU
\bUP
\bPS
\bS have no effect
888 and return an error status. If G
\bGR
\bRO
\bOU
\bUP
\bPS
\bS is unset, it loses its
889 special properties, even if it is subsequently reset.
891 H
\bHI
\bIS
\bST
\bTC
\bCM
\bMD
\bD
892 The history number, or index in the history list, of the current
893 command. If H
\bHI
\bIS
\bST
\bTC
\bCM
\bMD
\bD is unset, it loses its special properties,
894 even if it is subsequently reset.
896 H
\bHO
\bOS
\bST
\bTN
\bNA
\bAM
\bME
\bE
897 Automatically set to the name of the current host.
899 H
\bHO
\bOS
\bST
\bTT
\bTY
\bYP
\bPE
\bE
900 Automatically set to a string that uniquely describes the type
901 of machine on which b
\bba
\bas
\bsh
\bh is executing. The default is system-
904 L
\bLI
\bIN
\bNE
\bEN
\bNO
\bO Each time this parameter is referenced, the shell substitutes a
905 decimal number representing the current sequential line number
906 (starting with 1) within a script or function. When not in a
907 script or function, the value substituted is not guaranteed to
908 be meaningful. If L
\bLI
\bIN
\bNE
\bEN
\bNO
\bO is unset, it loses its special proper-
909 ties, even if it is subsequently reset.
911 M
\bMA
\bAC
\bCH
\bHT
\bTY
\bYP
\bPE
\bE
912 Automatically set to a string that fully describes the system
913 type on which b
\bba
\bas
\bsh
\bh is executing, in the standard GNU _
\bc_
\bp_
\bu_
\b-_
\bc_
\bo_
\bm_
\b-
914 _
\bp_
\ba_
\bn_
\by_
\b-_
\bs_
\by_
\bs_
\bt_
\be_
\bm format. The default is system-dependent.
916 M
\bMA
\bAP
\bPF
\bFI
\bIL
\bLE
\bE
917 An array variable (see A
\bAr
\brr
\bra
\bay
\bys
\bs below) created to hold the text
918 read by the m
\bma
\bap
\bpf
\bfi
\bil
\ble
\be builtin when no variable name is supplied.
920 O
\bOL
\bLD
\bDP
\bPW
\bWD
\bD The previous working directory as set by the c
\bcd
\bd command.
922 O
\bOP
\bPT
\bTA
\bAR
\bRG
\bG The value of the last option argument processed by the g
\bge
\bet
\bto
\bop
\bpt
\bts
\bs
923 builtin command (see S
\bSH
\bHE
\bEL
\bLL
\bL B
\bBU
\bUI
\bIL
\bLT
\bTI
\bIN
\bN C
\bCO
\bOM
\bMM
\bMA
\bAN
\bND
\bDS
\bS below).
925 O
\bOP
\bPT
\bTI
\bIN
\bND
\bD The index of the next argument to be processed by the g
\bge
\bet
\bto
\bop
\bpt
\bts
\bs
926 builtin command (see S
\bSH
\bHE
\bEL
\bLL
\bL B
\bBU
\bUI
\bIL
\bLT
\bTI
\bIN
\bN C
\bCO
\bOM
\bMM
\bMA
\bAN
\bND
\bDS
\bS below).
928 O
\bOS
\bST
\bTY
\bYP
\bPE
\bE Automatically set to a string that describes the operating sys-
929 tem on which b
\bba
\bas
\bsh
\bh is executing. The default is system-depen-
932 P
\bPI
\bIP
\bPE
\bES
\bST
\bTA
\bAT
\bTU
\bUS
\bS
933 An array variable (see A
\bAr
\brr
\bra
\bay
\bys
\bs below) containing a list of exit
934 status values from the processes in the most-recently-executed
935 foreground pipeline (which may contain only a single command).
937 P
\bPP
\bPI
\bID
\bD The process ID of the shell's parent. This variable is read-
940 P
\bPW
\bWD
\bD The current working directory as set by the c
\bcd
\bd command.
942 R
\bRA
\bAN
\bND
\bDO
\bOM
\bM Each time this parameter is referenced, a random integer between
943 0 and 32767 is generated. The sequence of random numbers may be
944 initialized by assigning a value to R
\bRA
\bAN
\bND
\bDO
\bOM
\bM. If R
\bRA
\bAN
\bND
\bDO
\bOM
\bM is unset,
945 it loses its special properties, even if it is subsequently
948 R
\bRE
\bEA
\bAD
\bDL
\bLI
\bIN
\bNE
\bE_
\b_L
\bLI
\bIN
\bNE
\bE
949 The contents of the r
\bre
\bea
\bad
\bdl
\bli
\bin
\bne
\be line buffer, for use with "bind -x"
950 (see S
\bSH
\bHE
\bEL
\bLL
\bL B
\bBU
\bUI
\bIL
\bLT
\bTI
\bIN
\bN C
\bCO
\bOM
\bMM
\bMA
\bAN
\bND
\bDS
\bS below).
952 R
\bRE
\bEA
\bAD
\bDL
\bLI
\bIN
\bNE
\bE_
\b_P
\bPO
\bOI
\bIN
\bNT
\bT
953 The position of the insertion point in the r
\bre
\bea
\bad
\bdl
\bli
\bin
\bne
\be line buffer,
954 for use with "bind -x" (see S
\bSH
\bHE
\bEL
\bLL
\bL B
\bBU
\bUI
\bIL
\bLT
\bTI
\bIN
\bN C
\bCO
\bOM
\bMM
\bMA
\bAN
\bND
\bDS
\bS below).
956 R
\bRE
\bEP
\bPL
\bLY
\bY Set to the line of input read by the r
\bre
\bea
\bad
\bd builtin command when
957 no arguments are supplied.
959 S
\bSE
\bEC
\bCO
\bON
\bND
\bDS
\bS
960 Each time this parameter is referenced, the number of seconds
961 since shell invocation is returned. If a value is assigned to
962 S
\bSE
\bEC
\bCO
\bON
\bND
\bDS
\bS, the value returned upon subsequent references is the
963 number of seconds since the assignment plus the value assigned.
964 If S
\bSE
\bEC
\bCO
\bON
\bND
\bDS
\bS is unset, it loses its special properties, even if it
965 is subsequently reset.
967 S
\bSH
\bHE
\bEL
\bLL
\bLO
\bOP
\bPT
\bTS
\bS
968 A colon-separated list of enabled shell options. Each word in
969 the list is a valid argument for the -
\b-o
\bo option to the s
\bse
\bet
\bt
970 builtin command (see S
\bSH
\bHE
\bEL
\bLL
\bL B
\bBU
\bUI
\bIL
\bLT
\bTI
\bIN
\bN C
\bCO
\bOM
\bMM
\bMA
\bAN
\bND
\bDS
\bS below). The options
971 appearing in S
\bSH
\bHE
\bEL
\bLL
\bLO
\bOP
\bPT
\bTS
\bS are those reported as _
\bo_
\bn by s
\bse
\bet
\bt -
\b-o
\bo. If
972 this variable is in the environment when b
\bba
\bas
\bsh
\bh starts up, each
973 shell option in the list will be enabled before reading any
974 startup files. This variable is read-only.
976 S
\bSH
\bHL
\bLV
\bVL
\bL Incremented by one each time an instance of b
\bba
\bas
\bsh
\bh is started.
978 U
\bUI
\bID
\bD Expands to the user ID of the current user, initialized at shell
979 startup. This variable is readonly.
981 The following variables are used by the shell. In some cases, b
\bba
\bas
\bsh
\bh
982 assigns a default value to a variable; these cases are noted below.
984 B
\bBA
\bAS
\bSH
\bH_
\b_E
\bEN
\bNV
\bV
985 If this parameter is set when b
\bba
\bas
\bsh
\bh is executing a shell script,
986 its value is interpreted as a filename containing commands to
987 initialize the shell, as in _
\b~_
\b/_
\b._
\bb_
\ba_
\bs_
\bh_
\br_
\bc. The value of B
\bBA
\bAS
\bSH
\bH_
\b_E
\bEN
\bNV
\bV is
988 subjected to parameter expansion, command substitution, and
989 arithmetic expansion before being interpreted as a file name.
990 P
\bPA
\bAT
\bTH
\bH is not used to search for the resultant file name.
991 B
\bBA
\bAS
\bSH
\bH_
\b_X
\bXT
\bTR
\bRA
\bAC
\bCE
\bEF
\bFD
\bD
992 If set to an integer corresponding to a valid file descriptor,
993 b
\bba
\bas
\bsh
\bh will write the trace output generated when _
\bs_
\be_
\bt _
\b-_
\bx is
994 enabled to that file descriptor. The file descriptor is closed
995 when B
\bBA
\bAS
\bSH
\bH_
\b_X
\bXT
\bTR
\bRA
\bAC
\bCE
\bEF
\bFD
\bD is unset or assigned a new value. Unsetting
996 B
\bBA
\bAS
\bSH
\bH_
\b_X
\bXT
\bTR
\bRA
\bAC
\bCE
\bEF
\bFD
\bD or assigning it the empty string causes the trace
997 output to be sent to the standard error. Note that setting
998 B
\bBA
\bAS
\bSH
\bH_
\b_X
\bXT
\bTR
\bRA
\bAC
\bCE
\bEF
\bFD
\bD to 2 (the standard error file descriptor) and then
999 unsetting it will result in the standard error being closed.
1000 C
\bCD
\bDP
\bPA
\bAT
\bTH
\bH The search path for the c
\bcd
\bd command. This is a colon-separated
1001 list of directories in which the shell looks for destination
1002 directories specified by the c
\bcd
\bd command. A sample value is
1004 C
\bCO
\bOL
\bLU
\bUM
\bMN
\bNS
\bS
1005 Used by the s
\bse
\bel
\ble
\bec
\bct
\bt compound command to determine the terminal
1006 width when printing selection lists. Automatically set upon
1007 receipt of a S
\bSI
\bIG
\bGW
\bWI
\bIN
\bNC
\bCH
\bH.
1008 C
\bCO
\bOM
\bMP
\bPR
\bRE
\bEP
\bPL
\bLY
\bY
1009 An array variable from which b
\bba
\bas
\bsh
\bh reads the possible completions
1010 generated by a shell function invoked by the programmable com-
1011 pletion facility (see P
\bPr
\bro
\bog
\bgr
\bra
\bam
\bmm
\bma
\bab
\bbl
\ble
\be C
\bCo
\bom
\bmp
\bpl
\ble
\bet
\bti
\bio
\bon
\bn below).
1012 E
\bEM
\bMA
\bAC
\bCS
\bS If b
\bba
\bas
\bsh
\bh finds this variable in the environment when the shell
1013 starts with value "t", it assumes that the shell is running in
1014 an Emacs shell buffer and disables line editing.
1015 E
\bEN
\bNV
\bV Similar to B
\bBA
\bAS
\bSH
\bH_
\b_E
\bEN
\bNV
\bV; used when the shell is invoked in POSIX
1017 F
\bFC
\bCE
\bED
\bDI
\bIT
\bT The default editor for the f
\bfc
\bc builtin command.
1018 F
\bFI
\bIG
\bGN
\bNO
\bOR
\bRE
\bE
1019 A colon-separated list of suffixes to ignore when performing
1020 filename completion (see R
\bRE
\bEA
\bAD
\bDL
\bLI
\bIN
\bNE
\bE below). A filename whose suf-
1021 fix matches one of the entries in F
\bFI
\bIG
\bGN
\bNO
\bOR
\bRE
\bE is excluded from the
1022 list of matched filenames. A sample value is ".o:~".
1023 F
\bFU
\bUN
\bNC
\bCN
\bNE
\bES
\bST
\bT
1024 If set to a numeric value greater than 0, defines a maximum
1025 function nesting level. Function invocations that exceed this
1026 nesting level will cause the current command to abort.
1027 G
\bGL
\bLO
\bOB
\bBI
\bIG
\bGN
\bNO
\bOR
\bRE
\bE
1028 A colon-separated list of patterns defining the set of filenames
1029 to be ignored by pathname expansion. If a filename matched by a
1030 pathname expansion pattern also matches one of the patterns in
1031 G
\bGL
\bLO
\bOB
\bBI
\bIG
\bGN
\bNO
\bOR
\bRE
\bE, it is removed from the list of matches.
1032 H
\bHI
\bIS
\bST
\bTC
\bCO
\bON
\bNT
\bTR
\bRO
\bOL
\bL
1033 A colon-separated list of values controlling how commands are
1034 saved on the history list. If the list of values includes
1035 _
\bi_
\bg_
\bn_
\bo_
\br_
\be_
\bs_
\bp_
\ba_
\bc_
\be, lines which begin with a s
\bsp
\bpa
\bac
\bce
\be character are not
1036 saved in the history list. A value of _
\bi_
\bg_
\bn_
\bo_
\br_
\be_
\bd_
\bu_
\bp_
\bs causes lines
1037 matching the previous history entry to not be saved. A value of
1038 _
\bi_
\bg_
\bn_
\bo_
\br_
\be_
\bb_
\bo_
\bt_
\bh is shorthand for _
\bi_
\bg_
\bn_
\bo_
\br_
\be_
\bs_
\bp_
\ba_
\bc_
\be and _
\bi_
\bg_
\bn_
\bo_
\br_
\be_
\bd_
\bu_
\bp_
\bs. A value
1039 of _
\be_
\br_
\ba_
\bs_
\be_
\bd_
\bu_
\bp_
\bs causes all previous lines matching the current line
1040 to be removed from the history list before that line is saved.
1041 Any value not in the above list is ignored. If H
\bHI
\bIS
\bST
\bTC
\bCO
\bON
\bNT
\bTR
\bRO
\bOL
\bL is
1042 unset, or does not include a valid value, all lines read by the
1043 shell parser are saved on the history list, subject to the value
1044 of H
\bHI
\bIS
\bST
\bTI
\bIG
\bGN
\bNO
\bOR
\bRE
\bE. The second and subsequent lines of a multi-line
1045 compound command are not tested, and are added to the history
1046 regardless of the value of H
\bHI
\bIS
\bST
\bTC
\bCO
\bON
\bNT
\bTR
\bRO
\bOL
\bL.
1047 H
\bHI
\bIS
\bST
\bTF
\bFI
\bIL
\bLE
\bE
1048 The name of the file in which command history is saved (see H
\bHI
\bIS
\bS-
\b-
1049 T
\bTO
\bOR
\bRY
\bY below). The default value is _
\b~_
\b/_
\b._
\bb_
\ba_
\bs_
\bh_
\b__
\bh_
\bi_
\bs_
\bt_
\bo_
\br_
\by. If unset,
1050 the command history is not saved when an interactive shell
1052 H
\bHI
\bIS
\bST
\bTF
\bFI
\bIL
\bLE
\bES
\bSI
\bIZ
\bZE
\bE
1053 The maximum number of lines contained in the history file. When
1054 this variable is assigned a value, the history file is trun-
1055 cated, if necessary, by removing the oldest entries, to contain
1056 no more than that number of lines. The default value is 500.
1057 The history file is also truncated to this size after writing it
1058 when an interactive shell exits.
1059 H
\bHI
\bIS
\bST
\bTI
\bIG
\bGN
\bNO
\bOR
\bRE
\bE
1060 A colon-separated list of patterns used to decide which command
1061 lines should be saved on the history list. Each pattern is
1062 anchored at the beginning of the line and must match the com-
1063 plete line (no implicit `*
\b*' is appended). Each pattern is
1064 tested against the line after the checks specified by H
\bHI
\bIS
\bST
\bTC
\bCO
\bON
\bN-
\b-
1065 T
\bTR
\bRO
\bOL
\bL are applied. In addition to the normal shell pattern
1066 matching characters, `&
\b&' matches the previous history line. `&
\b&'
1067 may be escaped using a backslash; the backslash is removed
1068 before attempting a match. The second and subsequent lines of a
1069 multi-line compound command are not tested, and are added to the
1070 history regardless of the value of H
\bHI
\bIS
\bST
\bTI
\bIG
\bGN
\bNO
\bOR
\bRE
\bE.
1071 H
\bHI
\bIS
\bST
\bTS
\bSI
\bIZ
\bZE
\bE
1072 The number of commands to remember in the command history (see
1073 H
\bHI
\bIS
\bST
\bTO
\bOR
\bRY
\bY below). The default value is 500.
1074 H
\bHI
\bIS
\bST
\bTT
\bTI
\bIM
\bME
\bEF
\bFO
\bOR
\bRM
\bMA
\bAT
\bT
1075 If this variable is set and not null, its value is used as a
1076 format string for _
\bs_
\bt_
\br_
\bf_
\bt_
\bi_
\bm_
\be(3) to print the time stamp associated
1077 with each history entry displayed by the h
\bhi
\bis
\bst
\bto
\bor
\bry
\by builtin. If
1078 this variable is set, time stamps are written to the history
1079 file so they may be preserved across shell sessions. This uses
1080 the history comment character to distinguish timestamps from
1081 other history lines.
1082 H
\bHO
\bOM
\bME
\bE The home directory of the current user; the default argument for
1083 the c
\bcd
\bd builtin command. The value of this variable is also used
1084 when performing tilde expansion.
1085 H
\bHO
\bOS
\bST
\bTF
\bFI
\bIL
\bLE
\bE
1086 Contains the name of a file in the same format as _
\b/_
\be_
\bt_
\bc_
\b/_
\bh_
\bo_
\bs_
\bt_
\bs
1087 that should be read when the shell needs to complete a hostname.
1088 The list of possible hostname completions may be changed while
1089 the shell is running; the next time hostname completion is
1090 attempted after the value is changed, b
\bba
\bas
\bsh
\bh adds the contents of
1091 the new file to the existing list. If H
\bHO
\bOS
\bST
\bTF
\bFI
\bIL
\bLE
\bE is set, but has
1092 no value, or does not name a readable file, b
\bba
\bas
\bsh
\bh attempts to
1093 read _
\b/_
\be_
\bt_
\bc_
\b/_
\bh_
\bo_
\bs_
\bt_
\bs to obtain the list of possible hostname comple-
1094 tions. When H
\bHO
\bOS
\bST
\bTF
\bFI
\bIL
\bLE
\bE is unset, the hostname list is cleared.
1095 I
\bIF
\bFS
\bS The _
\bI_
\bn_
\bt_
\be_
\br_
\bn_
\ba_
\bl _
\bF_
\bi_
\be_
\bl_
\bd _
\bS_
\be_
\bp_
\ba_
\br_
\ba_
\bt_
\bo_
\br that is used for word splitting
1096 after expansion and to split lines into words with the r
\bre
\bea
\bad
\bd
1097 builtin command. The default value is ``<space><tab><new-
1099 I
\bIG
\bGN
\bNO
\bOR
\bRE
\bEE
\bEO
\bOF
\bF
1100 Controls the action of an interactive shell on receipt of an E
\bEO
\bOF
\bF
1101 character as the sole input. If set, the value is the number of
1102 consecutive E
\bEO
\bOF
\bF characters which must be typed as the first
1103 characters on an input line before b
\bba
\bas
\bsh
\bh exits. If the variable
1104 exists but does not have a numeric value, or has no value, the
1105 default value is 10. If it does not exist, E
\bEO
\bOF
\bF signifies the
1106 end of input to the shell.
1107 I
\bIN
\bNP
\bPU
\bUT
\bTR
\bRC
\bC
1108 The filename for the r
\bre
\bea
\bad
\bdl
\bli
\bin
\bne
\be startup file, overriding the
1109 default of _
\b~_
\b/_
\b._
\bi_
\bn_
\bp_
\bu_
\bt_
\br_
\bc (see R
\bRE
\bEA
\bAD
\bDL
\bLI
\bIN
\bNE
\bE below).
1110 L
\bLA
\bAN
\bNG
\bG Used to determine the locale category for any category not
1111 specifically selected with a variable starting with L
\bLC
\bC_
\b_.
1112 L
\bLC
\bC_
\b_A
\bAL
\bLL
\bL This variable overrides the value of L
\bLA
\bAN
\bNG
\bG and any other L
\bLC
\bC_
\b_
1113 variable specifying a locale category.
1114 L
\bLC
\bC_
\b_C
\bCO
\bOL
\bLL
\bLA
\bAT
\bTE
\bE
1115 This variable determines the collation order used when sorting
1116 the results of pathname expansion, and determines the behavior
1117 of range expressions, equivalence classes, and collating
1118 sequences within pathname expansion and pattern matching.
1119 L
\bLC
\bC_
\b_C
\bCT
\bTY
\bYP
\bPE
\bE
1120 This variable determines the interpretation of characters and
1121 the behavior of character classes within pathname expansion and
1123 L
\bLC
\bC_
\b_M
\bME
\bES
\bSS
\bSA
\bAG
\bGE
\bES
\bS
1124 This variable determines the locale used to translate double-
1125 quoted strings preceded by a $
\b$.
1126 L
\bLC
\bC_
\b_N
\bNU
\bUM
\bME
\bER
\bRI
\bIC
\bC
1127 This variable determines the locale category used for number
1129 L
\bLI
\bIN
\bNE
\bES
\bS Used by the s
\bse
\bel
\ble
\bec
\bct
\bt compound command to determine the column
1130 length for printing selection lists. Automatically set upon
1131 receipt of a S
\bSI
\bIG
\bGW
\bWI
\bIN
\bNC
\bCH
\bH.
1132 M
\bMA
\bAI
\bIL
\bL If this parameter is set to a file or directory name and the
1133 M
\bMA
\bAI
\bIL
\bLP
\bPA
\bAT
\bTH
\bH variable is not set, b
\bba
\bas
\bsh
\bh informs the user of the
1134 arrival of mail in the specified file or Maildir-format direc-
1136 M
\bMA
\bAI
\bIL
\bLC
\bCH
\bHE
\bEC
\bCK
\bK
1137 Specifies how often (in seconds) b
\bba
\bas
\bsh
\bh checks for mail. The
1138 default is 60 seconds. When it is time to check for mail, the
1139 shell does so before displaying the primary prompt. If this
1140 variable is unset, or set to a value that is not a number
1141 greater than or equal to zero, the shell disables mail checking.
1142 M
\bMA
\bAI
\bIL
\bLP
\bPA
\bAT
\bTH
\bH
1143 A colon-separated list of file names to be checked for mail.
1144 The message to be printed when mail arrives in a particular file
1145 may be specified by separating the file name from the message
1146 with a `?'. When used in the text of the message, $
\b$_
\b_ expands to
1147 the name of the current mailfile. Example:
1148 M
\bMA
\bAI
\bIL
\bLP
\bPA
\bAT
\bTH
\bH='/var/mail/bfox?"You have mail":~/shell-mail?"$_ has
1150 B
\bBa
\bas
\bsh
\bh supplies a default value for this variable, but the loca-
1151 tion of the user mail files that it uses is system dependent
1152 (e.g., /var/mail/$
\b$U
\bUS
\bSE
\bER
\bR).
1153 O
\bOP
\bPT
\bTE
\bER
\bRR
\bR If set to the value 1, b
\bba
\bas
\bsh
\bh displays error messages generated by
1154 the g
\bge
\bet
\bto
\bop
\bpt
\bts
\bs builtin command (see S
\bSH
\bHE
\bEL
\bLL
\bL B
\bBU
\bUI
\bIL
\bLT
\bTI
\bIN
\bN C
\bCO
\bOM
\bMM
\bMA
\bAN
\bND
\bDS
\bS below).
1155 O
\bOP
\bPT
\bTE
\bER
\bRR
\bR is initialized to 1 each time the shell is invoked or a
1156 shell script is executed.
1157 P
\bPA
\bAT
\bTH
\bH The search path for commands. It is a colon-separated list of
1158 directories in which the shell looks for commands (see C
\bCO
\bOM
\bMM
\bMA
\bAN
\bND
\bD
1159 E
\bEX
\bXE
\bEC
\bCU
\bUT
\bTI
\bIO
\bON
\bN below). A zero-length (null) directory name in the
1160 value of P
\bPA
\bAT
\bTH
\bH indicates the current directory. A null directory
1161 name may appear as two adjacent colons, or as an initial or
1162 trailing colon. The default path is system-dependent, and is
1163 set by the administrator who installs b
\bba
\bas
\bsh
\bh. A common value is
1164 ``/usr/gnu/bin:/usr/local/bin:/usr/ucb:/bin:/usr/bin''.
1165 P
\bPO
\bOS
\bSI
\bIX
\bXL
\bLY
\bY_
\b_C
\bCO
\bOR
\bRR
\bRE
\bEC
\bCT
\bT
1166 If this variable is in the environment when b
\bba
\bas
\bsh
\bh starts, the
1167 shell enters _
\bp_
\bo_
\bs_
\bi_
\bx _
\bm_
\bo_
\bd_
\be before reading the startup files, as if
1168 the -
\b--
\b-p
\bpo
\bos
\bsi
\bix
\bx invocation option had been supplied. If it is set
1169 while the shell is running, b
\bba
\bas
\bsh
\bh enables _
\bp_
\bo_
\bs_
\bi_
\bx _
\bm_
\bo_
\bd_
\be, as if the
1170 command _
\bs_
\be_
\bt _
\b-_
\bo _
\bp_
\bo_
\bs_
\bi_
\bx had been executed.
1171 P
\bPR
\bRO
\bOM
\bMP
\bPT
\bT_
\b_C
\bCO
\bOM
\bMM
\bMA
\bAN
\bND
\bD
1172 If set, the value is executed as a command prior to issuing each
1174 P
\bPR
\bRO
\bOM
\bMP
\bPT
\bT_
\b_D
\bDI
\bIR
\bRT
\bTR
\bRI
\bIM
\bM
1175 If set to a number greater than zero, the value is used as the
1176 number of trailing directory components to retain when expanding
1177 the \
\b\w
\bw and \
\b\W
\bW prompt string escapes (see P
\bPR
\bRO
\bOM
\bMP
\bPT
\bTI
\bIN
\bNG
\bG below).
1178 Characters removed are replaced with an ellipsis.
1179 P
\bPS
\bS1
\b1 The value of this parameter is expanded (see P
\bPR
\bRO
\bOM
\bMP
\bPT
\bTI
\bIN
\bNG
\bG below)
1180 and used as the primary prompt string. The default value is
1181 ``\
\b\s
\bs-
\b-\
\b\v
\bv\
\b\$
\b$ ''.
1182 P
\bPS
\bS2
\b2 The value of this parameter is expanded as with P
\bPS
\bS1
\b1 and used as
1183 the secondary prompt string. The default is ``>
\b> ''.
1184 P
\bPS
\bS3
\b3 The value of this parameter is used as the prompt for the s
\bse
\bel
\ble
\bec
\bct
\bt
1185 command (see S
\bSH
\bHE
\bEL
\bLL
\bL G
\bGR
\bRA
\bAM
\bMM
\bMA
\bAR
\bR above).
1186 P
\bPS
\bS4
\b4 The value of this parameter is expanded as with P
\bPS
\bS1
\b1 and the
1187 value is printed before each command b
\bba
\bas
\bsh
\bh displays during an
1188 execution trace. The first character of P
\bPS
\bS4
\b4 is replicated mul-
1189 tiple times, as necessary, to indicate multiple levels of indi-
1190 rection. The default is ``+
\b+ ''.
1191 S
\bSH
\bHE
\bEL
\bLL
\bL The full pathname to the shell is kept in this environment vari-
1192 able. If it is not set when the shell starts, b
\bba
\bas
\bsh
\bh assigns to
1193 it the full pathname of the current user's login shell.
1194 T
\bTI
\bIM
\bME
\bEF
\bFO
\bOR
\bRM
\bMA
\bAT
\bT
1195 The value of this parameter is used as a format string specify-
1196 ing how the timing information for pipelines prefixed with the
1197 t
\bti
\bim
\bme
\be reserved word should be displayed. The %
\b% character intro-
1198 duces an escape sequence that is expanded to a time value or
1199 other information. The escape sequences and their meanings are
1200 as follows; the braces denote optional portions.
1201 %
\b%%
\b% A literal %
\b%.
1202 %
\b%[
\b[_
\bp]
\b][
\b[l
\bl]
\b]R
\bR The elapsed time in seconds.
1203 %
\b%[
\b[_
\bp]
\b][
\b[l
\bl]
\b]U
\bU The number of CPU seconds spent in user mode.
1204 %
\b%[
\b[_
\bp]
\b][
\b[l
\bl]
\b]S
\bS The number of CPU seconds spent in system mode.
1205 %
\b%P
\bP The CPU percentage, computed as (%U + %S) / %R.
1207 The optional _
\bp is a digit specifying the _
\bp_
\br_
\be_
\bc_
\bi_
\bs_
\bi_
\bo_
\bn, the number
1208 of fractional digits after a decimal point. A value of 0 causes
1209 no decimal point or fraction to be output. At most three places
1210 after the decimal point may be specified; values of _
\bp greater
1211 than 3 are changed to 3. If _
\bp is not specified, the value 3 is
1214 The optional l
\bl specifies a longer format, including minutes, of
1215 the form _
\bM_
\bMm_
\bS_
\bS._
\bF_
\bFs. The value of _
\bp determines whether or not
1216 the fraction is included.
1218 If this variable is not set, b
\bba
\bas
\bsh
\bh acts as if it had the value
1219 $
\b$'
\b'\
\b\n
\bnr
\bre
\bea
\bal
\bl\
\b\t
\bt%
\b%3
\b3l
\blR
\bR\
\b\n
\bnu
\bus
\bse
\ber
\br\
\b\t
\bt%
\b%3
\b3l
\blU
\bU\
\b\n
\bns
\bsy
\bys
\bs%
\b%3
\b3l
\blS
\bS'
\b'. If the value is null, no
1220 timing information is displayed. A trailing newline is added
1221 when the format string is displayed.
1223 T
\bTM
\bMO
\bOU
\bUT
\bT If set to a value greater than zero, T
\bTM
\bMO
\bOU
\bUT
\bT is treated as the
1224 default timeout for the r
\bre
\bea
\bad
\bd builtin. The s
\bse
\bel
\ble
\bec
\bct
\bt command termi-
1225 nates if input does not arrive after T
\bTM
\bMO
\bOU
\bUT
\bT seconds when input is
1226 coming from a terminal. In an interactive shell, the value is
1227 interpreted as the number of seconds to wait for input after
1228 issuing the primary prompt. B
\bBa
\bas
\bsh
\bh terminates after waiting for
1229 that number of seconds if input does not arrive.
1231 T
\bTM
\bMP
\bPD
\bDI
\bIR
\bR If set, b
\bba
\bas
\bsh
\bh uses its value as the name of a directory in which
1232 b
\bba
\bas
\bsh
\bh creates temporary files for the shell's use.
1234 a
\bau
\but
\bto
\bo_
\b_r
\bre
\bes
\bsu
\bum
\bme
\be
1235 This variable controls how the shell interacts with the user and
1236 job control. If this variable is set, single word simple com-
1237 mands without redirections are treated as candidates for resump-
1238 tion of an existing stopped job. There is no ambiguity allowed;
1239 if there is more than one job beginning with the string typed,
1240 the job most recently accessed is selected. The _
\bn_
\ba_
\bm_
\be of a
1241 stopped job, in this context, is the command line used to start
1242 it. If set to the value _
\be_
\bx_
\ba_
\bc_
\bt, the string supplied must match
1243 the name of a stopped job exactly; if set to _
\bs_
\bu_
\bb_
\bs_
\bt_
\br_
\bi_
\bn_
\bg, the
1244 string supplied needs to match a substring of the name of a
1245 stopped job. The _
\bs_
\bu_
\bb_
\bs_
\bt_
\br_
\bi_
\bn_
\bg value provides functionality analo-
1246 gous to the %
\b%?
\b? job identifier (see J
\bJO
\bOB
\bB C
\bCO
\bON
\bNT
\bTR
\bRO
\bOL
\bL below). If set
1247 to any other value, the supplied string must be a prefix of a
1248 stopped job's name; this provides functionality analogous to the
1249 %
\b%_
\bs_
\bt_
\br_
\bi_
\bn_
\bg job identifier.
1251 h
\bhi
\bis
\bst
\btc
\bch
\bha
\bar
\brs
\bs
1252 The two or three characters which control history expansion and
1253 tokenization (see H
\bHI
\bIS
\bST
\bTO
\bOR
\bRY
\bY E
\bEX
\bXP
\bPA
\bAN
\bNS
\bSI
\bIO
\bON
\bN below). The first character
1254 is the _
\bh_
\bi_
\bs_
\bt_
\bo_
\br_
\by _
\be_
\bx_
\bp_
\ba_
\bn_
\bs_
\bi_
\bo_
\bn character, the character which signals
1255 the start of a history expansion, normally `!
\b!'. The second
1256 character is the _
\bq_
\bu_
\bi_
\bc_
\bk _
\bs_
\bu_
\bb_
\bs_
\bt_
\bi_
\bt_
\bu_
\bt_
\bi_
\bo_
\bn character, which is used as
1257 shorthand for re-running the previous command entered, substi-
1258 tuting one string for another in the command. The default is
1259 `^
\b^'. The optional third character is the character which indi-
1260 cates that the remainder of the line is a comment when found as
1261 the first character of a word, normally `#
\b#'. The history com-
1262 ment character causes history substitution to be skipped for the
1263 remaining words on the line. It does not necessarily cause the
1264 shell parser to treat the rest of the line as a comment.
1266 A
\bAr
\brr
\bra
\bay
\bys
\bs
1267 B
\bBa
\bas
\bsh
\bh provides one-dimensional indexed and associative array variables.
1268 Any variable may be used as an indexed array; the d
\bde
\bec
\bcl
\bla
\bar
\bre
\be builtin will
1269 explicitly declare an array. There is no maximum limit on the size of
1270 an array, nor any requirement that members be indexed or assigned con-
1271 tiguously. Indexed arrays are referenced using integers (including
1272 arithmetic expressions) and are zero-based; associative arrays are
1273 referenced using arbitrary strings.
1275 An indexed array is created automatically if any variable is assigned
1276 to using the syntax _
\bn_
\ba_
\bm_
\be[_
\bs_
\bu_
\bb_
\bs_
\bc_
\br_
\bi_
\bp_
\bt]=_
\bv_
\ba_
\bl_
\bu_
\be. The _
\bs_
\bu_
\bb_
\bs_
\bc_
\br_
\bi_
\bp_
\bt is treated as
1277 an arithmetic expression that must evaluate to a number. If _
\bs_
\bu_
\bb_
\bs_
\bc_
\br_
\bi_
\bp_
\bt
1278 evaluates to a number less than zero, it is used as an offset from one
1279 greater than the array's maximum index (so a subcript of -1 refers to
1280 the last element of the array). To explicitly declare an indexed
1281 array, use d
\bde
\bec
\bcl
\bla
\bar
\bre
\be -
\b-a
\ba _
\bn_
\ba_
\bm_
\be (see S
\bSH
\bHE
\bEL
\bLL
\bL B
\bBU
\bUI
\bIL
\bLT
\bTI
\bIN
\bN C
\bCO
\bOM
\bMM
\bMA
\bAN
\bND
\bDS
\bS below). d
\bde
\bec
\bcl
\bla
\bar
\bre
\be
1282 -
\b-a
\ba _
\bn_
\ba_
\bm_
\be[
\b[_
\bs_
\bu_
\bb_
\bs_
\bc_
\br_
\bi_
\bp_
\bt]
\b] is also accepted; the _
\bs_
\bu_
\bb_
\bs_
\bc_
\br_
\bi_
\bp_
\bt is ignored.
1284 Associative arrays are created using d
\bde
\bec
\bcl
\bla
\bar
\bre
\be -
\b-A
\bA _
\bn_
\ba_
\bm_
\be.
1286 Attributes may be specified for an array variable using the d
\bde
\bec
\bcl
\bla
\bar
\bre
\be and
1287 r
\bre
\bea
\bad
\bdo
\bon
\bnl
\bly
\by builtins. Each attribute applies to all members of an array.
1289 Arrays are assigned to using compound assignments of the form
1290 _
\bn_
\ba_
\bm_
\be=(
\b(value_
\b1 ... value_
\bn)
\b), where each _
\bv_
\ba_
\bl_
\bu_
\be is of the form [_
\bs_
\bu_
\bb_
\b-
1291 _
\bs_
\bc_
\br_
\bi_
\bp_
\bt]=_
\bs_
\bt_
\br_
\bi_
\bn_
\bg. Indexed array assignments do not require the bracket
1292 and subscript. When assigning to indexed arrays, if the optional
1293 brackets and subscript are supplied, that index is assigned to; other-
1294 wise the index of the element assigned is the last index assigned to by
1295 the statement plus one. Indexing starts at zero.
1297 When assigning to an associative array, the subscript is required.
1299 This syntax is also accepted by the d
\bde
\bec
\bcl
\bla
\bar
\bre
\be builtin. Individual array
1300 elements may be assigned to using the _
\bn_
\ba_
\bm_
\be[_
\bs_
\bu_
\bb_
\bs_
\bc_
\br_
\bi_
\bp_
\bt]=_
\bv_
\ba_
\bl_
\bu_
\be syntax
1303 Any element of an array may be referenced using ${_
\bn_
\ba_
\bm_
\be[_
\bs_
\bu_
\bb_
\bs_
\bc_
\br_
\bi_
\bp_
\bt]}.
1304 The braces are required to avoid conflicts with pathname expansion. If
1305 _
\bs_
\bu_
\bb_
\bs_
\bc_
\br_
\bi_
\bp_
\bt is @
\b@ or *
\b*, the word expands to all members of _
\bn_
\ba_
\bm_
\be. These
1306 subscripts differ only when the word appears within double quotes. If
1307 the word is double-quoted, ${_
\bn_
\ba_
\bm_
\be[*]} expands to a single word with the
1308 value of each array member separated by the first character of the I
\bIF
\bFS
\bS
1309 special variable, and ${_
\bn_
\ba_
\bm_
\be[@]} expands each element of _
\bn_
\ba_
\bm_
\be to a sep-
1310 arate word. When there are no array members, ${_
\bn_
\ba_
\bm_
\be[@]} expands to
1311 nothing. If the double-quoted expansion occurs within a word, the
1312 expansion of the first parameter is joined with the beginning part of
1313 the original word, and the expansion of the last parameter is joined
1314 with the last part of the original word. This is analogous to the
1315 expansion of the special parameters *
\b* and @
\b@ (see S
\bSp
\bpe
\bec
\bci
\bia
\bal
\bl P
\bPa
\bar
\bra
\bam
\bme
\bet
\bte
\ber
\brs
\bs
1316 above). ${#_
\bn_
\ba_
\bm_
\be[_
\bs_
\bu_
\bb_
\bs_
\bc_
\br_
\bi_
\bp_
\bt]} expands to the length of ${_
\bn_
\ba_
\bm_
\be[_
\bs_
\bu_
\bb_
\b-
1317 _
\bs_
\bc_
\br_
\bi_
\bp_
\bt]}. If _
\bs_
\bu_
\bb_
\bs_
\bc_
\br_
\bi_
\bp_
\bt is *
\b* or @
\b@, the expansion is the number of ele-
1318 ments in the array. Referencing an array variable without a subscript
1319 is equivalent to referencing the array with a subscript of 0.
1321 An array variable is considered set if a subscript has been assigned a
1322 value. The null string is a valid value.
1324 The u
\bun
\bns
\bse
\bet
\bt builtin is used to destroy arrays. u
\bun
\bns
\bse
\bet
\bt _
\bn_
\ba_
\bm_
\be[_
\bs_
\bu_
\bb_
\bs_
\bc_
\br_
\bi_
\bp_
\bt]
1325 destroys the array element at index _
\bs_
\bu_
\bb_
\bs_
\bc_
\br_
\bi_
\bp_
\bt. Care must be taken to
1326 avoid unwanted side effects caused by pathname expansion. u
\bun
\bns
\bse
\bet
\bt _
\bn_
\ba_
\bm_
\be,
1327 where _
\bn_
\ba_
\bm_
\be is an array, or u
\bun
\bns
\bse
\bet
\bt _
\bn_
\ba_
\bm_
\be[_
\bs_
\bu_
\bb_
\bs_
\bc_
\br_
\bi_
\bp_
\bt], where _
\bs_
\bu_
\bb_
\bs_
\bc_
\br_
\bi_
\bp_
\bt is *
\b*
1328 or @
\b@, removes the entire array.
1330 The d
\bde
\bec
\bcl
\bla
\bar
\bre
\be, l
\blo
\boc
\bca
\bal
\bl, and r
\bre
\bea
\bad
\bdo
\bon
\bnl
\bly
\by builtins each accept a -
\b-a
\ba option to
1331 specify an indexed array and a -
\b-A
\bA option to specify an associative
1332 array. The r
\bre
\bea
\bad
\bd builtin accepts a -
\b-a
\ba option to assign a list of words
1333 read from the standard input to an array. The s
\bse
\bet
\bt and d
\bde
\bec
\bcl
\bla
\bar
\bre
\be builtins
1334 display array values in a way that allows them to be reused as assign-
1337 E
\bEX
\bXP
\bPA
\bAN
\bNS
\bSI
\bIO
\bON
\bN
1338 Expansion is performed on the command line after it has been split into
1339 words. There are seven kinds of expansion performed: _
\bb_
\br_
\ba_
\bc_
\be _
\be_
\bx_
\bp_
\ba_
\bn_
\bs_
\bi_
\bo_
\bn,
1340 _
\bt_
\bi_
\bl_
\bd_
\be _
\be_
\bx_
\bp_
\ba_
\bn_
\bs_
\bi_
\bo_
\bn, _
\bp_
\ba_
\br_
\ba_
\bm_
\be_
\bt_
\be_
\br _
\ba_
\bn_
\bd _
\bv_
\ba_
\br_
\bi_
\ba_
\bb_
\bl_
\be _
\be_
\bx_
\bp_
\ba_
\bn_
\bs_
\bi_
\bo_
\bn, _
\bc_
\bo_
\bm_
\bm_
\ba_
\bn_
\bd _
\bs_
\bu_
\bb_
\bs_
\bt_
\bi_
\bt_
\bu_
\b-
1341 _
\bt_
\bi_
\bo_
\bn, _
\ba_
\br_
\bi_
\bt_
\bh_
\bm_
\be_
\bt_
\bi_
\bc _
\be_
\bx_
\bp_
\ba_
\bn_
\bs_
\bi_
\bo_
\bn, _
\bw_
\bo_
\br_
\bd _
\bs_
\bp_
\bl_
\bi_
\bt_
\bt_
\bi_
\bn_
\bg, and _
\bp_
\ba_
\bt_
\bh_
\bn_
\ba_
\bm_
\be _
\be_
\bx_
\bp_
\ba_
\bn_
\bs_
\bi_
\bo_
\bn.
1343 The order of expansions is: brace expansion, tilde expansion, parame-
1344 ter, variable and arithmetic expansion and command substitution (done
1345 in a left-to-right fashion), word splitting, and pathname expansion.
1347 On systems that can support it, there is an additional expansion avail-
1348 able: _
\bp_
\br_
\bo_
\bc_
\be_
\bs_
\bs _
\bs_
\bu_
\bb_
\bs_
\bt_
\bi_
\bt_
\bu_
\bt_
\bi_
\bo_
\bn.
1350 Only brace expansion, word splitting, and pathname expansion can change
1351 the number of words of the expansion; other expansions expand a single
1352 word to a single word. The only exceptions to this are the expansions
1353 of "$
\b$@
\b@" and "$
\b${
\b{_
\bn_
\ba_
\bm_
\be[
\b[@
\b@]
\b]}
\b}" as explained above (see P
\bPA
\bAR
\bRA
\bAM
\bME
\bET
\bTE
\bER
\bRS
\bS).
1355 B
\bBr
\bra
\bac
\bce
\be E
\bEx
\bxp
\bpa
\ban
\bns
\bsi
\bio
\bon
\bn
1356 _
\bB_
\br_
\ba_
\bc_
\be _
\be_
\bx_
\bp_
\ba_
\bn_
\bs_
\bi_
\bo_
\bn is a mechanism by which arbitrary strings may be gener-
1357 ated. This mechanism is similar to _
\bp_
\ba_
\bt_
\bh_
\bn_
\ba_
\bm_
\be _
\be_
\bx_
\bp_
\ba_
\bn_
\bs_
\bi_
\bo_
\bn, but the file-
1358 names generated need not exist. Patterns to be brace expanded take the
1359 form of an optional _
\bp_
\br_
\be_
\ba_
\bm_
\bb_
\bl_
\be, followed by either a series of comma-sep-
1360 arated strings or a sequence expression between a pair of braces, fol-
1361 lowed by an optional _
\bp_
\bo_
\bs_
\bt_
\bs_
\bc_
\br_
\bi_
\bp_
\bt. The preamble is prefixed to each
1362 string contained within the braces, and the postscript is then appended
1363 to each resulting string, expanding left to right.
1365 Brace expansions may be nested. The results of each expanded string
1366 are not sorted; left to right order is preserved. For example,
1367 a{
\b{d,c,b}
\b}e expands into `ade ace abe'.
1369 A sequence expression takes the form {
\b{_
\bx.
\b..
\b._
\by[
\b[.
\b..
\b._
\bi_
\bn_
\bc_
\br]
\b]}
\b}, where _
\bx and _
\by are
1370 either integers or single characters, and _
\bi_
\bn_
\bc_
\br, an optional increment,
1371 is an integer. When integers are supplied, the expression expands to
1372 each number between _
\bx and _
\by, inclusive. Supplied integers may be pre-
1373 fixed with _
\b0 to force each term to have the same width. When either _
\bx
1374 or _
\by begins with a zero, the shell attempts to force all generated
1375 terms to contain the same number of digits, zero-padding where neces-
1376 sary. When characters are supplied, the expression expands to each
1377 character lexicographically between _
\bx and _
\by, inclusive. Note that both
1378 _
\bx and _
\by must be of the same type. When the increment is supplied, it
1379 is used as the difference between each term. The default increment is
1380 1 or -1 as appropriate.
1382 Brace expansion is performed before any other expansions, and any char-
1383 acters special to other expansions are preserved in the result. It is
1384 strictly textual. B
\bBa
\bas
\bsh
\bh does not apply any syntactic interpretation to
1385 the context of the expansion or the text between the braces.
1387 A correctly-formed brace expansion must contain unquoted opening and
1388 closing braces, and at least one unquoted comma or a valid sequence
1389 expression. Any incorrectly formed brace expansion is left unchanged.
1390 A {
\b{ or ,
\b, may be quoted with a backslash to prevent its being considered
1391 part of a brace expression. To avoid conflicts with parameter expan-
1392 sion, the string $
\b${
\b{ is not considered eligible for brace expansion.
1394 This construct is typically used as shorthand when the common prefix of
1395 the strings to be generated is longer than in the above example:
1397 mkdir /usr/local/src/bash/{old,new,dist,bugs}
1399 chown root /usr/{ucb/{ex,edit},lib/{ex?.?*,how_ex}}
1401 Brace expansion introduces a slight incompatibility with historical
1402 versions of s
\bsh
\bh. s
\bsh
\bh does not treat opening or closing braces specially
1403 when they appear as part of a word, and preserves them in the output.
1404 B
\bBa
\bas
\bsh
\bh removes braces from words as a consequence of brace expansion.
1405 For example, a word entered to s
\bsh
\bh as _
\bf_
\bi_
\bl_
\be_
\b{_
\b1_
\b,_
\b2_
\b} appears identically in
1406 the output. The same word is output as _
\bf_
\bi_
\bl_
\be_
\b1 _
\bf_
\bi_
\bl_
\be_
\b2 after expansion by
1407 b
\bba
\bas
\bsh
\bh. If strict compatibility with s
\bsh
\bh is desired, start b
\bba
\bas
\bsh
\bh with the
1408 +
\b+B
\bB option or disable brace expansion with the +
\b+B
\bB option to the s
\bse
\bet
\bt com-
1409 mand (see S
\bSH
\bHE
\bEL
\bLL
\bL B
\bBU
\bUI
\bIL
\bLT
\bTI
\bIN
\bN C
\bCO
\bOM
\bMM
\bMA
\bAN
\bND
\bDS
\bS below).
1411 T
\bTi
\bil
\bld
\bde
\be E
\bEx
\bxp
\bpa
\ban
\bns
\bsi
\bio
\bon
\bn
1412 If a word begins with an unquoted tilde character (`~
\b~'), all of the
1413 characters preceding the first unquoted slash (or all characters, if
1414 there is no unquoted slash) are considered a _
\bt_
\bi_
\bl_
\bd_
\be_
\b-_
\bp_
\br_
\be_
\bf_
\bi_
\bx. If none of
1415 the characters in the tilde-prefix are quoted, the characters in the
1416 tilde-prefix following the tilde are treated as a possible _
\bl_
\bo_
\bg_
\bi_
\bn _
\bn_
\ba_
\bm_
\be.
1417 If this login name is the null string, the tilde is replaced with the
1418 value of the shell parameter H
\bHO
\bOM
\bME
\bE. If H
\bHO
\bOM
\bME
\bE is unset, the home direc-
1419 tory of the user executing the shell is substituted instead. Other-
1420 wise, the tilde-prefix is replaced with the home directory associated
1421 with the specified login name.
1423 If the tilde-prefix is a `~+', the value of the shell variable P
\bPW
\bWD
\bD
1424 replaces the tilde-prefix. If the tilde-prefix is a `~-', the value of
1425 the shell variable O
\bOL
\bLD
\bDP
\bPW
\bWD
\bD, if it is set, is substituted. If the char-
1426 acters following the tilde in the tilde-prefix consist of a number _
\bN,
1427 optionally prefixed by a `+' or a `-', the tilde-prefix is replaced
1428 with the corresponding element from the directory stack, as it would be
1429 displayed by the d
\bdi
\bir
\brs
\bs builtin invoked with the tilde-prefix as an argu-
1430 ment. If the characters following the tilde in the tilde-prefix con-
1431 sist of a number without a leading `+' or `-', `+' is assumed.
1433 If the login name is invalid, or the tilde expansion fails, the word is
1436 Each variable assignment is checked for unquoted tilde-prefixes immedi-
1437 ately following a :
\b: or the first =
\b=. In these cases, tilde expansion is
1438 also performed. Consequently, one may use file names with tildes in
1439 assignments to P
\bPA
\bAT
\bTH
\bH, M
\bMA
\bAI
\bIL
\bLP
\bPA
\bAT
\bTH
\bH, and C
\bCD
\bDP
\bPA
\bAT
\bTH
\bH, and the shell assigns the
1442 P
\bPa
\bar
\bra
\bam
\bme
\bet
\bte
\ber
\br E
\bEx
\bxp
\bpa
\ban
\bns
\bsi
\bio
\bon
\bn
1443 The `$
\b$' character introduces parameter expansion, command substitution,
1444 or arithmetic expansion. The parameter name or symbol to be expanded
1445 may be enclosed in braces, which are optional but serve to protect the
1446 variable to be expanded from characters immediately following it which
1447 could be interpreted as part of the name.
1449 When braces are used, the matching ending brace is the first `}
\b}' not
1450 escaped by a backslash or within a quoted string, and not within an
1451 embedded arithmetic expansion, command substitution, or parameter
1454 ${_
\bp_
\ba_
\br_
\ba_
\bm_
\be_
\bt_
\be_
\br}
1455 The value of _
\bp_
\ba_
\br_
\ba_
\bm_
\be_
\bt_
\be_
\br is substituted. The braces are required
1456 when _
\bp_
\ba_
\br_
\ba_
\bm_
\be_
\bt_
\be_
\br is a positional parameter with more than one
1457 digit, or when _
\bp_
\ba_
\br_
\ba_
\bm_
\be_
\bt_
\be_
\br is followed by a character which is not
1458 to be interpreted as part of its name.
1460 If the first character of _
\bp_
\ba_
\br_
\ba_
\bm_
\be_
\bt_
\be_
\br is an exclamation point (!
\b!), a
1461 level of variable indirection is introduced. B
\bBa
\bas
\bsh
\bh uses the value of
1462 the variable formed from the rest of _
\bp_
\ba_
\br_
\ba_
\bm_
\be_
\bt_
\be_
\br as the name of the vari-
1463 able; this variable is then expanded and that value is used in the rest
1464 of the substitution, rather than the value of _
\bp_
\ba_
\br_
\ba_
\bm_
\be_
\bt_
\be_
\br itself. This
1465 is known as _
\bi_
\bn_
\bd_
\bi_
\br_
\be_
\bc_
\bt _
\be_
\bx_
\bp_
\ba_
\bn_
\bs_
\bi_
\bo_
\bn. The exceptions to this are the expan-
1466 sions of ${!
\b!\
\b\f
\bfP
\bPf
\bfI
\bIp
\bpr
\bre
\bef
\bfi
\bix
\bx*
\b*} and ${!
\b!_
\bn_
\ba_
\bm_
\be[_
\b@]} described below. The excla-
1467 mation point must immediately follow the left brace in order to intro-
1470 In each of the cases below, _
\bw_
\bo_
\br_
\bd is subject to tilde expansion, parame-
1471 ter expansion, command substitution, and arithmetic expansion.
1473 When not performing substring expansion, using the forms documented
1474 below, b
\bba
\bas
\bsh
\bh tests for a parameter that is unset or null. Omitting the
1475 colon results in a test only for a parameter that is unset.
1477 ${_
\bp_
\ba_
\br_
\ba_
\bm_
\be_
\bt_
\be_
\br:
\b:-
\b-_
\bw_
\bo_
\br_
\bd}
1478 U
\bUs
\bse
\be D
\bDe
\bef
\bfa
\bau
\bul
\blt
\bt V
\bVa
\bal
\blu
\bue
\bes
\bs. If _
\bp_
\ba_
\br_
\ba_
\bm_
\be_
\bt_
\be_
\br is unset or null, the expan-
1479 sion of _
\bw_
\bo_
\br_
\bd is substituted. Otherwise, the value of _
\bp_
\ba_
\br_
\ba_
\bm_
\be_
\bt_
\be_
\br
1481 ${_
\bp_
\ba_
\br_
\ba_
\bm_
\be_
\bt_
\be_
\br:
\b:=
\b=_
\bw_
\bo_
\br_
\bd}
1482 A
\bAs
\bss
\bsi
\big
\bgn
\bn D
\bDe
\bef
\bfa
\bau
\bul
\blt
\bt V
\bVa
\bal
\blu
\bue
\bes
\bs. If _
\bp_
\ba_
\br_
\ba_
\bm_
\be_
\bt_
\be_
\br is unset or null, the
1483 expansion of _
\bw_
\bo_
\br_
\bd is assigned to _
\bp_
\ba_
\br_
\ba_
\bm_
\be_
\bt_
\be_
\br. The value of _
\bp_
\ba_
\br_
\ba_
\bm_
\b-
1484 _
\be_
\bt_
\be_
\br is then substituted. Positional parameters and special
1485 parameters may not be assigned to in this way.
1486 ${_
\bp_
\ba_
\br_
\ba_
\bm_
\be_
\bt_
\be_
\br:
\b:?
\b?_
\bw_
\bo_
\br_
\bd}
1487 D
\bDi
\bis
\bsp
\bpl
\bla
\bay
\by E
\bEr
\brr
\bro
\bor
\br i
\bif
\bf N
\bNu
\bul
\bll
\bl o
\bor
\br U
\bUn
\bns
\bse
\bet
\bt. If _
\bp_
\ba_
\br_
\ba_
\bm_
\be_
\bt_
\be_
\br is null or unset,
1488 the expansion of _
\bw_
\bo_
\br_
\bd (or a message to that effect if _
\bw_
\bo_
\br_
\bd is
1489 not present) is written to the standard error and the shell, if
1490 it is not interactive, exits. Otherwise, the value of _
\bp_
\ba_
\br_
\ba_
\bm_
\be_
\bt_
\be_
\br
1492 ${_
\bp_
\ba_
\br_
\ba_
\bm_
\be_
\bt_
\be_
\br:
\b:+
\b+_
\bw_
\bo_
\br_
\bd}
1493 U
\bUs
\bse
\be A
\bAl
\blt
\bte
\ber
\brn
\bna
\bat
\bte
\be V
\bVa
\bal
\blu
\bue
\be. If _
\bp_
\ba_
\br_
\ba_
\bm_
\be_
\bt_
\be_
\br is null or unset, nothing is
1494 substituted, otherwise the expansion of _
\bw_
\bo_
\br_
\bd is substituted.
1495 ${_
\bp_
\ba_
\br_
\ba_
\bm_
\be_
\bt_
\be_
\br:
\b:_
\bo_
\bf_
\bf_
\bs_
\be_
\bt}
1496 ${_
\bp_
\ba_
\br_
\ba_
\bm_
\be_
\bt_
\be_
\br:
\b:_
\bo_
\bf_
\bf_
\bs_
\be_
\bt:
\b:_
\bl_
\be_
\bn_
\bg_
\bt_
\bh}
1497 S
\bSu
\bub
\bbs
\bst
\btr
\bri
\bin
\bng
\bg E
\bEx
\bxp
\bpa
\ban
\bns
\bsi
\bio
\bon
\bn. Expands to up to _
\bl_
\be_
\bn_
\bg_
\bt_
\bh characters of
1498 _
\bp_
\ba_
\br_
\ba_
\bm_
\be_
\bt_
\be_
\br starting at the character specified by _
\bo_
\bf_
\bf_
\bs_
\be_
\bt. If
1499 _
\bl_
\be_
\bn_
\bg_
\bt_
\bh is omitted, expands to the substring of _
\bp_
\ba_
\br_
\ba_
\bm_
\be_
\bt_
\be_
\br start-
1500 ing at the character specified by _
\bo_
\bf_
\bf_
\bs_
\be_
\bt. _
\bl_
\be_
\bn_
\bg_
\bt_
\bh and _
\bo_
\bf_
\bf_
\bs_
\be_
\bt are
1501 arithmetic expressions (see A
\bAR
\bRI
\bIT
\bTH
\bHM
\bME
\bET
\bTI
\bIC
\bC E
\bEV
\bVA
\bAL
\bLU
\bUA
\bAT
\bTI
\bIO
\bON
\bN below). If
1502 _
\bo_
\bf_
\bf_
\bs_
\be_
\bt evaluates to a number less than zero, the value is used
1503 as an offset from the end of the value of _
\bp_
\ba_
\br_
\ba_
\bm_
\be_
\bt_
\be_
\br. If _
\bl_
\be_
\bn_
\bg_
\bt_
\bh
1504 evaluates to a number less than zero, and _
\bp_
\ba_
\br_
\ba_
\bm_
\be_
\bt_
\be_
\br is not @
\b@ and
1505 not an indexed or associative array, it is interpreted as an
1506 offset from the end of the value of _
\bp_
\ba_
\br_
\ba_
\bm_
\be_
\bt_
\be_
\br rather than a num-
1507 ber of characters, and the expansion is the characters between
1508 the two offsets. If _
\bp_
\ba_
\br_
\ba_
\bm_
\be_
\bt_
\be_
\br is @
\b@, the result is _
\bl_
\be_
\bn_
\bg_
\bt_
\bh posi-
1509 tional parameters beginning at _
\bo_
\bf_
\bf_
\bs_
\be_
\bt. If _
\bp_
\ba_
\br_
\ba_
\bm_
\be_
\bt_
\be_
\br is an
1510 indexed array name subscripted by @ or *, the result is the
1511 _
\bl_
\be_
\bn_
\bg_
\bt_
\bh members of the array beginning with ${_
\bp_
\ba_
\br_
\ba_
\bm_
\be_
\bt_
\be_
\br[_
\bo_
\bf_
\bf_
\bs_
\be_
\bt]}.
1512 A negative _
\bo_
\bf_
\bf_
\bs_
\be_
\bt is taken relative to one greater than the max-
1513 imum index of the specified array. Substring expansion applied
1514 to an associative array produces undefined results. Note that a
1515 negative offset must be separated from the colon by at least one
1516 space to avoid being confused with the :- expansion. Substring
1517 indexing is zero-based unless the positional parameters are
1518 used, in which case the indexing starts at 1 by default. If
1519 _
\bo_
\bf_
\bf_
\bs_
\be_
\bt is 0, and the positional parameters are used, $
\b$0
\b0 is pre-
1522 ${!
\b!_
\bp_
\br_
\be_
\bf_
\bi_
\bx*
\b*}
1523 ${!
\b!_
\bp_
\br_
\be_
\bf_
\bi_
\bx@
\b@}
1524 N
\bNa
\bam
\bme
\bes
\bs m
\bma
\bat
\btc
\bch
\bhi
\bin
\bng
\bg p
\bpr
\bre
\bef
\bfi
\bix
\bx. Expands to the names of variables whose
1525 names begin with _
\bp_
\br_
\be_
\bf_
\bi_
\bx, separated by the first character of the
1526 I
\bIF
\bFS
\bS special variable. When _
\b@ is used and the expansion appears
1527 within double quotes, each variable name expands to a separate
1530 ${!
\b!_
\bn_
\ba_
\bm_
\be[_
\b@]}
1531 ${!
\b!_
\bn_
\ba_
\bm_
\be[_
\b*]}
1532 L
\bLi
\bis
\bst
\bt o
\bof
\bf a
\bar
\brr
\bra
\bay
\by k
\bke
\bey
\bys
\bs. If _
\bn_
\ba_
\bm_
\be is an array variable, expands to
1533 the list of array indices (keys) assigned in _
\bn_
\ba_
\bm_
\be. If _
\bn_
\ba_
\bm_
\be is
1534 not an array, expands to 0 if _
\bn_
\ba_
\bm_
\be is set and null otherwise.
1535 When _
\b@ is used and the expansion appears within double quotes,
1536 each key expands to a separate word.
1538 ${#
\b#_
\bp_
\ba_
\br_
\ba_
\bm_
\be_
\bt_
\be_
\br}
1539 P
\bPa
\bar
\bra
\bam
\bme
\bet
\bte
\ber
\br l
\ble
\ben
\bng
\bgt
\bth
\bh. The length in characters of the value of
1540 _
\bp_
\ba_
\br_
\ba_
\bm_
\be_
\bt_
\be_
\br is substituted. If _
\bp_
\ba_
\br_
\ba_
\bm_
\be_
\bt_
\be_
\br is *
\b* or @
\b@, the value
1541 substituted is the number of positional parameters. If _
\bp_
\ba_
\br_
\ba_
\bm_
\be_
\b-
1542 _
\bt_
\be_
\br is an array name subscripted by *
\b* or @
\b@, the value substi-
1543 tuted is the number of elements in the array.
1545 ${_
\bp_
\ba_
\br_
\ba_
\bm_
\be_
\bt_
\be_
\br#
\b#_
\bw_
\bo_
\br_
\bd}
1546 ${_
\bp_
\ba_
\br_
\ba_
\bm_
\be_
\bt_
\be_
\br#
\b##
\b#_
\bw_
\bo_
\br_
\bd}
1547 R
\bRe
\bem
\bmo
\bov
\bve
\be m
\bma
\bat
\btc
\bch
\bhi
\bin
\bng
\bg p
\bpr
\bre
\bef
\bfi
\bix
\bx p
\bpa
\bat
\btt
\bte
\ber
\brn
\bn. The _
\bw_
\bo_
\br_
\bd is expanded to produce
1548 a pattern just as in pathname expansion. If the pattern matches
1549 the beginning of the value of _
\bp_
\ba_
\br_
\ba_
\bm_
\be_
\bt_
\be_
\br, then the result of the
1550 expansion is the expanded value of _
\bp_
\ba_
\br_
\ba_
\bm_
\be_
\bt_
\be_
\br with the shortest
1551 matching pattern (the ``#
\b#'' case) or the longest matching pat-
1552 tern (the ``#
\b##
\b#'' case) deleted. If _
\bp_
\ba_
\br_
\ba_
\bm_
\be_
\bt_
\be_
\br is @
\b@ or *
\b*, the
1553 pattern removal operation is applied to each positional parame-
1554 ter in turn, and the expansion is the resultant list. If _
\bp_
\ba_
\br_
\ba_
\bm_
\b-
1555 _
\be_
\bt_
\be_
\br is an array variable subscripted with @
\b@ or *
\b*, the pattern
1556 removal operation is applied to each member of the array in
1557 turn, and the expansion is the resultant list.
1559 ${_
\bp_
\ba_
\br_
\ba_
\bm_
\be_
\bt_
\be_
\br%
\b%_
\bw_
\bo_
\br_
\bd}
1560 ${_
\bp_
\ba_
\br_
\ba_
\bm_
\be_
\bt_
\be_
\br%
\b%%
\b%_
\bw_
\bo_
\br_
\bd}
1561 R
\bRe
\bem
\bmo
\bov
\bve
\be m
\bma
\bat
\btc
\bch
\bhi
\bin
\bng
\bg s
\bsu
\buf
\bff
\bfi
\bix
\bx p
\bpa
\bat
\btt
\bte
\ber
\brn
\bn. The _
\bw_
\bo_
\br_
\bd is expanded to produce
1562 a pattern just as in pathname expansion. If the pattern matches
1563 a trailing portion of the expanded value of _
\bp_
\ba_
\br_
\ba_
\bm_
\be_
\bt_
\be_
\br, then the
1564 result of the expansion is the expanded value of _
\bp_
\ba_
\br_
\ba_
\bm_
\be_
\bt_
\be_
\br with
1565 the shortest matching pattern (the ``%
\b%'' case) or the longest
1566 matching pattern (the ``%
\b%%
\b%'' case) deleted. If _
\bp_
\ba_
\br_
\ba_
\bm_
\be_
\bt_
\be_
\br is @
\b@
1567 or *
\b*, the pattern removal operation is applied to each posi-
1568 tional parameter in turn, and the expansion is the resultant
1569 list. If _
\bp_
\ba_
\br_
\ba_
\bm_
\be_
\bt_
\be_
\br is an array variable subscripted with @
\b@ or
1570 *
\b*, the pattern removal operation is applied to each member of
1571 the array in turn, and the expansion is the resultant list.
1573 ${_
\bp_
\ba_
\br_
\ba_
\bm_
\be_
\bt_
\be_
\br/
\b/_
\bp_
\ba_
\bt_
\bt_
\be_
\br_
\bn/
\b/_
\bs_
\bt_
\br_
\bi_
\bn_
\bg}
1574 P
\bPa
\bat
\btt
\bte
\ber
\brn
\bn s
\bsu
\bub
\bbs
\bst
\bti
\bit
\btu
\but
\bti
\bio
\bon
\bn. The _
\bp_
\ba_
\bt_
\bt_
\be_
\br_
\bn is expanded to produce a pat-
1575 tern just as in pathname expansion. _
\bP_
\ba_
\br_
\ba_
\bm_
\be_
\bt_
\be_
\br is expanded and
1576 the longest match of _
\bp_
\ba_
\bt_
\bt_
\be_
\br_
\bn against its value is replaced with
1577 _
\bs_
\bt_
\br_
\bi_
\bn_
\bg. If _
\bp_
\ba_
\bt_
\bt_
\be_
\br_
\bn begins with /
\b/, all matches of _
\bp_
\ba_
\bt_
\bt_
\be_
\br_
\bn are
1578 replaced with _
\bs_
\bt_
\br_
\bi_
\bn_
\bg. Normally only the first match is
1579 replaced. If _
\bp_
\ba_
\bt_
\bt_
\be_
\br_
\bn begins with #
\b#, it must match at the begin-
1580 ning of the expanded value of _
\bp_
\ba_
\br_
\ba_
\bm_
\be_
\bt_
\be_
\br. If _
\bp_
\ba_
\bt_
\bt_
\be_
\br_
\bn begins with
1581 %
\b%, it must match at the end of the expanded value of _
\bp_
\ba_
\br_
\ba_
\bm_
\be_
\bt_
\be_
\br.
1582 If _
\bs_
\bt_
\br_
\bi_
\bn_
\bg is null, matches of _
\bp_
\ba_
\bt_
\bt_
\be_
\br_
\bn are deleted and the /
\b/ fol-
1583 lowing _
\bp_
\ba_
\bt_
\bt_
\be_
\br_
\bn may be omitted. If _
\bp_
\ba_
\br_
\ba_
\bm_
\be_
\bt_
\be_
\br is @
\b@ or *
\b*, the sub-
1584 stitution operation is applied to each positional parameter in
1585 turn, and the expansion is the resultant list. If _
\bp_
\ba_
\br_
\ba_
\bm_
\be_
\bt_
\be_
\br is
1586 an array variable subscripted with @
\b@ or *
\b*, the substitution
1587 operation is applied to each member of the array in turn, and
1588 the expansion is the resultant list.
1590 ${_
\bp_
\ba_
\br_
\ba_
\bm_
\be_
\bt_
\be_
\br^
\b^_
\bp_
\ba_
\bt_
\bt_
\be_
\br_
\bn}
1591 ${_
\bp_
\ba_
\br_
\ba_
\bm_
\be_
\bt_
\be_
\br^
\b^^
\b^_
\bp_
\ba_
\bt_
\bt_
\be_
\br_
\bn}
1592 ${_
\bp_
\ba_
\br_
\ba_
\bm_
\be_
\bt_
\be_
\br,
\b,_
\bp_
\ba_
\bt_
\bt_
\be_
\br_
\bn}
1593 ${_
\bp_
\ba_
\br_
\ba_
\bm_
\be_
\bt_
\be_
\br,
\b,,
\b,_
\bp_
\ba_
\bt_
\bt_
\be_
\br_
\bn}
1594 C
\bCa
\bas
\bse
\be m
\bmo
\bod
\bdi
\bif
\bfi
\bic
\bca
\bat
\bti
\bio
\bon
\bn. This expansion modifies the case of alpha-
1595 betic characters in _
\bp_
\ba_
\br_
\ba_
\bm_
\be_
\bt_
\be_
\br. The _
\bp_
\ba_
\bt_
\bt_
\be_
\br_
\bn is expanded to pro-
1596 duce a pattern just as in pathname expansion. The ^
\b^ operator
1597 converts lowercase letters matching _
\bp_
\ba_
\bt_
\bt_
\be_
\br_
\bn to uppercase; the ,
\b,
1598 operator converts matching uppercase letters to lowercase. The
1599 ^
\b^^
\b^ and ,
\b,,
\b, expansions convert each matched character in the
1600 expanded value; the ^
\b^ and ,
\b, expansions match and convert only
1601 the first character in the expanded value. If _
\bp_
\ba_
\bt_
\bt_
\be_
\br_
\bn is omit-
1602 ted, it is treated like a ?
\b?, which matches every character. If
1603 _
\bp_
\ba_
\br_
\ba_
\bm_
\be_
\bt_
\be_
\br is @
\b@ or *
\b*, the case modification operation is applied
1604 to each positional parameter in turn, and the expansion is the
1605 resultant list. If _
\bp_
\ba_
\br_
\ba_
\bm_
\be_
\bt_
\be_
\br is an array variable subscripted
1606 with @
\b@ or *
\b*, the case modification operation is applied to each
1607 member of the array in turn, and the expansion is the resultant
1610 C
\bCo
\bom
\bmm
\bma
\ban
\bnd
\bd S
\bSu
\bub
\bbs
\bst
\bti
\bit
\btu
\but
\bti
\bio
\bon
\bn
1611 _
\bC_
\bo_
\bm_
\bm_
\ba_
\bn_
\bd _
\bs_
\bu_
\bb_
\bs_
\bt_
\bi_
\bt_
\bu_
\bt_
\bi_
\bo_
\bn allows the output of a command to replace the com-
1612 mand name. There are two forms:
1615 $
\b$(
\b(_
\bc_
\bo_
\bm_
\bm_
\ba_
\bn_
\bd)
\b)
1617 `
\b`_
\bc_
\bo_
\bm_
\bm_
\ba_
\bn_
\bd`
\b`
1619 B
\bBa
\bas
\bsh
\bh performs the expansion by executing _
\bc_
\bo_
\bm_
\bm_
\ba_
\bn_
\bd and replacing the com-
1620 mand substitution with the standard output of the command, with any
1621 trailing newlines deleted. Embedded newlines are not deleted, but they
1622 may be removed during word splitting. The command substitution $
\b$(
\b(c
\bca
\bat
\bt
1623 _
\bf_
\bi_
\bl_
\be)
\b) can be replaced by the equivalent but faster $
\b$(
\b(<
\b< _
\bf_
\bi_
\bl_
\be)
\b).
1625 When the old-style backquote form of substitution is used, backslash
1626 retains its literal meaning except when followed by $
\b$, `
\b`, or \
\b\. The
1627 first backquote not preceded by a backslash terminates the command sub-
1628 stitution. When using the $(_
\bc_
\bo_
\bm_
\bm_
\ba_
\bn_
\bd) form, all characters between the
1629 parentheses make up the command; none are treated specially.
1631 Command substitutions may be nested. To nest when using the backquoted
1632 form, escape the inner backquotes with backslashes.
1634 If the substitution appears within double quotes, word splitting and
1635 pathname expansion are not performed on the results.
1637 A
\bAr
\bri
\bit
\bth
\bhm
\bme
\bet
\bti
\bic
\bc E
\bEx
\bxp
\bpa
\ban
\bns
\bsi
\bio
\bon
\bn
1638 Arithmetic expansion allows the evaluation of an arithmetic expression
1639 and the substitution of the result. The format for arithmetic expan-
1642 $
\b$(
\b((
\b(_
\be_
\bx_
\bp_
\br_
\be_
\bs_
\bs_
\bi_
\bo_
\bn)
\b))
\b)
1644 The _
\be_
\bx_
\bp_
\br_
\be_
\bs_
\bs_
\bi_
\bo_
\bn is treated as if it were within double quotes, but a
1645 double quote inside the parentheses is not treated specially. All
1646 tokens in the expression undergo parameter expansion, string expansion,
1647 command substitution, and quote removal. Arithmetic expansions may be
1650 The evaluation is performed according to the rules listed below under
1651 A
\bAR
\bRI
\bIT
\bTH
\bHM
\bME
\bET
\bTI
\bIC
\bC E
\bEV
\bVA
\bAL
\bLU
\bUA
\bAT
\bTI
\bIO
\bON
\bN. If _
\be_
\bx_
\bp_
\br_
\be_
\bs_
\bs_
\bi_
\bo_
\bn is invalid, b
\bba
\bas
\bsh
\bh prints a message
1652 indicating failure and no substitution occurs.
1654 P
\bPr
\bro
\boc
\bce
\bes
\bss
\bs S
\bSu
\bub
\bbs
\bst
\bti
\bit
\btu
\but
\bti
\bio
\bon
\bn
1655 _
\bP_
\br_
\bo_
\bc_
\be_
\bs_
\bs _
\bs_
\bu_
\bb_
\bs_
\bt_
\bi_
\bt_
\bu_
\bt_
\bi_
\bo_
\bn is supported on systems that support named pipes
1656 (_
\bF_
\bI_
\bF_
\bO_
\bs) or the /
\b/d
\bde
\bev
\bv/
\b/f
\bfd
\bd method of naming open files. It takes the form
1657 of <
\b<(
\b(_
\bl_
\bi_
\bs_
\bt)
\b) or >
\b>(
\b(_
\bl_
\bi_
\bs_
\bt)
\b). The process _
\bl_
\bi_
\bs_
\bt is run with its input or out-
1658 put connected to a _
\bF_
\bI_
\bF_
\bO or some file in /
\b/d
\bde
\bev
\bv/
\b/f
\bfd
\bd. The name of this file
1659 is passed as an argument to the current command as the result of the
1660 expansion. If the >
\b>(
\b(_
\bl_
\bi_
\bs_
\bt)
\b) form is used, writing to the file will pro-
1661 vide input for _
\bl_
\bi_
\bs_
\bt. If the <
\b<(
\b(_
\bl_
\bi_
\bs_
\bt)
\b) form is used, the file passed as
1662 an argument should be read to obtain the output of _
\bl_
\bi_
\bs_
\bt.
1664 When available, process substitution is performed simultaneously with
1665 parameter and variable expansion, command substitution, and arithmetic
1668 W
\bWo
\bor
\brd
\bd S
\bSp
\bpl
\bli
\bit
\btt
\bti
\bin
\bng
\bg
1669 The shell scans the results of parameter expansion, command substitu-
1670 tion, and arithmetic expansion that did not occur within double quotes
1671 for _
\bw_
\bo_
\br_
\bd _
\bs_
\bp_
\bl_
\bi_
\bt_
\bt_
\bi_
\bn_
\bg.
1673 The shell treats each character of I
\bIF
\bFS
\bS as a delimiter, and splits the
1674 results of the other expansions into words on these characters. If I
\bIF
\bFS
\bS
1675 is unset, or its value is exactly <
\b<s
\bsp
\bpa
\bac
\bce
\be>
\b><
\b<t
\bta
\bab
\bb>
\b><
\b<n
\bne
\bew
\bwl
\bli
\bin
\bne
\be>
\b>, the default,
1676 then sequences of <
\b<s
\bsp
\bpa
\bac
\bce
\be>
\b>, <
\b<t
\bta
\bab
\bb>
\b>, and <
\b<n
\bne
\bew
\bwl
\bli
\bin
\bne
\be>
\b> at the beginning and
1677 end of the results of the previous expansions are ignored, and any
1678 sequence of I
\bIF
\bFS
\bS characters not at the beginning or end serves to
1679 delimit words. If I
\bIF
\bFS
\bS has a value other than the default, then
1680 sequences of the whitespace characters s
\bsp
\bpa
\bac
\bce
\be and t
\bta
\bab
\bb are ignored at the
1681 beginning and end of the word, as long as the whitespace character is
1682 in the value of I
\bIF
\bFS
\bS (an I
\bIF
\bFS
\bS whitespace character). Any character in
1683 I
\bIF
\bFS
\bS that is not I
\bIF
\bFS
\bS whitespace, along with any adjacent I
\bIF
\bFS
\bS whitespace
1684 characters, delimits a field. A sequence of I
\bIF
\bFS
\bS whitespace characters
1685 is also treated as a delimiter. If the value of I
\bIF
\bFS
\bS is null, no word
1688 Explicit null arguments ("
\b""
\b" or '
\b''
\b') are retained. Unquoted implicit
1689 null arguments, resulting from the expansion of parameters that have no
1690 values, are removed. If a parameter with no value is expanded within
1691 double quotes, a null argument results and is retained.
1693 Note that if no expansion occurs, no splitting is performed.
1695 P
\bPa
\bat
\bth
\bhn
\bna
\bam
\bme
\be E
\bEx
\bxp
\bpa
\ban
\bns
\bsi
\bio
\bon
\bn
1696 After word splitting, unless the -
\b-f
\bf option has been set, b
\bba
\bas
\bsh
\bh scans
1697 each word for the characters *
\b*, ?
\b?, and [
\b[. If one of these characters
1698 appears, then the word is regarded as a _
\bp_
\ba_
\bt_
\bt_
\be_
\br_
\bn, and replaced with an
1699 alphabetically sorted list of file names matching the pattern. If no
1700 matching file names are found, and the shell option n
\bnu
\bul
\bll
\blg
\bgl
\blo
\bob
\bb is not
1701 enabled, the word is left unchanged. If the n
\bnu
\bul
\bll
\blg
\bgl
\blo
\bob
\bb option is set,
1702 and no matches are found, the word is removed. If the f
\bfa
\bai
\bil
\blg
\bgl
\blo
\bob
\bb shell
1703 option is set, and no matches are found, an error message is printed
1704 and the command is not executed. If the shell option n
\bno
\boc
\bca
\bas
\bse
\beg
\bgl
\blo
\bob
\bb is
1705 enabled, the match is performed without regard to the case of alpha-
1706 betic characters. When a pattern is used for pathname expansion, the
1707 character `
\b``
\b`.
\b.'
\b''
\b' at the start of a name or immediately following a
1708 slash must be matched explicitly, unless the shell option d
\bdo
\bot
\btg
\bgl
\blo
\bob
\bb is
1709 set. When matching a pathname, the slash character must always be
1710 matched explicitly. In other cases, the `
\b``
\b`.
\b.'
\b''
\b' character is not
1711 treated specially. See the description of s
\bsh
\bho
\bop
\bpt
\bt below under S
\bSH
\bHE
\bEL
\bLL
\bL
1712 B
\bBU
\bUI
\bIL
\bLT
\bTI
\bIN
\bN C
\bCO
\bOM
\bMM
\bMA
\bAN
\bND
\bDS
\bS for a description of the n
\bno
\boc
\bca
\bas
\bse
\beg
\bgl
\blo
\bob
\bb, n
\bnu
\bul
\bll
\blg
\bgl
\blo
\bob
\bb, f
\bfa
\bai
\bil
\bl-
\b-
1713 g
\bgl
\blo
\bob
\bb, and d
\bdo
\bot
\btg
\bgl
\blo
\bob
\bb shell options.
1715 The G
\bGL
\bLO
\bOB
\bBI
\bIG
\bGN
\bNO
\bOR
\bRE
\bE shell variable may be used to restrict the set of file
1716 names matching a _
\bp_
\ba_
\bt_
\bt_
\be_
\br_
\bn. If G
\bGL
\bLO
\bOB
\bBI
\bIG
\bGN
\bNO
\bOR
\bRE
\bE is set, each matching file
1717 name that also matches one of the patterns in G
\bGL
\bLO
\bOB
\bBI
\bIG
\bGN
\bNO
\bOR
\bRE
\bE is removed
1718 from the list of matches. The file names `
\b``
\b`.
\b.'
\b''
\b' and `
\b``
\b`.
\b..
\b.'
\b''
\b' are always
1719 ignored when G
\bGL
\bLO
\bOB
\bBI
\bIG
\bGN
\bNO
\bOR
\bRE
\bE is set and not null. However, setting G
\bGL
\bLO
\bOB
\bBI
\bIG
\bG-
\b-
1720 N
\bNO
\bOR
\bRE
\bE to a non-null value has the effect of enabling the d
\bdo
\bot
\btg
\bgl
\blo
\bob
\bb shell
1721 option, so all other file names beginning with a `
\b``
\b`.
\b.'
\b''
\b' will match. To
1722 get the old behavior of ignoring file names beginning with a `
\b``
\b`.
\b.'
\b''
\b',
1723 make `
\b``
\b`.
\b.*
\b*'
\b''
\b' one of the patterns in G
\bGL
\bLO
\bOB
\bBI
\bIG
\bGN
\bNO
\bOR
\bRE
\bE. The d
\bdo
\bot
\btg
\bgl
\blo
\bob
\bb option is
1724 disabled when G
\bGL
\bLO
\bOB
\bBI
\bIG
\bGN
\bNO
\bOR
\bRE
\bE is unset.
1726 P
\bPa
\bat
\btt
\bte
\ber
\brn
\bn M
\bMa
\bat
\btc
\bch
\bhi
\bin
\bng
\bg
1728 Any character that appears in a pattern, other than the special pattern
1729 characters described below, matches itself. The NUL character may not
1730 occur in a pattern. A backslash escapes the following character; the
1731 escaping backslash is discarded when matching. The special pattern
1732 characters must be quoted if they are to be matched literally.
1734 The special pattern characters have the following meanings:
1736 *
\b* Matches any string, including the null string. When the
1737 g
\bgl
\blo
\bob
\bbs
\bst
\bta
\bar
\br shell option is enabled, and *
\b* is used in a
1738 pathname expansion context, two adjacent *
\b*s used as a
1739 single pattern will match all files and zero or more
1740 directories and subdirectories. If followed by a /
\b/, two
1741 adjacent *
\b*s will match only directories and subdirecto-
1743 ?
\b? Matches any single character.
1744 [
\b[.
\b..
\b..
\b.]
\b] Matches any one of the enclosed characters. A pair of
1745 characters separated by a hyphen denotes a _
\br_
\ba_
\bn_
\bg_
\be _
\be_
\bx_
\bp_
\br_
\be_
\bs_
\b-
1746 _
\bs_
\bi_
\bo_
\bn; any character that sorts between those two charac-
1747 ters, inclusive, using the current locale's collating
1748 sequence and character set, is matched. If the first
1749 character following the [
\b[ is a !
\b! or a ^
\b^ then any charac-
1750 ter not enclosed is matched. The sorting order of char-
1751 acters in range expressions is determined by the current
1752 locale and the value of the L
\bLC
\bC_
\b_C
\bCO
\bOL
\bLL
\bLA
\bAT
\bTE
\bE shell variable, if
1753 set. A -
\b- may be matched by including it as the first or
1754 last character in the set. A ]
\b] may be matched by includ-
1755 ing it as the first character in the set.
1757 Within [
\b[ and ]
\b], _
\bc_
\bh_
\ba_
\br_
\ba_
\bc_
\bt_
\be_
\br _
\bc_
\bl_
\ba_
\bs_
\bs_
\be_
\bs can be specified using
1758 the syntax [
\b[:
\b:_
\bc_
\bl_
\ba_
\bs_
\bs:
\b:]
\b], where _
\bc_
\bl_
\ba_
\bs_
\bs is one of the following
1759 classes defined in the POSIX standard:
1760 a
\bal
\bln
\bnu
\bum
\bm a
\bal
\blp
\bph
\bha
\ba a
\bas
\bsc
\bci
\bii
\bi b
\bbl
\bla
\ban
\bnk
\bk c
\bcn
\bnt
\btr
\brl
\bl d
\bdi
\big
\bgi
\bit
\bt g
\bgr
\bra
\bap
\bph
\bh l
\blo
\bow
\bwe
\ber
\br p
\bpr
\bri
\bin
\bnt
\bt
1761 p
\bpu
\bun
\bnc
\bct
\bt s
\bsp
\bpa
\bac
\bce
\be u
\bup
\bpp
\bpe
\ber
\br w
\bwo
\bor
\brd
\bd x
\bxd
\bdi
\big
\bgi
\bit
\bt
1762 A character class matches any character belonging to that
1763 class. The w
\bwo
\bor
\brd
\bd character class matches letters, digits,
1764 and the character _.
1766 Within [
\b[ and ]
\b], an _
\be_
\bq_
\bu_
\bi_
\bv_
\ba_
\bl_
\be_
\bn_
\bc_
\be _
\bc_
\bl_
\ba_
\bs_
\bs can be specified
1767 using the syntax [
\b[=
\b=_
\bc=
\b=]
\b], which matches all characters with
1768 the same collation weight (as defined by the current
1769 locale) as the character _
\bc.
1771 Within [
\b[ and ]
\b], the syntax [
\b[.
\b._
\bs_
\by_
\bm_
\bb_
\bo_
\bl.
\b.]
\b] matches the collat-
1772 ing symbol _
\bs_
\by_
\bm_
\bb_
\bo_
\bl.
1774 If the e
\bex
\bxt
\btg
\bgl
\blo
\bob
\bb shell option is enabled using the s
\bsh
\bho
\bop
\bpt
\bt builtin, several
1775 extended pattern matching operators are recognized. In the following
1776 description, a _
\bp_
\ba_
\bt_
\bt_
\be_
\br_
\bn_
\b-_
\bl_
\bi_
\bs_
\bt is a list of one or more patterns separated
1777 by a |
\b|. Composite patterns may be formed using one or more of the fol-
1778 lowing sub-patterns:
1780 ?
\b?(
\b(_
\bp_
\ba_
\bt_
\bt_
\be_
\br_
\bn_
\b-_
\bl_
\bi_
\bs_
\bt)
\b)
1781 Matches zero or one occurrence of the given patterns
1782 *
\b*(
\b(_
\bp_
\ba_
\bt_
\bt_
\be_
\br_
\bn_
\b-_
\bl_
\bi_
\bs_
\bt)
\b)
1783 Matches zero or more occurrences of the given patterns
1784 +
\b+(
\b(_
\bp_
\ba_
\bt_
\bt_
\be_
\br_
\bn_
\b-_
\bl_
\bi_
\bs_
\bt)
\b)
1785 Matches one or more occurrences of the given patterns
1786 @
\b@(
\b(_
\bp_
\ba_
\bt_
\bt_
\be_
\br_
\bn_
\b-_
\bl_
\bi_
\bs_
\bt)
\b)
1787 Matches one of the given patterns
1788 !
\b!(
\b(_
\bp_
\ba_
\bt_
\bt_
\be_
\br_
\bn_
\b-_
\bl_
\bi_
\bs_
\bt)
\b)
1789 Matches anything except one of the given patterns
1791 Q
\bQu
\buo
\bot
\bte
\be R
\bRe
\bem
\bmo
\bov
\bva
\bal
\bl
1792 After the preceding expansions, all unquoted occurrences of the charac-
1793 ters \
\b\, '
\b', and "
\b" that did not result from one of the above expansions
1796 R
\bRE
\bED
\bDI
\bIR
\bRE
\bEC
\bCT
\bTI
\bIO
\bON
\bN
1797 Before a command is executed, its input and output may be _
\br_
\be_
\bd_
\bi_
\br_
\be_
\bc_
\bt_
\be_
\bd
1798 using a special notation interpreted by the shell. Redirection may
1799 also be used to open and close files for the current shell execution
1800 environment. The following redirection operators may precede or appear
1801 anywhere within a _
\bs_
\bi_
\bm_
\bp_
\bl_
\be _
\bc_
\bo_
\bm_
\bm_
\ba_
\bn_
\bd or may follow a _
\bc_
\bo_
\bm_
\bm_
\ba_
\bn_
\bd. Redirections
1802 are processed in the order they appear, from left to right.
1804 Each redirection that may be preceded by a file descriptor number may
1805 instead be preceded by a word of the form {_
\bv_
\ba_
\br_
\bn_
\ba_
\bm_
\be}. In this case, for
1806 each redirection operator except >&- and <&-, the shell will allocate a
1807 file descriptor greater than 10 and assign it to _
\bv_
\ba_
\br_
\bn_
\ba_
\bm_
\be. If >&- or
1808 <&- is preceded by {_
\bv_
\ba_
\br_
\bn_
\ba_
\bm_
\be}, the value of _
\bv_
\ba_
\br_
\bn_
\ba_
\bm_
\be defines the file
1809 descriptor to close.
1811 In the following descriptions, if the file descriptor number is omit-
1812 ted, and the first character of the redirection operator is <
\b<, the re-
1813 direction refers to the standard input (file descriptor 0). If the
1814 first character of the redirection operator is >
\b>, the redirection
1815 refers to the standard output (file descriptor 1).
1817 The word following the redirection operator in the following descrip-
1818 tions, unless otherwise noted, is subjected to brace expansion, tilde
1819 expansion, parameter expansion, command substitution, arithmetic expan-
1820 sion, quote removal, pathname expansion, and word splitting. If it
1821 expands to more than one word, b
\bba
\bas
\bsh
\bh reports an error.
1823 Note that the order of redirections is significant. For example, the
1826 ls >
\b> dirlist 2>
\b>&
\b&1
1828 directs both standard output and standard error to the file _
\bd_
\bi_
\br_
\bl_
\bi_
\bs_
\bt,
1831 ls 2>
\b>&
\b&1 >
\b> dirlist
1833 directs only the standard output to file _
\bd_
\bi_
\br_
\bl_
\bi_
\bs_
\bt, because the standard
1834 error was duplicated from the standard output before the standard out-
1835 put was redirected to _
\bd_
\bi_
\br_
\bl_
\bi_
\bs_
\bt.
1837 B
\bBa
\bas
\bsh
\bh handles several filenames specially when they are used in redirec-
1838 tions, as described in the following table:
1840 /
\b/d
\bde
\bev
\bv/
\b/f
\bfd
\bd/
\b/_
\bf_
\bd
1841 If _
\bf_
\bd is a valid integer, file descriptor _
\bf_
\bd is dupli-
1843 /
\b/d
\bde
\bev
\bv/
\b/s
\bst
\btd
\bdi
\bin
\bn
1844 File descriptor 0 is duplicated.
1845 /
\b/d
\bde
\bev
\bv/
\b/s
\bst
\btd
\bdo
\bou
\but
\bt
1846 File descriptor 1 is duplicated.
1847 /
\b/d
\bde
\bev
\bv/
\b/s
\bst
\btd
\bde
\ber
\brr
\br
1848 File descriptor 2 is duplicated.
1849 /
\b/d
\bde
\bev
\bv/
\b/t
\btc
\bcp
\bp/
\b/_
\bh_
\bo_
\bs_
\bt/
\b/_
\bp_
\bo_
\br_
\bt
1850 If _
\bh_
\bo_
\bs_
\bt is a valid hostname or Internet address, and _
\bp_
\bo_
\br_
\bt
1851 is an integer port number or service name, b
\bba
\bas
\bsh
\bh attempts
1852 to open a TCP connection to the corresponding socket.
1853 /
\b/d
\bde
\bev
\bv/
\b/u
\bud
\bdp
\bp/
\b/_
\bh_
\bo_
\bs_
\bt/
\b/_
\bp_
\bo_
\br_
\bt
1854 If _
\bh_
\bo_
\bs_
\bt is a valid hostname or Internet address, and _
\bp_
\bo_
\br_
\bt
1855 is an integer port number or service name, b
\bba
\bas
\bsh
\bh attempts
1856 to open a UDP connection to the corresponding socket.
1858 A failure to open or create a file causes the redirection to fail.
1860 Redirections using file descriptors greater than 9 should be used with
1861 care, as they may conflict with file descriptors the shell uses inter-
1864 R
\bRe
\bed
\bdi
\bir
\bre
\bec
\bct
\bti
\bin
\bng
\bg I
\bIn
\bnp
\bpu
\but
\bt
1865 Redirection of input causes the file whose name results from the expan-
1866 sion of _
\bw_
\bo_
\br_
\bd to be opened for reading on file descriptor _
\bn, or the
1867 standard input (file descriptor 0) if _
\bn is not specified.
1869 The general format for redirecting input is:
1871 [_
\bn]<
\b<_
\bw_
\bo_
\br_
\bd
1873 R
\bRe
\bed
\bdi
\bir
\bre
\bec
\bct
\bti
\bin
\bng
\bg O
\bOu
\but
\btp
\bpu
\but
\bt
1874 Redirection of output causes the file whose name results from the
1875 expansion of _
\bw_
\bo_
\br_
\bd to be opened for writing on file descriptor _
\bn, or the
1876 standard output (file descriptor 1) if _
\bn is not specified. If the file
1877 does not exist it is created; if it does exist it is truncated to zero
1880 The general format for redirecting output is:
1882 [_
\bn]>
\b>_
\bw_
\bo_
\br_
\bd
1884 If the redirection operator is >
\b>, and the n
\bno
\boc
\bcl
\blo
\bob
\bbb
\bbe
\ber
\br option to the s
\bse
\bet
\bt
1885 builtin has been enabled, the redirection will fail if the file whose
1886 name results from the expansion of _
\bw_
\bo_
\br_
\bd exists and is a regular file.
1887 If the redirection operator is >
\b>|
\b|, or the redirection operator is >
\b> and
1888 the n
\bno
\boc
\bcl
\blo
\bob
\bbb
\bbe
\ber
\br option to the s
\bse
\bet
\bt builtin command is not enabled, the re-
1889 direction is attempted even if the file named by _
\bw_
\bo_
\br_
\bd exists.
1891 A
\bAp
\bpp
\bpe
\ben
\bnd
\bdi
\bin
\bng
\bg R
\bRe
\bed
\bdi
\bir
\bre
\bec
\bct
\bte
\bed
\bd O
\bOu
\but
\btp
\bpu
\but
\bt
1892 Redirection of output in this fashion causes the file whose name
1893 results from the expansion of _
\bw_
\bo_
\br_
\bd to be opened for appending on file
1894 descriptor _
\bn, or the standard output (file descriptor 1) if _
\bn is not
1895 specified. If the file does not exist it is created.
1897 The general format for appending output is:
1899 [_
\bn]>
\b>>
\b>_
\bw_
\bo_
\br_
\bd
1902 R
\bRe
\bed
\bdi
\bir
\bre
\bec
\bct
\bti
\bin
\bng
\bg S
\bSt
\bta
\ban
\bnd
\bda
\bar
\brd
\bd O
\bOu
\but
\btp
\bpu
\but
\bt a
\ban
\bnd
\bd S
\bSt
\bta
\ban
\bnd
\bda
\bar
\brd
\bd E
\bEr
\brr
\bro
\bor
\br
1903 This construct allows both the standard output (file descriptor 1) and
1904 the standard error output (file descriptor 2) to be redirected to the
1905 file whose name is the expansion of _
\bw_
\bo_
\br_
\bd.
1907 There are two formats for redirecting standard output and standard
1910 &
\b&>
\b>_
\bw_
\bo_
\br_
\bd
1912 >
\b>&
\b&_
\bw_
\bo_
\br_
\bd
1914 Of the two forms, the first is preferred. This is semantically equiva-
1917 >
\b>_
\bw_
\bo_
\br_
\bd 2>
\b>&
\b&1
1920 A
\bAp
\bpp
\bpe
\ben
\bnd
\bdi
\bin
\bng
\bg S
\bSt
\bta
\ban
\bnd
\bda
\bar
\brd
\bd O
\bOu
\but
\btp
\bpu
\but
\bt a
\ban
\bnd
\bd S
\bSt
\bta
\ban
\bnd
\bda
\bar
\brd
\bd E
\bEr
\brr
\bro
\bor
\br
1921 This construct allows both the standard output (file descriptor 1) and
1922 the standard error output (file descriptor 2) to be appended to the
1923 file whose name is the expansion of _
\bw_
\bo_
\br_
\bd.
1925 The format for appending standard output and standard error is:
1927 &
\b&>
\b>>
\b>_
\bw_
\bo_
\br_
\bd
1929 This is semantically equivalent to
1931 >
\b>>
\b>_
\bw_
\bo_
\br_
\bd 2>
\b>&
\b&1
1933 H
\bHe
\ber
\bre
\be D
\bDo
\boc
\bcu
\bum
\bme
\ben
\bnt
\bts
\bs
1934 This type of redirection instructs the shell to read input from the
1935 current source until a line containing only _
\bd_
\be_
\bl_
\bi_
\bm_
\bi_
\bt_
\be_
\br (with no trailing
1936 blanks) is seen. All of the lines read up to that point are then used
1937 as the standard input for a command.
1939 The format of here-documents is:
1941 <
\b<<
\b<[-
\b-]_
\bw_
\bo_
\br_
\bd
1942 _
\bh_
\be_
\br_
\be_
\b-_
\bd_
\bo_
\bc_
\bu_
\bm_
\be_
\bn_
\bt
1943 _
\bd_
\be_
\bl_
\bi_
\bm_
\bi_
\bt_
\be_
\br
1945 No parameter expansion, command substitution, arithmetic expansion, or
1946 pathname expansion is performed on _
\bw_
\bo_
\br_
\bd. If any characters in _
\bw_
\bo_
\br_
\bd are
1947 quoted, the _
\bd_
\be_
\bl_
\bi_
\bm_
\bi_
\bt_
\be_
\br is the result of quote removal on _
\bw_
\bo_
\br_
\bd, and the
1948 lines in the here-document are not expanded. If _
\bw_
\bo_
\br_
\bd is unquoted, all
1949 lines of the here-document are subjected to parameter expansion, com-
1950 mand substitution, and arithmetic expansion. In the latter case, the
1951 character sequence \
\b\<
\b<n
\bne
\bew
\bwl
\bli
\bin
\bne
\be>
\b> is ignored, and \
\b\ must be used to quote
1952 the characters \
\b\, $
\b$, and `
\b`.
1954 If the redirection operator is <
\b<<
\b<-
\b-, then all leading tab characters are
1955 stripped from input lines and the line containing _
\bd_
\be_
\bl_
\bi_
\bm_
\bi_
\bt_
\be_
\br. This
1956 allows here-documents within shell scripts to be indented in a natural
1959 H
\bHe
\ber
\bre
\be S
\bSt
\btr
\bri
\bin
\bng
\bgs
\bs
1960 A variant of here documents, the format is:
1962 <
\b<<
\b<<
\b<_
\bw_
\bo_
\br_
\bd
1964 The _
\bw_
\bo_
\br_
\bd is expanded and supplied to the command on its standard input.
1966 D
\bDu
\bup
\bpl
\bli
\bic
\bca
\bat
\bti
\bin
\bng
\bg F
\bFi
\bil
\ble
\be D
\bDe
\bes
\bsc
\bcr
\bri
\bip
\bpt
\bto
\bor
\brs
\bs
1967 The redirection operator
1969 [_
\bn]<
\b<&
\b&_
\bw_
\bo_
\br_
\bd
1971 is used to duplicate input file descriptors. If _
\bw_
\bo_
\br_
\bd expands to one or
1972 more digits, the file descriptor denoted by _
\bn is made to be a copy of
1973 that file descriptor. If the digits in _
\bw_
\bo_
\br_
\bd do not specify a file
1974 descriptor open for input, a redirection error occurs. If _
\bw_
\bo_
\br_
\bd evalu-
1975 ates to -
\b-, file descriptor _
\bn is closed. If _
\bn is not specified, the
1976 standard input (file descriptor 0) is used.
1980 [_
\bn]>
\b>&
\b&_
\bw_
\bo_
\br_
\bd
1982 is used similarly to duplicate output file descriptors. If _
\bn is not
1983 specified, the standard output (file descriptor 1) is used. If the
1984 digits in _
\bw_
\bo_
\br_
\bd do not specify a file descriptor open for output, a re-
1985 direction error occurs. As a special case, if _
\bn is omitted, and _
\bw_
\bo_
\br_
\bd
1986 does not expand to one or more digits, the standard output and standard
1987 error are redirected as described previously.
1989 M
\bMo
\bov
\bvi
\bin
\bng
\bg F
\bFi
\bil
\ble
\be D
\bDe
\bes
\bsc
\bcr
\bri
\bip
\bpt
\bto
\bor
\brs
\bs
1990 The redirection operator
1992 [_
\bn]<
\b<&
\b&_
\bd_
\bi_
\bg_
\bi_
\bt-
\b-
1994 moves the file descriptor _
\bd_
\bi_
\bg_
\bi_
\bt to file descriptor _
\bn, or the standard
1995 input (file descriptor 0) if _
\bn is not specified. _
\bd_
\bi_
\bg_
\bi_
\bt is closed after
1996 being duplicated to _
\bn.
1998 Similarly, the redirection operator
2000 [_
\bn]>
\b>&
\b&_
\bd_
\bi_
\bg_
\bi_
\bt-
\b-
2002 moves the file descriptor _
\bd_
\bi_
\bg_
\bi_
\bt to file descriptor _
\bn, or the standard
2003 output (file descriptor 1) if _
\bn is not specified.
2005 O
\bOp
\bpe
\ben
\bni
\bin
\bng
\bg F
\bFi
\bil
\ble
\be D
\bDe
\bes
\bsc
\bcr
\bri
\bip
\bpt
\bto
\bor
\brs
\bs f
\bfo
\bor
\br R
\bRe
\bea
\bad
\bdi
\bin
\bng
\bg a
\ban
\bnd
\bd W
\bWr
\bri
\bit
\bti
\bin
\bng
\bg
2006 The redirection operator
2008 [_
\bn]<
\b<>
\b>_
\bw_
\bo_
\br_
\bd
2010 causes the file whose name is the expansion of _
\bw_
\bo_
\br_
\bd to be opened for
2011 both reading and writing on file descriptor _
\bn, or on file descriptor 0
2012 if _
\bn is not specified. If the file does not exist, it is created.
2014 A
\bAL
\bLI
\bIA
\bAS
\bSE
\bES
\bS
2015 _
\bA_
\bl_
\bi_
\ba_
\bs_
\be_
\bs allow a string to be substituted for a word when it is used as
2016 the first word of a simple command. The shell maintains a list of
2017 aliases that may be set and unset with the a
\bal
\bli
\bia
\bas
\bs and u
\bun
\bna
\bal
\bli
\bia
\bas
\bs builtin
2018 commands (see S
\bSH
\bHE
\bEL
\bLL
\bL B
\bBU
\bUI
\bIL
\bLT
\bTI
\bIN
\bN C
\bCO
\bOM
\bMM
\bMA
\bAN
\bND
\bDS
\bS below). The first word of each
2019 simple command, if unquoted, is checked to see if it has an alias. If
2020 so, that word is replaced by the text of the alias. The characters /
\b/,
2021 $
\b$, `
\b`, and =
\b= and any of the shell _
\bm_
\be_
\bt_
\ba_
\bc_
\bh_
\ba_
\br_
\ba_
\bc_
\bt_
\be_
\br_
\bs or quoting characters
2022 listed above may not appear in an alias name. The replacement text may
2023 contain any valid shell input, including shell metacharacters. The
2024 first word of the replacement text is tested for aliases, but a word
2025 that is identical to an alias being expanded is not expanded a second
2026 time. This means that one may alias l
\bls
\bs to l
\bls
\bs -
\b-F
\bF, for instance, and
2027 b
\bba
\bas
\bsh
\bh does not try to recursively expand the replacement text. If the
2028 last character of the alias value is a _
\bb_
\bl_
\ba_
\bn_
\bk, then the next command
2029 word following the alias is also checked for alias expansion.
2031 Aliases are created and listed with the a
\bal
\bli
\bia
\bas
\bs command, and removed with
2032 the u
\bun
\bna
\bal
\bli
\bia
\bas
\bs command.
2034 There is no mechanism for using arguments in the replacement text. If
2035 arguments are needed, a shell function should be used (see F
\bFU
\bUN
\bNC
\bCT
\bTI
\bIO
\bON
\bNS
\bS
2038 Aliases are not expanded when the shell is not interactive, unless the
2039 e
\bex
\bxp
\bpa
\ban
\bnd
\bd_
\b_a
\bal
\bli
\bia
\bas
\bse
\bes
\bs shell option is set using s
\bsh
\bho
\bop
\bpt
\bt (see the description of
2040 s
\bsh
\bho
\bop
\bpt
\bt under S
\bSH
\bHE
\bEL
\bLL
\bL B
\bBU
\bUI
\bIL
\bLT
\bTI
\bIN
\bN C
\bCO
\bOM
\bMM
\bMA
\bAN
\bND
\bDS
\bS below).
2042 The rules concerning the definition and use of aliases are somewhat
2043 confusing. B
\bBa
\bas
\bsh
\bh always reads at least one complete line of input
2044 before executing any of the commands on that line. Aliases are
2045 expanded when a command is read, not when it is executed. Therefore,
2046 an alias definition appearing on the same line as another command does
2047 not take effect until the next line of input is read. The commands
2048 following the alias definition on that line are not affected by the new
2049 alias. This behavior is also an issue when functions are executed.
2050 Aliases are expanded when a function definition is read, not when the
2051 function is executed, because a function definition is itself a com-
2052 pound command. As a consequence, aliases defined in a function are not
2053 available until after that function is executed. To be safe, always
2054 put alias definitions on a separate line, and do not use a
\bal
\bli
\bia
\bas
\bs in com-
2057 For almost every purpose, aliases are superseded by shell functions.
2059 F
\bFU
\bUN
\bNC
\bCT
\bTI
\bIO
\bON
\bNS
\bS
2060 A shell function, defined as described above under S
\bSH
\bHE
\bEL
\bLL
\bL G
\bGR
\bRA
\bAM
\bMM
\bMA
\bAR
\bR,
2061 stores a series of commands for later execution. When the name of a
2062 shell function is used as a simple command name, the list of commands
2063 associated with that function name is executed. Functions are executed
2064 in the context of the current shell; no new process is created to
2065 interpret them (contrast this with the execution of a shell script).
2066 When a function is executed, the arguments to the function become the
2067 positional parameters during its execution. The special parameter #
\b# is
2068 updated to reflect the change. Special parameter 0
\b0 is unchanged. The
2069 first element of the F
\bFU
\bUN
\bNC
\bCN
\bNA
\bAM
\bME
\bE variable is set to the name of the func-
2070 tion while the function is executing.
2072 All other aspects of the shell execution environment are identical
2073 between a function and its caller with these exceptions: the D
\bDE
\bEB
\bBU
\bUG
\bG and
2074 R
\bRE
\bET
\bTU
\bUR
\bRN
\bN traps (see the description of the t
\btr
\bra
\bap
\bp builtin under S
\bSH
\bHE
\bEL
\bLL
\bL
2075 B
\bBU
\bUI
\bIL
\bLT
\bTI
\bIN
\bN C
\bCO
\bOM
\bMM
\bMA
\bAN
\bND
\bDS
\bS below) are not inherited unless the function has been
2076 given the t
\btr
\bra
\bac
\bce
\be attribute (see the description of the d
\bde
\bec
\bcl
\bla
\bar
\bre
\be builtin
2077 below) or the -
\b-o
\bo f
\bfu
\bun
\bnc
\bct
\btr
\bra
\bac
\bce
\be shell option has been enabled with the s
\bse
\bet
\bt
2078 builtin (in which case all functions inherit the D
\bDE
\bEB
\bBU
\bUG
\bG and R
\bRE
\bET
\bTU
\bUR
\bRN
\bN
2079 traps), and the E
\bER
\bRR
\bR trap is not inherited unless the -
\b-o
\bo e
\ber
\brr
\brt
\btr
\bra
\bac
\bce
\be shell
2080 option has been enabled.
2082 Variables local to the function may be declared with the l
\blo
\boc
\bca
\bal
\bl builtin
2083 command. Ordinarily, variables and their values are shared between the
2084 function and its caller.
2086 The F
\bFU
\bUN
\bNC
\bCN
\bNE
\bES
\bST
\bT variable, if set to a numeric value greater than 0,
2087 defines a maximum function nesting level. Function invocations that
2088 exceed the limit cause the entire command to abort.
2090 If the builtin command r
\bre
\bet
\btu
\bur
\brn
\bn is executed in a function, the function
2091 completes and execution resumes with the next command after the func-
2092 tion call. Any command associated with the R
\bRE
\bET
\bTU
\bUR
\bRN
\bN trap is executed
2093 before execution resumes. When a function completes, the values of the
2094 positional parameters and the special parameter #
\b# are restored to the
2095 values they had prior to the function's execution.
2097 Function names and definitions may be listed with the -
\b-f
\bf option to the
2098 d
\bde
\bec
\bcl
\bla
\bar
\bre
\be or t
\bty
\byp
\bpe
\bes
\bse
\bet
\bt builtin commands. The -
\b-F
\bF option to d
\bde
\bec
\bcl
\bla
\bar
\bre
\be or t
\bty
\byp
\bpe
\be-
\b-
2099 s
\bse
\bet
\bt will list the function names only (and optionally the source file
2100 and line number, if the e
\bex
\bxt
\btd
\bde
\beb
\bbu
\bug
\bg shell option is enabled). Functions
2101 may be exported so that subshells automatically have them defined with
2102 the -
\b-f
\bf option to the e
\bex
\bxp
\bpo
\bor
\brt
\bt builtin. A function definition may be
2103 deleted using the -
\b-f
\bf option to the u
\bun
\bns
\bse
\bet
\bt builtin. Note that shell
2104 functions and variables with the same name may result in multiple iden-
2105 tically-named entries in the environment passed to the shell's chil-
2106 dren. Care should be taken in cases where this may cause a problem.
2108 Functions may be recursive. The F
\bFU
\bUN
\bNC
\bCN
\bNE
\bES
\bST
\bT variable may be used to limit
2109 the depth of the function call stack and restrict the number of func-
2110 tion invocations. By default, no limit is imposed on the number of
2113 A
\bAR
\bRI
\bIT
\bTH
\bHM
\bME
\bET
\bTI
\bIC
\bC E
\bEV
\bVA
\bAL
\bLU
\bUA
\bAT
\bTI
\bIO
\bON
\bN
2114 The shell allows arithmetic expressions to be evaluated, under certain
2115 circumstances (see the l
\ble
\bet
\bt and d
\bde
\bec
\bcl
\bla
\bar
\bre
\be builtin commands and A
\bAr
\bri
\bit
\bth
\bhm
\bme
\bet
\bti
\bic
\bc
2116 E
\bEx
\bxp
\bpa
\ban
\bns
\bsi
\bio
\bon
\bn). Evaluation is done in fixed-width integers with no check
2117 for overflow, though division by 0 is trapped and flagged as an error.
2118 The operators and their precedence, associativity, and values are the
2119 same as in the C language. The following list of operators is grouped
2120 into levels of equal-precedence operators. The levels are listed in
2121 order of decreasing precedence.
2123 _
\bi_
\bd+
\b++
\b+ _
\bi_
\bd-
\b--
\b-
2124 variable post-increment and post-decrement
2125 +
\b++
\b+_
\bi_
\bd -
\b--
\b-_
\bi_
\bd
2126 variable pre-increment and pre-decrement
2127 -
\b- +
\b+ unary minus and plus
2128 !
\b! ~
\b~ logical and bitwise negation
2129 *
\b**
\b* exponentiation
2130 *
\b* /
\b/ %
\b% multiplication, division, remainder
2131 +
\b+ -
\b- addition, subtraction
2132 <
\b<<
\b< >
\b>>
\b> left and right bitwise shifts
2133 <
\b<=
\b= >
\b>=
\b= <
\b< >
\b>
2135 =
\b==
\b= !
\b!=
\b= equality and inequality
2137 ^
\b^ bitwise exclusive OR
2139 &
\b&&
\b& logical AND
2141 _
\be_
\bx_
\bp_
\br?
\b?_
\be_
\bx_
\bp_
\br:
\b:_
\be_
\bx_
\bp_
\br
2142 conditional operator
2143 =
\b= *
\b*=
\b= /
\b/=
\b= %
\b%=
\b= +
\b+=
\b= -
\b-=
\b= <
\b<<
\b<=
\b= >
\b>>
\b>=
\b= &
\b&=
\b= ^
\b^=
\b= |
\b|=
\b=
2145 _
\be_
\bx_
\bp_
\br_
\b1 ,
\b, _
\be_
\bx_
\bp_
\br_
\b2
2148 Shell variables are allowed as operands; parameter expansion is per-
2149 formed before the expression is evaluated. Within an expression, shell
2150 variables may also be referenced by name without using the parameter
2151 expansion syntax. A shell variable that is null or unset evaluates to
2152 0 when referenced by name without using the parameter expansion syntax.
2153 The value of a variable is evaluated as an arithmetic expression when
2154 it is referenced, or when a variable which has been given the _
\bi_
\bn_
\bt_
\be_
\bg_
\be_
\br
2155 attribute using d
\bde
\bec
\bcl
\bla
\bar
\bre
\be -
\b-i
\bi is assigned a value. A null value evaluates
2156 to 0. A shell variable need not have its _
\bi_
\bn_
\bt_
\be_
\bg_
\be_
\br attribute turned on
2157 to be used in an expression.
2159 Constants with a leading 0 are interpreted as octal numbers. A leading
2160 0x or 0X denotes hexadecimal. Otherwise, numbers take the form
2161 [_
\bb_
\ba_
\bs_
\be_
\b#]n, where the optional _
\bb_
\ba_
\bs_
\be is a decimal number between 2 and 64
2162 representing the arithmetic base, and _
\bn is a number in that base. If
2163 _
\bb_
\ba_
\bs_
\be_
\b# is omitted, then base 10 is used. The digits greater than 9 are
2164 represented by the lowercase letters, the uppercase letters, @, and _,
2165 in that order. If _
\bb_
\ba_
\bs_
\be is less than or equal to 36, lowercase and
2166 uppercase letters may be used interchangeably to represent numbers
2169 Operators are evaluated in order of precedence. Sub-expressions in
2170 parentheses are evaluated first and may override the precedence rules
2173 C
\bCO
\bON
\bND
\bDI
\bIT
\bTI
\bIO
\bON
\bNA
\bAL
\bL E
\bEX
\bXP
\bPR
\bRE
\bES
\bSS
\bSI
\bIO
\bON
\bNS
\bS
2174 Conditional expressions are used by the [
\b[[
\b[ compound command and the
2175 t
\bte
\bes
\bst
\bt and [
\b[ builtin commands to test file attributes and perform string
2176 and arithmetic comparisons. Expressions are formed from the following
2177 unary or binary primaries. If any _
\bf_
\bi_
\bl_
\be argument to one of the pri-
2178 maries is of the form _
\b/_
\bd_
\be_
\bv_
\b/_
\bf_
\bd_
\b/_
\bn, then file descriptor _
\bn is checked. If
2179 the _
\bf_
\bi_
\bl_
\be argument to one of the primaries is one of _
\b/_
\bd_
\be_
\bv_
\b/_
\bs_
\bt_
\bd_
\bi_
\bn,
2180 _
\b/_
\bd_
\be_
\bv_
\b/_
\bs_
\bt_
\bd_
\bo_
\bu_
\bt, or _
\b/_
\bd_
\be_
\bv_
\b/_
\bs_
\bt_
\bd_
\be_
\br_
\br, file descriptor 0, 1, or 2, respectively,
2183 Unless otherwise specified, primaries that operate on files follow sym-
2184 bolic links and operate on the target of the link, rather than the link
2187 When used with [
\b[[
\b[, the <
\b< and >
\b> operators sort lexicographically using
2188 the current locale. The t
\bte
\bes
\bst
\bt command sorts using ASCII ordering.
2190 -
\b-a
\ba _
\bf_
\bi_
\bl_
\be
2191 True if _
\bf_
\bi_
\bl_
\be exists.
2192 -
\b-b
\bb _
\bf_
\bi_
\bl_
\be
2193 True if _
\bf_
\bi_
\bl_
\be exists and is a block special file.
2194 -
\b-c
\bc _
\bf_
\bi_
\bl_
\be
2195 True if _
\bf_
\bi_
\bl_
\be exists and is a character special file.
2196 -
\b-d
\bd _
\bf_
\bi_
\bl_
\be
2197 True if _
\bf_
\bi_
\bl_
\be exists and is a directory.
2198 -
\b-e
\be _
\bf_
\bi_
\bl_
\be
2199 True if _
\bf_
\bi_
\bl_
\be exists.
2200 -
\b-f
\bf _
\bf_
\bi_
\bl_
\be
2201 True if _
\bf_
\bi_
\bl_
\be exists and is a regular file.
2202 -
\b-g
\bg _
\bf_
\bi_
\bl_
\be
2203 True if _
\bf_
\bi_
\bl_
\be exists and is set-group-id.
2204 -
\b-h
\bh _
\bf_
\bi_
\bl_
\be
2205 True if _
\bf_
\bi_
\bl_
\be exists and is a symbolic link.
2206 -
\b-k
\bk _
\bf_
\bi_
\bl_
\be
2207 True if _
\bf_
\bi_
\bl_
\be exists and its ``sticky'' bit is set.
2208 -
\b-p
\bp _
\bf_
\bi_
\bl_
\be
2209 True if _
\bf_
\bi_
\bl_
\be exists and is a named pipe (FIFO).
2210 -
\b-r
\br _
\bf_
\bi_
\bl_
\be
2211 True if _
\bf_
\bi_
\bl_
\be exists and is readable.
2212 -
\b-s
\bs _
\bf_
\bi_
\bl_
\be
2213 True if _
\bf_
\bi_
\bl_
\be exists and has a size greater than zero.
2214 -
\b-t
\bt _
\bf_
\bd True if file descriptor _
\bf_
\bd is open and refers to a terminal.
2215 -
\b-u
\bu _
\bf_
\bi_
\bl_
\be
2216 True if _
\bf_
\bi_
\bl_
\be exists and its set-user-id bit is set.
2217 -
\b-w
\bw _
\bf_
\bi_
\bl_
\be
2218 True if _
\bf_
\bi_
\bl_
\be exists and is writable.
2219 -
\b-x
\bx _
\bf_
\bi_
\bl_
\be
2220 True if _
\bf_
\bi_
\bl_
\be exists and is executable.
2221 -
\b-G
\bG _
\bf_
\bi_
\bl_
\be
2222 True if _
\bf_
\bi_
\bl_
\be exists and is owned by the effective group id.
2223 -
\b-L
\bL _
\bf_
\bi_
\bl_
\be
2224 True if _
\bf_
\bi_
\bl_
\be exists and is a symbolic link.
2225 -
\b-N
\bN _
\bf_
\bi_
\bl_
\be
2226 True if _
\bf_
\bi_
\bl_
\be exists and has been modified since it was last
2228 -
\b-O
\bO _
\bf_
\bi_
\bl_
\be
2229 True if _
\bf_
\bi_
\bl_
\be exists and is owned by the effective user id.
2230 -
\b-S
\bS _
\bf_
\bi_
\bl_
\be
2231 True if _
\bf_
\bi_
\bl_
\be exists and is a socket.
2232 _
\bf_
\bi_
\bl_
\be_
\b1 -
\b-e
\bef
\bf _
\bf_
\bi_
\bl_
\be_
\b2
2233 True if _
\bf_
\bi_
\bl_
\be_
\b1 and _
\bf_
\bi_
\bl_
\be_
\b2 refer to the same device and inode num-
2235 _
\bf_
\bi_
\bl_
\be_
\b1 -n
\bnt
\bt _
\bf_
\bi_
\bl_
\be_
\b2
2236 True if _
\bf_
\bi_
\bl_
\be_
\b1 is newer (according to modification date) than
2237 _
\bf_
\bi_
\bl_
\be_
\b2, or if _
\bf_
\bi_
\bl_
\be_
\b1 exists and _
\bf_
\bi_
\bl_
\be_
\b2 does not.
2238 _
\bf_
\bi_
\bl_
\be_
\b1 -o
\bot
\bt _
\bf_
\bi_
\bl_
\be_
\b2
2239 True if _
\bf_
\bi_
\bl_
\be_
\b1 is older than _
\bf_
\bi_
\bl_
\be_
\b2, or if _
\bf_
\bi_
\bl_
\be_
\b2 exists and _
\bf_
\bi_
\bl_
\be_
\b1
2241 -
\b-o
\bo _
\bo_
\bp_
\bt_
\bn_
\ba_
\bm_
\be
2242 True if the shell option _
\bo_
\bp_
\bt_
\bn_
\ba_
\bm_
\be is enabled. See the list of
2243 options under the description of the -
\b-o
\bo option to the s
\bse
\bet
\bt
2245 -
\b-v
\bv _
\bv_
\ba_
\br_
\bn_
\ba_
\bm_
\be
2246 True if the shell variable _
\bv_
\ba_
\br_
\bn_
\ba_
\bm_
\be is set (has been assigned a
2248 -
\b-z
\bz _
\bs_
\bt_
\br_
\bi_
\bn_
\bg
2249 True if the length of _
\bs_
\bt_
\br_
\bi_
\bn_
\bg is zero.
2250 _
\bs_
\bt_
\br_
\bi_
\bn_
\bg
2251 -
\b-n
\bn _
\bs_
\bt_
\br_
\bi_
\bn_
\bg
2252 True if the length of _
\bs_
\bt_
\br_
\bi_
\bn_
\bg is non-zero.
2254 _
\bs_
\bt_
\br_
\bi_
\bn_
\bg_
\b1 =
\b==
\b= _
\bs_
\bt_
\br_
\bi_
\bn_
\bg_
\b2
2255 _
\bs_
\bt_
\br_
\bi_
\bn_
\bg_
\b1 =
\b= _
\bs_
\bt_
\br_
\bi_
\bn_
\bg_
\b2
2256 True if the strings are equal. =
\b= should be used with the t
\bte
\bes
\bst
\bt
2257 command for POSIX conformance.
2259 _
\bs_
\bt_
\br_
\bi_
\bn_
\bg_
\b1 !
\b!=
\b= _
\bs_
\bt_
\br_
\bi_
\bn_
\bg_
\b2
2260 True if the strings are not equal.
2262 _
\bs_
\bt_
\br_
\bi_
\bn_
\bg_
\b1 <
\b< _
\bs_
\bt_
\br_
\bi_
\bn_
\bg_
\b2
2263 True if _
\bs_
\bt_
\br_
\bi_
\bn_
\bg_
\b1 sorts before _
\bs_
\bt_
\br_
\bi_
\bn_
\bg_
\b2 lexicographically.
2265 _
\bs_
\bt_
\br_
\bi_
\bn_
\bg_
\b1 >
\b> _
\bs_
\bt_
\br_
\bi_
\bn_
\bg_
\b2
2266 True if _
\bs_
\bt_
\br_
\bi_
\bn_
\bg_
\b1 sorts after _
\bs_
\bt_
\br_
\bi_
\bn_
\bg_
\b2 lexicographically.
2268 _
\ba_
\br_
\bg_
\b1 O
\bOP
\bP _
\ba_
\br_
\bg_
\b2
2269 O
\bOP
\bP is one of -
\b-e
\beq
\bq, -
\b-n
\bne
\be, -
\b-l
\blt
\bt, -
\b-l
\ble
\be, -
\b-g
\bgt
\bt, or -
\b-g
\bge
\be. These arithmetic
2270 binary operators return true if _
\ba_
\br_
\bg_
\b1 is equal to, not equal to,
2271 less than, less than or equal to, greater than, or greater than
2272 or equal to _
\ba_
\br_
\bg_
\b2, respectively. _
\bA_
\br_
\bg_
\b1 and _
\ba_
\br_
\bg_
\b2 may be positive
2273 or negative integers.
2275 S
\bSI
\bIM
\bMP
\bPL
\bLE
\bE C
\bCO
\bOM
\bMM
\bMA
\bAN
\bND
\bD E
\bEX
\bXP
\bPA
\bAN
\bNS
\bSI
\bIO
\bON
\bN
2276 When a simple command is executed, the shell performs the following
2277 expansions, assignments, and redirections, from left to right.
2279 1. The words that the parser has marked as variable assignments
2280 (those preceding the command name) and redirections are saved
2281 for later processing.
2283 2. The words that are not variable assignments or redirections are
2284 expanded. If any words remain after expansion, the first word
2285 is taken to be the name of the command and the remaining words
2288 3. Redirections are performed as described above under R
\bRE
\bED
\bDI
\bIR
\bRE
\bEC
\bCT
\bTI
\bIO
\bON
\bN.
2290 4. The text after the =
\b= in each variable assignment undergoes tilde
2291 expansion, parameter expansion, command substitution, arithmetic
2292 expansion, and quote removal before being assigned to the vari-
2295 If no command name results, the variable assignments affect the current
2296 shell environment. Otherwise, the variables are added to the environ-
2297 ment of the executed command and do not affect the current shell envi-
2298 ronment. If any of the assignments attempts to assign a value to a
2299 readonly variable, an error occurs, and the command exits with a non-
2302 If no command name results, redirections are performed, but do not
2303 affect the current shell environment. A redirection error causes the
2304 command to exit with a non-zero status.
2306 If there is a command name left after expansion, execution proceeds as
2307 described below. Otherwise, the command exits. If one of the expan-
2308 sions contained a command substitution, the exit status of the command
2309 is the exit status of the last command substitution performed. If
2310 there were no command substitutions, the command exits with a status of
2313 C
\bCO
\bOM
\bMM
\bMA
\bAN
\bND
\bD E
\bEX
\bXE
\bEC
\bCU
\bUT
\bTI
\bIO
\bON
\bN
2314 After a command has been split into words, if it results in a simple
2315 command and an optional list of arguments, the following actions are
2318 If the command name contains no slashes, the shell attempts to locate
2319 it. If there exists a shell function by that name, that function is
2320 invoked as described above in F
\bFU
\bUN
\bNC
\bCT
\bTI
\bIO
\bON
\bNS
\bS. If the name does not match a
2321 function, the shell searches for it in the list of shell builtins. If
2322 a match is found, that builtin is invoked.
2324 If the name is neither a shell function nor a builtin, and contains no
2325 slashes, b
\bba
\bas
\bsh
\bh searches each element of the P
\bPA
\bAT
\bTH
\bH for a directory con-
2326 taining an executable file by that name. B
\bBa
\bas
\bsh
\bh uses a hash table to
2327 remember the full pathnames of executable files (see h
\bha
\bas
\bsh
\bh under S
\bSH
\bHE
\bEL
\bLL
\bL
2328 B
\bBU
\bUI
\bIL
\bLT
\bTI
\bIN
\bN C
\bCO
\bOM
\bMM
\bMA
\bAN
\bND
\bDS
\bS below). A full search of the directories in P
\bPA
\bAT
\bTH
\bH is
2329 performed only if the command is not found in the hash table. If the
2330 search is unsuccessful, the shell searches for a defined shell function
2331 named c
\bco
\bom
\bmm
\bma
\ban
\bnd
\bd_
\b_n
\bno
\bot
\bt_
\b_f
\bfo
\bou
\bun
\bnd
\bd_
\b_h
\bha
\ban
\bnd
\bdl
\ble
\be. If that function exists, it is invoked
2332 with the original command and the original command's arguments as its
2333 arguments, and the function's exit status becomes the exit status of
2334 the shell. If that function is not defined, the shell prints an error
2335 message and returns an exit status of 127.
2337 If the search is successful, or if the command name contains one or
2338 more slashes, the shell executes the named program in a separate execu-
2339 tion environment. Argument 0 is set to the name given, and the remain-
2340 ing arguments to the command are set to the arguments given, if any.
2342 If this execution fails because the file is not in executable format,
2343 and the file is not a directory, it is assumed to be a _
\bs_
\bh_
\be_
\bl_
\bl _
\bs_
\bc_
\br_
\bi_
\bp_
\bt, a
2344 file containing shell commands. A subshell is spawned to execute it.
2345 This subshell reinitializes itself, so that the effect is as if a new
2346 shell had been invoked to handle the script, with the exception that
2347 the locations of commands remembered by the parent (see h
\bha
\bas
\bsh
\bh below
2348 under S
\bSH
\bHE
\bEL
\bLL
\bL B
\bBU
\bUI
\bIL
\bLT
\bTI
\bIN
\bN C
\bCO
\bOM
\bMM
\bMA
\bAN
\bND
\bDS
\bS) are retained by the child.
2350 If the program is a file beginning with #
\b#!
\b!, the remainder of the first
2351 line specifies an interpreter for the program. The shell executes the
2352 specified interpreter on operating systems that do not handle this exe-
2353 cutable format themselves. The arguments to the interpreter consist of
2354 a single optional argument following the interpreter name on the first
2355 line of the program, followed by the name of the program, followed by
2356 the command arguments, if any.
2358 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
2359 The shell has an _
\be_
\bx_
\be_
\bc_
\bu_
\bt_
\bi_
\bo_
\bn _
\be_
\bn_
\bv_
\bi_
\br_
\bo_
\bn_
\bm_
\be_
\bn_
\bt, which consists of the follow-
2363 +
\bo open files inherited by the shell at invocation, as modified by
2364 redirections supplied to the e
\bex
\bxe
\bec
\bc builtin
2366 +
\bo the current working directory as set by c
\bcd
\bd, p
\bpu
\bus
\bsh
\bhd
\bd, or p
\bpo
\bop
\bpd
\bd, or
2367 inherited by the shell at invocation
2369 +
\bo the file creation mode mask as set by u
\bum
\bma
\bas
\bsk
\bk or inherited from
2372 +
\bo current traps set by t
\btr
\bra
\bap
\bp
2374 +
\bo shell parameters that are set by variable assignment or with s
\bse
\bet
\bt
2375 or inherited from the shell's parent in the environment
2377 +
\bo shell functions defined during execution or inherited from the
2378 shell's parent in the environment
2380 +
\bo options enabled at invocation (either by default or with com-
2381 mand-line arguments) or by s
\bse
\bet
\bt
2383 +
\bo options enabled by s
\bsh
\bho
\bop
\bpt
\bt
2385 +
\bo shell aliases defined with a
\bal
\bli
\bia
\bas
\bs
2387 +
\bo various process IDs, including those of background jobs, the
2388 value of $
\b$$
\b$, and the value of P
\bPP
\bPI
\bID
\bD
2390 When a simple command other than a builtin or shell function is to be
2391 executed, it is invoked in a separate execution environment that con-
2392 sists of the following. Unless otherwise noted, the values are inher-
2393 ited from the shell.
2396 +
\bo the shell's open files, plus any modifications and additions
2397 specified by redirections to the command
2399 +
\bo the current working directory
2401 +
\bo the file creation mode mask
2403 +
\bo shell variables and functions marked for export, along with
2404 variables exported for the command, passed in the environment
2406 +
\bo traps caught by the shell are reset to the values inherited from
2407 the shell's parent, and traps ignored by the shell are ignored
2409 A command invoked in this separate environment cannot affect the
2410 shell's execution environment.
2412 Command substitution, commands grouped with parentheses, and asynchro-
2413 nous commands are invoked in a subshell environment that is a duplicate
2414 of the shell environment, except that traps caught by the shell are
2415 reset to the values that the shell inherited from its parent at invoca-
2416 tion. Builtin commands that are invoked as part of a pipeline are also
2417 executed in a subshell environment. Changes made to the subshell envi-
2418 ronment cannot affect the shell's execution environment.
2420 Subshells spawned to execute command substitutions inherit the value of
2421 the -
\b-e
\be option from the parent shell. When not in _
\bp_
\bo_
\bs_
\bi_
\bx mode, b
\bba
\bas
\bsh
\bh
2422 clears the -
\b-e
\be option in such subshells.
2424 If a command is followed by a &
\b& and job control is not active, the
2425 default standard input for the command is the empty file _
\b/_
\bd_
\be_
\bv_
\b/_
\bn_
\bu_
\bl_
\bl.
2426 Otherwise, the invoked command inherits the file descriptors of the
2427 calling shell as modified by redirections.
2429 E
\bEN
\bNV
\bVI
\bIR
\bRO
\bON
\bNM
\bME
\bEN
\bNT
\bT
2430 When a program is invoked it is given an array of strings called the
2431 _
\be_
\bn_
\bv_
\bi_
\br_
\bo_
\bn_
\bm_
\be_
\bn_
\bt. This is a list of _
\bn_
\ba_
\bm_
\be-_
\bv_
\ba_
\bl_
\bu_
\be pairs, of the form
2432 _
\bn_
\ba_
\bm_
\be=_
\bv_
\ba_
\bl_
\bu_
\be.
2434 The shell provides several ways to manipulate the environment. On
2435 invocation, the shell scans its own environment and creates a parameter
2436 for each name found, automatically marking it for _
\be_
\bx_
\bp_
\bo_
\br_
\bt to child pro-
2437 cesses. Executed commands inherit the environment. The e
\bex
\bxp
\bpo
\bor
\brt
\bt and
2438 d
\bde
\bec
\bcl
\bla
\bar
\bre
\be -
\b-x
\bx commands allow parameters and functions to be added to and
2439 deleted from the environment. If the value of a parameter in the envi-
2440 ronment is modified, the new value becomes part of the environment,
2441 replacing the old. The environment inherited by any executed command
2442 consists of the shell's initial environment, whose values may be modi-
2443 fied in the shell, less any pairs removed by the u
\bun
\bns
\bse
\bet
\bt command, plus
2444 any additions via the e
\bex
\bxp
\bpo
\bor
\brt
\bt and d
\bde
\bec
\bcl
\bla
\bar
\bre
\be -
\b-x
\bx commands.
2446 The environment for any _
\bs_
\bi_
\bm_
\bp_
\bl_
\be _
\bc_
\bo_
\bm_
\bm_
\ba_
\bn_
\bd or function may be augmented
2447 temporarily by prefixing it with parameter assignments, as described
2448 above in P
\bPA
\bAR
\bRA
\bAM
\bME
\bET
\bTE
\bER
\bRS
\bS. These assignment statements affect only the envi-
2449 ronment seen by that command.
2451 If the -
\b-k
\bk option is set (see the s
\bse
\bet
\bt builtin command below), then _
\ba_
\bl_
\bl
2452 parameter assignments are placed in the environment for a command, not
2453 just those that precede the command name.
2455 When b
\bba
\bas
\bsh
\bh invokes an external command, the variable _
\b_ is set to the
2456 full file name of the command and passed to that command in its envi-
2459 E
\bEX
\bXI
\bIT
\bT S
\bST
\bTA
\bAT
\bTU
\bUS
\bS
2460 The exit status of an executed command is the value returned by the
2461 _
\bw_
\ba_
\bi_
\bt_
\bp_
\bi_
\bd system call or equivalent function. Exit statuses fall between
2462 0 and 255, though, as explained below, the shell may use values above
2463 125 specially. Exit statuses from shell builtins and compound commands
2464 are also limited to this range. Under certain circumstances, the shell
2465 will use special values to indicate specific failure modes.
2467 For the shell's purposes, a command which exits with a zero exit status
2468 has succeeded. An exit status of zero indicates success. A non-zero
2469 exit status indicates failure. When a command terminates on a fatal
2470 signal _
\bN, b
\bba
\bas
\bsh
\bh uses the value of 128+_
\bN as the exit status.
2472 If a command is not found, the child process created to execute it
2473 returns a status of 127. If a command is found but is not executable,
2474 the return status is 126.
2476 If a command fails because of an error during expansion or redirection,
2477 the exit status is greater than zero.
2479 Shell builtin commands return a status of 0 (_
\bt_
\br_
\bu_
\be) if successful, and
2480 non-zero (_
\bf_
\ba_
\bl_
\bs_
\be) if an error occurs while they execute. All builtins
2481 return an exit status of 2 to indicate incorrect usage.
2483 B
\bBa
\bas
\bsh
\bh itself returns the exit status of the last command executed,
2484 unless a syntax error occurs, in which case it exits with a non-zero
2485 value. See also the e
\bex
\bxi
\bit
\bt builtin command below.
2487 S
\bSI
\bIG
\bGN
\bNA
\bAL
\bLS
\bS
2488 When b
\bba
\bas
\bsh
\bh is interactive, in the absence of any traps, it ignores
2489 S
\bSI
\bIG
\bGT
\bTE
\bER
\bRM
\bM (so that k
\bki
\bil
\bll
\bl 0
\b0 does not kill an interactive shell), and S
\bSI
\bIG
\bGI
\bIN
\bNT
\bT
2490 is caught and handled (so that the w
\bwa
\bai
\bit
\bt builtin is interruptible). In
2491 all cases, b
\bba
\bas
\bsh
\bh ignores S
\bSI
\bIG
\bGQ
\bQU
\bUI
\bIT
\bT. If job control is in effect, b
\bba
\bas
\bsh
\bh
2492 ignores S
\bSI
\bIG
\bGT
\bTT
\bTI
\bIN
\bN, S
\bSI
\bIG
\bGT
\bTT
\bTO
\bOU
\bU, and S
\bSI
\bIG
\bGT
\bTS
\bST
\bTP
\bP.
2494 Non-builtin commands run by b
\bba
\bas
\bsh
\bh have signal handlers set to the values
2495 inherited by the shell from its parent. When job control is not in
2496 effect, asynchronous commands ignore S
\bSI
\bIG
\bGI
\bIN
\bNT
\bT and S
\bSI
\bIG
\bGQ
\bQU
\bUI
\bIT
\bT in addition to
2497 these inherited handlers. Commands run as a result of command substi-
2498 tution ignore the keyboard-generated job control signals S
\bSI
\bIG
\bGT
\bTT
\bTI
\bIN
\bN, S
\bSI
\bIG
\bGT
\bT-
\b-
2499 T
\bTO
\bOU
\bU, and S
\bSI
\bIG
\bGT
\bTS
\bST
\bTP
\bP.
2501 The shell exits by default upon receipt of a S
\bSI
\bIG
\bGH
\bHU
\bUP
\bP. Before exiting,
2502 an interactive shell resends the S
\bSI
\bIG
\bGH
\bHU
\bUP
\bP to all jobs, running or
2503 stopped. Stopped jobs are sent S
\bSI
\bIG
\bGC
\bCO
\bON
\bNT
\bT to ensure that they receive the
2504 S
\bSI
\bIG
\bGH
\bHU
\bUP
\bP. To prevent the shell from sending the signal to a particular
2505 job, it should be removed from the jobs table with the d
\bdi
\bis
\bso
\bow
\bwn
\bn builtin
2506 (see S
\bSH
\bHE
\bEL
\bLL
\bL B
\bBU
\bUI
\bIL
\bLT
\bTI
\bIN
\bN C
\bCO
\bOM
\bMM
\bMA
\bAN
\bND
\bDS
\bS below) or marked to not receive S
\bSI
\bIG
\bGH
\bHU
\bUP
\bP
2507 using d
\bdi
\bis
\bso
\bow
\bwn
\bn -
\b-h
\bh.
2509 If the h
\bhu
\bup
\bpo
\bon
\bne
\bex
\bxi
\bit
\bt shell option has been set with s
\bsh
\bho
\bop
\bpt
\bt, b
\bba
\bas
\bsh
\bh sends a
2510 S
\bSI
\bIG
\bGH
\bHU
\bUP
\bP to all jobs when an interactive login shell exits.
2512 If b
\bba
\bas
\bsh
\bh is waiting for a command to complete and receives a signal for
2513 which a trap has been set, the trap will not be executed until the com-
2514 mand completes. When b
\bba
\bas
\bsh
\bh is waiting for an asynchronous command via
2515 the w
\bwa
\bai
\bit
\bt builtin, the reception of a signal for which a trap has been
2516 set will cause the w
\bwa
\bai
\bit
\bt builtin to return immediately with an exit sta-
2517 tus greater than 128, immediately after which the trap is executed.
2519 J
\bJO
\bOB
\bB C
\bCO
\bON
\bNT
\bTR
\bRO
\bOL
\bL
2520 _
\bJ_
\bo_
\bb _
\bc_
\bo_
\bn_
\bt_
\br_
\bo_
\bl refers to the ability to selectively stop (_
\bs_
\bu_
\bs_
\bp_
\be_
\bn_
\bd) the
2521 execution of processes and continue (_
\br_
\be_
\bs_
\bu_
\bm_
\be) their execution at a later
2522 point. A user typically employs this facility via an interactive
2523 interface supplied jointly by the operating system kernel's terminal
2524 driver and b
\bba
\bas
\bsh
\bh.
2526 The shell associates a _
\bj_
\bo_
\bb with each pipeline. It keeps a table of
2527 currently executing jobs, which may be listed with the j
\bjo
\bob
\bbs
\bs command.
2528 When b
\bba
\bas
\bsh
\bh starts a job asynchronously (in the _
\bb_
\ba_
\bc_
\bk_
\bg_
\br_
\bo_
\bu_
\bn_
\bd), it prints a
2529 line that looks like:
2533 indicating that this job is job number 1 and that the process ID of the
2534 last process in the pipeline associated with this job is 25647. All of
2535 the processes in a single pipeline are members of the same job. B
\bBa
\bas
\bsh
\bh
2536 uses the _
\bj_
\bo_
\bb abstraction as the basis for job control.
2538 To facilitate the implementation of the user interface to job control,
2539 the operating system maintains the notion of a _
\bc_
\bu_
\br_
\br_
\be_
\bn_
\bt _
\bt_
\be_
\br_
\bm_
\bi_
\bn_
\ba_
\bl _
\bp_
\br_
\bo_
\bc_
\be_
\bs_
\bs
2540 _
\bg_
\br_
\bo_
\bu_
\bp _
\bI_
\bD. Members of this process group (processes whose process group
2541 ID is equal to the current terminal process group ID) receive keyboard-
2542 generated signals such as S
\bSI
\bIG
\bGI
\bIN
\bNT
\bT. These processes are said to be in
2543 the _
\bf_
\bo_
\br_
\be_
\bg_
\br_
\bo_
\bu_
\bn_
\bd. _
\bB_
\ba_
\bc_
\bk_
\bg_
\br_
\bo_
\bu_
\bn_
\bd processes are those whose process group ID
2544 differs from the terminal's; such processes are immune to keyboard-gen-
2545 erated signals. Only foreground processes are allowed to read from or,
2546 if the user so specifies with stty tostop, write to the terminal.
2547 Background processes which attempt to read from (write to when stty
2548 tostop is in effect) the terminal are sent a S
\bSI
\bIG
\bGT
\bTT
\bTI
\bIN
\bN (
\b(S
\bSI
\bIG
\bGT
\bTT
\bTO
\bOU
\bU)
\b) signal
2549 by the kernel's terminal driver, which, unless caught, suspends the
2552 If the operating system on which b
\bba
\bas
\bsh
\bh is running supports job control,
2553 b
\bba
\bas
\bsh
\bh contains facilities to use it. Typing the _
\bs_
\bu_
\bs_
\bp_
\be_
\bn_
\bd character (typ-
2554 ically ^
\b^Z
\bZ, Control-Z) while a process is running causes that process to
2555 be stopped and returns control to b
\bba
\bas
\bsh
\bh. Typing the _
\bd_
\be_
\bl_
\ba_
\by_
\be_
\bd _
\bs_
\bu_
\bs_
\bp_
\be_
\bn_
\bd
2556 character (typically ^
\b^Y
\bY, Control-Y) causes the process to be stopped
2557 when it attempts to read input from the terminal, and control to be
2558 returned to b
\bba
\bas
\bsh
\bh. The user may then manipulate the state of this job,
2559 using the b
\bbg
\bg command to continue it in the background, the f
\bfg
\bg command
2560 to continue it in the foreground, or the k
\bki
\bil
\bll
\bl command to kill it. A ^
\b^Z
\bZ
2561 takes effect immediately, and has the additional side effect of causing
2562 pending output and typeahead to be discarded.
2564 There are a number of ways to refer to a job in the shell. The charac-
2565 ter %
\b% introduces a job specification (_
\bj_
\bo_
\bb_
\bs_
\bp_
\be_
\bc). Job number _
\bn may be
2566 referred to as %
\b%n
\bn. A job may also be referred to using a prefix of the
2567 name used to start it, or using a substring that appears in its command
2568 line. For example, %
\b%c
\bce
\be refers to a stopped c
\bce
\be job. If a prefix
2569 matches more than one job, b
\bba
\bas
\bsh
\bh reports an error. Using %
\b%?
\b?c
\bce
\be, on the
2570 other hand, refers to any job containing the string c
\bce
\be in its command
2571 line. If the substring matches more than one job, b
\bba
\bas
\bsh
\bh reports an
2572 error. The symbols %
\b%%
\b% and %
\b%+
\b+ refer to the shell's notion of the _
\bc_
\bu_
\br_
\b-
2573 _
\br_
\be_
\bn_
\bt _
\bj_
\bo_
\bb, which is the last job stopped while it was in the foreground
2574 or started in the background. The _
\bp_
\br_
\be_
\bv_
\bi_
\bo_
\bu_
\bs _
\bj_
\bo_
\bb may be referenced using
2575 %
\b%-
\b-. If there is only a single job, %
\b%+
\b+ and %
\b%-
\b- can both be used to refer
2576 to that job. In output pertaining to jobs (e.g., the output of the
2577 j
\bjo
\bob
\bbs
\bs command), the current job is always flagged with a +
\b+, and the pre-
2578 vious job with a -
\b-. A single % (with no accompanying job specifica-
2579 tion) also refers to the current job.
2581 Simply naming a job can be used to bring it into the foreground: %
\b%1
\b1 is
2582 a synonym for `
\b``
\b`f
\bfg
\bg %
\b%1
\b1'
\b''
\b', bringing job 1 from the background into the
2583 foreground. Similarly, `
\b``
\b`%
\b%1
\b1 &
\b&'
\b''
\b' resumes job 1 in the background,
2584 equivalent to `
\b``
\b`b
\bbg
\bg %
\b%1
\b1'
\b''
\b'.
2586 The shell learns immediately whenever a job changes state. Normally,
2587 b
\bba
\bas
\bsh
\bh waits until it is about to print a prompt before reporting changes
2588 in a job's status so as to not interrupt any other output. If the -
\b-b
\bb
2589 option to the s
\bse
\bet
\bt builtin command is enabled, b
\bba
\bas
\bsh
\bh reports such changes
2590 immediately. Any trap on S
\bSI
\bIG
\bGC
\bCH
\bHL
\bLD
\bD is executed for each child that
2593 If an attempt to exit b
\bba
\bas
\bsh
\bh is made while jobs are stopped (or, if the
2594 c
\bch
\bhe
\bec
\bck
\bkj
\bjo
\bob
\bbs
\bs shell option has been enabled using the s
\bsh
\bho
\bop
\bpt
\bt builtin, run-
2595 ning), the shell prints a warning message, and, if the c
\bch
\bhe
\bec
\bck
\bkj
\bjo
\bob
\bbs
\bs option
2596 is enabled, lists the jobs and their statuses. The j
\bjo
\bob
\bbs
\bs command may
2597 then be used to inspect their status. If a second attempt to exit is
2598 made without an intervening command, the shell does not print another
2599 warning, and any stopped jobs are terminated.
2601 P
\bPR
\bRO
\bOM
\bMP
\bPT
\bTI
\bIN
\bNG
\bG
2602 When executing interactively, b
\bba
\bas
\bsh
\bh displays the primary prompt P
\bPS
\bS1
\b1 when
2603 it is ready to read a command, and the secondary prompt P
\bPS
\bS2
\b2 when it
2604 needs more input to complete a command. B
\bBa
\bas
\bsh
\bh allows these prompt
2605 strings to be customized by inserting a number of backslash-escaped
2606 special characters that are decoded as follows:
2607 \
\b\a
\ba an ASCII bell character (07)
2608 \
\b\d
\bd the date in "Weekday Month Date" format (e.g., "Tue May
2610 \
\b\D
\bD{
\b{_
\bf_
\bo_
\br_
\bm_
\ba_
\bt}
\b}
2611 the _
\bf_
\bo_
\br_
\bm_
\ba_
\bt is passed to _
\bs_
\bt_
\br_
\bf_
\bt_
\bi_
\bm_
\be(3) and the result is
2612 inserted into the prompt string; an empty _
\bf_
\bo_
\br_
\bm_
\ba_
\bt results
2613 in a locale-specific time representation. The braces are
2615 \
\b\e
\be an ASCII escape character (033)
2616 \
\b\h
\bh the hostname up to the first `.'
2617 \
\b\H
\bH the hostname
2618 \
\b\j
\bj the number of jobs currently managed by the shell
2619 \
\b\l
\bl the basename of the shell's terminal device name
2621 \
\b\r
\br carriage return
2622 \
\b\s
\bs the name of the shell, the basename of $
\b$0
\b0 (the portion
2623 following the final slash)
2624 \
\b\t
\bt the current time in 24-hour HH:MM:SS format
2625 \
\b\T
\bT the current time in 12-hour HH:MM:SS format
2626 \
\b\@
\b@ the current time in 12-hour am/pm format
2627 \
\b\A
\bA the current time in 24-hour HH:MM format
2628 \
\b\u
\bu the username of the current user
2629 \
\b\v
\bv the version of b
\bba
\bas
\bsh
\bh (e.g., 2.00)
2630 \
\b\V
\bV the release of b
\bba
\bas
\bsh
\bh, version + patch level (e.g., 2.00.0)
2631 \
\b\w
\bw the current working directory, with $
\b$H
\bHO
\bOM
\bME
\bE abbreviated
2632 with a tilde (uses the value of the P
\bPR
\bRO
\bOM
\bMP
\bPT
\bT_
\b_D
\bDI
\bIR
\bRT
\bTR
\bRI
\bIM
\bM vari-
2634 \
\b\W
\bW the basename of the current working directory, with $
\b$H
\bHO
\bOM
\bME
\bE
2635 abbreviated with a tilde
2636 \
\b\!
\b! the history number of this command
2637 \
\b\#
\b# the command number of this command
2638 \
\b\$
\b$ if the effective UID is 0, a #
\b#, otherwise a $
\b$
2639 \
\b\_
\bn_
\bn_
\bn the character corresponding to the octal number _
\bn_
\bn_
\bn
2640 \
\b\\
\b\ a backslash
2641 \
\b\[
\b[ begin a sequence of non-printing characters, which could
2642 be used to embed a terminal control sequence into the
2644 \
\b\]
\b] end a sequence of non-printing characters
2646 The command number and the history number are usually different: the
2647 history number of a command is its position in the history list, which
2648 may include commands restored from the history file (see H
\bHI
\bIS
\bST
\bTO
\bOR
\bRY
\bY
2649 below), while the command number is the position in the sequence of
2650 commands executed during the current shell session. After the string
2651 is decoded, it is expanded via parameter expansion, command substitu-
2652 tion, arithmetic expansion, and quote removal, subject to the value of
2653 the p
\bpr
\bro
\bom
\bmp
\bpt
\btv
\bva
\bar
\brs
\bs shell option (see the description of the s
\bsh
\bho
\bop
\bpt
\bt command
2654 under S
\bSH
\bHE
\bEL
\bLL
\bL B
\bBU
\bUI
\bIL
\bLT
\bTI
\bIN
\bN C
\bCO
\bOM
\bMM
\bMA
\bAN
\bND
\bDS
\bS below).
2656 R
\bRE
\bEA
\bAD
\bDL
\bLI
\bIN
\bNE
\bE
2657 This is the library that handles reading input when using an interac-
2658 tive shell, unless the -
\b--
\b-n
\bno
\boe
\bed
\bdi
\bit
\bti
\bin
\bng
\bg option is given at shell invocation.
2659 Line editing is also used when using the -
\b-e
\be option to the r
\bre
\bea
\bad
\bd builtin.
2660 By default, the line editing commands are similar to those of Emacs. A
2661 vi-style line editing interface is also available. Line editing can be
2662 enabled at any time using the -
\b-o
\bo e
\bem
\bma
\bac
\bcs
\bs or -
\b-o
\bo v
\bvi
\bi options to the s
\bse
\bet
\bt
2663 builtin (see S
\bSH
\bHE
\bEL
\bLL
\bL B
\bBU
\bUI
\bIL
\bLT
\bTI
\bIN
\bN C
\bCO
\bOM
\bMM
\bMA
\bAN
\bND
\bDS
\bS below). To turn off line editing
2664 after the shell is running, use the +
\b+o
\bo e
\bem
\bma
\bac
\bcs
\bs or +
\b+o
\bo v
\bvi
\bi options to the
2665 s
\bse
\bet
\bt builtin.
2667 R
\bRe
\bea
\bad
\bdl
\bli
\bin
\bne
\be N
\bNo
\bot
\bta
\bat
\bti
\bio
\bon
\bn
2668 In this section, the Emacs-style notation is used to denote keystrokes.
2669 Control keys are denoted by C-_
\bk_
\be_
\by, e.g., C-n means Control-N. Simi-
2670 larly, _
\bm_
\be_
\bt_
\ba keys are denoted by M-_
\bk_
\be_
\by, so M-x means Meta-X. (On key-
2671 boards without a _
\bm_
\be_
\bt_
\ba key, M-_
\bx means ESC _
\bx, i.e., press the Escape key
2672 then the _
\bx key. This makes ESC the _
\bm_
\be_
\bt_
\ba _
\bp_
\br_
\be_
\bf_
\bi_
\bx. The combination M-C-_
\bx
2673 means ESC-Control-_
\bx, or press the Escape key then hold the Control key
2674 while pressing the _
\bx key.)
2676 Readline commands may be given numeric _
\ba_
\br_
\bg_
\bu_
\bm_
\be_
\bn_
\bt_
\bs, which normally act as
2677 a repeat count. Sometimes, however, it is the sign of the argument
2678 that is significant. Passing a negative argument to a command that
2679 acts in the forward direction (e.g., k
\bki
\bil
\bll
\bl-
\b-l
\bli
\bin
\bne
\be) causes that command to
2680 act in a backward direction. Commands whose behavior with arguments
2681 deviates from this are noted below.
2683 When a command is described as _
\bk_
\bi_
\bl_
\bl_
\bi_
\bn_
\bg text, the text deleted is saved
2684 for possible future retrieval (_
\by_
\ba_
\bn_
\bk_
\bi_
\bn_
\bg). The killed text is saved in a
2685 _
\bk_
\bi_
\bl_
\bl _
\br_
\bi_
\bn_
\bg. Consecutive kills cause the text to be accumulated into one
2686 unit, which can be yanked all at once. Commands which do not kill text
2687 separate the chunks of text on the kill ring.
2689 R
\bRe
\bea
\bad
\bdl
\bli
\bin
\bne
\be I
\bIn
\bni
\bit
\bti
\bia
\bal
\bli
\biz
\bza
\bat
\bti
\bio
\bon
\bn
2690 Readline is customized by putting commands in an initialization file
2691 (the _
\bi_
\bn_
\bp_
\bu_
\bt_
\br_
\bc file). The name of this file is taken from the value of
2692 the I
\bIN
\bNP
\bPU
\bUT
\bTR
\bRC
\bC variable. If that variable is unset, the default is
2693 _
\b~_
\b/_
\b._
\bi_
\bn_
\bp_
\bu_
\bt_
\br_
\bc. When a program which uses the readline library starts up,
2694 the initialization file is read, and the key bindings and variables are
2695 set. There are only a few basic constructs allowed in the readline
2696 initialization file. Blank lines are ignored. Lines beginning with a
2697 #
\b# are comments. Lines beginning with a $
\b$ indicate conditional con-
2698 structs. Other lines denote key bindings and variable settings.
2700 The default key-bindings may be changed with an _
\bi_
\bn_
\bp_
\bu_
\bt_
\br_
\bc file. Other
2701 programs that use this library may add their own commands and bindings.
2703 For example, placing
2705 M-Control-u: universal-argument
2707 C-Meta-u: universal-argument
2708 into the _
\bi_
\bn_
\bp_
\bu_
\bt_
\br_
\bc would make M-C-u execute the readline command _
\bu_
\bn_
\bi_
\bv_
\be_
\br_
\b-
2709 _
\bs_
\ba_
\bl_
\b-_
\ba_
\br_
\bg_
\bu_
\bm_
\be_
\bn_
\bt.
2711 The following symbolic character names are recognized: _
\bR_
\bU_
\bB_
\bO_
\bU_
\bT, _
\bD_
\bE_
\bL,
2712 _
\bE_
\bS_
\bC, _
\bL_
\bF_
\bD, _
\bN_
\bE_
\bW_
\bL_
\bI_
\bN_
\bE, _
\bR_
\bE_
\bT, _
\bR_
\bE_
\bT_
\bU_
\bR_
\bN, _
\bS_
\bP_
\bC, _
\bS_
\bP_
\bA_
\bC_
\bE, and _
\bT_
\bA_
\bB.
2714 In addition to command names, readline allows keys to be bound to a
2715 string that is inserted when the key is pressed (a _
\bm_
\ba_
\bc_
\br_
\bo).
2717 R
\bRe
\bea
\bad
\bdl
\bli
\bin
\bne
\be K
\bKe
\bey
\by B
\bBi
\bin
\bnd
\bdi
\bin
\bng
\bgs
\bs
2718 The syntax for controlling key bindings in the _
\bi_
\bn_
\bp_
\bu_
\bt_
\br_
\bc file is simple.
2719 All that is required is the name of the command or the text of a macro
2720 and a key sequence to which it should be bound. The name may be speci-
2721 fied in one of two ways: as a symbolic key name, possibly with _
\bM_
\be_
\bt_
\ba_
\b- or
2722 _
\bC_
\bo_
\bn_
\bt_
\br_
\bo_
\bl_
\b- prefixes, or as a key sequence.
2724 When using the form k
\bke
\bey
\byn
\bna
\bam
\bme
\be:_
\bf_
\bu_
\bn_
\bc_
\bt_
\bi_
\bo_
\bn_
\b-_
\bn_
\ba_
\bm_
\be or _
\bm_
\ba_
\bc_
\br_
\bo, _
\bk_
\be_
\by_
\bn_
\ba_
\bm_
\be is the name
2725 of a key spelled out in English. For example:
2727 Control-u: universal-argument
2728 Meta-Rubout: backward-kill-word
2729 Control-o: "> output"
2731 In the above example, _
\bC_
\b-_
\bu is bound to the function u
\bun
\bni
\biv
\bve
\ber
\brs
\bsa
\bal
\bl-
\b-a
\bar
\brg
\bgu
\bum
\bme
\ben
\bnt
\bt,
2732 _
\bM_
\b-_
\bD_
\bE_
\bL is bound to the function b
\bba
\bac
\bck
\bkw
\bwa
\bar
\brd
\bd-
\b-k
\bki
\bil
\bll
\bl-
\b-w
\bwo
\bor
\brd
\bd, and _
\bC_
\b-_
\bo is bound to
2733 run the macro expressed on the right hand side (that is, to insert the
2734 text ``> output'' into the line).
2736 In the second form, "
\b"k
\bke
\bey
\bys
\bse
\beq
\bq"
\b":_
\bf_
\bu_
\bn_
\bc_
\bt_
\bi_
\bo_
\bn_
\b-_
\bn_
\ba_
\bm_
\be or _
\bm_
\ba_
\bc_
\br_
\bo, k
\bke
\bey
\bys
\bse
\beq
\bq differs
2737 from k
\bke
\bey
\byn
\bna
\bam
\bme
\be above in that strings denoting an entire key sequence may
2738 be specified by placing the sequence within double quotes. Some GNU
2739 Emacs style key escapes can be used, as in the following example, but
2740 the symbolic character names are not recognized.
2742 "\C-u": universal-argument
2743 "\C-x\C-r": re-read-init-file
2744 "\e[11~": "Function Key 1"
2746 In this example, _
\bC_
\b-_
\bu is again bound to the function u
\bun
\bni
\biv
\bve
\ber
\brs
\bsa
\bal
\bl-
\b-a
\bar
\brg
\bgu
\bum
\bme
\ben
\bnt
\bt.
2747 _
\bC_
\b-_
\bx _
\bC_
\b-_
\br is bound to the function r
\bre
\be-
\b-r
\bre
\bea
\bad
\bd-
\b-i
\bin
\bni
\bit
\bt-
\b-f
\bfi
\bil
\ble
\be, and _
\bE_
\bS_
\bC _
\b[ _
\b1 _
\b1 _
\b~ is
2748 bound to insert the text ``Function Key 1''.
2750 The full set of GNU Emacs style escape sequences is
2751 \
\b\C
\bC-
\b- control prefix
2752 \
\b\M
\bM-
\b- meta prefix
2753 \
\b\e
\be an escape character
2758 In addition to the GNU Emacs style escape sequences, a second set of
2759 backslash escapes is available:
2760 \
\b\a
\ba alert (bell)
2765 \
\b\r
\br carriage return
2766 \
\b\t
\bt horizontal tab
2767 \
\b\v
\bv vertical tab
2768 \
\b\_
\bn_
\bn_
\bn the eight-bit character whose value is the octal value
2769 _
\bn_
\bn_
\bn (one to three digits)
2770 \
\b\x
\bx_
\bH_
\bH the eight-bit character whose value is the hexadecimal
2771 value _
\bH_
\bH (one or two hex digits)
2773 When entering the text of a macro, single or double quotes must be used
2774 to indicate a macro definition. Unquoted text is assumed to be a func-
2775 tion name. In the macro body, the backslash escapes described above
2776 are expanded. Backslash will quote any other character in the macro
2777 text, including " and '.
2779 B
\bBa
\bas
\bsh
\bh allows the current readline key bindings to be displayed or modi-
2780 fied with the b
\bbi
\bin
\bnd
\bd builtin command. The editing mode may be switched
2781 during interactive use by using the -
\b-o
\bo option to the s
\bse
\bet
\bt builtin com-
2782 mand (see S
\bSH
\bHE
\bEL
\bLL
\bL B
\bBU
\bUI
\bIL
\bLT
\bTI
\bIN
\bN C
\bCO
\bOM
\bMM
\bMA
\bAN
\bND
\bDS
\bS below).
2784 R
\bRe
\bea
\bad
\bdl
\bli
\bin
\bne
\be V
\bVa
\bar
\bri
\bia
\bab
\bbl
\ble
\bes
\bs
2785 Readline has variables that can be used to further customize its behav-
2786 ior. A variable may be set in the _
\bi_
\bn_
\bp_
\bu_
\bt_
\br_
\bc file with a statement of the
2789 s
\bse
\bet
\bt _
\bv_
\ba_
\br_
\bi_
\ba_
\bb_
\bl_
\be_
\b-_
\bn_
\ba_
\bm_
\be _
\bv_
\ba_
\bl_
\bu_
\be
2791 Except where noted, readline variables can take the values O
\bOn
\bn or O
\bOf
\bff
\bf
2792 (without regard to case). Unrecognized variable names are ignored.
2793 When a variable value is read, empty or null values, "on" (case-insen-
2794 sitive), and "1" are equivalent to O
\bOn
\bn. All other values are equivalent
2795 to O
\bOf
\bff
\bf. The variables and their default values are:
2797 b
\bbe
\bel
\bll
\bl-
\b-s
\bst
\bty
\byl
\ble
\be (
\b(a
\bau
\bud
\bdi
\bib
\bbl
\ble
\be)
\b)
2798 Controls what happens when readline wants to ring the terminal
2799 bell. If set to n
\bno
\bon
\bne
\be, readline never rings the bell. If set to
2800 v
\bvi
\bis
\bsi
\bib
\bbl
\ble
\be, readline uses a visible bell if one is available. If
2801 set to a
\bau
\bud
\bdi
\bib
\bbl
\ble
\be, readline attempts to ring the terminal's bell.
2802 b
\bbi
\bin
\bnd
\bd-
\b-t
\btt
\bty
\by-
\b-s
\bsp
\bpe
\bec
\bci
\bia
\bal
\bl-
\b-c
\bch
\bha
\bar
\brs
\bs (
\b(O
\bOn
\bn)
\b)
2803 If set to O
\bOn
\bn, readline attempts to bind the control characters
2804 treated specially by the kernel's terminal driver to their read-
2806 c
\bco
\bom
\bmm
\bme
\ben
\bnt
\bt-
\b-b
\bbe
\beg
\bgi
\bin
\bn (
\b(`
\b``
\b`#
\b#'
\b''
\b')
\b)
2807 The string that is inserted when the readline i
\bin
\bns
\bse
\ber
\brt
\bt-
\b-c
\bco
\bom
\bmm
\bme
\ben
\bnt
\bt
2808 command is executed. This command is bound to M
\bM-
\b-#
\b# in emacs mode
2809 and to #
\b# in vi command mode.
2810 c
\bco
\bom
\bmp
\bpl
\ble
\bet
\bti
\bio
\bon
\bn-
\b-i
\big
\bgn
\bno
\bor
\bre
\be-
\b-c
\bca
\bas
\bse
\be (
\b(O
\bOf
\bff
\bf)
\b)
2811 If set to O
\bOn
\bn, readline performs filename matching and completion
2812 in a case-insensitive fashion.
2813 c
\bco
\bom
\bmp
\bpl
\ble
\bet
\bti
\bio
\bon
\bn-
\b-p
\bpr
\bre
\bef
\bfi
\bix
\bx-
\b-d
\bdi
\bis
\bsp
\bpl
\bla
\bay
\by-
\b-l
\ble
\ben
\bng
\bgt
\bth
\bh (
\b(0
\b0)
\b)
2814 The length in characters of the common prefix of a list of pos-
2815 sible completions that is displayed without modification. When
2816 set to a value greater than zero, common prefixes longer than
2817 this value are replaced with an ellipsis when displaying possi-
2819 c
\bco
\bom
\bmp
\bpl
\ble
\bet
\bti
\bio
\bon
\bn-
\b-q
\bqu
\bue
\ber
\bry
\by-
\b-i
\bit
\bte
\bem
\bms
\bs (
\b(1
\b10
\b00
\b0)
\b)
2820 This determines when the user is queried about viewing the num-
2821 ber of possible completions generated by the p
\bpo
\bos
\bss
\bsi
\bib
\bbl
\ble
\be-
\b-c
\bco
\bom
\bmp
\bpl
\ble
\be-
\b-
2822 t
\bti
\bio
\bon
\bns
\bs command. It may be set to any integer value greater than
2823 or equal to zero. If the number of possible completions is
2824 greater than or equal to the value of this variable, the user is
2825 asked whether or not he wishes to view them; otherwise they are
2826 simply listed on the terminal.
2827 c
\bco
\bon
\bnv
\bve
\ber
\brt
\bt-
\b-m
\bme
\bet
\bta
\ba (
\b(O
\bOn
\bn)
\b)
2828 If set to O
\bOn
\bn, readline will convert characters with the eighth
2829 bit set to an ASCII key sequence by stripping the eighth bit and
2830 prefixing an escape character (in effect, using escape as the
2831 _
\bm_
\be_
\bt_
\ba _
\bp_
\br_
\be_
\bf_
\bi_
\bx).
2832 d
\bdi
\bis
\bsa
\bab
\bbl
\ble
\be-
\b-c
\bco
\bom
\bmp
\bpl
\ble
\bet
\bti
\bio
\bon
\bn (
\b(O
\bOf
\bff
\bf)
\b)
2833 If set to O
\bOn
\bn, readline will inhibit word completion. Completion
2834 characters will be inserted into the line as if they had been
2835 mapped to s
\bse
\bel
\blf
\bf-
\b-i
\bin
\bns
\bse
\ber
\brt
\bt.
2836 e
\bed
\bdi
\bit
\bti
\bin
\bng
\bg-
\b-m
\bmo
\bod
\bde
\be (
\b(e
\bem
\bma
\bac
\bcs
\bs)
\b)
2837 Controls whether readline begins with a set of key bindings sim-
2838 ilar to _
\bE_
\bm_
\ba_
\bc_
\bs or _
\bv_
\bi. e
\bed
\bdi
\bit
\bti
\bin
\bng
\bg-
\b-m
\bmo
\bod
\bde
\be can be set to either e
\bem
\bma
\bac
\bcs
\bs or
2840 e
\bec
\bch
\bho
\bo-
\b-c
\bco
\bon
\bnt
\btr
\bro
\bol
\bl-
\b-c
\bch
\bha
\bar
\bra
\bac
\bct
\bte
\ber
\brs
\bs (
\b(O
\bOn
\bn)
\b)
2841 When set to O
\bOn
\bn, on operating systems that indicate they support
2842 it, readline echoes a character corresponding to a signal gener-
2843 ated from the keyboard.
2844 e
\ben
\bna
\bab
\bbl
\ble
\be-
\b-k
\bke
\bey
\byp
\bpa
\bad
\bd (
\b(O
\bOf
\bff
\bf)
\b)
2845 When set to O
\bOn
\bn, readline will try to enable the application key-
2846 pad when it is called. Some systems need this to enable the
2848 e
\ben
\bna
\bab
\bbl
\ble
\be-
\b-m
\bme
\bet
\bta
\ba-
\b-k
\bke
\bey
\by (
\b(O
\bOn
\bn)
\b)
2849 When set to O
\bOn
\bn, readline will try to enable any meta modifier
2850 key the terminal claims to support when it is called. On many
2851 terminals, the meta key is used to send eight-bit characters.
2852 e
\bex
\bxp
\bpa
\ban
\bnd
\bd-
\b-t
\bti
\bil
\bld
\bde
\be (
\b(O
\bOf
\bff
\bf)
\b)
2853 If set to O
\bOn
\bn, tilde expansion is performed when readline
2854 attempts word completion.
2855 h
\bhi
\bis
\bst
\bto
\bor
\bry
\by-
\b-p
\bpr
\bre
\bes
\bse
\ber
\brv
\bve
\be-
\b-p
\bpo
\boi
\bin
\bnt
\bt (
\b(O
\bOf
\bff
\bf)
\b)
2856 If set to O
\bOn
\bn, the history code attempts to place point at the
2857 same location on each history line retrieved with p
\bpr
\bre
\bev
\bvi
\bio
\bou
\bus
\bs-
\b-h
\bhi
\bis
\bs-
\b-
2858 t
\bto
\bor
\bry
\by or n
\bne
\bex
\bxt
\bt-
\b-h
\bhi
\bis
\bst
\bto
\bor
\bry
\by.
2859 h
\bhi
\bis
\bst
\bto
\bor
\bry
\by-
\b-s
\bsi
\biz
\bze
\be (
\b(0
\b0)
\b)
2860 Set the maximum number of history entries saved in the history
2861 list. If set to zero, the number of entries in the history list
2863 h
\bho
\bor
\bri
\biz
\bzo
\bon
\bnt
\bta
\bal
\bl-
\b-s
\bsc
\bcr
\bro
\bol
\bll
\bl-
\b-m
\bmo
\bod
\bde
\be (
\b(O
\bOf
\bff
\bf)
\b)
2864 When set to O
\bOn
\bn, makes readline use a single line for display,
2865 scrolling the input horizontally on a single screen line when it
2866 becomes longer than the screen width rather than wrapping to a
2868 i
\bin
\bnp
\bpu
\but
\bt-
\b-m
\bme
\bet
\bta
\ba (
\b(O
\bOf
\bff
\bf)
\b)
2869 If set to O
\bOn
\bn, readline will enable eight-bit input (that is, it
2870 will not strip the high bit from the characters it reads),
2871 regardless of what the terminal claims it can support. The name
2872 m
\bme
\bet
\bta
\ba-
\b-f
\bfl
\bla
\bag
\bg is a synonym for this variable.
2873 i
\bis
\bse
\bea
\bar
\brc
\bch
\bh-
\b-t
\bte
\ber
\brm
\bmi
\bin
\bna
\bat
\bto
\bor
\brs
\bs (
\b(`
\b``
\b`C
\bC-
\b-[
\b[C
\bC-
\b-J
\bJ'
\b''
\b')
\b)
2874 The string of characters that should terminate an incremental
2875 search without subsequently executing the character as a com-
2876 mand. If this variable has not been given a value, the charac-
2877 ters _
\bE_
\bS_
\bC and _
\bC_
\b-_
\bJ will terminate an incremental search.
2878 k
\bke
\bey
\bym
\bma
\bap
\bp (
\b(e
\bem
\bma
\bac
\bcs
\bs)
\b)
2879 Set the current readline keymap. The set of valid keymap names
2880 is _
\be_
\bm_
\ba_
\bc_
\bs_
\b, _
\be_
\bm_
\ba_
\bc_
\bs_
\b-_
\bs_
\bt_
\ba_
\bn_
\bd_
\ba_
\br_
\bd_
\b, _
\be_
\bm_
\ba_
\bc_
\bs_
\b-_
\bm_
\be_
\bt_
\ba_
\b, _
\be_
\bm_
\ba_
\bc_
\bs_
\b-_
\bc_
\bt_
\bl_
\bx_
\b, _
\bv_
\bi_
\b, _
\bv_
\bi_
\b-_
\bc_
\bo_
\bm_
\b-
2881 _
\bm_
\ba_
\bn_
\bd, and _
\bv_
\bi_
\b-_
\bi_
\bn_
\bs_
\be_
\br_
\bt. _
\bv_
\bi is equivalent to _
\bv_
\bi_
\b-_
\bc_
\bo_
\bm_
\bm_
\ba_
\bn_
\bd; _
\be_
\bm_
\ba_
\bc_
\bs is
2882 equivalent to _
\be_
\bm_
\ba_
\bc_
\bs_
\b-_
\bs_
\bt_
\ba_
\bn_
\bd_
\ba_
\br_
\bd. The default value is _
\be_
\bm_
\ba_
\bc_
\bs; the
2883 value of e
\bed
\bdi
\bit
\bti
\bin
\bng
\bg-
\b-m
\bmo
\bod
\bde
\be also affects the default keymap.
2884 m
\bma
\bar
\brk
\bk-
\b-d
\bdi
\bir
\bre
\bec
\bct
\bto
\bor
\bri
\bie
\bes
\bs (
\b(O
\bOn
\bn)
\b)
2885 If set to O
\bOn
\bn, completed directory names have a slash appended.
2886 m
\bma
\bar
\brk
\bk-
\b-m
\bmo
\bod
\bdi
\bif
\bfi
\bie
\bed
\bd-
\b-l
\bli
\bin
\bne
\bes
\bs (
\b(O
\bOf
\bff
\bf)
\b)
2887 If set to O
\bOn
\bn, history lines that have been modified are dis-
2888 played with a preceding asterisk (*
\b*).
2889 m
\bma
\bar
\brk
\bk-
\b-s
\bsy
\bym
\bml
\bli
\bin
\bnk
\bke
\bed
\bd-
\b-d
\bdi
\bir
\bre
\bec
\bct
\bto
\bor
\bri
\bie
\bes
\bs (
\b(O
\bOf
\bff
\bf)
\b)
2890 If set to O
\bOn
\bn, completed names which are symbolic links to direc-
2891 tories have a slash appended (subject to the value of
2892 m
\bma
\bar
\brk
\bk-
\b-d
\bdi
\bir
\bre
\bec
\bct
\bto
\bor
\bri
\bie
\bes
\bs).
2893 m
\bma
\bat
\btc
\bch
\bh-
\b-h
\bhi
\bid
\bdd
\bde
\ben
\bn-
\b-f
\bfi
\bil
\ble
\bes
\bs (
\b(O
\bOn
\bn)
\b)
2894 This variable, when set to O
\bOn
\bn, causes readline to match files
2895 whose names begin with a `.' (hidden files) when performing
2896 filename completion. If set to O
\bOf
\bff
\bf, the leading `.' must be
2897 supplied by the user in the filename to be completed.
2898 m
\bme
\ben
\bnu
\bu-
\b-c
\bco
\bom
\bmp
\bpl
\ble
\bet
\bte
\be-
\b-d
\bdi
\bis
\bsp
\bpl
\bla
\bay
\by-
\b-p
\bpr
\bre
\bef
\bfi
\bix
\bx (
\b(O
\bOf
\bff
\bf)
\b)
2899 If set to O
\bOn
\bn, menu completion displays the common prefix of the
2900 list of possible completions (which may be empty) before cycling
2902 o
\bou
\but
\btp
\bpu
\but
\bt-
\b-m
\bme
\bet
\bta
\ba (
\b(O
\bOf
\bff
\bf)
\b)
2903 If set to O
\bOn
\bn, readline will display characters with the eighth
2904 bit set directly rather than as a meta-prefixed escape sequence.
2905 p
\bpa
\bag
\bge
\be-
\b-c
\bco
\bom
\bmp
\bpl
\ble
\bet
\bti
\bio
\bon
\bns
\bs (
\b(O
\bOn
\bn)
\b)
2906 If set to O
\bOn
\bn, readline uses an internal _
\bm_
\bo_
\br_
\be-like pager to dis-
2907 play a screenful of possible completions at a time.
2908 p
\bpr
\bri
\bin
\bnt
\bt-
\b-c
\bco
\bom
\bmp
\bpl
\ble
\bet
\bti
\bio
\bon
\bns
\bs-
\b-h
\bho
\bor
\bri
\biz
\bzo
\bon
\bnt
\bta
\bal
\bll
\bly
\by (
\b(O
\bOf
\bff
\bf)
\b)
2909 If set to O
\bOn
\bn, readline will display completions with matches
2910 sorted horizontally in alphabetical order, rather than down the
2912 r
\bre
\bev
\bve
\ber
\brt
\bt-
\b-a
\bal
\bll
\bl-
\b-a
\bat
\bt-
\b-n
\bne
\bew
\bwl
\bli
\bin
\bne
\be (
\b(O
\bOf
\bff
\bf)
\b)
2913 If set to O
\bOn
\bn, readline will undo all changes to history lines
2914 before returning when a
\bac
\bcc
\bce
\bep
\bpt
\bt-
\b-l
\bli
\bin
\bne
\be is executed. By default, his-
2915 tory lines may be modified and retain individual undo lists
2916 across calls to r
\bre
\bea
\bad
\bdl
\bli
\bin
\bne
\be.
2917 s
\bsh
\bho
\bow
\bw-
\b-a
\bal
\bll
\bl-
\b-i
\bif
\bf-
\b-a
\bam
\bmb
\bbi
\big
\bgu
\buo
\bou
\bus
\bs (
\b(O
\bOf
\bff
\bf)
\b)
2918 This alters the default behavior of the completion functions.
2919 If set to O
\bOn
\bn, words which have more than one possible completion
2920 cause the matches to be listed immediately instead of ringing
2922 s
\bsh
\bho
\bow
\bw-
\b-a
\bal
\bll
\bl-
\b-i
\bif
\bf-
\b-u
\bun
\bnm
\bmo
\bod
\bdi
\bif
\bfi
\bie
\bed
\bd (
\b(O
\bOf
\bff
\bf)
\b)
2923 This alters the default behavior of the completion functions in
2924 a fashion similar to s
\bsh
\bho
\bow
\bw-
\b-a
\bal
\bll
\bl-
\b-i
\bif
\bf-
\b-a
\bam
\bmb
\bbi
\big
\bgu
\buo
\bou
\bus
\bs. If set to O
\bOn
\bn, words
2925 which have more than one possible completion without any possi-
2926 ble partial completion (the possible completions don't share a
2927 common prefix) cause the matches to be listed immediately
2928 instead of ringing the bell.
2929 s
\bsk
\bki
\bip
\bp-
\b-c
\bco
\bom
\bmp
\bpl
\ble
\bet
\bte
\bed
\bd-
\b-t
\bte
\bex
\bxt
\bt (
\b(O
\bOf
\bff
\bf)
\b)
2930 If set to O
\bOn
\bn, this alters the default completion behavior when
2931 inserting a single match into the line. It's only active when
2932 performing completion in the middle of a word. If enabled,
2933 readline does not insert characters from the completion that
2934 match characters after point in the word being completed, so
2935 portions of the word following the cursor are not duplicated.
2936 v
\bvi
\bis
\bsi
\bib
\bbl
\ble
\be-
\b-s
\bst
\bta
\bat
\bts
\bs (
\b(O
\bOf
\bff
\bf)
\b)
2937 If set to O
\bOn
\bn, a character denoting a file's type as reported by
2938 _
\bs_
\bt_
\ba_
\bt(2) is appended to the filename when listing possible com-
2941 R
\bRe
\bea
\bad
\bdl
\bli
\bin
\bne
\be C
\bCo
\bon
\bnd
\bdi
\bit
\bti
\bio
\bon
\bna
\bal
\bl C
\bCo
\bon
\bns
\bst
\btr
\bru
\buc
\bct
\bts
\bs
2942 Readline implements a facility similar in spirit to the conditional
2943 compilation features of the C preprocessor which allows key bindings
2944 and variable settings to be performed as the result of tests. There
2945 are four parser directives used.
2947 $
\b$i
\bif
\bf The $
\b$i
\bif
\bf construct allows bindings to be made based on the edit-
2948 ing mode, the terminal being used, or the application using
2949 readline. The text of the test extends to the end of the line;
2950 no characters are required to isolate it.
2952 m
\bmo
\bod
\bde
\be The m
\bmo
\bod
\bde
\be=
\b= form of the $
\b$i
\bif
\bf directive is used to test
2953 whether readline is in emacs or vi mode. This may be
2954 used in conjunction with the s
\bse
\bet
\bt k
\bke
\bey
\bym
\bma
\bap
\bp command, for
2955 instance, to set bindings in the _
\be_
\bm_
\ba_
\bc_
\bs_
\b-_
\bs_
\bt_
\ba_
\bn_
\bd_
\ba_
\br_
\bd and
2956 _
\be_
\bm_
\ba_
\bc_
\bs_
\b-_
\bc_
\bt_
\bl_
\bx keymaps only if readline is starting out in
2959 t
\bte
\ber
\brm
\bm The t
\bte
\ber
\brm
\bm=
\b= form may be used to include terminal-specific
2960 key bindings, perhaps to bind the key sequences output by
2961 the terminal's function keys. The word on the right side
2962 of the =
\b= is tested against the both full name of the ter-
2963 minal and the portion of the terminal name before the
2964 first -
\b-. This allows _
\bs_
\bu_
\bn to match both _
\bs_
\bu_
\bn and _
\bs_
\bu_
\bn_
\b-_
\bc_
\bm_
\bd,
2967 a
\bap
\bpp
\bpl
\bli
\bic
\bca
\bat
\bti
\bio
\bon
\bn
2968 The a
\bap
\bpp
\bpl
\bli
\bic
\bca
\bat
\bti
\bio
\bon
\bn construct is used to include application-
2969 specific settings. Each program using the readline
2970 library sets the _
\ba_
\bp_
\bp_
\bl_
\bi_
\bc_
\ba_
\bt_
\bi_
\bo_
\bn _
\bn_
\ba_
\bm_
\be, and an initialization
2971 file can test for a particular value. This could be used
2972 to bind key sequences to functions useful for a specific
2973 program. For instance, the following command adds a key
2974 sequence that quotes the current or previous word in
2978 # Quote the current or previous word
2979 "\C-xq": "\eb\"\ef\""
2980 $
\b$e
\ben
\bnd
\bdi
\bif
\bf
2982 $
\b$e
\ben
\bnd
\bdi
\bif
\bf This command, as seen in the previous example, terminates an $
\b$i
\bif
\bf
2985 $
\b$e
\bel
\bls
\bse
\be Commands in this branch of the $
\b$i
\bif
\bf directive are executed if the
2988 $
\b$i
\bin
\bnc
\bcl
\blu
\bud
\bde
\be
2989 This directive takes a single filename as an argument and reads
2990 commands and bindings from that file. For example, the follow-
2991 ing directive would read _
\b/_
\be_
\bt_
\bc_
\b/_
\bi_
\bn_
\bp_
\bu_
\bt_
\br_
\bc:
2993 $
\b$i
\bin
\bnc
\bcl
\blu
\bud
\bde
\be _
\b/_
\be_
\bt_
\bc_
\b/_
\bi_
\bn_
\bp_
\bu_
\bt_
\br_
\bc
2995 S
\bSe
\bea
\bar
\brc
\bch
\bhi
\bin
\bng
\bg
2996 Readline provides commands for searching through the command history
2997 (see H
\bHI
\bIS
\bST
\bTO
\bOR
\bRY
\bY below) for lines containing a specified string. There are
2998 two search modes: _
\bi_
\bn_
\bc_
\br_
\be_
\bm_
\be_
\bn_
\bt_
\ba_
\bl and _
\bn_
\bo_
\bn_
\b-_
\bi_
\bn_
\bc_
\br_
\be_
\bm_
\be_
\bn_
\bt_
\ba_
\bl.
3000 Incremental searches begin before the user has finished typing the
3001 search string. As each character of the search string is typed, read-
3002 line displays the next entry from the history matching the string typed
3003 so far. An incremental search requires only as many characters as
3004 needed to find the desired history entry. The characters present in
3005 the value of the i
\bis
\bse
\bea
\bar
\brc
\bch
\bh-
\b-t
\bte
\ber
\brm
\bmi
\bin
\bna
\bat
\bto
\bor
\brs
\bs variable are used to terminate an
3006 incremental search. If that variable has not been assigned a value the
3007 Escape and Control-J characters will terminate an incremental search.
3008 Control-G will abort an incremental search and restore the original
3009 line. When the search is terminated, the history entry containing the
3010 search string becomes the current line.
3012 To find other matching entries in the history list, type Control-S or
3013 Control-R as appropriate. This will search backward or forward in the
3014 history for the next entry matching the search string typed so far.
3015 Any other key sequence bound to a readline command will terminate the
3016 search and execute that command. For instance, a _
\bn_
\be_
\bw_
\bl_
\bi_
\bn_
\be will termi-
3017 nate the search and accept the line, thereby executing the command from
3020 Readline remembers the last incremental search string. If two Control-
3021 Rs are typed without any intervening characters defining a new search
3022 string, any remembered search string is used.
3024 Non-incremental searches read the entire search string before starting
3025 to search for matching history lines. The search string may be typed
3026 by the user or be part of the contents of the current line.
3028 R
\bRe
\bea
\bad
\bdl
\bli
\bin
\bne
\be C
\bCo
\bom
\bmm
\bma
\ban
\bnd
\bd N
\bNa
\bam
\bme
\bes
\bs
3029 The following is a list of the names of the commands and the default
3030 key sequences to which they are bound. Command names without an accom-
3031 panying key sequence are unbound by default. In the following descrip-
3032 tions, _
\bp_
\bo_
\bi_
\bn_
\bt refers to the current cursor position, and _
\bm_
\ba_
\br_
\bk refers to
3033 a cursor position saved by the s
\bse
\bet
\bt-
\b-m
\bma
\bar
\brk
\bk command. The text between the
3034 point and mark is referred to as the _
\br_
\be_
\bg_
\bi_
\bo_
\bn.
3036 C
\bCo
\bom
\bmm
\bma
\ban
\bnd
\bds
\bs f
\bfo
\bor
\br M
\bMo
\bov
\bvi
\bin
\bng
\bg
3037 b
\bbe
\beg
\bgi
\bin
\bnn
\bni
\bin
\bng
\bg-
\b-o
\bof
\bf-
\b-l
\bli
\bin
\bne
\be (
\b(C
\bC-
\b-a
\ba)
\b)
3038 Move to the start of the current line.
3039 e
\ben
\bnd
\bd-
\b-o
\bof
\bf-
\b-l
\bli
\bin
\bne
\be (
\b(C
\bC-
\b-e
\be)
\b)
3040 Move to the end of the line.
3041 f
\bfo
\bor
\brw
\bwa
\bar
\brd
\bd-
\b-c
\bch
\bha
\bar
\br (
\b(C
\bC-
\b-f
\bf)
\b)
3042 Move forward a character.
3043 b
\bba
\bac
\bck
\bkw
\bwa
\bar
\brd
\bd-
\b-c
\bch
\bha
\bar
\br (
\b(C
\bC-
\b-b
\bb)
\b)
3044 Move back a character.
3045 f
\bfo
\bor
\brw
\bwa
\bar
\brd
\bd-
\b-w
\bwo
\bor
\brd
\bd (
\b(M
\bM-
\b-f
\bf)
\b)
3046 Move forward to the end of the next word. Words are composed of
3047 alphanumeric characters (letters and digits).
3048 b
\bba
\bac
\bck
\bkw
\bwa
\bar
\brd
\bd-
\b-w
\bwo
\bor
\brd
\bd (
\b(M
\bM-
\b-b
\bb)
\b)
3049 Move back to the start of the current or previous word. Words
3050 are composed of alphanumeric characters (letters and digits).
3051 s
\bsh
\bhe
\bel
\bll
\bl-
\b-f
\bfo
\bor
\brw
\bwa
\bar
\brd
\bd-
\b-w
\bwo
\bor
\brd
\bd
3052 Move forward to the end of the next word. Words are delimited
3053 by non-quoted shell metacharacters.
3054 s
\bsh
\bhe
\bel
\bll
\bl-
\b-b
\bba
\bac
\bck
\bkw
\bwa
\bar
\brd
\bd-
\b-w
\bwo
\bor
\brd
\bd
3055 Move back to the start of the current or previous word. Words
3056 are delimited by non-quoted shell metacharacters.
3057 c
\bcl
\ble
\bea
\bar
\br-
\b-s
\bsc
\bcr
\bre
\bee
\ben
\bn (
\b(C
\bC-
\b-l
\bl)
\b)
3058 Clear the screen leaving the current line at the top of the
3059 screen. With an argument, refresh the current line without
3060 clearing the screen.
3061 r
\bre
\bed
\bdr
\bra
\baw
\bw-
\b-c
\bcu
\bur
\brr
\bre
\ben
\bnt
\bt-
\b-l
\bli
\bin
\bne
\be
3062 Refresh the current line.
3064 C
\bCo
\bom
\bmm
\bma
\ban
\bnd
\bds
\bs f
\bfo
\bor
\br M
\bMa
\ban
\bni
\bip
\bpu
\bul
\bla
\bat
\bti
\bin
\bng
\bg t
\bth
\bhe
\be H
\bHi
\bis
\bst
\bto
\bor
\bry
\by
3065 a
\bac
\bcc
\bce
\bep
\bpt
\bt-
\b-l
\bli
\bin
\bne
\be (
\b(N
\bNe
\bew
\bwl
\bli
\bin
\bne
\be,
\b, R
\bRe
\bet
\btu
\bur
\brn
\bn)
\b)
3066 Accept the line regardless of where the cursor is. If this line
3067 is non-empty, add it to the history list according to the state
3068 of the H
\bHI
\bIS
\bST
\bTC
\bCO
\bON
\bNT
\bTR
\bRO
\bOL
\bL variable. If the line is a modified history
3069 line, then restore the history line to its original state.
3070 p
\bpr
\bre
\bev
\bvi
\bio
\bou
\bus
\bs-
\b-h
\bhi
\bis
\bst
\bto
\bor
\bry
\by (
\b(C
\bC-
\b-p
\bp)
\b)
3071 Fetch the previous command from the history list, moving back in
3073 n
\bne
\bex
\bxt
\bt-
\b-h
\bhi
\bis
\bst
\bto
\bor
\bry
\by (
\b(C
\bC-
\b-n
\bn)
\b)
3074 Fetch the next command from the history list, moving forward in
3076 b
\bbe
\beg
\bgi
\bin
\bnn
\bni
\bin
\bng
\bg-
\b-o
\bof
\bf-
\b-h
\bhi
\bis
\bst
\bto
\bor
\bry
\by (
\b(M
\bM-
\b-<
\b<)
\b)
3077 Move to the first line in the history.
3078 e
\ben
\bnd
\bd-
\b-o
\bof
\bf-
\b-h
\bhi
\bis
\bst
\bto
\bor
\bry
\by (
\b(M
\bM-
\b->
\b>)
\b)
3079 Move to the end of the input history, i.e., the line currently
3081 r
\bre
\bev
\bve
\ber
\brs
\bse
\be-
\b-s
\bse
\bea
\bar
\brc
\bch
\bh-
\b-h
\bhi
\bis
\bst
\bto
\bor
\bry
\by (
\b(C
\bC-
\b-r
\br)
\b)
3082 Search backward starting at the current line and moving `up'
3083 through the history as necessary. This is an incremental
3085 f
\bfo
\bor
\brw
\bwa
\bar
\brd
\bd-
\b-s
\bse
\bea
\bar
\brc
\bch
\bh-
\b-h
\bhi
\bis
\bst
\bto
\bor
\bry
\by (
\b(C
\bC-
\b-s
\bs)
\b)
3086 Search forward starting at the current line and moving `down'
3087 through the history as necessary. This is an incremental
3089 n
\bno
\bon
\bn-
\b-i
\bin
\bnc
\bcr
\bre
\bem
\bme
\ben
\bnt
\bta
\bal
\bl-
\b-r
\bre
\bev
\bve
\ber
\brs
\bse
\be-
\b-s
\bse
\bea
\bar
\brc
\bch
\bh-
\b-h
\bhi
\bis
\bst
\bto
\bor
\bry
\by (
\b(M
\bM-
\b-p
\bp)
\b)
3090 Search backward through the history starting at the current line
3091 using a non-incremental search for a string supplied by the
3093 n
\bno
\bon
\bn-
\b-i
\bin
\bnc
\bcr
\bre
\bem
\bme
\ben
\bnt
\bta
\bal
\bl-
\b-f
\bfo
\bor
\brw
\bwa
\bar
\brd
\bd-
\b-s
\bse
\bea
\bar
\brc
\bch
\bh-
\b-h
\bhi
\bis
\bst
\bto
\bor
\bry
\by (
\b(M
\bM-
\b-n
\bn)
\b)
3094 Search forward through the history using a non-incremental
3095 search for a string supplied by the user.
3096 h
\bhi
\bis
\bst
\bto
\bor
\bry
\by-
\b-s
\bse
\bea
\bar
\brc
\bch
\bh-
\b-f
\bfo
\bor
\brw
\bwa
\bar
\brd
\bd
3097 Search forward through the history for the string of characters
3098 between the start of the current line and the point. This is a
3099 non-incremental search.
3100 h
\bhi
\bis
\bst
\bto
\bor
\bry
\by-
\b-s
\bse
\bea
\bar
\brc
\bch
\bh-
\b-b
\bba
\bac
\bck
\bkw
\bwa
\bar
\brd
\bd
3101 Search backward through the history for the string of characters
3102 between the start of the current line and the point. This is a
3103 non-incremental search.
3104 y
\bya
\ban
\bnk
\bk-
\b-n
\bnt
\bth
\bh-
\b-a
\bar
\brg
\bg (
\b(M
\bM-
\b-C
\bC-
\b-y
\by)
\b)
3105 Insert the first argument to the previous command (usually the
3106 second word on the previous line) at point. With an argument _
\bn,
3107 insert the _
\bnth word from the previous command (the words in the
3108 previous command begin with word 0). A negative argument
3109 inserts the _
\bnth word from the end of the previous command. Once
3110 the argument _
\bn is computed, the argument is extracted as if the
3111 "!_
\bn" history expansion had been specified.
3112 y
\bya
\ban
\bnk
\bk-
\b-l
\bla
\bas
\bst
\bt-
\b-a
\bar
\brg
\bg (
\b(M
\bM-
\b-.
\b.,
\b, M
\bM-
\b-_
\b_)
\b)
3113 Insert the last argument to the previous command (the last word
3114 of the previous history entry). With a numeric argument, behave
3115 exactly like y
\bya
\ban
\bnk
\bk-
\b-n
\bnt
\bth
\bh-
\b-a
\bar
\brg
\bg. Successive calls to y
\bya
\ban
\bnk
\bk-
\b-l
\bla
\bas
\bst
\bt-
\b-a
\bar
\brg
\bg
3116 move back through the history list, inserting the last word (or
3117 the word specified by the argument to the first call) of each
3118 line in turn. Any numeric argument supplied to these successive
3119 calls determines the direction to move through the history. A
3120 negative argument switches the direction through the history
3121 (back or forward). The history expansion facilities are used to
3122 extract the last argument, as if the "!$" history expansion had
3124 s
\bsh
\bhe
\bel
\bll
\bl-
\b-e
\bex
\bxp
\bpa
\ban
\bnd
\bd-
\b-l
\bli
\bin
\bne
\be (
\b(M
\bM-
\b-C
\bC-
\b-e
\be)
\b)
3125 Expand the line as the shell does. This performs alias and his-
3126 tory expansion as well as all of the shell word expansions. See
3127 H
\bHI
\bIS
\bST
\bTO
\bOR
\bRY
\bY E
\bEX
\bXP
\bPA
\bAN
\bNS
\bSI
\bIO
\bON
\bN below for a description of history expansion.
3128 h
\bhi
\bis
\bst
\bto
\bor
\bry
\by-
\b-e
\bex
\bxp
\bpa
\ban
\bnd
\bd-
\b-l
\bli
\bin
\bne
\be (
\b(M
\bM-
\b-^
\b^)
\b)
3129 Perform history expansion on the current line. See H
\bHI
\bIS
\bST
\bTO
\bOR
\bRY
\bY
3130 E
\bEX
\bXP
\bPA
\bAN
\bNS
\bSI
\bIO
\bON
\bN below for a description of history expansion.
3131 m
\bma
\bag
\bgi
\bic
\bc-
\b-s
\bsp
\bpa
\bac
\bce
\be
3132 Perform history expansion on the current line and insert a
3133 space. See H
\bHI
\bIS
\bST
\bTO
\bOR
\bRY
\bY E
\bEX
\bXP
\bPA
\bAN
\bNS
\bSI
\bIO
\bON
\bN below for a description of history
3135 a
\bal
\bli
\bia
\bas
\bs-
\b-e
\bex
\bxp
\bpa
\ban
\bnd
\bd-
\b-l
\bli
\bin
\bne
\be
3136 Perform alias expansion on the current line. See A
\bAL
\bLI
\bIA
\bAS
\bSE
\bES
\bS above
3137 for a description of alias expansion.
3138 h
\bhi
\bis
\bst
\bto
\bor
\bry
\by-
\b-a
\ban
\bnd
\bd-
\b-a
\bal
\bli
\bia
\bas
\bs-
\b-e
\bex
\bxp
\bpa
\ban
\bnd
\bd-
\b-l
\bli
\bin
\bne
\be
3139 Perform history and alias expansion on the current line.
3140 i
\bin
\bns
\bse
\ber
\brt
\bt-
\b-l
\bla
\bas
\bst
\bt-
\b-a
\bar
\brg
\bgu
\bum
\bme
\ben
\bnt
\bt (
\b(M
\bM-
\b-.
\b.,
\b, M
\bM-
\b-_
\b_)
\b)
3141 A synonym for y
\bya
\ban
\bnk
\bk-
\b-l
\bla
\bas
\bst
\bt-
\b-a
\bar
\brg
\bg.
3142 o
\bop
\bpe
\ber
\bra
\bat
\bte
\be-
\b-a
\ban
\bnd
\bd-
\b-g
\bge
\bet
\bt-
\b-n
\bne
\bex
\bxt
\bt (
\b(C
\bC-
\b-o
\bo)
\b)
3143 Accept the current line for execution and fetch the next line
3144 relative to the current line from the history for editing. Any
3145 argument is ignored.
3146 e
\bed
\bdi
\bit
\bt-
\b-a
\ban
\bnd
\bd-
\b-e
\bex
\bxe
\bec
\bcu
\but
\bte
\be-
\b-c
\bco
\bom
\bmm
\bma
\ban
\bnd
\bd (
\b(C
\bC-
\b-x
\bxC
\bC-
\b-e
\be)
\b)
3147 Invoke an editor on the current command line, and execute the
3148 result as shell commands. B
\bBa
\bas
\bsh
\bh attempts to invoke $
\b$V
\bVI
\bIS
\bSU
\bUA
\bAL
\bL,
3149 $
\b$E
\bED
\bDI
\bIT
\bTO
\bOR
\bR, and _
\be_
\bm_
\ba_
\bc_
\bs as the editor, in that order.
3151 C
\bCo
\bom
\bmm
\bma
\ban
\bnd
\bds
\bs f
\bfo
\bor
\br C
\bCh
\bha
\ban
\bng
\bgi
\bin
\bng
\bg T
\bTe
\bex
\bxt
\bt
3152 d
\bde
\bel
\ble
\bet
\bte
\be-
\b-c
\bch
\bha
\bar
\br (
\b(C
\bC-
\b-d
\bd)
\b)
3153 Delete the character at point. If point is at the beginning of
3154 the line, there are no characters in the line, and the last
3155 character typed was not bound to d
\bde
\bel
\ble
\bet
\bte
\be-
\b-c
\bch
\bha
\bar
\br, then return E
\bEO
\bOF
\bF.
3156 b
\bba
\bac
\bck
\bkw
\bwa
\bar
\brd
\bd-
\b-d
\bde
\bel
\ble
\bet
\bte
\be-
\b-c
\bch
\bha
\bar
\br (
\b(R
\bRu
\bub
\bbo
\bou
\but
\bt)
\b)
3157 Delete the character behind the cursor. When given a numeric
3158 argument, save the deleted text on the kill ring.
3159 f
\bfo
\bor
\brw
\bwa
\bar
\brd
\bd-
\b-b
\bba
\bac
\bck
\bkw
\bwa
\bar
\brd
\bd-
\b-d
\bde
\bel
\ble
\bet
\bte
\be-
\b-c
\bch
\bha
\bar
\br
3160 Delete the character under the cursor, unless the cursor is at
3161 the end of the line, in which case the character behind the cur-
3163 q
\bqu
\buo
\bot
\bte
\bed
\bd-
\b-i
\bin
\bns
\bse
\ber
\brt
\bt (
\b(C
\bC-
\b-q
\bq,
\b, C
\bC-
\b-v
\bv)
\b)
3164 Add the next character typed to the line verbatim. This is how
3165 to insert characters like C
\bC-
\b-q
\bq, for example.
3166 t
\bta
\bab
\bb-
\b-i
\bin
\bns
\bse
\ber
\brt
\bt (
\b(C
\bC-
\b-v
\bv T
\bTA
\bAB
\bB)
\b)
3167 Insert a tab character.
3168 s
\bse
\bel
\blf
\bf-
\b-i
\bin
\bns
\bse
\ber
\brt
\bt (
\b(a
\ba,
\b, b
\bb,
\b, A
\bA,
\b, 1
\b1,
\b, !
\b!,
\b, .
\b..
\b..
\b.)
\b)
3169 Insert the character typed.
3170 t
\btr
\bra
\ban
\bns
\bsp
\bpo
\bos
\bse
\be-
\b-c
\bch
\bha
\bar
\brs
\bs (
\b(C
\bC-
\b-t
\bt)
\b)
3171 Drag the character before point forward over the character at
3172 point, moving point forward as well. If point is at the end of
3173 the line, then this transposes the two characters before point.
3174 Negative arguments have no effect.
3175 t
\btr
\bra
\ban
\bns
\bsp
\bpo
\bos
\bse
\be-
\b-w
\bwo
\bor
\brd
\bds
\bs (
\b(M
\bM-
\b-t
\bt)
\b)
3176 Drag the word before point past the word after point, moving
3177 point over that word as well. If point is at the end of the
3178 line, this transposes the last two words on the line.
3179 u
\bup
\bpc
\bca
\bas
\bse
\be-
\b-w
\bwo
\bor
\brd
\bd (
\b(M
\bM-
\b-u
\bu)
\b)
3180 Uppercase the current (or following) word. With a negative
3181 argument, uppercase the previous word, but do not move point.
3182 d
\bdo
\bow
\bwn
\bnc
\bca
\bas
\bse
\be-
\b-w
\bwo
\bor
\brd
\bd (
\b(M
\bM-
\b-l
\bl)
\b)
3183 Lowercase the current (or following) word. With a negative
3184 argument, lowercase the previous word, but do not move point.
3185 c
\bca
\bap
\bpi
\bit
\bta
\bal
\bli
\biz
\bze
\be-
\b-w
\bwo
\bor
\brd
\bd (
\b(M
\bM-
\b-c
\bc)
\b)
3186 Capitalize the current (or following) word. With a negative
3187 argument, capitalize the previous word, but do not move point.
3188 o
\bov
\bve
\ber
\brw
\bwr
\bri
\bit
\bte
\be-
\b-m
\bmo
\bod
\bde
\be
3189 Toggle overwrite mode. With an explicit positive numeric argu-
3190 ment, switches to overwrite mode. With an explicit non-positive
3191 numeric argument, switches to insert mode. This command affects
3192 only e
\bem
\bma
\bac
\bcs
\bs mode; v
\bvi
\bi mode does overwrite differently. Each call
3193 to _
\br_
\be_
\ba_
\bd_
\bl_
\bi_
\bn_
\be_
\b(_
\b) starts in insert mode. In overwrite mode, charac-
3194 ters bound to s
\bse
\bel
\blf
\bf-
\b-i
\bin
\bns
\bse
\ber
\brt
\bt replace the text at point rather than
3195 pushing the text to the right. Characters bound to b
\bba
\bac
\bck
\bk-
\b-
3196 w
\bwa
\bar
\brd
\bd-
\b-d
\bde
\bel
\ble
\bet
\bte
\be-
\b-c
\bch
\bha
\bar
\br replace the character before point with a
3197 space. By default, this command is unbound.
3199 K
\bKi
\bil
\bll
\bli
\bin
\bng
\bg a
\ban
\bnd
\bd Y
\bYa
\ban
\bnk
\bki
\bin
\bng
\bg
3200 k
\bki
\bil
\bll
\bl-
\b-l
\bli
\bin
\bne
\be (
\b(C
\bC-
\b-k
\bk)
\b)
3201 Kill the text from point to the end of the line.
3202 b
\bba
\bac
\bck
\bkw
\bwa
\bar
\brd
\bd-
\b-k
\bki
\bil
\bll
\bl-
\b-l
\bli
\bin
\bne
\be (
\b(C
\bC-
\b-x
\bx R
\bRu
\bub
\bbo
\bou
\but
\bt)
\b)
3203 Kill backward to the beginning of the line.
3204 u
\bun
\bni
\bix
\bx-
\b-l
\bli
\bin
\bne
\be-
\b-d
\bdi
\bis
\bsc
\bca
\bar
\brd
\bd (
\b(C
\bC-
\b-u
\bu)
\b)
3205 Kill backward from point to the beginning of the line. The
3206 killed text is saved on the kill-ring.
3207 k
\bki
\bil
\bll
\bl-
\b-w
\bwh
\bho
\bol
\ble
\be-
\b-l
\bli
\bin
\bne
\be
3208 Kill all characters on the current line, no matter where point
3210 k
\bki
\bil
\bll
\bl-
\b-w
\bwo
\bor
\brd
\bd (
\b(M
\bM-
\b-d
\bd)
\b)
3211 Kill from point to the end of the current word, or if between
3212 words, to the end of the next word. Word boundaries are the
3213 same as those used by f
\bfo
\bor
\brw
\bwa
\bar
\brd
\bd-
\b-w
\bwo
\bor
\brd
\bd.
3214 b
\bba
\bac
\bck
\bkw
\bwa
\bar
\brd
\bd-
\b-k
\bki
\bil
\bll
\bl-
\b-w
\bwo
\bor
\brd
\bd (
\b(M
\bM-
\b-R
\bRu
\bub
\bbo
\bou
\but
\bt)
\b)
3215 Kill the word behind point. Word boundaries are the same as
3216 those used by b
\bba
\bac
\bck
\bkw
\bwa
\bar
\brd
\bd-
\b-w
\bwo
\bor
\brd
\bd.
3217 s
\bsh
\bhe
\bel
\bll
\bl-
\b-k
\bki
\bil
\bll
\bl-
\b-w
\bwo
\bor
\brd
\bd (
\b(M
\bM-
\b-d
\bd)
\b)
3218 Kill from point to the end of the current word, or if between
3219 words, to the end of the next word. Word boundaries are the
3220 same as those used by s
\bsh
\bhe
\bel
\bll
\bl-
\b-f
\bfo
\bor
\brw
\bwa
\bar
\brd
\bd-
\b-w
\bwo
\bor
\brd
\bd.
3221 s
\bsh
\bhe
\bel
\bll
\bl-
\b-b
\bba
\bac
\bck
\bkw
\bwa
\bar
\brd
\bd-
\b-k
\bki
\bil
\bll
\bl-
\b-w
\bwo
\bor
\brd
\bd (
\b(M
\bM-
\b-R
\bRu
\bub
\bbo
\bou
\but
\bt)
\b)
3222 Kill the word behind point. Word boundaries are the same as
3223 those used by s
\bsh
\bhe
\bel
\bll
\bl-
\b-b
\bba
\bac
\bck
\bkw
\bwa
\bar
\brd
\bd-
\b-w
\bwo
\bor
\brd
\bd.
3224 u
\bun
\bni
\bix
\bx-
\b-w
\bwo
\bor
\brd
\bd-
\b-r
\bru
\bub
\bbo
\bou
\but
\bt (
\b(C
\bC-
\b-w
\bw)
\b)
3225 Kill the word behind point, using white space as a word bound-
3226 ary. The killed text is saved on the kill-ring.
3227 u
\bun
\bni
\bix
\bx-
\b-f
\bfi
\bil
\ble
\ben
\bna
\bam
\bme
\be-
\b-r
\bru
\bub
\bbo
\bou
\but
\bt
3228 Kill the word behind point, using white space and the slash
3229 character as the word boundaries. The killed text is saved on
3231 d
\bde
\bel
\ble
\bet
\bte
\be-
\b-h
\bho
\bor
\bri
\biz
\bzo
\bon
\bnt
\bta
\bal
\bl-
\b-s
\bsp
\bpa
\bac
\bce
\be (
\b(M
\bM-
\b-\
\b\)
\b)
3232 Delete all spaces and tabs around point.
3233 k
\bki
\bil
\bll
\bl-
\b-r
\bre
\beg
\bgi
\bio
\bon
\bn
3234 Kill the text in the current region.
3235 c
\bco
\bop
\bpy
\by-
\b-r
\bre
\beg
\bgi
\bio
\bon
\bn-
\b-a
\bas
\bs-
\b-k
\bki
\bil
\bll
\bl
3236 Copy the text in the region to the kill buffer.
3237 c
\bco
\bop
\bpy
\by-
\b-b
\bba
\bac
\bck
\bkw
\bwa
\bar
\brd
\bd-
\b-w
\bwo
\bor
\brd
\bd
3238 Copy the word before point to the kill buffer. The word bound-
3239 aries are the same as b
\bba
\bac
\bck
\bkw
\bwa
\bar
\brd
\bd-
\b-w
\bwo
\bor
\brd
\bd.
3240 c
\bco
\bop
\bpy
\by-
\b-f
\bfo
\bor
\brw
\bwa
\bar
\brd
\bd-
\b-w
\bwo
\bor
\brd
\bd
3241 Copy the word following point to the kill buffer. The word
3242 boundaries are the same as f
\bfo
\bor
\brw
\bwa
\bar
\brd
\bd-
\b-w
\bwo
\bor
\brd
\bd.
3243 y
\bya
\ban
\bnk
\bk (
\b(C
\bC-
\b-y
\by)
\b)
3244 Yank the top of the kill ring into the buffer at point.
3245 y
\bya
\ban
\bnk
\bk-
\b-p
\bpo
\bop
\bp (
\b(M
\bM-
\b-y
\by)
\b)
3246 Rotate the kill ring, and yank the new top. Only works follow-
3247 ing y
\bya
\ban
\bnk
\bk or y
\bya
\ban
\bnk
\bk-
\b-p
\bpo
\bop
\bp.
3249 N
\bNu
\bum
\bme
\ber
\bri
\bic
\bc A
\bAr
\brg
\bgu
\bum
\bme
\ben
\bnt
\bts
\bs
3250 d
\bdi
\big
\bgi
\bit
\bt-
\b-a
\bar
\brg
\bgu
\bum
\bme
\ben
\bnt
\bt (
\b(M
\bM-
\b-0
\b0,
\b, M
\bM-
\b-1
\b1,
\b, .
\b..
\b..
\b.,
\b, M
\bM-
\b--
\b-)
\b)
3251 Add this digit to the argument already accumulating, or start a
3252 new argument. M-- starts a negative argument.
3253 u
\bun
\bni
\biv
\bve
\ber
\brs
\bsa
\bal
\bl-
\b-a
\bar
\brg
\bgu
\bum
\bme
\ben
\bnt
\bt
3254 This is another way to specify an argument. If this command is
3255 followed by one or more digits, optionally with a leading minus
3256 sign, those digits define the argument. If the command is fol-
3257 lowed by digits, executing u
\bun
\bni
\biv
\bve
\ber
\brs
\bsa
\bal
\bl-
\b-a
\bar
\brg
\bgu
\bum
\bme
\ben
\bnt
\bt again ends the
3258 numeric argument, but is otherwise ignored. As a special case,
3259 if this command is immediately followed by a character that is
3260 neither a digit or minus sign, the argument count for the next
3261 command is multiplied by four. The argument count is initially
3262 one, so executing this function the first time makes the argu-
3263 ment count four, a second time makes the argument count sixteen,
3266 C
\bCo
\bom
\bmp
\bpl
\ble
\bet
\bti
\bin
\bng
\bg
3267 c
\bco
\bom
\bmp
\bpl
\ble
\bet
\bte
\be (
\b(T
\bTA
\bAB
\bB)
\b)
3268 Attempt to perform completion on the text before point. B
\bBa
\bas
\bsh
\bh
3269 attempts completion treating the text as a variable (if the text
3270 begins with $
\b$), username (if the text begins with ~
\b~), hostname
3271 (if the text begins with @
\b@), or command (including aliases and
3272 functions) in turn. If none of these produces a match, filename
3273 completion is attempted.
3274 p
\bpo
\bos
\bss
\bsi
\bib
\bbl
\ble
\be-
\b-c
\bco
\bom
\bmp
\bpl
\ble
\bet
\bti
\bio
\bon
\bns
\bs (
\b(M
\bM-
\b-?
\b?)
\b)
3275 List the possible completions of the text before point.
3276 i
\bin
\bns
\bse
\ber
\brt
\bt-
\b-c
\bco
\bom
\bmp
\bpl
\ble
\bet
\bti
\bio
\bon
\bns
\bs (
\b(M
\bM-
\b-*
\b*)
\b)
3277 Insert all completions of the text before point that would have
3278 been generated by p
\bpo
\bos
\bss
\bsi
\bib
\bbl
\ble
\be-
\b-c
\bco
\bom
\bmp
\bpl
\ble
\bet
\bti
\bio
\bon
\bns
\bs.
3279 m
\bme
\ben
\bnu
\bu-
\b-c
\bco
\bom
\bmp
\bpl
\ble
\bet
\bte
\be
3280 Similar to c
\bco
\bom
\bmp
\bpl
\ble
\bet
\bte
\be, but replaces the word to be completed with
3281 a single match from the list of possible completions. Repeated
3282 execution of m
\bme
\ben
\bnu
\bu-
\b-c
\bco
\bom
\bmp
\bpl
\ble
\bet
\bte
\be steps through the list of possible
3283 completions, inserting each match in turn. At the end of the
3284 list of completions, the bell is rung (subject to the setting of
3285 b
\bbe
\bel
\bll
\bl-
\b-s
\bst
\bty
\byl
\ble
\be) and the original text is restored. An argument of _
\bn
3286 moves _
\bn positions forward in the list of matches; a negative
3287 argument may be used to move backward through the list. This
3288 command is intended to be bound to T
\bTA
\bAB
\bB, but is unbound by
3290 m
\bme
\ben
\bnu
\bu-
\b-c
\bco
\bom
\bmp
\bpl
\ble
\bet
\bte
\be-
\b-b
\bba
\bac
\bck
\bkw
\bwa
\bar
\brd
\bd
3291 Identical to m
\bme
\ben
\bnu
\bu-
\b-c
\bco
\bom
\bmp
\bpl
\ble
\bet
\bte
\be, but moves backward through the list
3292 of possible completions, as if m
\bme
\ben
\bnu
\bu-
\b-c
\bco
\bom
\bmp
\bpl
\ble
\bet
\bte
\be had been given a
3293 negative argument. This command is unbound by default.
3294 d
\bde
\bel
\ble
\bet
\bte
\be-
\b-c
\bch
\bha
\bar
\br-
\b-o
\bor
\br-
\b-l
\bli
\bis
\bst
\bt
3295 Deletes the character under the cursor if not at the beginning
3296 or end of the line (like d
\bde
\bel
\ble
\bet
\bte
\be-
\b-c
\bch
\bha
\bar
\br). If at the end of the
3297 line, behaves identically to p
\bpo
\bos
\bss
\bsi
\bib
\bbl
\ble
\be-
\b-c
\bco
\bom
\bmp
\bpl
\ble
\bet
\bti
\bio
\bon
\bns
\bs. This command
3298 is unbound by default.
3299 c
\bco
\bom
\bmp
\bpl
\ble
\bet
\bte
\be-
\b-f
\bfi
\bil
\ble
\ben
\bna
\bam
\bme
\be (
\b(M
\bM-
\b-/
\b/)
\b)
3300 Attempt filename completion on the text before point.
3301 p
\bpo
\bos
\bss
\bsi
\bib
\bbl
\ble
\be-
\b-f
\bfi
\bil
\ble
\ben
\bna
\bam
\bme
\be-
\b-c
\bco
\bom
\bmp
\bpl
\ble
\bet
\bti
\bio
\bon
\bns
\bs (
\b(C
\bC-
\b-x
\bx /
\b/)
\b)
3302 List the possible completions of the text before point, treating
3304 c
\bco
\bom
\bmp
\bpl
\ble
\bet
\bte
\be-
\b-u
\bus
\bse
\ber
\brn
\bna
\bam
\bme
\be (
\b(M
\bM-
\b-~
\b~)
\b)
3305 Attempt completion on the text before point, treating it as a
3307 p
\bpo
\bos
\bss
\bsi
\bib
\bbl
\ble
\be-
\b-u
\bus
\bse
\ber
\brn
\bna
\bam
\bme
\be-
\b-c
\bco
\bom
\bmp
\bpl
\ble
\bet
\bti
\bio
\bon
\bns
\bs (
\b(C
\bC-
\b-x
\bx ~
\b~)
\b)
3308 List the possible completions of the text before point, treating
3310 c
\bco
\bom
\bmp
\bpl
\ble
\bet
\bte
\be-
\b-v
\bva
\bar
\bri
\bia
\bab
\bbl
\ble
\be (
\b(M
\bM-
\b-$
\b$)
\b)
3311 Attempt completion on the text before point, treating it as a
3313 p
\bpo
\bos
\bss
\bsi
\bib
\bbl
\ble
\be-
\b-v
\bva
\bar
\bri
\bia
\bab
\bbl
\ble
\be-
\b-c
\bco
\bom
\bmp
\bpl
\ble
\bet
\bti
\bio
\bon
\bns
\bs (
\b(C
\bC-
\b-x
\bx $
\b$)
\b)
3314 List the possible completions of the text before point, treating
3315 it as a shell variable.
3316 c
\bco
\bom
\bmp
\bpl
\ble
\bet
\bte
\be-
\b-h
\bho
\bos
\bst
\btn
\bna
\bam
\bme
\be (
\b(M
\bM-
\b-@
\b@)
\b)
3317 Attempt completion on the text before point, treating it as a
3319 p
\bpo
\bos
\bss
\bsi
\bib
\bbl
\ble
\be-
\b-h
\bho
\bos
\bst
\btn
\bna
\bam
\bme
\be-
\b-c
\bco
\bom
\bmp
\bpl
\ble
\bet
\bti
\bio
\bon
\bns
\bs (
\b(C
\bC-
\b-x
\bx @
\b@)
\b)
3320 List the possible completions of the text before point, treating
3322 c
\bco
\bom
\bmp
\bpl
\ble
\bet
\bte
\be-
\b-c
\bco
\bom
\bmm
\bma
\ban
\bnd
\bd (
\b(M
\bM-
\b-!
\b!)
\b)
3323 Attempt completion on the text before point, treating it as a
3324 command name. Command completion attempts to match the text
3325 against aliases, reserved words, shell functions, shell
3326 builtins, and finally executable filenames, in that order.
3327 p
\bpo
\bos
\bss
\bsi
\bib
\bbl
\ble
\be-
\b-c
\bco
\bom
\bmm
\bma
\ban
\bnd
\bd-
\b-c
\bco
\bom
\bmp
\bpl
\ble
\bet
\bti
\bio
\bon
\bns
\bs (
\b(C
\bC-
\b-x
\bx !
\b!)
\b)
3328 List the possible completions of the text before point, treating
3329 it as a command name.
3330 d
\bdy
\byn
\bna
\bam
\bmi
\bic
\bc-
\b-c
\bco
\bom
\bmp
\bpl
\ble
\bet
\bte
\be-
\b-h
\bhi
\bis
\bst
\bto
\bor
\bry
\by (
\b(M
\bM-
\b-T
\bTA
\bAB
\bB)
\b)
3331 Attempt completion on the text before point, comparing the text
3332 against lines from the history list for possible completion
3334 d
\bda
\bab
\bbb
\bbr
\bre
\bev
\bv-
\b-e
\bex
\bxp
\bpa
\ban
\bnd
\bd
3335 Attempt menu completion on the text before point, comparing the
3336 text against lines from the history list for possible completion
3338 c
\bco
\bom
\bmp
\bpl
\ble
\bet
\bte
\be-
\b-i
\bin
\bnt
\bto
\bo-
\b-b
\bbr
\bra
\bac
\bce
\bes
\bs (
\b(M
\bM-
\b-{
\b{)
\b)
3339 Perform filename completion and insert the list of possible com-
3340 pletions enclosed within braces so the list is available to the
3341 shell (see B
\bBr
\bra
\bac
\bce
\be E
\bEx
\bxp
\bpa
\ban
\bns
\bsi
\bio
\bon
\bn above).
3343 K
\bKe
\bey
\byb
\bbo
\boa
\bar
\brd
\bd M
\bMa
\bac
\bcr
\bro
\bos
\bs
3344 s
\bst
\bta
\bar
\brt
\bt-
\b-k
\bkb
\bbd
\bd-
\b-m
\bma
\bac
\bcr
\bro
\bo (
\b(C
\bC-
\b-x
\bx (
\b()
\b)
3345 Begin saving the characters typed into the current keyboard
3347 e
\ben
\bnd
\bd-
\b-k
\bkb
\bbd
\bd-
\b-m
\bma
\bac
\bcr
\bro
\bo (
\b(C
\bC-
\b-x
\bx )
\b))
\b)
3348 Stop saving the characters typed into the current keyboard macro
3349 and store the definition.
3350 c
\bca
\bal
\bll
\bl-
\b-l
\bla
\bas
\bst
\bt-
\b-k
\bkb
\bbd
\bd-
\b-m
\bma
\bac
\bcr
\bro
\bo (
\b(C
\bC-
\b-x
\bx e
\be)
\b)
3351 Re-execute the last keyboard macro defined, by making the char-
3352 acters in the macro appear as if typed at the keyboard.
3354 M
\bMi
\bis
\bsc
\bce
\bel
\bll
\bla
\ban
\bne
\beo
\bou
\bus
\bs
3355 r
\bre
\be-
\b-r
\bre
\bea
\bad
\bd-
\b-i
\bin
\bni
\bit
\bt-
\b-f
\bfi
\bil
\ble
\be (
\b(C
\bC-
\b-x
\bx C
\bC-
\b-r
\br)
\b)
3356 Read in the contents of the _
\bi_
\bn_
\bp_
\bu_
\bt_
\br_
\bc file, and incorporate any
3357 bindings or variable assignments found there.
3358 a
\bab
\bbo
\bor
\brt
\bt (
\b(C
\bC-
\b-g
\bg)
\b)
3359 Abort the current editing command and ring the terminal's bell
3360 (subject to the setting of b
\bbe
\bel
\bll
\bl-
\b-s
\bst
\bty
\byl
\ble
\be).
3361 d
\bdo
\bo-
\b-u
\bup
\bpp
\bpe
\ber
\brc
\bca
\bas
\bse
\be-
\b-v
\bve
\ber
\brs
\bsi
\bio
\bon
\bn (
\b(M
\bM-
\b-a
\ba,
\b, M
\bM-
\b-b
\bb,
\b, M
\bM-
\b-_
\bx,
\b, .
\b..
\b..
\b.)
\b)
3362 If the metafied character _
\bx is lowercase, run the command that
3363 is bound to the corresponding uppercase character.
3364 p
\bpr
\bre
\bef
\bfi
\bix
\bx-
\b-m
\bme
\bet
\bta
\ba (
\b(E
\bES
\bSC
\bC)
\b)
3365 Metafy the next character typed. E
\bES
\bSC
\bC f
\bf is equivalent to M
\bMe
\bet
\bta
\ba-
\b-f
\bf.
3366 u
\bun
\bnd
\bdo
\bo (
\b(C
\bC-
\b-_
\b_,
\b, C
\bC-
\b-x
\bx C
\bC-
\b-u
\bu)
\b)
3367 Incremental undo, separately remembered for each line.
3368 r
\bre
\bev
\bve
\ber
\brt
\bt-
\b-l
\bli
\bin
\bne
\be (
\b(M
\bM-
\b-r
\br)
\b)
3369 Undo all changes made to this line. This is like executing the
3370 u
\bun
\bnd
\bdo
\bo command enough times to return the line to its initial
3372 t
\bti
\bil
\bld
\bde
\be-
\b-e
\bex
\bxp
\bpa
\ban
\bnd
\bd (
\b(M
\bM-
\b-&
\b&)
\b)
3373 Perform tilde expansion on the current word.
3374 s
\bse
\bet
\bt-
\b-m
\bma
\bar
\brk
\bk (
\b(C
\bC-
\b-@
\b@,
\b, M
\bM-
\b-<
\b<s
\bsp
\bpa
\bac
\bce
\be>
\b>)
\b)
3375 Set the mark to the point. If a numeric argument is supplied,
3376 the mark is set to that position.
3377 e
\bex
\bxc
\bch
\bha
\ban
\bng
\bge
\be-
\b-p
\bpo
\boi
\bin
\bnt
\bt-
\b-a
\ban
\bnd
\bd-
\b-m
\bma
\bar
\brk
\bk (
\b(C
\bC-
\b-x
\bx C
\bC-
\b-x
\bx)
\b)
3378 Swap the point with the mark. The current cursor position is
3379 set to the saved position, and the old cursor position is saved
3381 c
\bch
\bha
\bar
\bra
\bac
\bct
\bte
\ber
\br-
\b-s
\bse
\bea
\bar
\brc
\bch
\bh (
\b(C
\bC-
\b-]
\b])
\b)
3382 A character is read and point is moved to the next occurrence of
3383 that character. A negative count searches for previous occur-
3385 c
\bch
\bha
\bar
\bra
\bac
\bct
\bte
\ber
\br-
\b-s
\bse
\bea
\bar
\brc
\bch
\bh-
\b-b
\bba
\bac
\bck
\bkw
\bwa
\bar
\brd
\bd (
\b(M
\bM-
\b-C
\bC-
\b-]
\b])
\b)
3386 A character is read and point is moved to the previous occur-
3387 rence of that character. A negative count searches for subse-
3389 s
\bsk
\bki
\bip
\bp-
\b-c
\bcs
\bsi
\bi-
\b-s
\bse
\beq
\bqu
\bue
\ben
\bnc
\bce
\be
3390 Read enough characters to consume a multi-key sequence such as
3391 those defined for keys like Home and End. Such sequences begin
3392 with a Control Sequence Indicator (CSI), usually ESC-[. If this
3393 sequence is bound to "\[", keys producing such sequences will
3394 have no effect unless explicitly bound to a readline command,
3395 instead of inserting stray characters into the editing buffer.
3396 This is unbound by default, but usually bound to ESC-[.
3397 i
\bin
\bns
\bse
\ber
\brt
\bt-
\b-c
\bco
\bom
\bmm
\bme
\ben
\bnt
\bt (
\b(M
\bM-
\b-#
\b#)
\b)
3398 Without a numeric argument, the value of the readline c
\bco
\bom
\bm-
\b-
3399 m
\bme
\ben
\bnt
\bt-
\b-b
\bbe
\beg
\bgi
\bin
\bn variable is inserted at the beginning of the current
3400 line. If a numeric argument is supplied, this command acts as a
3401 toggle: if the characters at the beginning of the line do not
3402 match the value of c
\bco
\bom
\bmm
\bme
\ben
\bnt
\bt-
\b-b
\bbe
\beg
\bgi
\bin
\bn, the value is inserted, other-
3403 wise the characters in c
\bco
\bom
\bmm
\bme
\ben
\bnt
\bt-
\b-b
\bbe
\beg
\bgi
\bin
\bn are deleted from the begin-
3404 ning of the line. In either case, the line is accepted as if a
3405 newline had been typed. The default value of c
\bco
\bom
\bmm
\bme
\ben
\bnt
\bt-
\b-b
\bbe
\beg
\bgi
\bin
\bn
3406 causes this command to make the current line a shell comment.
3407 If a numeric argument causes the comment character to be
3408 removed, the line will be executed by the shell.
3409 g
\bgl
\blo
\bob
\bb-
\b-c
\bco
\bom
\bmp
\bpl
\ble
\bet
\bte
\be-
\b-w
\bwo
\bor
\brd
\bd (
\b(M
\bM-
\b-g
\bg)
\b)
3410 The word before point is treated as a pattern for pathname
3411 expansion, with an asterisk implicitly appended. This pattern
3412 is used to generate a list of matching file names for possible
3414 g
\bgl
\blo
\bob
\bb-
\b-e
\bex
\bxp
\bpa
\ban
\bnd
\bd-
\b-w
\bwo
\bor
\brd
\bd (
\b(C
\bC-
\b-x
\bx *
\b*)
\b)
3415 The word before point is treated as a pattern for pathname
3416 expansion, and the list of matching file names is inserted,
3417 replacing the word. If a numeric argument is supplied, an
3418 asterisk is appended before pathname expansion.
3419 g
\bgl
\blo
\bob
\bb-
\b-l
\bli
\bis
\bst
\bt-
\b-e
\bex
\bxp
\bpa
\ban
\bns
\bsi
\bio
\bon
\bns
\bs (
\b(C
\bC-
\b-x
\bx g
\bg)
\b)
3420 The list of expansions that would have been generated by
3421 g
\bgl
\blo
\bob
\bb-
\b-e
\bex
\bxp
\bpa
\ban
\bnd
\bd-
\b-w
\bwo
\bor
\brd
\bd is displayed, and the line is redrawn. If a
3422 numeric argument is supplied, an asterisk is appended before
3424 d
\bdu
\bum
\bmp
\bp-
\b-f
\bfu
\bun
\bnc
\bct
\bti
\bio
\bon
\bns
\bs
3425 Print all of the functions and their key bindings to the read-
3426 line output stream. If a numeric argument is supplied, the out-
3427 put is formatted in such a way that it can be made part of an
3428 _
\bi_
\bn_
\bp_
\bu_
\bt_
\br_
\bc file.
3429 d
\bdu
\bum
\bmp
\bp-
\b-v
\bva
\bar
\bri
\bia
\bab
\bbl
\ble
\bes
\bs
3430 Print all of the settable readline variables and their values to
3431 the readline output stream. If a numeric argument is supplied,
3432 the output is formatted in such a way that it can be made part
3433 of an _
\bi_
\bn_
\bp_
\bu_
\bt_
\br_
\bc file.
3434 d
\bdu
\bum
\bmp
\bp-
\b-m
\bma
\bac
\bcr
\bro
\bos
\bs
3435 Print all of the readline key sequences bound to macros and the
3436 strings they output. If a numeric argument is supplied, the
3437 output is formatted in such a way that it can be made part of an
3438 _
\bi_
\bn_
\bp_
\bu_
\bt_
\br_
\bc file.
3439 d
\bdi
\bis
\bsp
\bpl
\bla
\bay
\by-
\b-s
\bsh
\bhe
\bel
\bll
\bl-
\b-v
\bve
\ber
\brs
\bsi
\bio
\bon
\bn (
\b(C
\bC-
\b-x
\bx C
\bC-
\b-v
\bv)
\b)
3440 Display version information about the current instance of b
\bba
\bas
\bsh
\bh.
3442 P
\bPr
\bro
\bog
\bgr
\bra
\bam
\bmm
\bma
\bab
\bbl
\ble
\be C
\bCo
\bom
\bmp
\bpl
\ble
\bet
\bti
\bio
\bon
\bn
3443 When word completion is attempted for an argument to a command for
3444 which a completion specification (a _
\bc_
\bo_
\bm_
\bp_
\bs_
\bp_
\be_
\bc) has been defined using
3445 the c
\bco
\bom
\bmp
\bpl
\ble
\bet
\bte
\be builtin (see S
\bSH
\bHE
\bEL
\bLL
\bL B
\bBU
\bUI
\bIL
\bLT
\bTI
\bIN
\bN C
\bCO
\bOM
\bMM
\bMA
\bAN
\bND
\bDS
\bS below), the pro-
3446 grammable completion facilities are invoked.
3448 First, the command name is identified. If the command word is the
3449 empty string (completion attempted at the beginning of an empty line),
3450 any compspec defined with the -
\b-E
\bE option to c
\bco
\bom
\bmp
\bpl
\ble
\bet
\bte
\be is used. If a
3451 compspec has been defined for that command, the compspec is used to
3452 generate the list of possible completions for the word. If the command
3453 word is a full pathname, a compspec for the full pathname is searched
3454 for first. If no compspec is found for the full pathname, an attempt
3455 is made to find a compspec for the portion following the final slash.
3456 If those searches do not result in a compspec, any compspec defined
3457 with the -
\b-D
\bD option to c
\bco
\bom
\bmp
\bpl
\ble
\bet
\bte
\be is used as the default.
3459 Once a compspec has been found, it is used to generate the list of
3460 matching words. If a compspec is not found, the default b
\bba
\bas
\bsh
\bh comple-
3461 tion as described above under C
\bCo
\bom
\bmp
\bpl
\ble
\bet
\bti
\bin
\bng
\bg is performed.
3463 First, the actions specified by the compspec are used. Only matches
3464 which are prefixed by the word being completed are returned. When the
3465 -
\b-f
\bf or -
\b-d
\bd option is used for filename or directory name completion, the
3466 shell variable F
\bFI
\bIG
\bGN
\bNO
\bOR
\bRE
\bE is used to filter the matches.
3468 Any completions specified by a pathname expansion pattern to the -
\b-G
\bG
3469 option are generated next. The words generated by the pattern need not
3470 match the word being completed. The G
\bGL
\bLO
\bOB
\bBI
\bIG
\bGN
\bNO
\bOR
\bRE
\bE shell variable is not
3471 used to filter the matches, but the F
\bFI
\bIG
\bGN
\bNO
\bOR
\bRE
\bE variable is used.
3473 Next, the string specified as the argument to the -
\b-W
\bW option is consid-
3474 ered. The string is first split using the characters in the I
\bIF
\bFS
\bS spe-
3475 cial variable as delimiters. Shell quoting is honored. Each word is
3476 then expanded using brace expansion, tilde expansion, parameter and
3477 variable expansion, command substitution, and arithmetic expansion, as
3478 described above under E
\bEX
\bXP
\bPA
\bAN
\bNS
\bSI
\bIO
\bON
\bN. The results are split using the rules
3479 described above under W
\bWo
\bor
\brd
\bd S
\bSp
\bpl
\bli
\bit
\btt
\bti
\bin
\bng
\bg. The results of the expansion are
3480 prefix-matched against the word being completed, and the matching words
3481 become the possible completions.
3483 After these matches have been generated, any shell function or command
3484 specified with the -
\b-F
\bF and -
\b-C
\bC options is invoked. When the command or
3485 function is invoked, the C
\bCO
\bOM
\bMP
\bP_
\b_L
\bLI
\bIN
\bNE
\bE, C
\bCO
\bOM
\bMP
\bP_
\b_P
\bPO
\bOI
\bIN
\bNT
\bT, C
\bCO
\bOM
\bMP
\bP_
\b_K
\bKE
\bEY
\bY, and C
\bCO
\bOM
\bMP
\bP_
\b_T
\bTY
\bYP
\bPE
\bE
3486 variables are assigned values as described above under S
\bSh
\bhe
\bel
\bll
\bl V
\bVa
\bar
\bri
\bia
\bab
\bbl
\ble
\bes
\bs.
3487 If a shell function is being invoked, the C
\bCO
\bOM
\bMP
\bP_
\b_W
\bWO
\bOR
\bRD
\bDS
\bS and C
\bCO
\bOM
\bMP
\bP_
\b_C
\bCW
\bWO
\bOR
\bRD
\bD
3488 variables are also set. When the function or command is invoked, the
3489 first argument is the name of the command whose arguments are being
3490 completed, the second argument is the word being completed, and the
3491 third argument is the word preceding the word being completed on the
3492 current command line. No filtering of the generated completions
3493 against the word being completed is performed; the function or command
3494 has complete freedom in generating the matches.
3496 Any function specified with -
\b-F
\bF is invoked first. The function may use
3497 any of the shell facilities, including the c
\bco
\bom
\bmp
\bpg
\bge
\ben
\bn builtin described
3498 below, to generate the matches. It must put the possible completions
3499 in the C
\bCO
\bOM
\bMP
\bPR
\bRE
\bEP
\bPL
\bLY
\bY array variable.
3501 Next, any command specified with the -
\b-C
\bC option is invoked in an envi-
3502 ronment equivalent to command substitution. It should print a list of
3503 completions, one per line, to the standard output. Backslash may be
3504 used to escape a newline, if necessary.
3506 After all of the possible completions are generated, any filter speci-
3507 fied with the -
\b-X
\bX option is applied to the list. The filter is a pat-
3508 tern as used for pathname expansion; a &
\b& in the pattern is replaced
3509 with the text of the word being completed. A literal &
\b& may be escaped
3510 with a backslash; the backslash is removed before attempting a match.
3511 Any completion that matches the pattern will be removed from the list.
3512 A leading !
\b! negates the pattern; in this case any completion not match-
3513 ing the pattern will be removed.
3515 Finally, any prefix and suffix specified with the -
\b-P
\bP and -
\b-S
\bS options are
3516 added to each member of the completion list, and the result is returned
3517 to the readline completion code as the list of possible completions.
3519 If the previously-applied actions do not generate any matches, and the
3520 -
\b-o
\bo d
\bdi
\bir
\brn
\bna
\bam
\bme
\bes
\bs option was supplied to c
\bco
\bom
\bmp
\bpl
\ble
\bet
\bte
\be when the compspec was
3521 defined, directory name completion is attempted.
3523 If the -
\b-o
\bo p
\bpl
\blu
\bus
\bsd
\bdi
\bir
\brs
\bs option was supplied to c
\bco
\bom
\bmp
\bpl
\ble
\bet
\bte
\be when the compspec
3524 was defined, directory name completion is attempted and any matches are
3525 added to the results of the other actions.
3527 By default, if a compspec is found, whatever it generates is returned
3528 to the completion code as the full set of possible completions. The
3529 default b
\bba
\bas
\bsh
\bh completions are not attempted, and the readline default of
3530 filename completion is disabled. If the -
\b-o
\bo b
\bba
\bas
\bsh
\bhd
\bde
\bef
\bfa
\bau
\bul
\blt
\bt option was sup-
3531 plied to c
\bco
\bom
\bmp
\bpl
\ble
\bet
\bte
\be when the compspec was defined, the b
\bba
\bas
\bsh
\bh default com-
3532 pletions are attempted if the compspec generates no matches. If the -
\b-o
\bo
3533 d
\bde
\bef
\bfa
\bau
\bul
\blt
\bt option was supplied to c
\bco
\bom
\bmp
\bpl
\ble
\bet
\bte
\be when the compspec was defined,
3534 readline's default completion will be performed if the compspec (and,
3535 if attempted, the default b
\bba
\bas
\bsh
\bh completions) generate no matches.
3537 When a compspec indicates that directory name completion is desired,
3538 the programmable completion functions force readline to append a slash
3539 to completed names which are symbolic links to directories, subject to
3540 the value of the m
\bma
\bar
\brk
\bk-
\b-d
\bdi
\bir
\bre
\bec
\bct
\bto
\bor
\bri
\bie
\bes
\bs readline variable, regardless of the
3541 setting of the m
\bma
\bar
\brk
\bk-
\b-s
\bsy
\bym
\bml
\bli
\bin
\bnk
\bke
\bed
\bd-
\b-d
\bdi
\bir
\bre
\bec
\bct
\bto
\bor
\bri
\bie
\bes
\bs readline variable.
3543 There is some support for dynamically modifying completions. This is
3544 most useful when used in combination with a default completion speci-
3545 fied with c
\bco
\bom
\bmp
\bpl
\ble
\bet
\bte
\be -
\b-D
\bD. It's possible for shell functions executed as
3546 completion handlers to indicate that completion should be retried by
3547 returning an exit status of 124. If a shell function returns 124, and
3548 changes the compspec associated with the command on which completion is
3549 being attempted (supplied as the first argument when the function is
3550 executed), programmable completion restarts from the beginning, with an
3551 attempt to find a new compspec for that command. This allows a set of
3552 completions to be built dynamically as completion is attempted, rather
3553 than being loaded all at once.
3555 For instance, assuming that there is a library of compspecs, each kept
3556 in a file corresponding to the name of the command, the following
3557 default completion function would load completions dynamically:
3559 _completion_loader()
3561 . "/etc/bash_completion.d/$1.sh" >/dev/null 2>&1 && return 124
3563 complete -D -F _completion_loader
3566 H
\bHI
\bIS
\bST
\bTO
\bOR
\bRY
\bY
3567 When the -
\b-o
\bo h
\bhi
\bis
\bst
\bto
\bor
\bry
\by option to the s
\bse
\bet
\bt builtin is enabled, the shell
3568 provides access to the _
\bc_
\bo_
\bm_
\bm_
\ba_
\bn_
\bd _
\bh_
\bi_
\bs_
\bt_
\bo_
\br_
\by, the list of commands previously
3569 typed. The value of the H
\bHI
\bIS
\bST
\bTS
\bSI
\bIZ
\bZE
\bE variable is used as the number of
3570 commands to save in a history list. The text of the last H
\bHI
\bIS
\bST
\bTS
\bSI
\bIZ
\bZE
\bE com-
3571 mands (default 500) is saved. The shell stores each command in the
3572 history list prior to parameter and variable expansion (see E
\bEX
\bXP
\bPA
\bAN
\bNS
\bSI
\bIO
\bON
\bN
3573 above) but after history expansion is performed, subject to the values
3574 of the shell variables H
\bHI
\bIS
\bST
\bTI
\bIG
\bGN
\bNO
\bOR
\bRE
\bE and H
\bHI
\bIS
\bST
\bTC
\bCO
\bON
\bNT
\bTR
\bRO
\bOL
\bL.
3576 On startup, the history is initialized from the file named by the vari-
3577 able H
\bHI
\bIS
\bST
\bTF
\bFI
\bIL
\bLE
\bE (default _
\b~_
\b/_
\b._
\bb_
\ba_
\bs_
\bh_
\b__
\bh_
\bi_
\bs_
\bt_
\bo_
\br_
\by). The file named by the value
3578 of H
\bHI
\bIS
\bST
\bTF
\bFI
\bIL
\bLE
\bE is truncated, if necessary, to contain no more than the
3579 number of lines specified by the value of H
\bHI
\bIS
\bST
\bTF
\bFI
\bIL
\bLE
\bES
\bSI
\bIZ
\bZE
\bE. When the his-
3580 tory file is read, lines beginning with the history comment character
3581 followed immediately by a digit are interpreted as timestamps for the
3582 preceding history line. These timestamps are optionally displayed
3583 depending on the value of the H
\bHI
\bIS
\bST
\bTT
\bTI
\bIM
\bME
\bEF
\bFO
\bOR
\bRM
\bMA
\bAT
\bT variable. When an inter-
3584 active shell exits, the last $
\b$H
\bHI
\bIS
\bST
\bTS
\bSI
\bIZ
\bZE
\bE lines are copied from the his-
3585 tory list to $
\b$H
\bHI
\bIS
\bST
\bTF
\bFI
\bIL
\bLE
\bE. If the h
\bhi
\bis
\bst
\bta
\bap
\bpp
\bpe
\ben
\bnd
\bd shell option is enabled (see
3586 the description of s
\bsh
\bho
\bop
\bpt
\bt under S
\bSH
\bHE
\bEL
\bLL
\bL B
\bBU
\bUI
\bIL
\bLT
\bTI
\bIN
\bN C
\bCO
\bOM
\bMM
\bMA
\bAN
\bND
\bDS
\bS below), the lines
3587 are appended to the history file, otherwise the history file is over-
3588 written. If H
\bHI
\bIS
\bST
\bTF
\bFI
\bIL
\bLE
\bE is unset, or if the history file is unwritable,
3589 the history is not saved. If the H
\bHI
\bIS
\bST
\bTT
\bTI
\bIM
\bME
\bEF
\bFO
\bOR
\bRM
\bMA
\bAT
\bT variable is set, time
3590 stamps are written to the history file, marked with the history comment
3591 character, so they may be preserved across shell sessions. This uses
3592 the history comment character to distinguish timestamps from other his-
3593 tory lines. After saving the history, the history file is truncated to
3594 contain no more than H
\bHI
\bIS
\bST
\bTF
\bFI
\bIL
\bLE
\bES
\bSI
\bIZ
\bZE
\bE lines. If H
\bHI
\bIS
\bST
\bTF
\bFI
\bIL
\bLE
\bES
\bSI
\bIZ
\bZE
\bE is not set,
3595 no truncation is performed.
3597 The builtin command f
\bfc
\bc (see S
\bSH
\bHE
\bEL
\bLL
\bL B
\bBU
\bUI
\bIL
\bLT
\bTI
\bIN
\bN C
\bCO
\bOM
\bMM
\bMA
\bAN
\bND
\bDS
\bS below) may be used
3598 to list or edit and re-execute a portion of the history list. The h
\bhi
\bis
\bs-
\b-
3599 t
\bto
\bor
\bry
\by builtin may be used to display or modify the history list and
3600 manipulate the history file. When using command-line editing, search
3601 commands are available in each editing mode that provide access to the
3604 The shell allows control over which commands are saved on the history
3605 list. The H
\bHI
\bIS
\bST
\bTC
\bCO
\bON
\bNT
\bTR
\bRO
\bOL
\bL and H
\bHI
\bIS
\bST
\bTI
\bIG
\bGN
\bNO
\bOR
\bRE
\bE variables may be set to cause the
3606 shell to save only a subset of the commands entered. The c
\bcm
\bmd
\bdh
\bhi
\bis
\bst
\bt shell
3607 option, if enabled, causes the shell to attempt to save each line of a
3608 multi-line command in the same history entry, adding semicolons where
3609 necessary to preserve syntactic correctness. The l
\bli
\bit
\bth
\bhi
\bis
\bst
\bt shell option
3610 causes the shell to save the command with embedded newlines instead of
3611 semicolons. See the description of the s
\bsh
\bho
\bop
\bpt
\bt builtin below under S
\bSH
\bHE
\bEL
\bLL
\bL
3612 B
\bBU
\bUI
\bIL
\bLT
\bTI
\bIN
\bN C
\bCO
\bOM
\bMM
\bMA
\bAN
\bND
\bDS
\bS for information on setting and unsetting shell
3615 H
\bHI
\bIS
\bST
\bTO
\bOR
\bRY
\bY E
\bEX
\bXP
\bPA
\bAN
\bNS
\bSI
\bIO
\bON
\bN
3616 The shell supports a history expansion feature that is similar to the
3617 history expansion in c
\bcs
\bsh
\bh.
\b. This section describes what syntax features
3618 are available. This feature is enabled by default for interactive
3619 shells, and can be disabled using the +
\b+H
\bH option to the s
\bse
\bet
\bt builtin com-
3620 mand (see S
\bSH
\bHE
\bEL
\bLL
\bL B
\bBU
\bUI
\bIL
\bLT
\bTI
\bIN
\bN C
\bCO
\bOM
\bMM
\bMA
\bAN
\bND
\bDS
\bS below). Non-interactive shells do not
3621 perform history expansion by default.
3623 History expansions introduce words from the history list into the input
3624 stream, making it easy to repeat commands, insert the arguments to a
3625 previous command into the current input line, or fix errors in previous
3628 History expansion is performed immediately after a complete line is
3629 read, before the shell breaks it into words. It takes place in two
3630 parts. The first is to determine which line from the history list to
3631 use during substitution. The second is to select portions of that line
3632 for inclusion into the current one. The line selected from the history
3633 is the _
\be_
\bv_
\be_
\bn_
\bt, and the portions of that line that are acted upon are
3634 _
\bw_
\bo_
\br_
\bd_
\bs. Various _
\bm_
\bo_
\bd_
\bi_
\bf_
\bi_
\be_
\br_
\bs are available to manipulate the selected
3635 words. The line is broken into words in the same fashion as when read-
3636 ing input, so that several _
\bm_
\be_
\bt_
\ba_
\bc_
\bh_
\ba_
\br_
\ba_
\bc_
\bt_
\be_
\br-separated words surrounded by
3637 quotes are considered one word. History expansions are introduced by
3638 the appearance of the history expansion character, which is !
\b! by
3639 default. Only backslash (\
\b\) and single quotes can quote the history
3640 expansion character.
3642 Several characters inhibit history expansion if found immediately fol-
3643 lowing the history expansion character, even if it is unquoted: space,
3644 tab, newline, carriage return, and =
\b=. If the e
\bex
\bxt
\btg
\bgl
\blo
\bob
\bb shell option is
3645 enabled, (
\b( will also inhibit expansion.
3647 Several shell options settable with the s
\bsh
\bho
\bop
\bpt
\bt builtin may be used to
3648 tailor the behavior of history expansion. If the h
\bhi
\bis
\bst
\btv
\bve
\ber
\bri
\bif
\bfy
\by shell
3649 option is enabled (see the description of the s
\bsh
\bho
\bop
\bpt
\bt builtin below), and
3650 r
\bre
\bea
\bad
\bdl
\bli
\bin
\bne
\be is being used, history substitutions are not immediately
3651 passed to the shell parser. Instead, the expanded line is reloaded
3652 into the r
\bre
\bea
\bad
\bdl
\bli
\bin
\bne
\be editing buffer for further modification. If r
\bre
\bea
\bad
\bdl
\bli
\bin
\bne
\be
3653 is being used, and the h
\bhi
\bis
\bst
\btr
\bre
\bee
\bed
\bdi
\bit
\bt shell option is enabled, a failed
3654 history substitution will be reloaded into the r
\bre
\bea
\bad
\bdl
\bli
\bin
\bne
\be editing buffer
3655 for correction. The -
\b-p
\bp option to the h
\bhi
\bis
\bst
\bto
\bor
\bry
\by builtin command may be
3656 used to see what a history expansion will do before using it. The -
\b-s
\bs
3657 option to the h
\bhi
\bis
\bst
\bto
\bor
\bry
\by builtin may be used to add commands to the end of
3658 the history list without actually executing them, so that they are
3659 available for subsequent recall.
3661 The shell allows control of the various characters used by the history
3662 expansion mechanism (see the description of h
\bhi
\bis
\bst
\btc
\bch
\bha
\bar
\brs
\bs above under S
\bSh
\bhe
\bel
\bll
\bl
3663 V
\bVa
\bar
\bri
\bia
\bab
\bbl
\ble
\bes
\bs). The shell uses the history comment character to mark his-
3664 tory timestamps when writing the history file.
3666 E
\bEv
\bve
\ben
\bnt
\bt D
\bDe
\bes
\bsi
\big
\bgn
\bna
\bat
\bto
\bor
\brs
\bs
3667 An event designator is a reference to a command line entry in the his-
3668 tory list. Unless the reference is absolute, events are relative to
3669 the current position in the history list.
3671 !
\b! Start a history substitution, except when followed by a b
\bbl
\bla
\ban
\bnk
\bk,
3672 newline, carriage return, = or ( (when the e
\bex
\bxt
\btg
\bgl
\blo
\bob
\bb shell option
3673 is enabled using the s
\bsh
\bho
\bop
\bpt
\bt builtin).
3674 !
\b!_
\bn Refer to command line _
\bn.
3675 !
\b!-
\b-_
\bn Refer to the current command minus _
\bn.
3676 !
\b!!
\b! Refer to the previous command. This is a synonym for `!-1'.
3677 !
\b!_
\bs_
\bt_
\br_
\bi_
\bn_
\bg
3678 Refer to the most recent command preceding the current position
3679 in the history list starting with _
\bs_
\bt_
\br_
\bi_
\bn_
\bg.
3680 !
\b!?
\b?_
\bs_
\bt_
\br_
\bi_
\bn_
\bg[
\b[?
\b?]
\b]
3681 Refer to the most recent command preceding the current postition
3682 in the history list containing _
\bs_
\bt_
\br_
\bi_
\bn_
\bg. The trailing ?
\b? may be
3683 omitted if _
\bs_
\bt_
\br_
\bi_
\bn_
\bg is followed immediately by a newline.
3684 ^
\b^_
\bs_
\bt_
\br_
\bi_
\bn_
\bg_
\b1^
\b^_
\bs_
\bt_
\br_
\bi_
\bn_
\bg_
\b2^
\b^
3685 Quick substitution. Repeat the previous command, replacing
3686 _
\bs_
\bt_
\br_
\bi_
\bn_
\bg_
\b1 with _
\bs_
\bt_
\br_
\bi_
\bn_
\bg_
\b2. Equivalent to ``!!:s/_
\bs_
\bt_
\br_
\bi_
\bn_
\bg_
\b1/_
\bs_
\bt_
\br_
\bi_
\bn_
\bg_
\b2/''
3687 (see M
\bMo
\bod
\bdi
\bif
\bfi
\bie
\ber
\brs
\bs below).
3688 !
\b!#
\b# The entire command line typed so far.
3690 W
\bWo
\bor
\brd
\bd D
\bDe
\bes
\bsi
\big
\bgn
\bna
\bat
\bto
\bor
\brs
\bs
3691 Word designators are used to select desired words from the event. A :
\b:
3692 separates the event specification from the word designator. It may be
3693 omitted if the word designator begins with a ^
\b^, $
\b$, *
\b*, -
\b-, or %
\b%. Words
3694 are numbered from the beginning of the line, with the first word being
3695 denoted by 0 (zero). Words are inserted into the current line sepa-
3696 rated by single spaces.
3698 0
\b0 (
\b(z
\bze
\ber
\bro
\bo)
\b)
3699 The zeroth word. For the shell, this is the command word.
3700 _
\bn The _
\bnth word.
3701 ^
\b^ The first argument. That is, word 1.
3702 $
\b$ The last argument.
3703 %
\b% The word matched by the most recent `?_
\bs_
\bt_
\br_
\bi_
\bn_
\bg?' search.
3704 _
\bx-
\b-_
\by A range of words; `-_
\by' abbreviates `0-_
\by'.
3705 *
\b* All of the words but the zeroth. This is a synonym for `_
\b1_
\b-_
\b$'.
3706 It is not an error to use *
\b* if there is just one word in the
3707 event; the empty string is returned in that case.
3708 x
\bx*
\b* Abbreviates _
\bx_
\b-_
\b$.
3709 x
\bx-
\b- Abbreviates _
\bx_
\b-_
\b$ like x
\bx*
\b*, but omits the last word.
3711 If a word designator is supplied without an event specification, the
3712 previous command is used as the event.
3714 M
\bMo
\bod
\bdi
\bif
\bfi
\bie
\ber
\brs
\bs
3715 After the optional word designator, there may appear a sequence of one
3716 or more of the following modifiers, each preceded by a `:'.
3718 h
\bh Remove a trailing file name component, leaving only the head.
3719 t
\bt Remove all leading file name components, leaving the tail.
3720 r
\br Remove a trailing suffix of the form _
\b._
\bx_
\bx_
\bx, leaving the basename.
3721 e
\be Remove all but the trailing suffix.
3722 p
\bp Print the new command but do not execute it.
3723 q
\bq Quote the substituted words, escaping further substitutions.
3724 x
\bx Quote the substituted words as with q
\bq, but break into words at
3725 b
\bbl
\bla
\ban
\bnk
\bks
\bs and newlines.
3726 s
\bs/
\b/_
\bo_
\bl_
\bd/
\b/_
\bn_
\be_
\bw/
\b/
3727 Substitute _
\bn_
\be_
\bw for the first occurrence of _
\bo_
\bl_
\bd in the event
3728 line. Any delimiter can be used in place of /. The final
3729 delimiter is optional if it is the last character of the event
3730 line. The delimiter may be quoted in _
\bo_
\bl_
\bd and _
\bn_
\be_
\bw with a single
3731 backslash. If & appears in _
\bn_
\be_
\bw, it is replaced by _
\bo_
\bl_
\bd. A sin-
3732 gle backslash will quote the &. If _
\bo_
\bl_
\bd is null, it is set to
3733 the last _
\bo_
\bl_
\bd substituted, or, if no previous history substitu-
3734 tions took place, the last _
\bs_
\bt_
\br_
\bi_
\bn_
\bg in a !
\b!?
\b?_
\bs_
\bt_
\br_
\bi_
\bn_
\bg[
\b[?
\b?]
\b] search.
3735 &
\b& Repeat the previous substitution.
3736 g
\bg Cause changes to be applied over the entire event line. This is
3737 used in conjunction with `:
\b:s
\bs' (e.g., `:
\b:g
\bgs
\bs/
\b/_
\bo_
\bl_
\bd/
\b/_
\bn_
\be_
\bw/
\b/') or `:
\b:&
\b&'.
3738 If used with `:
\b:s
\bs', any delimiter can be used in place of /, and
3739 the final delimiter is optional if it is the last character of
3740 the event line. An a
\ba may be used as a synonym for g
\bg.
3741 G
\bG Apply the following `s
\bs' modifier once to each word in the event
3744 S
\bSH
\bHE
\bEL
\bLL
\bL B
\bBU
\bUI
\bIL
\bLT
\bTI
\bIN
\bN C
\bCO
\bOM
\bMM
\bMA
\bAN
\bND
\bDS
\bS
3745 Unless otherwise noted, each builtin command documented in this section
3746 as accepting options preceded by -
\b- accepts -
\b--
\b- to signify the end of the
3747 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
3748 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,
3749 and s
\bsh
\bhi
\bif
\bft
\bt builtins accept and process arguments beginning with -
\b- with-
3750 out requiring -
\b--
\b-. Other builtins that accept arguments but are not
3751 specified as accepting options interpret arguments beginning with -
\b- as
3752 invalid options and require -
\b--
\b- to prevent this interpretation.
3753 :
\b: [_
\ba_
\br_
\bg_
\bu_
\bm_
\be_
\bn_
\bt_
\bs]
3754 No effect; the command does nothing beyond expanding _
\ba_
\br_
\bg_
\bu_
\bm_
\be_
\bn_
\bt_
\bs
3755 and performing any specified redirections. A zero exit code is
3758 .
\b. _
\bf_
\bi_
\bl_
\be_
\bn_
\ba_
\bm_
\be [_
\ba_
\br_
\bg_
\bu_
\bm_
\be_
\bn_
\bt_
\bs]
3759 s
\bso
\bou
\bur
\brc
\bce
\be _
\bf_
\bi_
\bl_
\be_
\bn_
\ba_
\bm_
\be [_
\ba_
\br_
\bg_
\bu_
\bm_
\be_
\bn_
\bt_
\bs]
3760 Read and execute commands from _
\bf_
\bi_
\bl_
\be_
\bn_
\ba_
\bm_
\be in the current shell
3761 environment and return the exit status of the last command exe-
3762 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
3763 names in P
\bPA
\bAT
\bTH
\bH are used to find the directory containing _
\bf_
\bi_
\bl_
\be_
\b-
3764 _
\bn_
\ba_
\bm_
\be. The file searched for in P
\bPA
\bAT
\bTH
\bH need not be executable.
3765 When b
\bba
\bas
\bsh
\bh is not in _
\bp_
\bo_
\bs_
\bi_
\bx _
\bm_
\bo_
\bd_
\be, the current directory is
3766 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
3767 to the s
\bsh
\bho
\bop
\bpt
\bt builtin command is turned off, the P
\bPA
\bAT
\bTH
\bH is not
3768 searched. If any _
\ba_
\br_
\bg_
\bu_
\bm_
\be_
\bn_
\bt_
\bs are supplied, they become the posi-
3769 tional parameters when _
\bf_
\bi_
\bl_
\be_
\bn_
\ba_
\bm_
\be is executed. Otherwise the
3770 positional parameters are unchanged. The return status is the
3771 status of the last command exited within the script (0 if no
3772 commands are executed), and false if _
\bf_
\bi_
\bl_
\be_
\bn_
\ba_
\bm_
\be is not found or
3775 a
\bal
\bli
\bia
\bas
\bs [-
\b-p
\bp] [_
\bn_
\ba_
\bm_
\be[=_
\bv_
\ba_
\bl_
\bu_
\be] ...]
3776 A
\bAl
\bli
\bia
\bas
\bs with no arguments or with the -
\b-p
\bp option prints the list of
3777 aliases in the form a
\bal
\bli
\bia
\bas
\bs _
\bn_
\ba_
\bm_
\be=_
\bv_
\ba_
\bl_
\bu_
\be on standard output. When
3778 arguments are supplied, an alias is defined for each _
\bn_
\ba_
\bm_
\be whose
3779 _
\bv_
\ba_
\bl_
\bu_
\be is given. A trailing space in _
\bv_
\ba_
\bl_
\bu_
\be causes the next word
3780 to be checked for alias substitution when the alias is expanded.
3781 For each _
\bn_
\ba_
\bm_
\be in the argument list for which no _
\bv_
\ba_
\bl_
\bu_
\be is sup-
3782 plied, the name and value of the alias is printed. A
\bAl
\bli
\bia
\bas
\bs
3783 returns true unless a _
\bn_
\ba_
\bm_
\be is given for which no alias has been
3786 b
\bbg
\bg [_
\bj_
\bo_
\bb_
\bs_
\bp_
\be_
\bc ...]
3787 Resume each suspended job _
\bj_
\bo_
\bb_
\bs_
\bp_
\be_
\bc in the background, as if it
3788 had been started with &
\b&. If _
\bj_
\bo_
\bb_
\bs_
\bp_
\be_
\bc is not present, the shell's
3789 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
3790 run when job control is disabled or, when run with job control
3791 enabled, any specified _
\bj_
\bo_
\bb_
\bs_
\bp_
\be_
\bc was not found or was started
3792 without job control.
3794 b
\bbi
\bin
\bnd
\bd [-
\b-m
\bm _
\bk_
\be_
\by_
\bm_
\ba_
\bp] [-
\b-l
\blp
\bps
\bsv
\bvP
\bPS
\bSV
\bV]
3795 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]
3796 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
3797 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
3798 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
3799 b
\bbi
\bin
\bnd
\bd _
\br_
\be_
\ba_
\bd_
\bl_
\bi_
\bn_
\be_
\b-_
\bc_
\bo_
\bm_
\bm_
\ba_
\bn_
\bd
3800 Display current r
\bre
\bea
\bad
\bdl
\bli
\bin
\bne
\be key and function bindings, bind a key
3801 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
3802 variable. Each non-option argument is a command as it would
3803 appear in _
\b._
\bi_
\bn_
\bp_
\bu_
\bt_
\br_
\bc, but each binding or command must be passed
3804 as a separate argument; e.g., '"\C-x\C-r": re-read-init-file'.
3805 Options, if supplied, have the following meanings:
3806 -
\b-m
\bm _
\bk_
\be_
\by_
\bm_
\ba_
\bp
3807 Use _
\bk_
\be_
\by_
\bm_
\ba_
\bp as the keymap to be affected by the subsequent
3808 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-
3809 _
\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,
3810 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
3811 equivalent to _
\be_
\bm_
\ba_
\bc_
\bs_
\b-_
\bs_
\bt_
\ba_
\bn_
\bd_
\ba_
\br_
\bd.
3812 -
\b-l
\bl List the names of all r
\bre
\bea
\bad
\bdl
\bli
\bin
\bne
\be functions.
3813 -
\b-p
\bp Display r
\bre
\bea
\bad
\bdl
\bli
\bin
\bne
\be function names and bindings in such a
3814 way that they can be re-read.
3815 -
\b-P
\bP List current r
\bre
\bea
\bad
\bdl
\bli
\bin
\bne
\be function names and bindings.
3816 -
\b-s
\bs Display r
\bre
\bea
\bad
\bdl
\bli
\bin
\bne
\be key sequences bound to macros and the
3817 strings they output in such a way that they can be re-
3819 -
\b-S
\bS Display r
\bre
\bea
\bad
\bdl
\bli
\bin
\bne
\be key sequences bound to macros and the
3820 strings they output.
3821 -
\b-v
\bv Display r
\bre
\bea
\bad
\bdl
\bli
\bin
\bne
\be variable names and values in such a way
3822 that they can be re-read.
3823 -
\b-V
\bV List current r
\bre
\bea
\bad
\bdl
\bli
\bin
\bne
\be variable names and values.
3824 -
\b-f
\bf _
\bf_
\bi_
\bl_
\be_
\bn_
\ba_
\bm_
\be
3825 Read key bindings from _
\bf_
\bi_
\bl_
\be_
\bn_
\ba_
\bm_
\be.
3826 -
\b-q
\bq _
\bf_
\bu_
\bn_
\bc_
\bt_
\bi_
\bo_
\bn
3827 Query about which keys invoke the named _
\bf_
\bu_
\bn_
\bc_
\bt_
\bi_
\bo_
\bn.
3828 -
\b-u
\bu _
\bf_
\bu_
\bn_
\bc_
\bt_
\bi_
\bo_
\bn
3829 Unbind all keys bound to the named _
\bf_
\bu_
\bn_
\bc_
\bt_
\bi_
\bo_
\bn.
3830 -
\b-r
\br _
\bk_
\be_
\by_
\bs_
\be_
\bq
3831 Remove any current binding for _
\bk_
\be_
\by_
\bs_
\be_
\bq.
3832 -
\b-x
\bx _
\bk_
\be_
\by_
\bs_
\be_
\bq:
\b:_
\bs_
\bh_
\be_
\bl_
\bl_
\b-_
\bc_
\bo_
\bm_
\bm_
\ba_
\bn_
\bd
3833 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
3834 entered. When _
\bs_
\bh_
\be_
\bl_
\bl_
\b-_
\bc_
\bo_
\bm_
\bm_
\ba_
\bn_
\bd is executed, the shell sets
3835 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-
3836 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
3837 current location of the insertion point. If the executed
3838 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-
3839 L
\bLI
\bIN
\bNE
\bE_
\b_P
\bPO
\bOI
\bIN
\bNT
\bT, those new values will be reflected in the
3842 The return value is 0 unless an unrecognized option is given or
3845 b
\bbr
\bre
\bea
\bak
\bk [_
\bn]
3846 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
3847 specified, break _
\bn levels. _
\bn must be >= 1. If _
\bn is greater
3848 than the number of enclosing loops, all enclosing loops are
3849 exited. The return value is 0 unless _
\bn is not greater than or
3852 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]
3853 Execute the specified shell builtin, passing it _
\ba_
\br_
\bg_
\bu_
\bm_
\be_
\bn_
\bt_
\bs, and
3854 return its exit status. This is useful when defining a function
3855 whose name is the same as a shell builtin, retaining the func-
3856 tionality of the builtin within the function. The c
\bcd
\bd builtin is
3857 commonly redefined this way. The return status is false if
3858 _
\bs_
\bh_
\be_
\bl_
\bl_
\b-_
\bb_
\bu_
\bi_
\bl_
\bt_
\bi_
\bn is not a shell builtin command.
3860 c
\bca
\bal
\bll
\ble
\ber
\br [_
\be_
\bx_
\bp_
\br]
3861 Returns the context of any active subroutine call (a shell func-
3862 tion or a script executed with the .
\b. or s
\bso
\bou
\bur
\brc
\bce
\be builtins). With-
3863 out _
\be_
\bx_
\bp_
\br, c
\bca
\bal
\bll
\ble
\ber
\br displays the line number and source filename of
3864 the current subroutine call. If a non-negative integer is sup-
3865 plied as _
\be_
\bx_
\bp_
\br, c
\bca
\bal
\bll
\ble
\ber
\br displays the line number, subroutine name,
3866 and source file corresponding to that position in the current
3867 execution call stack. This extra information may be used, for
3868 example, to print a stack trace. The current frame is frame 0.
3869 The return value is 0 unless the shell is not executing a sub-
3870 routine call or _
\be_
\bx_
\bp_
\br does not correspond to a valid position in
3873 c
\bcd
\bd [-
\b-L
\bL|[-
\b-P
\bP [-
\b-e
\be]]] [_
\bd_
\bi_
\br]
3874 Change the current directory to _
\bd_
\bi_
\br. The variable H
\bHO
\bOM
\bME
\bE is the
3875 default _
\bd_
\bi_
\br. The variable C
\bCD
\bDP
\bPA
\bAT
\bTH
\bH defines the search path for
3876 the directory containing _
\bd_
\bi_
\br. Alternative directory names in
3877 C
\bCD
\bDP
\bPA
\bAT
\bTH
\bH are separated by a colon (:). A null directory name in
3878 C
\bCD
\bDP
\bPA
\bAT
\bTH
\bH is the same as the current directory, i.e., ``.
\b.''. If
3879 _
\bd_
\bi_
\br begins with a slash (/), then C
\bCD
\bDP
\bPA
\bAT
\bTH
\bH is not used. The -
\b-P
\bP
3880 option says to use the physical directory structure instead of
3881 following symbolic links (see also the -
\b-P
\bP option to the s
\bse
\bet
\bt
3882 builtin command); the -
\b-L
\bL option forces symbolic links to be fol-
3883 lowed. If the -
\b-e
\be option is supplied with -
\b-P
\bP, and the current
3884 working directory cannot be successfully determined after a suc-
3885 cessful directory change, c
\bcd
\bd will return an unsuccessful status.
3886 An argument of -
\b- is equivalent to $
\b$O
\bOL
\bLD
\bDP
\bPW
\bWD
\bD. If a non-empty
3887 directory name from C
\bCD
\bDP
\bPA
\bAT
\bTH
\bH is used, or if -
\b- is the first argu-
3888 ment, and the directory change is successful, the absolute path-
3889 name of the new working directory is written to the standard
3890 output. The return value is true if the directory was success-
3891 fully changed; false otherwise.
3893 c
\bco
\bom
\bmm
\bma
\ban
\bnd
\bd [-
\b-p
\bpV
\bVv
\bv] _
\bc_
\bo_
\bm_
\bm_
\ba_
\bn_
\bd [_
\ba_
\br_
\bg ...]
3894 Run _
\bc_
\bo_
\bm_
\bm_
\ba_
\bn_
\bd with _
\ba_
\br_
\bg_
\bs suppressing the normal shell function
3895 lookup. Only builtin commands or commands found in the P
\bPA
\bAT
\bTH
\bH are
3896 executed. If the -
\b-p
\bp option is given, the search for _
\bc_
\bo_
\bm_
\bm_
\ba_
\bn_
\bd is
3897 performed using a default value for P
\bPA
\bAT
\bTH
\bH that is guaranteed to
3898 find all of the standard utilities. If either the -
\b-V
\bV or -
\b-v
\bv
3899 option is supplied, a description of _
\bc_
\bo_
\bm_
\bm_
\ba_
\bn_
\bd is printed. The -
\b-v
\bv
3900 option causes a single word indicating the command or file name
3901 used to invoke _
\bc_
\bo_
\bm_
\bm_
\ba_
\bn_
\bd to be displayed; the -
\b-V
\bV option produces a
3902 more verbose description. If the -
\b-V
\bV or -
\b-v
\bv option is supplied,
3903 the exit status is 0 if _
\bc_
\bo_
\bm_
\bm_
\ba_
\bn_
\bd was found, and 1 if not. If
3904 neither option is supplied and an error occurred or _
\bc_
\bo_
\bm_
\bm_
\ba_
\bn_
\bd can-
3905 not be found, the exit status is 127. Otherwise, the exit sta-
3906 tus of the c
\bco
\bom
\bmm
\bma
\ban
\bnd
\bd builtin is the exit status of _
\bc_
\bo_
\bm_
\bm_
\ba_
\bn_
\bd.
3908 c
\bco
\bom
\bmp
\bpg
\bge
\ben
\bn [_
\bo_
\bp_
\bt_
\bi_
\bo_
\bn] [_
\bw_
\bo_
\br_
\bd]
3909 Generate possible completion matches for _
\bw_
\bo_
\br_
\bd according to the
3910 _
\bo_
\bp_
\bt_
\bi_
\bo_
\bns, which may be any option accepted by the c
\bco
\bom
\bmp
\bpl
\ble
\bet
\bte
\be
3911 builtin with the exception of -
\b-p
\bp and -
\b-r
\br, and write the matches
3912 to the standard output. When using the -
\b-F
\bF or -
\b-C
\bC options, the
3913 various shell variables set by the programmable completion
3914 facilities, while available, will not have useful values.
3916 The matches will be generated in the same way as if the pro-
3917 grammable completion code had generated them directly from a
3918 completion specification with the same flags. If _
\bw_
\bo_
\br_
\bd is speci-
3919 fied, only those completions matching _
\bw_
\bo_
\br_
\bd will be displayed.
3921 The return value is true unless an invalid option is supplied,
3922 or no matches were generated.
3924 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-
3925 _
\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]
3926 [-
\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.]
3927 c
\bco
\bom
\bmp
\bpl
\ble
\bet
\bte
\be -
\b-p
\bpr
\br [-
\b-D
\bDE
\bE] [_
\bn_
\ba_
\bm_
\be ...]
3928 Specify how arguments to each _
\bn_
\ba_
\bm_
\be should be completed. If the
3929 -
\b-p
\bp option is supplied, or if no options are supplied, existing
3930 completion specifications are printed in a way that allows them
3931 to be reused as input. The -
\b-r
\br option removes a completion spec-
3932 ification for each _
\bn_
\ba_
\bm_
\be, or, if no _
\bn_
\ba_
\bm_
\bes are supplied, all com-
3933 pletion specifications. The -
\b-D
\bD option indicates that the
3934 remaining options and actions should apply to the ``default''
3935 command completion; that is, completion attempted on a command
3936 for which no completion has previously been defined. The -
\b-E
\bE
3937 option indicates that the remaining options and actions should
3938 apply to ``empty'' command completion; that is, completion
3939 attempted on a blank line.
3941 The process of applying these completion specifications when
3942 word completion is attempted is described above under P
\bPr
\bro
\bo-
\b-
3943 g
\bgr
\bra
\bam
\bmm
\bma
\bab
\bbl
\ble
\be C
\bCo
\bom
\bmp
\bpl
\ble
\bet
\bti
\bio
\bon
\bn.
3945 Other options, if specified, have the following meanings. The
3946 arguments to the -
\b-G
\bG, -
\b-W
\bW, and -
\b-X
\bX options (and, if necessary, the
3947 -
\b-P
\bP and -
\b-S
\bS options) should be quoted to protect them from expan-
3948 sion before the c
\bco
\bom
\bmp
\bpl
\ble
\bet
\bte
\be builtin is invoked.
3949 -
\b-o
\bo _
\bc_
\bo_
\bm_
\bp_
\b-_
\bo_
\bp_
\bt_
\bi_
\bo_
\bn
3950 The _
\bc_
\bo_
\bm_
\bp_
\b-_
\bo_
\bp_
\bt_
\bi_
\bo_
\bn controls several aspects of the comp-
3951 spec's behavior beyond the simple generation of comple-
3952 tions. _
\bc_
\bo_
\bm_
\bp_
\b-_
\bo_
\bp_
\bt_
\bi_
\bo_
\bn may be one of:
3953 b
\bba
\bas
\bsh
\bhd
\bde
\bef
\bfa
\bau
\bul
\blt
\bt
3954 Perform the rest of the default b
\bba
\bas
\bsh
\bh completions
3955 if the compspec generates no matches.
3956 d
\bde
\bef
\bfa
\bau
\bul
\blt
\bt Use readline's default filename completion if
3957 the compspec generates no matches.
3958 d
\bdi
\bir
\brn
\bna
\bam
\bme
\bes
\bs
3959 Perform directory name completion if the comp-
3960 spec generates no matches.
3961 f
\bfi
\bil
\ble
\ben
\bna
\bam
\bme
\bes
\bs
3962 Tell readline that the compspec generates file-
3963 names, so it can perform any filename-specific
3964 processing (like adding a slash to directory
3965 names, quoting special characters, or suppress-
3966 ing trailing spaces). Intended to be used with
3968 n
\bno
\bos
\bsp
\bpa
\bac
\bce
\be Tell readline not to append a space (the
3969 default) to words completed at the end of the
3971 p
\bpl
\blu
\bus
\bsd
\bdi
\bir
\brs
\bs
3972 After any matches defined by the compspec are
3973 generated, directory name completion is
3974 attempted and any matches are added to the
3975 results of the other actions.
3976 -
\b-A
\bA _
\ba_
\bc_
\bt_
\bi_
\bo_
\bn
3977 The _
\ba_
\bc_
\bt_
\bi_
\bo_
\bn may be one of the following to generate a
3978 list of possible completions:
3979 a
\bal
\bli
\bia
\bas
\bs Alias names. May also be specified as -
\b-a
\ba.
3980 a
\bar
\brr
\bra
\bay
\byv
\bva
\bar
\br
3981 Array variable names.
3982 b
\bbi
\bin
\bnd
\bdi
\bin
\bng
\bg R
\bRe
\bea
\bad
\bdl
\bli
\bin
\bne
\be key binding names.
3983 b
\bbu
\bui
\bil
\blt
\bti
\bin
\bn Names of shell builtin commands. May also be
3984 specified as -
\b-b
\bb.
3985 c
\bco
\bom
\bmm
\bma
\ban
\bnd
\bd Command names. May also be specified as -
\b-c
\bc.
3986 d
\bdi
\bir
\bre
\bec
\bct
\bto
\bor
\bry
\by
3987 Directory names. May also be specified as -
\b-d
\bd.
3988 d
\bdi
\bis
\bsa
\bab
\bbl
\ble
\bed
\bd
3989 Names of disabled shell builtins.
3990 e
\ben
\bna
\bab
\bbl
\ble
\bed
\bd Names of enabled shell builtins.
3991 e
\bex
\bxp
\bpo
\bor
\brt
\bt Names of exported shell variables. May also be
3992 specified as -
\b-e
\be.
3993 f
\bfi
\bil
\ble
\be File names. May also be specified as -
\b-f
\bf.
3994 f
\bfu
\bun
\bnc
\bct
\bti
\bio
\bon
\bn
3995 Names of shell functions.
3996 g
\bgr
\bro
\bou
\bup
\bp Group names. May also be specified as -
\b-g
\bg.
3997 h
\bhe
\bel
\blp
\bpt
\bto
\bop
\bpi
\bic
\bc
3998 Help topics as accepted by the h
\bhe
\bel
\blp
\bp builtin.
3999 h
\bho
\bos
\bst
\btn
\bna
\bam
\bme
\be
4000 Hostnames, as taken from the file specified by
4001 the H
\bHO
\bOS
\bST
\bTF
\bFI
\bIL
\bLE
\bE shell variable.
4002 j
\bjo
\bob
\bb Job names, if job control is active. May also
4003 be specified as -
\b-j
\bj.
4004 k
\bke
\bey
\byw
\bwo
\bor
\brd
\bd Shell reserved words. May also be specified as
4006 r
\bru
\bun
\bnn
\bni
\bin
\bng
\bg Names of running jobs, if job control is active.
4007 s
\bse
\ber
\brv
\bvi
\bic
\bce
\be Service names. May also be specified as -
\b-s
\bs.
4008 s
\bse
\bet
\bto
\bop
\bpt
\bt Valid arguments for the -
\b-o
\bo option to the s
\bse
\bet
\bt
4010 s
\bsh
\bho
\bop
\bpt
\bt Shell option names as accepted by the s
\bsh
\bho
\bop
\bpt
\bt
4012 s
\bsi
\big
\bgn
\bna
\bal
\bl Signal names.
4013 s
\bst
\bto
\bop
\bpp
\bpe
\bed
\bd Names of stopped jobs, if job control is active.
4014 u
\bus
\bse
\ber
\br User names. May also be specified as -
\b-u
\bu.
4015 v
\bva
\bar
\bri
\bia
\bab
\bbl
\ble
\be
4016 Names of all shell variables. May also be spec-
4018 -
\b-C
\bC _
\bc_
\bo_
\bm_
\bm_
\ba_
\bn_
\bd
4019 _
\bc_
\bo_
\bm_
\bm_
\ba_
\bn_
\bd is executed in a subshell environment, and its
4020 output is used as the possible completions.
4021 -
\b-F
\bF _
\bf_
\bu_
\bn_
\bc_
\bt_
\bi_
\bo_
\bn
4022 The shell function _
\bf_
\bu_
\bn_
\bc_
\bt_
\bi_
\bo_
\bn is executed in the current
4023 shell environment. When it finishes, the possible com-
4024 pletions are retrieved from the value of the C
\bCO
\bOM
\bMP
\bPR
\bRE
\bEP
\bPL
\bLY
\bY
4026 -
\b-G
\bG _
\bg_
\bl_
\bo_
\bb_
\bp_
\ba_
\bt
4027 The pathname expansion pattern _
\bg_
\bl_
\bo_
\bb_
\bp_
\ba_
\bt is expanded to
4028 generate the possible completions.
4029 -
\b-P
\bP _
\bp_
\br_
\be_
\bf_
\bi_
\bx
4030 _
\bp_
\br_
\be_
\bf_
\bi_
\bx is added at the beginning of each possible com-
4031 pletion after all other options have been applied.
4032 -
\b-S
\bS _
\bs_
\bu_
\bf_
\bf_
\bi_
\bx
4033 _
\bs_
\bu_
\bf_
\bf_
\bi_
\bx is appended to each possible completion after all
4034 other options have been applied.
4035 -
\b-W
\bW _
\bw_
\bo_
\br_
\bd_
\bl_
\bi_
\bs_
\bt
4036 The _
\bw_
\bo_
\br_
\bd_
\bl_
\bi_
\bs_
\bt is split using the characters in the I
\bIF
\bFS
\bS
4037 special variable as delimiters, and each resultant word
4038 is expanded. The possible completions are the members
4039 of the resultant list which match the word being com-
4041 -
\b-X
\bX _
\bf_
\bi_
\bl_
\bt_
\be_
\br_
\bp_
\ba_
\bt
4042 _
\bf_
\bi_
\bl_
\bt_
\be_
\br_
\bp_
\ba_
\bt is a pattern as used for pathname expansion.
4043 It is applied to the list of possible completions gener-
4044 ated by the preceding options and arguments, and each
4045 completion matching _
\bf_
\bi_
\bl_
\bt_
\be_
\br_
\bp_
\ba_
\bt is removed from the list.
4046 A leading !
\b! in _
\bf_
\bi_
\bl_
\bt_
\be_
\br_
\bp_
\ba_
\bt negates the pattern; in this
4047 case, any completion not matching _
\bf_
\bi_
\bl_
\bt_
\be_
\br_
\bp_
\ba_
\bt is removed.
4049 The return value is true unless an invalid option is supplied,
4050 an option other than -
\b-p
\bp or -
\b-r
\br is supplied without a _
\bn_
\ba_
\bm_
\be argu-
4051 ment, an attempt is made to remove a completion specification
4052 for a _
\bn_
\ba_
\bm_
\be for which no specification exists, or an error occurs
4053 adding a completion specification.
4055 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]
4056 Modify completion options for each _
\bn_
\ba_
\bm_
\be according to the
4057 _
\bo_
\bp_
\bt_
\bi_
\bo_
\bns, or for the currently-executing completion if no _
\bn_
\ba_
\bm_
\bes
4058 are supplied. If no _
\bo_
\bp_
\bt_
\bi_
\bo_
\bns are given, display the completion
4059 options for each _
\bn_
\ba_
\bm_
\be or the current completion. The possible
4060 values of _
\bo_
\bp_
\bt_
\bi_
\bo_
\bn are those valid for the c
\bco
\bom
\bmp
\bpl
\ble
\bet
\bte
\be builtin
4061 described above. The -
\b-D
\bD option indicates that the remaining
4062 options should apply to the ``default'' command completion; that
4063 is, completion attempted on a command for which no completion
4064 has previously been defined. The -
\b-E
\bE option indicates that the
4065 remaining options should apply to ``empty'' command completion;
4066 that is, completion attempted on a blank line.
4068 The return value is true unless an invalid option is supplied,
4069 an attempt is made to modify the options for a _
\bn_
\ba_
\bm_
\be for which no
4070 completion specification exists, or an output error occurs.
4072 c
\bco
\bon
\bnt
\bti
\bin
\bnu
\bue
\be [_
\bn]
4073 Resume the next iteration of the enclosing f
\bfo
\bor
\br, w
\bwh
\bhi
\bil
\ble
\be, u
\bun
\bnt
\bti
\bil
\bl, or
4074 s
\bse
\bel
\ble
\bec
\bct
\bt loop. If _
\bn is specified, resume at the _
\bnth enclosing
4075 loop. _
\bn must be >= 1. If _
\bn is greater than the number of
4076 enclosing loops, the last enclosing loop (the ``top-level''
4077 loop) is resumed. The return value is 0 unless _
\bn is not greater
4080 d
\bde
\bec
\bcl
\bla
\bar
\bre
\be [-
\b-a
\baA
\bAf
\bfF
\bFg
\bgi
\bil
\blr
\brt
\btu
\bux
\bx] [-
\b-p
\bp] [_
\bn_
\ba_
\bm_
\be[=_
\bv_
\ba_
\bl_
\bu_
\be] ...]
4081 t
\bty
\byp
\bpe
\bes
\bse
\bet
\bt [-
\b-a
\baA
\bAf
\bfF
\bFg
\bgi
\bil
\blr
\brt
\btu
\bux
\bx] [-
\b-p
\bp] [_
\bn_
\ba_
\bm_
\be[=_
\bv_
\ba_
\bl_
\bu_
\be] ...]
4082 Declare variables and/or give them attributes. If no _
\bn_
\ba_
\bm_
\bes are
4083 given then display the values of variables. The -
\b-p
\bp option will
4084 display the attributes and values of each _
\bn_
\ba_
\bm_
\be. When -
\b-p
\bp is used
4085 with _
\bn_
\ba_
\bm_
\be arguments, additional options are ignored. When -
\b-p
\bp is
4086 supplied without _
\bn_
\ba_
\bm_
\be arguments, it will display the attributes
4087 and values of all variables having the attributes specified by
4088 the additional options. If no other options are supplied with
4089 -
\b-p
\bp, d
\bde
\bec
\bcl
\bla
\bar
\bre
\be will display the attributes and values of all shell
4090 variables. The -
\b-f
\bf option will restrict the display to shell
4091 functions. The -
\b-F
\bF option inhibits the display of function defi-
4092 nitions; only the function name and attributes are printed. If
4093 the e
\bex
\bxt
\btd
\bde
\beb
\bbu
\bug
\bg shell option is enabled using s
\bsh
\bho
\bop
\bpt
\bt, the source
4094 file name and line number where the function is defined are dis-
4095 played as well. The -
\b-F
\bF option implies -
\b-f
\bf. The -
\b-g
\bg option forces
4096 variables to be created or modified at the global scope, even
4097 when d
\bde
\bec
\bcl
\bla
\bar
\bre
\be is executed in a shell function. It is ignored in
4098 all other cases. The following options can be used to restrict
4099 output to variables with the specified attribute or to give
4100 variables attributes:
4101 -
\b-a
\ba Each _
\bn_
\ba_
\bm_
\be is an indexed array variable (see A
\bAr
\brr
\bra
\bay
\bys
\bs
4103 -
\b-A
\bA Each _
\bn_
\ba_
\bm_
\be is an associative array variable (see A
\bAr
\brr
\bra
\bay
\bys
\bs
4105 -
\b-f
\bf Use function names only.
4106 -
\b-i
\bi The variable is treated as an integer; arithmetic evalua-
4107 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
4108 the variable is assigned a value.
4109 -
\b-l
\bl When the variable is assigned a value, all upper-case
4110 characters are converted to lower-case. The upper-case
4111 attribute is disabled.
4112 -
\b-r
\br Make _
\bn_
\ba_
\bm_
\bes readonly. These names cannot then be assigned
4113 values by subsequent assignment statements or unset.
4114 -
\b-t
\bt Give each _
\bn_
\ba_
\bm_
\be the _
\bt_
\br_
\ba_
\bc_
\be attribute. Traced functions
4115 inherit the D
\bDE
\bEB
\bBU
\bUG
\bG and R
\bRE
\bET
\bTU
\bUR
\bRN
\bN traps from the calling
4116 shell. The trace attribute has no special meaning for
4118 -
\b-u
\bu When the variable is assigned a value, all lower-case
4119 characters are converted to upper-case. The lower-case
4120 attribute is disabled.
4121 -
\b-x
\bx Mark _
\bn_
\ba_
\bm_
\bes for export to subsequent commands via the
4124 Using `+' instead of `-' turns off the attribute instead, with
4125 the exceptions that +
\b+a
\ba may not be used to destroy an array vari-
4126 able and +
\b+r
\br will not remove the readonly attribute. When used
4127 in a function, makes each _
\bn_
\ba_
\bm_
\be local, as with the l
\blo
\boc
\bca
\bal
\bl command,
4128 unless the -
\b-g
\bgP
\bP o
\bop
\bpt
\bti
\bio
\bon
\bn i
\bis
\bs s
\bsu
\bup
\bpp
\bpl
\bli
\bie
\bed
\bd,
\b, I
\bIf
\bf a
\ba v
\bva
\bar
\bri
\bia
\bab
\bbl
\ble
\be n
\bna
\bam
\bme
\be i
\bis
\bs f
\bfo
\bol
\bl-
\b-
4129 l
\blo
\bow
\bwe
\bed
\bd b
\bby
\by =
\b=_
\bv_
\ba_
\bl_
\bu_
\be,
\b, t
\bth
\bhe
\be v
\bva
\bal
\blu
\bue
\be o
\bof
\bf t
\bth
\bhe
\be v
\bva
\bar
\bri
\bia
\bab
\bbl
\ble
\be i
\bis
\bs s
\bse
\bet
\bt t
\bto
\bo _
\bv_
\ba_
\bl_
\bu_
\be.
\b. T
\bTh
\bhe
\be
4130 r
\bre
\bet
\btu
\bur
\brn
\bn v
\bva
\bal
\blu
\bue
\be i
\bis
\bs 0
\b0 u
\bun
\bnl
\ble
\bes
\bss
\bs a
\ban
\bn i
\bin
\bnv
\bva
\bal
\bli
\bid
\bd o
\bop
\bpt
\bti
\bio
\bon
\bn i
\bis
\bs e
\ben
\bnc
\bco
\bou
\bun
\bnt
\bte
\ber
\bre
\bed
\bd,
\b, a
\ban
\bn
4131 a
\bat
\btt
\bte
\bem
\bmp
\bpt
\bt i
\bis
\bs m
\bma
\bad
\bde
\be t
\bto
\bo d
\bde
\bef
\bfi
\bin
\bne
\be a
\ba f
\bfu
\bun
\bnc
\bct
\bti
\bio
\bon
\bn u
\bus
\bsi
\bin
\bng
\bg `
\b``
\b`-
\b-f
\bf f
\bfo
\boo
\bo=
\b=b
\bba
\bar
\br'
\b''
\b',
\b, a
\ban
\bn
4132 a
\bat
\btt
\bte
\bem
\bmp
\bpt
\bt i
\bis
\bs m
\bma
\bad
\bde
\be t
\bto
\bo a
\bas
\bss
\bsi
\big
\bgn
\bn a
\ba v
\bva
\bal
\blu
\bue
\be t
\bto
\bo a
\ba r
\bre
\bea
\bad
\bdo
\bon
\bnl
\bly
\by v
\bva
\bar
\bri
\bia
\bab
\bbl
\ble
\be,
\b, a
\ban
\bn
4133 a
\bat
\btt
\bte
\bem
\bmp
\bpt
\bt i
\bis
\bs m
\bma
\bad
\bde
\be t
\bto
\bo a
\bas
\bss
\bsi
\big
\bgn
\bn a
\ba v
\bva
\bal
\blu
\bue
\be t
\bto
\bo a
\ban
\bn a
\bar
\brr
\bra
\bay
\by v
\bva
\bar
\bri
\bia
\bab
\bbl
\ble
\be w
\bwi
\bit
\bth
\bho
\bou
\but
\bt
4134 u
\bus
\bsi
\bin
\bng
\bg t
\bth
\bhe
\be c
\bco
\bom
\bmp
\bpo
\bou
\bun
\bnd
\bd a
\bas
\bss
\bsi
\big
\bgn
\bnm
\bme
\ben
\bnt
\bt s
\bsy
\byn
\bnt
\bta
\bax
\bx (
\b(s
\bse
\bee
\be A
\bAr
\brr
\bra
\bay
\bys
\bs above), one of
4135 the _
\bn_
\ba_
\bm_
\be_
\bs is not a valid shell variable name, an attempt is made
4136 to turn off readonly status for a readonly variable, an attempt
4137 is made to turn off array status for an array variable, or an
4138 attempt is made to display a non-existent function with -
\b-f
\bf.
4140 d
\bdi
\bir
\brs
\bs [
\b[+
\b+_
\bn]
\b] [
\b[-
\b-_
\bn]
\b] [
\b[-
\b-c
\bcl
\blp
\bpv
\bv]
\b]
4141 Without options, displays the list of currently remembered
4142 directories. The default display is on a single line with
4143 directory names separated by spaces. Directories are added to
4144 the list with the p
\bpu
\bus
\bsh
\bhd
\bd command; the p
\bpo
\bop
\bpd
\bd command removes
4145 entries from the list.
4146 +
\b+_
\bn Displays the _
\bnth entry counting from the left of the list
4147 shown by d
\bdi
\bir
\brs
\bs when invoked without options, starting with
4149 -
\b-_
\bn Displays the _
\bnth entry counting from the right of the
4150 list shown by d
\bdi
\bir
\brs
\bs when invoked without options, starting
4152 -
\b-c
\bc Clears the directory stack by deleting all of the
4154 -
\b-l
\bl Produces a longer listing; the default listing format
4155 uses a tilde to denote the home directory.
4156 -
\b-p
\bp Print the directory stack with one entry per line.
4157 -
\b-v
\bv Print the directory stack with one entry per line, pre-
4158 fixing each entry with its index in the stack.
4160 The return value is 0 unless an invalid option is supplied or _
\bn
4161 indexes beyond the end of the directory stack.
4163 d
\bdi
\bis
\bso
\bow
\bwn
\bn [-
\b-a
\bar
\br] [-
\b-h
\bh] [_
\bj_
\bo_
\bb_
\bs_
\bp_
\be_
\bc ...]
4164 Without options, each _
\bj_
\bo_
\bb_
\bs_
\bp_
\be_
\bc is removed from the table of
4165 active jobs. If _
\bj_
\bo_
\bb_
\bs_
\bp_
\be_
\bc is not present, and neither -
\b-a
\ba nor -
\b-r
\br
4166 is supplied, the shell's notion of the _
\bc_
\bu_
\br_
\br_
\be_
\bn_
\bt _
\bj_
\bo_
\bb is used. If
4167 the -
\b-h
\bh option is given, each _
\bj_
\bo_
\bb_
\bs_
\bp_
\be_
\bc is not removed from the ta-
4168 ble, but is marked so that S
\bSI
\bIG
\bGH
\bHU
\bUP
\bP is not sent to the job if the
4169 shell receives a S
\bSI
\bIG
\bGH
\bHU
\bUP
\bP. If no _
\bj_
\bo_
\bb_
\bs_
\bp_
\be_
\bc is present, and neither
4170 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.
4171 If no _
\bj_
\bo_
\bb_
\bs_
\bp_
\be_
\bc is supplied, the -
\b-a
\ba option means to remove or mark
4172 all jobs; the -
\b-r
\br option without a _
\bj_
\bo_
\bb_
\bs_
\bp_
\be_
\bc argument restricts
4173 operation to running jobs. The return value is 0 unless a _
\bj_
\bo_
\bb_
\b-
4174 _
\bs_
\bp_
\be_
\bc does not specify a valid job.
4176 e
\bec
\bch
\bho
\bo [-
\b-n
\bne
\beE
\bE] [_
\ba_
\br_
\bg ...]
4177 Output the _
\ba_
\br_
\bgs, separated by spaces, followed by a newline.
4178 The return status is always 0. If -
\b-n
\bn is specified, the trailing
4179 newline is suppressed. If the -
\b-e
\be option is given, interpreta-
4180 tion of the following backslash-escaped characters is enabled.
4181 The -
\b-E
\bE option disables the interpretation of these escape char-
4182 acters, even on systems where they are interpreted by default.
4183 The x
\bxp
\bpg
\bg_
\b_e
\bec
\bch
\bho
\bo shell option may be used to dynamically determine
4184 whether or not e
\bec
\bch
\bho
\bo expands these escape characters by default.
4185 e
\bec
\bch
\bho
\bo does not interpret -
\b--
\b- to mean the end of options. e
\bec
\bch
\bho
\bo
4186 interprets the following escape sequences:
4187 \
\b\a
\ba alert (bell)
4189 \
\b\c
\bc suppress further output
4191 \
\b\E
\bE an escape character
4194 \
\b\r
\br carriage return
4195 \
\b\t
\bt horizontal tab
4196 \
\b\v
\bv vertical tab
4198 \
\b\0
\b0_
\bn_
\bn_
\bn the eight-bit character whose value is the octal value
4199 _
\bn_
\bn_
\bn (zero to three octal digits)
4200 \
\b\x
\bx_
\bH_
\bH the eight-bit character whose value is the hexadecimal
4201 value _
\bH_
\bH (one or two hex digits)
4202 \
\b\u
\bu_
\bH_
\bH_
\bH_
\bH the Unicode (ISO/IEC 10646) character whose value is the
4203 hexadecimal value _
\bH_
\bH_
\bH_
\bH (one to four hex digits)
4204 \
\b\U
\bU_
\bH_
\bH_
\bH_
\bH_
\bH_
\bH_
\bH_
\bH
4205 the Unicode (ISO/IEC 10646) character whose value is the
4206 hexadecimal value _
\bH_
\bH_
\bH_
\bH_
\bH_
\bH_
\bH_
\bH (one to eight hex digits)
4208 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 ...]
4209 Enable and disable builtin shell commands. Disabling a builtin
4210 allows a disk command which has the same name as a shell builtin
4211 to be executed without specifying a full pathname, even though
4212 the shell normally searches for builtins before disk commands.
4213 If -
\b-n
\bn is used, each _
\bn_
\ba_
\bm_
\be is disabled; otherwise, _
\bn_
\ba_
\bm_
\be_
\bs are
4214 enabled. For example, to use the t
\bte
\bes
\bst
\bt binary found via the P
\bPA
\bAT
\bTH
\bH
4215 instead of the shell builtin version, run ``enable -n test''.
4216 The -
\b-f
\bf option means to load the new builtin command _
\bn_
\ba_
\bm_
\be from
4217 shared object _
\bf_
\bi_
\bl_
\be_
\bn_
\ba_
\bm_
\be, on systems that support dynamic loading.
4218 The -
\b-d
\bd option will delete a builtin previously loaded with -
\b-f
\bf.
4219 If no _
\bn_
\ba_
\bm_
\be arguments are given, or if the -
\b-p
\bp option is supplied,
4220 a list of shell builtins is printed. With no other option argu-
4221 ments, the list consists of all enabled shell builtins. If -
\b-n
\bn
4222 is supplied, only disabled builtins are printed. If -
\b-a
\ba is sup-
4223 plied, the list printed includes all builtins, with an indica-
4224 tion of whether or not each is enabled. If -
\b-s
\bs is supplied, the
4225 output is restricted to the POSIX _
\bs_
\bp_
\be_
\bc_
\bi_
\ba_
\bl builtins. The return
4226 value is 0 unless a _
\bn_
\ba_
\bm_
\be is not a shell builtin or there is an
4227 error loading a new builtin from a shared object.
4229 e
\bev
\bva
\bal
\bl [_
\ba_
\br_
\bg ...]
4230 The _
\ba_
\br_
\bgs are read and concatenated together into a single com-
4231 mand. This command is then read and executed by the shell, and
4232 its exit status is returned as the value of e
\bev
\bva
\bal
\bl. If there are
4233 no _
\ba_
\br_
\bg_
\bs, or only null arguments, e
\bev
\bva
\bal
\bl returns 0.
4235 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]]
4236 If _
\bc_
\bo_
\bm_
\bm_
\ba_
\bn_
\bd is specified, it replaces the shell. No new process
4237 is created. The _
\ba_
\br_
\bg_
\bu_
\bm_
\be_
\bn_
\bt_
\bs become the arguments to _
\bc_
\bo_
\bm_
\bm_
\ba_
\bn_
\bd. If
4238 the -
\b-l
\bl option is supplied, the shell places a dash at the begin-
4239 ning of the zeroth argument passed to _
\bc_
\bo_
\bm_
\bm_
\ba_
\bn_
\bd. This is what
4240 _
\bl_
\bo_
\bg_
\bi_
\bn(1) does. The -
\b-c
\bc option causes _
\bc_
\bo_
\bm_
\bm_
\ba_
\bn_
\bd to be executed with
4241 an empty environment. If -
\b-a
\ba is supplied, the shell passes _
\bn_
\ba_
\bm_
\be
4242 as the zeroth argument to the executed command. If _
\bc_
\bo_
\bm_
\bm_
\ba_
\bn_
\bd can-
4243 not be executed for some reason, a non-interactive shell exits,
4244 unless the shell option e
\bex
\bxe
\bec
\bcf
\bfa
\bai
\bil
\bl is enabled, in which case it
4245 returns failure. An interactive shell returns failure if the
4246 file cannot be executed. If _
\bc_
\bo_
\bm_
\bm_
\ba_
\bn_
\bd is not specified, any redi-
4247 rections take effect in the current shell, and the return status
4248 is 0. If there is a redirection error, the return status is 1.
4250 e
\bex
\bxi
\bit
\bt [_
\bn]
4251 Cause the shell to exit with a status of _
\bn. If _
\bn is omitted,
4252 the exit status is that of the last command executed. A trap on
4253 E
\bEX
\bXI
\bIT
\bT is executed before the shell terminates.
4255 e
\bex
\bxp
\bpo
\bor
\brt
\bt [-
\b-f
\bfn
\bn] [_
\bn_
\ba_
\bm_
\be[=_
\bw_
\bo_
\br_
\bd]] ...
4256 e
\bex
\bxp
\bpo
\bor
\brt
\bt -
\b-p
\bp
4257 The supplied _
\bn_
\ba_
\bm_
\be_
\bs are marked for automatic export to the envi-
4258 ronment of subsequently executed commands. If the -
\b-f
\bf option is
4259 given, the _
\bn_
\ba_
\bm_
\be_
\bs refer to functions. If no _
\bn_
\ba_
\bm_
\be_
\bs are given, or
4260 if the -
\b-p
\bp option is supplied, a list of all names that are
4261 exported in this shell is printed. The -
\b-n
\bn option causes the
4262 export property to be removed from each _
\bn_
\ba_
\bm_
\be. If a variable
4263 name is followed by =_
\bw_
\bo_
\br_
\bd, the value of the variable is set to
4264 _
\bw_
\bo_
\br_
\bd. e
\bex
\bxp
\bpo
\bor
\brt
\bt returns an exit status of 0 unless an invalid
4265 option is encountered, one of the _
\bn_
\ba_
\bm_
\be_
\bs is not a valid shell
4266 variable name, or -
\b-f
\bf is supplied with a _
\bn_
\ba_
\bm_
\be that is not a func-
4269 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]
4270 f
\bfc
\bc -
\b-s
\bs [_
\bp_
\ba_
\bt=_
\br_
\be_
\bp] [_
\bc_
\bm_
\bd]
4271 Fix Command. In the first form, a range of commands from _
\bf_
\bi_
\br_
\bs_
\bt
4272 to _
\bl_
\ba_
\bs_
\bt is selected from the history list. _
\bF_
\bi_
\br_
\bs_
\bt and _
\bl_
\ba_
\bs_
\bt may
4273 be specified as a string (to locate the last command beginning
4274 with that string) or as a number (an index into the history
4275 list, where a negative number is used as an offset from the cur-
4276 rent command number). If _
\bl_
\ba_
\bs_
\bt is not specified it is set to the
4277 current command for listing (so that ``fc -l -10'' prints the
4278 last 10 commands) and to _
\bf_
\bi_
\br_
\bs_
\bt otherwise. If _
\bf_
\bi_
\br_
\bs_
\bt is not spec-
4279 ified it is set to the previous command for editing and -16 for
4282 The -
\b-n
\bn option suppresses the command numbers when listing. The
4283 -
\b-r
\br option reverses the order of the commands. If the -
\b-l
\bl option
4284 is given, the commands are listed on standard output. Other-
4285 wise, the editor given by _
\be_
\bn_
\ba_
\bm_
\be is invoked on a file containing
4286 those commands. If _
\be_
\bn_
\ba_
\bm_
\be is not given, the value of the F
\bFC
\bCE
\bED
\bDI
\bIT
\bT
4287 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.
4288 If neither variable is set, _
\bv_
\bi is used. When editing is com-
4289 plete, the edited commands are echoed and executed.
4291 In the second form, _
\bc_
\bo_
\bm_
\bm_
\ba_
\bn_
\bd is re-executed after each instance
4292 of _
\bp_
\ba_
\bt is replaced by _
\br_
\be_
\bp. A useful alias to use with this is
4293 ``r="fc -s"'', so that typing ``r cc'' runs the last command
4294 beginning with ``cc'' and typing ``r'' re-executes the last com-
4297 If the first form is used, the return value is 0 unless an
4298 invalid option is encountered or _
\bf_
\bi_
\br_
\bs_
\bt or _
\bl_
\ba_
\bs_
\bt specify history
4299 lines out of range. If the -
\b-e
\be option is supplied, the return
4300 value is the value of the last command executed or failure if an
4301 error occurs with the temporary file of commands. If the second
4302 form is used, the return status is that of the command re-exe-
4303 cuted, unless _
\bc_
\bm_
\bd does not specify a valid history line, in
4304 which case f
\bfc
\bc returns failure.
4306 f
\bfg
\bg [_
\bj_
\bo_
\bb_
\bs_
\bp_
\be_
\bc]
4307 Resume _
\bj_
\bo_
\bb_
\bs_
\bp_
\be_
\bc in the foreground, and make it the current job.
4308 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
4309 is used. The return value is that of the command placed into
4310 the foreground, or failure if run when job control is disabled
4311 or, when run with job control enabled, if _
\bj_
\bo_
\bb_
\bs_
\bp_
\be_
\bc does not spec-
4312 ify a valid job or _
\bj_
\bo_
\bb_
\bs_
\bp_
\be_
\bc specifies a job that was started
4313 without job control.
4315 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]
4316 g
\bge
\bet
\bto
\bop
\bpt
\bts
\bs is used by shell procedures to parse positional parame-
4317 ters. _
\bo_
\bp_
\bt_
\bs_
\bt_
\br_
\bi_
\bn_
\bg contains the option characters to be recog-
4318 nized; if a character is followed by a colon, the option is
4319 expected to have an argument, which should be separated from it
4320 by white space. The colon and question mark characters may not
4321 be used as option characters. Each time it is invoked, g
\bge
\bet
\bto
\bop
\bpt
\bts
\bs
4322 places the next option in the shell variable _
\bn_
\ba_
\bm_
\be, initializing
4323 _
\bn_
\ba_
\bm_
\be if it does not exist, and the index of the next argument to
4324 be processed into the variable O
\bOP
\bPT
\bTI
\bIN
\bND
\bD. O
\bOP
\bPT
\bTI
\bIN
\bND
\bD is initialized to
4325 1 each time the shell or a shell script is invoked. When an
4326 option requires an argument, g
\bge
\bet
\bto
\bop
\bpt
\bts
\bs places that argument into
4327 the variable O
\bOP
\bPT
\bTA
\bAR
\bRG
\bG. The shell does not reset O
\bOP
\bPT
\bTI
\bIN
\bND
\bD automati-
4328 cally; it must be manually reset between multiple calls to
4329 g
\bge
\bet
\bto
\bop
\bpt
\bts
\bs within the same shell invocation if a new set of parame-
4332 When the end of options is encountered, g
\bge
\bet
\bto
\bop
\bpt
\bts
\bs exits with a
4333 return value greater than zero. O
\bOP
\bPT
\bTI
\bIN
\bND
\bD is set to the index of
4334 the first non-option argument, and _
\bn_
\ba_
\bm_
\be is set to ?.
4336 g
\bge
\bet
\bto
\bop
\bpt
\bts
\bs normally parses the positional parameters, but if more
4337 arguments are given in _
\ba_
\br_
\bg_
\bs, g
\bge
\bet
\bto
\bop
\bpt
\bts
\bs parses those instead.
4339 g
\bge
\bet
\bto
\bop
\bpt
\bts
\bs can report errors in two ways. If the first character
4340 of _
\bo_
\bp_
\bt_
\bs_
\bt_
\br_
\bi_
\bn_
\bg is a colon, _
\bs_
\bi_
\bl_
\be_
\bn_
\bt error reporting is used. In
4341 normal operation diagnostic messages are printed when invalid
4342 options or missing option arguments are encountered. If the
4343 variable O
\bOP
\bPT
\bTE
\bER
\bRR
\bR is set to 0, no error messages will be dis-
4344 played, even if the first character of _
\bo_
\bp_
\bt_
\bs_
\bt_
\br_
\bi_
\bn_
\bg is not a colon.
4346 If an invalid option is seen, g
\bge
\bet
\bto
\bop
\bpt
\bts
\bs places ? into _
\bn_
\ba_
\bm_
\be and, if
4347 not silent, prints an error message and unsets O
\bOP
\bPT
\bTA
\bAR
\bRG
\bG. If
4348 g
\bge
\bet
\bto
\bop
\bpt
\bts
\bs is silent, the option character found is placed in
4349 O
\bOP
\bPT
\bTA
\bAR
\bRG
\bG and no diagnostic message is printed.
4351 If a required argument is not found, and g
\bge
\bet
\bto
\bop
\bpt
\bts
\bs is not silent,
4352 a question mark (?
\b?) is placed in _
\bn_
\ba_
\bm_
\be, O
\bOP
\bPT
\bTA
\bAR
\bRG
\bG is unset, and a
4353 diagnostic message is printed. If g
\bge
\bet
\bto
\bop
\bpt
\bts
\bs is silent, then a
4354 colon (:
\b:) is placed in _
\bn_
\ba_
\bm_
\be and O
\bOP
\bPT
\bTA
\bAR
\bRG
\bG is set to the option
4357 g
\bge
\bet
\bto
\bop
\bpt
\bts
\bs returns true if an option, specified or unspecified, is
4358 found. It returns false if the end of options is encountered or
4361 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]
4362 Each time h
\bha
\bas
\bsh
\bh is invoked, the full pathname of the command _
\bn_
\ba_
\bm_
\be
4363 is determined by searching the directories in $
\b$P
\bPA
\bAT
\bTH
\bH and remem-
4364 bered. Any previously-remembered pathname is discarded. If the
4365 -
\b-p
\bp option is supplied, no path search is performed, and _
\bf_
\bi_
\bl_
\be_
\bn_
\ba_
\bm_
\be
4366 is used as the full file name of the command. The -
\b-r
\br option
4367 causes the shell to forget all remembered locations. The -
\b-d
\bd
4368 option causes the shell to forget the remembered location of
4369 each _
\bn_
\ba_
\bm_
\be. If the -
\b-t
\bt option is supplied, the full pathname to
4370 which each _
\bn_
\ba_
\bm_
\be corresponds is printed. If multiple _
\bn_
\ba_
\bm_
\be argu-
4371 ments are supplied with -
\b-t
\bt, the _
\bn_
\ba_
\bm_
\be is printed before the
4372 hashed full pathname. The -
\b-l
\bl option causes output to be dis-
4373 played in a format that may be reused as input. If no arguments
4374 are given, or if only -
\b-l
\bl is supplied, information about remem-
4375 bered commands is printed. The return status is true unless a
4376 _
\bn_
\ba_
\bm_
\be is not found or an invalid option is supplied.
4378 h
\bhe
\bel
\blp
\bp [-
\b-d
\bdm
\bms
\bs] [_
\bp_
\ba_
\bt_
\bt_
\be_
\br_
\bn]
4379 Display helpful information about builtin commands. If _
\bp_
\ba_
\bt_
\bt_
\be_
\br_
\bn
4380 is specified, h
\bhe
\bel
\blp
\bp gives detailed help on all commands matching
4381 _
\bp_
\ba_
\bt_
\bt_
\be_
\br_
\bn; otherwise help for all the builtins and shell control
4382 structures is printed.
4383 -
\b-d
\bd Display a short description of each _
\bp_
\ba_
\bt_
\bt_
\be_
\br_
\bn
4384 -
\b-m
\bm Display the description of each _
\bp_
\ba_
\bt_
\bt_
\be_
\br_
\bn in a manpage-like
4386 -
\b-s
\bs Display only a short usage synopsis for each _
\bp_
\ba_
\bt_
\bt_
\be_
\br_
\bn
4387 The return status is 0 unless no command matches _
\bp_
\ba_
\bt_
\bt_
\be_
\br_
\bn.
4389 h
\bhi
\bis
\bst
\bto
\bor
\bry
\by [
\b[_
\bn]
\b]
4390 h
\bhi
\bis
\bst
\bto
\bor
\bry
\by -
\b-c
\bc
4391 h
\bhi
\bis
\bst
\bto
\bor
\bry
\by -
\b-d
\bd _
\bo_
\bf_
\bf_
\bs_
\be_
\bt
4392 h
\bhi
\bis
\bst
\bto
\bor
\bry
\by -
\b-a
\ban
\bnr
\brw
\bw [_
\bf_
\bi_
\bl_
\be_
\bn_
\ba_
\bm_
\be]
4393 h
\bhi
\bis
\bst
\bto
\bor
\bry
\by -
\b-p
\bp _
\ba_
\br_
\bg [_
\ba_
\br_
\bg _
\b._
\b._
\b.]
4394 h
\bhi
\bis
\bst
\bto
\bor
\bry
\by -
\b-s
\bs _
\ba_
\br_
\bg [_
\ba_
\br_
\bg _
\b._
\b._
\b.]
4395 With no options, display the command history list with line num-
4396 bers. Lines listed with a *
\b* have been modified. An argument of
4397 _
\bn lists only the last _
\bn lines. If the shell variable H
\bHI
\bIS
\bST
\bTT
\bTI
\bIM
\bME
\bE-
\b-
4398 F
\bFO
\bOR
\bRM
\bMA
\bAT
\bT is set and not null, it is used as a format string for
4399 _
\bs_
\bt_
\br_
\bf_
\bt_
\bi_
\bm_
\be(3) to display the time stamp associated with each dis-
4400 played history entry. No intervening blank is printed between
4401 the formatted time stamp and the history line. If _
\bf_
\bi_
\bl_
\be_
\bn_
\ba_
\bm_
\be is
4402 supplied, it is used as the name of the history file; if not,
4403 the value of H
\bHI
\bIS
\bST
\bTF
\bFI
\bIL
\bLE
\bE is used. Options, if supplied, have the
4405 -
\b-c
\bc Clear the history list by deleting all the entries.
4406 -
\b-d
\bd _
\bo_
\bf_
\bf_
\bs_
\be_
\bt
4407 Delete the history entry at position _
\bo_
\bf_
\bf_
\bs_
\be_
\bt.
4408 -
\b-a
\ba Append the ``new'' history lines (history lines entered
4409 since the beginning of the current b
\bba
\bas
\bsh
\bh session) to the
4411 -
\b-n
\bn Read the history lines not already read from the history
4412 file into the current history list. These are lines
4413 appended to the history file since the beginning of the
4414 current b
\bba
\bas
\bsh
\bh session.
4415 -
\b-r
\br Read the contents of the history file and use them as the
4417 -
\b-w
\bw Write the current history to the history file, overwrit-
4418 ing the history file's contents.
4419 -
\b-p
\bp Perform history substitution on the following _
\ba_
\br_
\bg_
\bs and
4420 display the result on the standard output. Does not
4421 store the results in the history list. Each _
\ba_
\br_
\bg must be
4422 quoted to disable normal history expansion.
4423 -
\b-s
\bs Store the _
\ba_
\br_
\bg_
\bs in the history list as a single entry.
4424 The last command in the history list is removed before
4425 the _
\ba_
\br_
\bg_
\bs are added.
4427 If the H
\bHI
\bIS
\bST
\bTT
\bTI
\bIM
\bME
\bEF
\bFO
\bOR
\bRM
\bMA
\bAT
\bT variable is set, the time stamp informa-
4428 tion associated with each history entry is written to the his-
4429 tory file, marked with the history comment character. When the
4430 history file is read, lines beginning with the history comment
4431 character followed immediately by a digit are interpreted as
4432 timestamps for the previous history line. The return value is 0
4433 unless an invalid option is encountered, an error occurs while
4434 reading or writing the history file, an invalid _
\bo_
\bf_
\bf_
\bs_
\be_
\bt is sup-
4435 plied as an argument to -
\b-d
\bd, or the history expansion supplied as
4436 an argument to -
\b-p
\bp fails.
4438 j
\bjo
\bob
\bbs
\bs [-
\b-l
\bln
\bnp
\bpr
\brs
\bs] [ _
\bj_
\bo_
\bb_
\bs_
\bp_
\be_
\bc ... ]
4439 j
\bjo
\bob
\bbs
\bs -
\b-x
\bx _
\bc_
\bo_
\bm_
\bm_
\ba_
\bn_
\bd [ _
\ba_
\br_
\bg_
\bs ... ]
4440 The first form lists the active jobs. The options have the fol-
4442 -
\b-l
\bl List process IDs in addition to the normal information.
4443 -
\b-n
\bn Display information only about jobs that have changed
4444 status since the user was last notified of their status.
4445 -
\b-p
\bp List only the process ID of the job's process group
4447 -
\b-r
\br Restrict output to running jobs.
4448 -
\b-s
\bs Restrict output to stopped jobs.
4450 If _
\bj_
\bo_
\bb_
\bs_
\bp_
\be_
\bc is given, output is restricted to information about
4451 that job. The return status is 0 unless an invalid option is
4452 encountered or an invalid _
\bj_
\bo_
\bb_
\bs_
\bp_
\be_
\bc is supplied.
4454 If the -
\b-x
\bx option is supplied, j
\bjo
\bob
\bbs
\bs replaces any _
\bj_
\bo_
\bb_
\bs_
\bp_
\be_
\bc found in
4455 _
\bc_
\bo_
\bm_
\bm_
\ba_
\bn_
\bd or _
\ba_
\br_
\bg_
\bs with the corresponding process group ID, and
4456 executes _
\bc_
\bo_
\bm_
\bm_
\ba_
\bn_
\bd passing it _
\ba_
\br_
\bg_
\bs, returning its exit status.
4458 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] ...
4459 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]
4460 Send the signal named by _
\bs_
\bi_
\bg_
\bs_
\bp_
\be_
\bc or _
\bs_
\bi_
\bg_
\bn_
\bu_
\bm to the processes
4461 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
4462 signal name such as S
\bSI
\bIG
\bGK
\bKI
\bIL
\bLL
\bL (with or without the S
\bSI
\bIG
\bG prefix) or
4463 a signal number; _
\bs_
\bi_
\bg_
\bn_
\bu_
\bm is a signal number. If _
\bs_
\bi_
\bg_
\bs_
\bp_
\be_
\bc is not
4464 present, then S
\bSI
\bIG
\bGT
\bTE
\bER
\bRM
\bM is assumed. An argument of -
\b-l
\bl lists the
4465 signal names. If any arguments are supplied when -
\b-l
\bl is given,
4466 the names of the signals corresponding to the arguments are
4467 listed, and the return status is 0. The _
\be_
\bx_
\bi_
\bt_
\b__
\bs_
\bt_
\ba_
\bt_
\bu_
\bs argument to
4468 -
\b-l
\bl is a number specifying either a signal number or the exit
4469 status of a process terminated by a signal. k
\bki
\bil
\bll
\bl returns true
4470 if at least one signal was successfully sent, or false if an
4471 error occurs or an invalid option is encountered.
4473 l
\ble
\bet
\bt _
\ba_
\br_
\bg [_
\ba_
\br_
\bg ...]
4474 Each _
\ba_
\br_
\bg is an arithmetic expression to be evaluated (see A
\bAR
\bRI
\bIT
\bTH
\bH-
\b-
4475 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
4476 returns 1; 0 is returned otherwise.
4478 l
\blo
\boc
\bca
\bal
\bl [_
\bo_
\bp_
\bt_
\bi_
\bo_
\bn] [_
\bn_
\ba_
\bm_
\be[=_
\bv_
\ba_
\bl_
\bu_
\be] ...]
4479 For each argument, a local variable named _
\bn_
\ba_
\bm_
\be is created, and
4480 assigned _
\bv_
\ba_
\bl_
\bu_
\be. The _
\bo_
\bp_
\bt_
\bi_
\bo_
\bn can be any of the options accepted
4481 by d
\bde
\bec
\bcl
\bla
\bar
\bre
\be. When l
\blo
\boc
\bca
\bal
\bl is used within a function, it causes the
4482 variable _
\bn_
\ba_
\bm_
\be to have a visible scope restricted to that func-
4483 tion and its children. With no operands, l
\blo
\boc
\bca
\bal
\bl writes a list of
4484 local variables to the standard output. It is an error to use
4485 l
\blo
\boc
\bca
\bal
\bl when not within a function. The return status is 0 unless
4486 l
\blo
\boc
\bca
\bal
\bl is used outside a function, an invalid _
\bn_
\ba_
\bm_
\be is supplied,
4487 or _
\bn_
\ba_
\bm_
\be is a readonly variable.
4489 l
\blo
\bog
\bgo
\bou
\but
\bt Exit a login shell.
4491 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]
4492 [-
\b-c
\bc _
\bq_
\bu_
\ba_
\bn_
\bt_
\bu_
\bm] [_
\ba_
\br_
\br_
\ba_
\by]
4493 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]
4494 [-
\b-c
\bc _
\bq_
\bu_
\ba_
\bn_
\bt_
\bu_
\bm] [_
\ba_
\br_
\br_
\ba_
\by]
4495 Read lines from the standard input into the indexed array vari-
4496 able _
\ba_
\br_
\br_
\ba_
\by, or from file descriptor _
\bf_
\bd if the -
\b-u
\bu option is sup-
4497 plied. The variable M
\bMA
\bAP
\bPF
\bFI
\bIL
\bLE
\bE is the default _
\ba_
\br_
\br_
\ba_
\by. Options, if
4498 supplied, have the following meanings:
4499 -
\b-n
\bn Copy at most _
\bc_
\bo_
\bu_
\bn_
\bt lines. If _
\bc_
\bo_
\bu_
\bn_
\bt is 0, all lines are
4501 -
\b-O
\bO Begin assigning to _
\ba_
\br_
\br_
\ba_
\by at index _
\bo_
\br_
\bi_
\bg_
\bi_
\bn. The default
4503 -
\b-s
\bs Discard the first _
\bc_
\bo_
\bu_
\bn_
\bt lines read.
4504 -
\b-t
\bt Remove a trailing newline from each line read.
4505 -
\b-u
\bu Read lines from file descriptor _
\bf_
\bd instead of the stan-
4507 -
\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
4508 -
\b-c
\bc option specifies _
\bq_
\bu_
\ba_
\bn_
\bt_
\bu_
\bm.
4509 -
\b-c
\bc Specify the number of lines read between each call to
4510 _
\bc_
\ba_
\bl_
\bl_
\bb_
\ba_
\bc_
\bk.
4512 If -
\b-C
\bC is specified without -
\b-c
\bc, the default quantum is 5000.
4513 When _
\bc_
\ba_
\bl_
\bl_
\bb_
\ba_
\bc_
\bk is evaluated, it is supplied the index of the next
4514 array element to be assigned and the line to be assigned to that
4515 element as additional arguments. _
\bc_
\ba_
\bl_
\bl_
\bb_
\ba_
\bc_
\bk is evaluated after
4516 the line is read but before the array element is assigned.
4518 If not supplied with an explicit origin, m
\bma
\bap
\bpf
\bfi
\bil
\ble
\be will clear
4519 _
\ba_
\br_
\br_
\ba_
\by before assigning to it.
4521 m
\bma
\bap
\bpf
\bfi
\bil
\ble
\be returns successfully unless an invalid option or option
4522 argument is supplied, _
\ba_
\br_
\br_
\ba_
\by is invalid or unassignable, or if
4523 _
\ba_
\br_
\br_
\ba_
\by is not an indexed array.
4525 p
\bpo
\bop
\bpd
\bd [-n
\bn] [+_
\bn] [-_
\bn]
4526 Removes entries from the directory stack. With no arguments,
4527 removes the top directory from the stack, and performs a c
\bcd
\bd to
4528 the new top directory. Arguments, if supplied, have the follow-
4530 -
\b-n
\bn Suppresses the normal change of directory when removing
4531 directories from the stack, so that only the stack is
4533 +
\b+_
\bn Removes the _
\bnth entry counting from the left of the list
4534 shown by d
\bdi
\bir
\brs
\bs, starting with zero. For example: ``popd
4535 +0'' removes the first directory, ``popd +1'' the second.
4536 -
\b-_
\bn Removes the _
\bnth entry counting from the right of the list
4537 shown by d
\bdi
\bir
\brs
\bs, starting with zero. For example: ``popd
4538 -0'' removes the last directory, ``popd -1'' the next to
4541 If the p
\bpo
\bop
\bpd
\bd command is successful, a d
\bdi
\bir
\brs
\bs is performed as well,
4542 and the return status is 0. p
\bpo
\bop
\bpd
\bd returns false if an invalid
4543 option is encountered, the directory stack is empty, a non-exis-
4544 tent directory stack entry is specified, or the directory change
4547 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]
4548 Write the formatted _
\ba_
\br_
\bg_
\bu_
\bm_
\be_
\bn_
\bt_
\bs to the standard output under the
4549 control of the _
\bf_
\bo_
\br_
\bm_
\ba_
\bt. The -
\b-v
\bv option causes the output to be
4550 assigned to the variable _
\bv_
\ba_
\br rather than being printed to the
4553 The _
\bf_
\bo_
\br_
\bm_
\ba_
\bt is a character string which contains three types of
4554 objects: plain characters, which are simply copied to standard
4555 output, character escape sequences, which are converted and
4556 copied to the standard output, and format specifications, each
4557 of which causes printing of the next successive _
\ba_
\br_
\bg_
\bu_
\bm_
\be_
\bn_
\bt. In
4558 addition to the standard _
\bp_
\br_
\bi_
\bn_
\bt_
\bf(1) format specifications, p
\bpr
\bri
\bin
\bnt
\btf
\bf
4559 interprets the following extensions:
4560 %
\b%b
\bb causes p
\bpr
\bri
\bin
\bnt
\btf
\bf to expand backslash escape sequences in the
4561 corresponding _
\ba_
\br_
\bg_
\bu_
\bm_
\be_
\bn_
\bt (except that \
\b\c
\bc terminates output,
4562 backslashes in \
\b\'
\b', \
\b\"
\b", and \
\b\?
\b? are not removed, and octal
4563 escapes beginning with \
\b\0
\b0 may contain up to four digits).
4564 %
\b%q
\bq causes p
\bpr
\bri
\bin
\bnt
\btf
\bf to output the corresponding _
\ba_
\br_
\bg_
\bu_
\bm_
\be_
\bn_
\bt in a
4565 format that can be reused as shell input.
4566 %
\b%(
\b(_
\bd_
\ba_
\bt_
\be_
\bf_
\bm_
\bt)
\b)T
\bT
4567 causes p
\bpr
\bri
\bin
\bnt
\btf
\bf to output the date-time string resulting
4568 from using _
\bd_
\ba_
\bt_
\be_
\bf_
\bm_
\bt as a format string for _
\bs_
\bt_
\br_
\bf_
\bt_
\bi_
\bm_
\be(3).
4569 The corresponding _
\ba_
\br_
\bg_
\bu_
\bm_
\be_
\bn_
\bt is an integer representing the
4570 number of seconds since the epoch. Two special argument
4571 values may be used: -1 represents the current time, and
4572 -2 represents the time the shell was invoked.
4574 Arguments to non-string format specifiers are treated as C con-
4575 stants, except that a leading plus or minus sign is allowed, and
4576 if the leading character is a single or double quote, the value
4577 is the ASCII value of the following character.
4579 The _
\bf_
\bo_
\br_
\bm_
\ba_
\bt is reused as necessary to consume all of the _
\ba_
\br_
\bg_
\bu_
\b-
4580 _
\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,
4581 the extra format specifications behave as if a zero value or
4582 null string, as appropriate, had been supplied. The return
4583 value is zero on success, non-zero on failure.
4585 p
\bpu
\bus
\bsh
\bhd
\bd [-
\b-n
\bn] [+_
\bn] [-_
\bn]
4586 p
\bpu
\bus
\bsh
\bhd
\bd [-
\b-n
\bn] [_
\bd_
\bi_
\br]
4587 Adds a directory to the top of the directory stack, or rotates
4588 the stack, making the new top of the stack the current working
4589 directory. With no arguments, exchanges the top two directories
4590 and returns 0, unless the directory stack is empty. Arguments,
4591 if supplied, have the following meanings:
4592 -
\b-n
\bn Suppresses the normal change of directory when adding
4593 directories to the stack, so that only the stack is
4595 +
\b+_
\bn Rotates the stack so that the _
\bnth directory (counting
4596 from the left of the list shown by d
\bdi
\bir
\brs
\bs, starting with
4597 zero) is at the top.
4598 -
\b-_
\bn Rotates the stack so that the _
\bnth directory (counting
4599 from the right of the list shown by d
\bdi
\bir
\brs
\bs, starting with
4600 zero) is at the top.
4601 _
\bd_
\bi_
\br Adds _
\bd_
\bi_
\br to the directory stack at the top, making it the
4602 new current working directory.
4604 If the p
\bpu
\bus
\bsh
\bhd
\bd command is successful, a d
\bdi
\bir
\brs
\bs is performed as well.
4605 If the first form is used, p
\bpu
\bus
\bsh
\bhd
\bd returns 0 unless the cd to _
\bd_
\bi_
\br
4606 fails. With the second form, p
\bpu
\bus
\bsh
\bhd
\bd returns 0 unless the direc-
4607 tory stack is empty, a non-existent directory stack element is
4608 specified, or the directory change to the specified new current
4611 p
\bpw
\bwd
\bd [-
\b-L
\bLP
\bP]
4612 Print the absolute pathname of the current working directory.
4613 The pathname printed contains no symbolic links if the -
\b-P
\bP option
4614 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
4615 is enabled. If the -
\b-L
\bL option is used, the pathname printed may
4616 contain symbolic links. The return status is 0 unless an error
4617 occurs while reading the name of the current directory or an
4618 invalid option is supplied.
4620 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
4621 _
\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 ...]
4622 One line is read from the standard input, or from the file
4623 descriptor _
\bf_
\bd supplied as an argument to the -
\b-u
\bu option, and the
4624 first word is assigned to the first _
\bn_
\ba_
\bm_
\be, the second word to the
4625 second _
\bn_
\ba_
\bm_
\be, and so on, with leftover words and their interven-
4626 ing separators assigned to the last _
\bn_
\ba_
\bm_
\be. If there are fewer
4627 words read from the input stream than names, the remaining names
4628 are assigned empty values. The characters in I
\bIF
\bFS
\bS are used to
4629 split the line into words. The backslash character (\
\b\) may be
4630 used to remove any special meaning for the next character read
4631 and for line continuation. Options, if supplied, have the fol-
4633 -
\b-a
\ba _
\ba_
\bn_
\ba_
\bm_
\be
4634 The words are assigned to sequential indices of the array
4635 variable _
\ba_
\bn_
\ba_
\bm_
\be, starting at 0. _
\ba_
\bn_
\ba_
\bm_
\be is unset before any
4636 new values are assigned. Other _
\bn_
\ba_
\bm_
\be arguments are
4638 -
\b-d
\bd _
\bd_
\be_
\bl_
\bi_
\bm
4639 The first character of _
\bd_
\be_
\bl_
\bi_
\bm is used to terminate the
4640 input line, rather than newline.
4641 -
\b-e
\be If the standard input is coming from a terminal, r
\bre
\bea
\bad
\bdl
\bli
\bin
\bne
\be
4642 (see R
\bRE
\bEA
\bAD
\bDL
\bLI
\bIN
\bNE
\bE above) is used to obtain the line. Read-
4643 line uses the current (or default, if line editing was
4644 not previously active) editing settings.
4645 -
\b-i
\bi _
\bt_
\be_
\bx_
\bt
4646 If r
\bre
\bea
\bad
\bdl
\bli
\bin
\bne
\be is being used to read the line, _
\bt_
\be_
\bx_
\bt is
4647 placed into the editing buffer before editing begins.
4648 -
\b-n
\bn _
\bn_
\bc_
\bh_
\ba_
\br_
\bs
4649 r
\bre
\bea
\bad
\bd returns after reading _
\bn_
\bc_
\bh_
\ba_
\br_
\bs characters rather than
4650 waiting for a complete line of input, but honor a delim-
4651 iter if fewer than _
\bn_
\bc_
\bh_
\ba_
\br_
\bs characters are read before the
4653 -
\b-N
\bN _
\bn_
\bc_
\bh_
\ba_
\br_
\bs
4654 r
\bre
\bea
\bad
\bd returns after reading exactly _
\bn_
\bc_
\bh_
\ba_
\br_
\bs characters
4655 rather than waiting for a complete line of input, unless
4656 EOF is encountered or r
\bre
\bea
\bad
\bd times out. Delimiter charac-
4657 ters encountered in the input are not treated specially
4658 and do not cause r
\bre
\bea
\bad
\bd to return until _
\bn_
\bc_
\bh_
\ba_
\br_
\bs characters
4660 -
\b-p
\bp _
\bp_
\br_
\bo_
\bm_
\bp_
\bt
4661 Display _
\bp_
\br_
\bo_
\bm_
\bp_
\bt on standard error, without a trailing new-
4662 line, before attempting to read any input. The prompt is
4663 displayed only if input is coming from a terminal.
4664 -
\b-r
\br Backslash does not act as an escape character. The back-
4665 slash is considered to be part of the line. In particu-
4666 lar, a backslash-newline pair may not be used as a line
4668 -
\b-s
\bs Silent mode. If input is coming from a terminal, charac-
4669 ters are not echoed.
4670 -
\b-t
\bt _
\bt_
\bi_
\bm_
\be_
\bo_
\bu_
\bt
4671 Cause r
\bre
\bea
\bad
\bd to time out and return failure if a complete
4672 line of input is not read within _
\bt_
\bi_
\bm_
\be_
\bo_
\bu_
\bt seconds. _
\bt_
\bi_
\bm_
\be_
\b-
4673 _
\bo_
\bu_
\bt may be a decimal number with a fractional portion
4674 following the decimal point. This option is only effec-
4675 tive if r
\bre
\bea
\bad
\bd is reading input from a terminal, pipe, or
4676 other special file; it has no effect when reading from
4677 regular files. If _
\bt_
\bi_
\bm_
\be_
\bo_
\bu_
\bt is 0, r
\bre
\bea
\bad
\bd returns success if
4678 input is available on the specified file descriptor,
4679 failure otherwise. The exit status is greater than 128
4680 if the timeout is exceeded.
4681 -
\b-u
\bu _
\bf_
\bd Read input from file descriptor _
\bf_
\bd.
4683 If no _
\bn_
\ba_
\bm_
\be_
\bs are supplied, the line read is assigned to the vari-
4684 able R
\bRE
\bEP
\bPL
\bLY
\bY. The return code is zero, unless end-of-file is
4685 encountered, r
\bre
\bea
\bad
\bd times out (in which case the return code is
4686 greater than 128), or an invalid file descriptor is supplied as
4687 the argument to -
\b-u
\bu.
4689 r
\bre
\bea
\bad
\bdo
\bon
\bnl
\bly
\by [-
\b-a
\baA
\bAp
\bpf
\bf] [_
\bn_
\ba_
\bm_
\be[=_
\bw_
\bo_
\br_
\bd] ...]
4690 The given _
\bn_
\ba_
\bm_
\be_
\bs are marked readonly; the values of these _
\bn_
\ba_
\bm_
\be_
\bs
4691 may not be changed by subsequent assignment. If the -
\b-f
\bf option
4692 is supplied, the functions corresponding to the _
\bn_
\ba_
\bm_
\be_
\bs are so
4693 marked. The -
\b-a
\ba option restricts the variables to indexed
4694 arrays; the -
\b-A
\bA option restricts the variables to associative
4695 arrays. If no _
\bn_
\ba_
\bm_
\be arguments are given, or if the -
\b-p
\bp option is
4696 supplied, a list of all readonly names is printed. The -
\b-p
\bp
4697 option causes output to be displayed in a format that may be
4698 reused as input. If a variable name is followed by =_
\bw_
\bo_
\br_
\bd, the
4699 value of the variable is set to _
\bw_
\bo_
\br_
\bd. The return status is 0
4700 unless an invalid option is encountered, one of the _
\bn_
\ba_
\bm_
\be_
\bs is not
4701 a valid shell variable name, or -
\b-f
\bf is supplied with a _
\bn_
\ba_
\bm_
\be that
4704 r
\bre
\bet
\btu
\bur
\brn
\bn [_
\bn]
4705 Causes a function to exit with the return value specified by _
\bn.
4706 If _
\bn is omitted, the return status is that of the last command
4707 executed in the function body. If used outside a function, but
4708 during execution of a script by the .
\b. (s
\bso
\bou
\bur
\brc
\bce
\be) command, it
4709 causes the shell to stop executing that script and return either
4710 _
\bn or the exit status of the last command executed within the
4711 script as the exit status of the script. If used outside a
4712 function and not during execution of a script by .
\b., the return
4713 status is false. Any command associated with the R
\bRE
\bET
\bTU
\bUR
\bRN
\bN trap is
4714 executed before execution resumes after the function or script.
4716 s
\bse
\bet
\bt [-
\b--
\b-a
\bab
\bbe
\bef
\bfh
\bhk
\bkm
\bmn
\bnp
\bpt
\btu
\buv
\bvx
\bxB
\bBC
\bCE
\bEH
\bHP
\bPT
\bT] [-
\b-o
\bo _
\bo_
\bp_
\bt_
\bi_
\bo_
\bn_
\b-_
\bn_
\ba_
\bm_
\be] [_
\ba_
\br_
\bg ...]
4717 s
\bse
\bet
\bt [+
\b+a
\bab
\bbe
\bef
\bfh
\bhk
\bkm
\bmn
\bnp
\bpt
\btu
\buv
\bvx
\bxB
\bBC
\bCE
\bEH
\bHP
\bPT
\bT] [+
\b+o
\bo _
\bo_
\bp_
\bt_
\bi_
\bo_
\bn_
\b-_
\bn_
\ba_
\bm_
\be] [_
\ba_
\br_
\bg ...]
4718 Without options, the name and value of each shell variable are
4719 displayed in a format that can be reused as input for setting or
4720 resetting the currently-set variables. Read-only variables can-
4721 not be reset. In _
\bp_
\bo_
\bs_
\bi_
\bx _
\bm_
\bo_
\bd_
\be, only shell variables are listed.
4722 The output is sorted according to the current locale. When
4723 options are specified, they set or unset shell attributes. Any
4724 arguments remaining after option processing are treated as val-
4725 ues for the positional parameters and are assigned, in order, to
4726 $
\b$1
\b1, $
\b$2
\b2, .
\b..
\b..
\b. $
\b$_
\bn. Options, if specified, have the following
4728 -
\b-a
\ba Automatically mark variables and functions which are
4729 modified or created for export to the environment of
4730 subsequent commands.
4731 -
\b-b
\bb Report the status of terminated background jobs immedi-
4732 ately, rather than before the next primary prompt. This
4733 is effective only when job control is enabled.
4734 -
\b-e
\be Exit immediately if a _
\bp_
\bi_
\bp_
\be_
\bl_
\bi_
\bn_
\be (which may consist of a
4735 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
4736 parentheses, or one of the commands executed as part of
4737 a command list enclosed by braces (see S
\bSH
\bHE
\bEL
\bLL
\bL G
\bGR
\bRA
\bAM
\bMM
\bMA
\bAR
\bR
4738 above) exits with a non-zero status. The shell does not
4739 exit if the command that fails is part of the command
4740 list immediately following a w
\bwh
\bhi
\bil
\ble
\be or u
\bun
\bnt
\bti
\bil
\bl keyword,
4741 part of the test following the i
\bif
\bf or e
\bel
\bli
\bif
\bf reserved
4742 words, part of any command executed in a &
\b&&
\b& or |
\b||
\b| list
4743 except the command following the final &
\b&&
\b& or |
\b||
\b|, any
4744 command in a pipeline but the last, or if the command's
4745 return value is being inverted with !
\b!. A trap on E
\bER
\bRR
\bR,
4746 if set, is executed before the shell exits. This option
4747 applies to the shell environment and each subshell envi-
4748 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
4749 above), and may cause subshells to exit before executing
4750 all the commands in the subshell.
4751 -
\b-f
\bf Disable pathname expansion.
4752 -
\b-h
\bh Remember the location of commands as they are looked up
4753 for execution. This is enabled by default.
4754 -
\b-k
\bk All arguments in the form of assignment statements are
4755 placed in the environment for a command, not just those
4756 that precede the command name.
4757 -
\b-m
\bm Monitor mode. Job control is enabled. This option is
4758 on by default for interactive shells on systems that
4759 support it (see J
\bJO
\bOB
\bB C
\bCO
\bON
\bNT
\bTR
\bRO
\bOL
\bL above). Background pro-
4760 cesses run in a separate process group and a line con-
4761 taining their exit status is printed upon their comple-
4763 -
\b-n
\bn Read commands but do not execute them. This may be used
4764 to check a shell script for syntax errors. This is
4765 ignored by interactive shells.
4766 -
\b-o
\bo _
\bo_
\bp_
\bt_
\bi_
\bo_
\bn_
\b-_
\bn_
\ba_
\bm_
\be
4767 The _
\bo_
\bp_
\bt_
\bi_
\bo_
\bn_
\b-_
\bn_
\ba_
\bm_
\be can be one of the following:
4768 a
\bal
\bll
\ble
\bex
\bxp
\bpo
\bor
\brt
\bt
4770 b
\bbr
\bra
\bac
\bce
\bee
\bex
\bxp
\bpa
\ban
\bnd
\bd
4772 e
\bem
\bma
\bac
\bcs
\bs Use an emacs-style command line editing inter-
4773 face. This is enabled by default when the shell
4774 is interactive, unless the shell is started with
4775 the -
\b--
\b-n
\bno
\boe
\bed
\bdi
\bit
\bti
\bin
\bng
\bg option. This also affects the
4776 editing interface used for r
\bre
\bea
\bad
\bd -
\b-e
\be.
4777 e
\ber
\brr
\bre
\bex
\bxi
\bit
\bt Same as -
\b-e
\be.
4778 e
\ber
\brr
\brt
\btr
\bra
\bac
\bce
\be
4780 f
\bfu
\bun
\bnc
\bct
\btr
\bra
\bac
\bce
\be
4782 h
\bha
\bas
\bsh
\bha
\bal
\bll
\bl Same as -
\b-h
\bh.
4783 h
\bhi
\bis
\bst
\bte
\bex
\bxp
\bpa
\ban
\bnd
\bd
4785 h
\bhi
\bis
\bst
\bto
\bor
\bry
\by Enable command history, as described above under
4786 H
\bHI
\bIS
\bST
\bTO
\bOR
\bRY
\bY. This option is on by default in inter-
4788 i
\big
\bgn
\bno
\bor
\bre
\bee
\beo
\bof
\bf
4789 The effect is as if the shell command
4790 ``IGNOREEOF=10'' had been executed (see S
\bSh
\bhe
\bel
\bll
\bl
4791 V
\bVa
\bar
\bri
\bia
\bab
\bbl
\ble
\bes
\bs above).
4792 k
\bke
\bey
\byw
\bwo
\bor
\brd
\bd Same as -
\b-k
\bk.
4793 m
\bmo
\bon
\bni
\bit
\bto
\bor
\br Same as -
\b-m
\bm.
4794 n
\bno
\boc
\bcl
\blo
\bob
\bbb
\bbe
\ber
\br
4796 n
\bno
\boe
\bex
\bxe
\bec
\bc Same as -
\b-n
\bn.
4797 n
\bno
\bog
\bgl
\blo
\bob
\bb Same as -
\b-f
\bf.
4798 n
\bno
\bol
\blo
\bog
\bg Currently ignored.
4799 n
\bno
\bot
\bti
\bif
\bfy
\by Same as -
\b-b
\bb.
4800 n
\bno
\bou
\bun
\bns
\bse
\bet
\bt Same as -
\b-u
\bu.
4801 o
\bon
\bne
\bec
\bcm
\bmd
\bd Same as -
\b-t
\bt.
4802 p
\bph
\bhy
\bys
\bsi
\bic
\bca
\bal
\bl
4804 p
\bpi
\bip
\bpe
\bef
\bfa
\bai
\bil
\bl
4805 If set, the return value of a pipeline is the
4806 value of the last (rightmost) command to exit
4807 with a non-zero status, or zero if all commands
4808 in the pipeline exit successfully. This option
4809 is disabled by default.
4810 p
\bpo
\bos
\bsi
\bix
\bx Change the behavior of b
\bba
\bas
\bsh
\bh where the default
4811 operation differs from the POSIX standard to
4812 match the standard (_
\bp_
\bo_
\bs_
\bi_
\bx _
\bm_
\bo_
\bd_
\be).
4813 p
\bpr
\bri
\biv
\bvi
\bil
\ble
\beg
\bge
\bed
\bd
4815 v
\bve
\ber
\brb
\bbo
\bos
\bse
\be Same as -
\b-v
\bv.
4816 v
\bvi
\bi Use a vi-style command line editing interface.
4817 This also affects the editing interface used for
4818 r
\bre
\bea
\bad
\bd -
\b-e
\be.
4819 x
\bxt
\btr
\bra
\bac
\bce
\be Same as -
\b-x
\bx.
4820 If -
\b-o
\bo is supplied with no _
\bo_
\bp_
\bt_
\bi_
\bo_
\bn_
\b-_
\bn_
\ba_
\bm_
\be, the values of the
4821 current options are printed. If +
\b+o
\bo is supplied with no
4822 _
\bo_
\bp_
\bt_
\bi_
\bo_
\bn_
\b-_
\bn_
\ba_
\bm_
\be, a series of s
\bse
\bet
\bt commands to recreate the
4823 current option settings is displayed on the standard
4825 -
\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
4826 $
\b$B
\bBA
\bAS
\bSH
\bH_
\b_E
\bEN
\bNV
\bV files are not processed, shell functions are
4827 not inherited from the environment, and the S
\bSH
\bHE
\bEL
\bLL
\bLO
\bOP
\bPT
\bTS
\bS,
4828 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
4829 appear in the environment, are ignored. If the shell is
4830 started with the effective user (group) id not equal to
4831 the real user (group) id, and the -
\b-p
\bp option is not sup-
4832 plied, these actions are taken and the effective user id
4833 is set to the real user id. If the -
\b-p
\bp option is sup-
4834 plied at startup, the effective user id is not reset.
4835 Turning this option off causes the effective user and
4836 group ids to be set to the real user and group ids.
4837 -
\b-t
\bt Exit after reading and executing one command.
4838 -
\b-u
\bu Treat unset variables and parameters other than the spe-
4839 cial parameters "@" and "*" as an error when performing
4840 parameter expansion. If expansion is attempted on an
4841 unset variable or parameter, the shell prints an error
4842 message, and, if not interactive, exits with a non-zero
4844 -
\b-v
\bv Print shell input lines as they are read.
4845 -
\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
4846 command, s
\bse
\bel
\ble
\bec
\bct
\bt command, or arithmetic f
\bfo
\bor
\br command, dis-
4847 play the expanded value of P
\bPS
\bS4
\b4, followed by the command
4848 and its expanded arguments or associated word list.
4849 -
\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
4850 above). This is on by default.
4851 -
\b-C
\bC If set, b
\bba
\bas
\bsh
\bh does not overwrite an existing file with
4852 the >
\b>, >
\b>&
\b&, and <
\b<>
\b> redirection operators. This may be
4853 overridden when creating output files by using the redi-
4854 rection operator >
\b>|
\b| instead of >
\b>.
4855 -
\b-E
\bE If set, any trap on E
\bER
\bRR
\bR is inherited by shell functions,
4856 command substitutions, and commands executed in a sub-
4857 shell environment. The E
\bER
\bRR
\bR trap is normally not inher-
4859 -
\b-H
\bH Enable !
\b! style history substitution. This option is on
4860 by default when the shell is interactive.
4861 -
\b-P
\bP If set, the shell does not follow symbolic links when
4862 executing commands such as c
\bcd
\bd that change the current
4863 working directory. It uses the physical directory
4864 structure instead. By default, b
\bba
\bas
\bsh
\bh follows the logical
4865 chain of directories when performing commands which
4866 change the current directory.
4867 -
\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
4868 shell functions, command substitutions, and commands
4869 executed in a subshell environment. The D
\bDE
\bEB
\bBU
\bUG
\bG and
4870 R
\bRE
\bET
\bTU
\bUR
\bRN
\bN traps are normally not inherited in such cases.
4871 -
\b--
\b- If no arguments follow this option, then the positional
4872 parameters are unset. Otherwise, the positional parame-
4873 ters are set to the _
\ba_
\br_
\bgs, even if some of them begin
4875 -
\b- Signal the end of options, cause all remaining _
\ba_
\br_
\bgs to
4876 be assigned to the positional parameters. The -
\b-x
\bx and -
\b-v
\bv
4877 options are turned off. If there are no _
\ba_
\br_
\bgs, the posi-
4878 tional parameters remain unchanged.
4880 The options are off by default unless otherwise noted. Using +
4881 rather than - causes these options to be turned off. The
4882 options can also be specified as arguments to an invocation of
4883 the shell. The current set of options may be found in $
\b$-
\b-. The
4884 return status is always true unless an invalid option is encoun-
4887 s
\bsh
\bhi
\bif
\bft
\bt [_
\bn]
4888 The positional parameters from _
\bn+1 ... are renamed to $
\b$1
\b1 .
\b..
\b..
\b..
\b.
4889 Parameters represented by the numbers $
\b$#
\b# down to $
\b$#
\b#-_
\bn+1 are
4890 unset. _
\bn must be a non-negative number less than or equal to
4891 $
\b$#
\b#. If _
\bn is 0, no parameters are changed. If _
\bn is not given,
4892 it is assumed to be 1. If _
\bn is greater than $
\b$#
\b#, the positional
4893 parameters are not changed. The return status is greater than
4894 zero if _
\bn is greater than $
\b$#
\b# or less than zero; otherwise 0.
4896 s
\bsh
\bho
\bop
\bpt
\bt [-
\b-p
\bpq
\bqs
\bsu
\bu] [-
\b-o
\bo] [_
\bo_
\bp_
\bt_
\bn_
\ba_
\bm_
\be ...]
4897 Toggle the values of variables controlling optional shell behav-
4898 ior. With no options, or with the -
\b-p
\bp option, a list of all set-
4899 table options is displayed, with an indication of whether or not
4900 each is set. The -
\b-p
\bp option causes output to be displayed in a
4901 form that may be reused as input. Other options have the fol-
4903 -
\b-s
\bs Enable (set) each _
\bo_
\bp_
\bt_
\bn_
\ba_
\bm_
\be.
4904 -
\b-u
\bu Disable (unset) each _
\bo_
\bp_
\bt_
\bn_
\ba_
\bm_
\be.
4905 -
\b-q
\bq Suppresses normal output (quiet mode); the return status
4906 indicates whether the _
\bo_
\bp_
\bt_
\bn_
\ba_
\bm_
\be is set or unset. If multi-
4907 ple _
\bo_
\bp_
\bt_
\bn_
\ba_
\bm_
\be arguments are given with -
\b-q
\bq, the return sta-
4908 tus is zero if all _
\bo_
\bp_
\bt_
\bn_
\ba_
\bm_
\be_
\bs are enabled; non-zero other-
4910 -
\b-o
\bo Restricts the values of _
\bo_
\bp_
\bt_
\bn_
\ba_
\bm_
\be to be those defined for
4911 the -
\b-o
\bo option to the s
\bse
\bet
\bt builtin.
4913 If either -
\b-s
\bs or -
\b-u
\bu is used with no _
\bo_
\bp_
\bt_
\bn_
\ba_
\bm_
\be arguments, the dis-
4914 play is limited to those options which are set or unset, respec-
4915 tively. Unless otherwise noted, the s
\bsh
\bho
\bop
\bpt
\bt options are disabled
4918 The return status when listing options is zero if all _
\bo_
\bp_
\bt_
\bn_
\ba_
\bm_
\be_
\bs
4919 are enabled, non-zero otherwise. When setting or unsetting
4920 options, the return status is zero unless an _
\bo_
\bp_
\bt_
\bn_
\ba_
\bm_
\be is not a
4923 The list of s
\bsh
\bho
\bop
\bpt
\bt options is:
4925 a
\bau
\but
\bto
\boc
\bcd
\bd If set, a command name that is the name of a directory
4926 is executed as if it were the argument to the c
\bcd
\bd com-
4927 mand. This option is only used by interactive shells.
4928 c
\bcd
\bda
\bab
\bbl
\ble
\be_
\b_v
\bva
\bar
\brs
\bs
4929 If set, an argument to the c
\bcd
\bd builtin command that is
4930 not a directory is assumed to be the name of a variable
4931 whose value is the directory to change to.
4932 c
\bcd
\bds
\bsp
\bpe
\bel
\bll
\bl If set, minor errors in the spelling of a directory com-
4933 ponent in a c
\bcd
\bd command will be corrected. The errors
4934 checked for are transposed characters, a missing charac-
4935 ter, and one character too many. If a correction is
4936 found, the corrected file name is printed, and the com-
4937 mand proceeds. This option is only used by interactive
4939 c
\bch
\bhe
\bec
\bck
\bkh
\bha
\bas
\bsh
\bh
4940 If set, b
\bba
\bas
\bsh
\bh checks that a command found in the hash ta-
4941 ble exists before trying to execute it. If a hashed
4942 command no longer exists, a normal path search is per-
4944 c
\bch
\bhe
\bec
\bck
\bkj
\bjo
\bob
\bbs
\bs
4945 If set, b
\bba
\bas
\bsh
\bh lists the status of any stopped and running
4946 jobs before exiting an interactive shell. If any jobs
4947 are running, this causes the exit to be deferred until a
4948 second exit is attempted without an intervening command
4949 (see J
\bJO
\bOB
\bB C
\bCO
\bON
\bNT
\bTR
\bRO
\bOL
\bL above). The shell always postpones
4950 exiting if any jobs are stopped.
4951 c
\bch
\bhe
\bec
\bck
\bkw
\bwi
\bin
\bns
\bsi
\biz
\bze
\be
4952 If set, b
\bba
\bas
\bsh
\bh checks the window size after each command
4953 and, if necessary, updates the values of L
\bLI
\bIN
\bNE
\bES
\bS and C
\bCO
\bOL
\bL-
\b-
4955 c
\bcm
\bmd
\bdh
\bhi
\bis
\bst
\bt If set, b
\bba
\bas
\bsh
\bh attempts to save all lines of a multiple-
4956 line command in the same history entry. This allows
4957 easy re-editing of multi-line commands.
4958 c
\bco
\bom
\bmp
\bpa
\bat
\bt3
\b31
\b1
4959 If set, b
\bba
\bas
\bsh
\bh changes its behavior to that of version 3.1
4960 with respect to quoted arguments to the [
\b[[
\b[ conditional
4961 command's =
\b=~
\b~ operator.
4962 c
\bco
\bom
\bmp
\bpa
\bat
\bt3
\b32
\b2
4963 If set, b
\bba
\bas
\bsh
\bh changes its behavior to that of version 3.2
4964 with respect to locale-specific string comparison when
4965 using the [
\b[[
\b[ conditional command's <
\b< and >
\b> operators.
4966 Bash versions prior to bash-4.1 use ASCII collation and
4967 _
\bs_
\bt_
\br_
\bc_
\bm_
\bp(3); bash-4.1 and later use the current locale's
4968 collation sequence and _
\bs_
\bt_
\br_
\bc_
\bo_
\bl_
\bl(3).
4969 c
\bco
\bom
\bmp
\bpa
\bat
\bt4
\b40
\b0
4970 If set, b
\bba
\bas
\bsh
\bh changes its behavior to that of version 4.0
4971 with respect to locale-specific string comparison when
4972 using the [
\b[[
\b[ conditional command's <
\b< and >
\b> operators
4973 (see previous item) and the effect of interrupting a
4975 c
\bco
\bom
\bmp
\bpa
\bat
\bt4
\b41
\b1
4976 @item compat41 If set, b
\bba
\bas
\bsh
\bh, when in posix mode, treats
4977 a single quote in a double-quoted parameter expansion as
4978 a special character. The single quotes must match (an
4979 even number) and the characters between the single
4980 quotes are considered quoted. This is the behavior of
4981 posix mode through version 4.1. The default bash behav-
4982 ior remains as in previous versions.
4983 d
\bdi
\bir
\brs
\bsp
\bpe
\bel
\bll
\bl
4984 If set, b
\bba
\bas
\bsh
\bh attempts spelling correction on directory
4985 names during word completion if the directory name ini-
4986 tially supplied does not exist.
4987 d
\bdo
\bot
\btg
\bgl
\blo
\bob
\bb If set, b
\bba
\bas
\bsh
\bh includes filenames beginning with a `.' in
4988 the results of pathname expansion.
4989 e
\bex
\bxe
\bec
\bcf
\bfa
\bai
\bil
\bl
4990 If set, a non-interactive shell will not exit if it can-
4991 not execute the file specified as an argument to the
4992 e
\bex
\bxe
\bec
\bc builtin command. An interactive shell does not
4993 exit if e
\bex
\bxe
\bec
\bc fails.
4994 e
\bex
\bxp
\bpa
\ban
\bnd
\bd_
\b_a
\bal
\bli
\bia
\bas
\bse
\bes
\bs
4995 If set, aliases are expanded as described above under
4996 A
\bAL
\bLI
\bIA
\bAS
\bSE
\bES
\bS. This option is enabled by default for interac-
4998 e
\bex
\bxt
\btd
\bde
\beb
\bbu
\bug
\bg
4999 If set, behavior intended for use by debuggers is
5001 1
\b1.
\b. The -
\b-F
\bF option to the d
\bde
\bec
\bcl
\bla
\bar
\bre
\be builtin displays the
5002 source file name and line number corresponding to
5003 each function name supplied as an argument.
5004 2
\b2.
\b. If the command run by the D
\bDE
\bEB
\bBU
\bUG
\bG trap returns a
5005 non-zero value, the next command is skipped and
5007 3
\b3.
\b. If the command run by the D
\bDE
\bEB
\bBU
\bUG
\bG trap returns a
5008 value of 2, and the shell is executing in a sub-
5009 routine (a shell function or a shell script exe-
5010 cuted by the .
\b. or s
\bso
\bou
\bur
\brc
\bce
\be builtins), a call to
5011 r
\bre
\bet
\btu
\bur
\brn
\bn is simulated.
5012 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
5013 in their descriptions above.
5014 5
\b5.
\b. Function tracing is enabled: command substitu-
5015 tion, shell functions, and subshells invoked with
5016 (
\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.
5017 6
\b6.
\b. Error tracing is enabled: command substitution,
5018 shell functions, and subshells invoked with (
\b(
5019 _
\bc_
\bo_
\bm_
\bm_
\ba_
\bn_
\bd )
\b) inherit the E
\bER
\bRR
\bR trap.
5020 e
\bex
\bxt
\btg
\bgl
\blo
\bob
\bb If set, the extended pattern matching features described
5021 above under P
\bPa
\bat
\bth
\bhn
\bna
\bam
\bme
\be E
\bEx
\bxp
\bpa
\ban
\bns
\bsi
\bio
\bon
\bn are enabled.
5022 e
\bex
\bxt
\btq
\bqu
\buo
\bot
\bte
\be
5023 If set, $
\b$'_
\bs_
\bt_
\br_
\bi_
\bn_
\bg' and $
\b$"_
\bs_
\bt_
\br_
\bi_
\bn_
\bg" quoting is performed
5024 within $
\b${
\b{_
\bp_
\ba_
\br_
\ba_
\bm_
\be_
\bt_
\be_
\br}
\b} expansions enclosed in double
5025 quotes. This option is enabled by default.
5026 f
\bfa
\bai
\bil
\blg
\bgl
\blo
\bob
\bb
5027 If set, patterns which fail to match filenames during
5028 pathname expansion result in an expansion error.
5029 f
\bfo
\bor
\brc
\bce
\be_
\b_f
\bfi
\big
\bgn
\bno
\bor
\bre
\be
5030 If set, the suffixes specified by the F
\bFI
\bIG
\bGN
\bNO
\bOR
\bRE
\bE shell
5031 variable cause words to be ignored when performing word
5032 completion even if the ignored words are the only possi-
5033 ble completions. See S
\bSH
\bHE
\bEL
\bLL
\bL V
\bVA
\bAR
\bRI
\bIA
\bAB
\bBL
\bLE
\bES
\bS above for a
5034 description of F
\bFI
\bIG
\bGN
\bNO
\bOR
\bRE
\bE. This option is enabled by
5036 g
\bgl
\blo
\bob
\bbs
\bst
\bta
\bar
\br
5037 If set, the pattern *
\b**
\b* used in a pathname expansion con-
5038 text will match a files and zero or more directories and
5039 subdirectories. If the pattern is followed by a /
\b/, only
5040 directories and subdirectories match.
5041 g
\bgn
\bnu
\bu_
\b_e
\ber
\brr
\brf
\bfm
\bmt
\bt
5042 If set, shell error messages are written in the standard
5043 GNU error message format.
5044 h
\bhi
\bis
\bst
\bta
\bap
\bpp
\bpe
\ben
\bnd
\bd
5045 If set, the history list is appended to the file named
5046 by the value of the H
\bHI
\bIS
\bST
\bTF
\bFI
\bIL
\bLE
\bE variable when the shell
5047 exits, rather than overwriting the file.
5048 h
\bhi
\bis
\bst
\btr
\bre
\bee
\bed
\bdi
\bit
\bt
5049 If set, and r
\bre
\bea
\bad
\bdl
\bli
\bin
\bne
\be is being used, a user is given the
5050 opportunity to re-edit a failed history substitution.
5051 h
\bhi
\bis
\bst
\btv
\bve
\ber
\bri
\bif
\bfy
\by
5052 If set, and r
\bre
\bea
\bad
\bdl
\bli
\bin
\bne
\be is being used, the results of his-
5053 tory substitution are not immediately passed to the
5054 shell parser. Instead, the resulting line is loaded
5055 into the r
\bre
\bea
\bad
\bdl
\bli
\bin
\bne
\be editing buffer, allowing further modi-
5057 h
\bho
\bos
\bst
\btc
\bco
\bom
\bmp
\bpl
\ble
\bet
\bte
\be
5058 If set, and r
\bre
\bea
\bad
\bdl
\bli
\bin
\bne
\be is being used, b
\bba
\bas
\bsh
\bh will attempt to
5059 perform hostname completion when a word containing a @
\b@
5060 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
5061 above). This is enabled by default.
5062 h
\bhu
\bup
\bpo
\bon
\bne
\bex
\bxi
\bit
\bt
5063 If set, b
\bba
\bas
\bsh
\bh will send S
\bSI
\bIG
\bGH
\bHU
\bUP
\bP to all jobs when an inter-
5064 active login shell exits.
5065 i
\bin
\bnt
\bte
\ber
\bra
\bac
\bct
\bti
\biv
\bve
\be_
\b_c
\bco
\bom
\bmm
\bme
\ben
\bnt
\bts
\bs
5066 If set, allow a word beginning with #
\b# to cause that word
5067 and all remaining characters on that line to be ignored
5068 in an interactive shell (see C
\bCO
\bOM
\bMM
\bME
\bEN
\bNT
\bTS
\bS above). This
5069 option is enabled by default.
5070 l
\bla
\bas
\bst
\btp
\bpi
\bip
\bpe
\be
5071 If set, and job control is not active, the shell runs
5072 the last command of a pipeline not executed in the back-
5073 ground in the current shell environment.
5074 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
5075 commands are saved to the history with embedded newlines
5076 rather than using semicolon separators where possible.
5077 l
\blo
\bog
\bgi
\bin
\bn_
\b_s
\bsh
\bhe
\bel
\bll
\bl
5078 The shell sets this option if it is started as a login
5079 shell (see I
\bIN
\bNV
\bVO
\bOC
\bCA
\bAT
\bTI
\bIO
\bON
\bN above). The value may not be
5081 m
\bma
\bai
\bil
\blw
\bwa
\bar
\brn
\bn
5082 If set, and a file that b
\bba
\bas
\bsh
\bh is checking for mail has
5083 been accessed since the last time it was checked, the
5084 message ``The mail in _
\bm_
\ba_
\bi_
\bl_
\bf_
\bi_
\bl_
\be has been read'' is dis-
5086 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
5087 If set, and r
\bre
\bea
\bad
\bdl
\bli
\bin
\bne
\be is being used, b
\bba
\bas
\bsh
\bh will not
5088 attempt to search the P
\bPA
\bAT
\bTH
\bH for possible completions when
5089 completion is attempted on an empty line.
5090 n
\bno
\boc
\bca
\bas
\bse
\beg
\bgl
\blo
\bob
\bb
5091 If set, b
\bba
\bas
\bsh
\bh matches filenames in a case-insensitive
5092 fashion when performing pathname expansion (see P
\bPa
\bat
\bth
\bhn
\bna
\bam
\bme
\be
5093 E
\bEx
\bxp
\bpa
\ban
\bns
\bsi
\bio
\bon
\bn above).
5094 n
\bno
\boc
\bca
\bas
\bse
\bem
\bma
\bat
\btc
\bch
\bh
5095 If set, b
\bba
\bas
\bsh
\bh matches patterns in a case-insensitive
5096 fashion when performing matching while executing c
\bca
\bas
\bse
\be or
5097 [
\b[[
\b[ conditional commands.
5098 n
\bnu
\bul
\bll
\blg
\bgl
\blo
\bob
\bb
5099 If set, b
\bba
\bas
\bsh
\bh allows patterns which match no files (see
5100 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,
5101 rather than themselves.
5102 p
\bpr
\bro
\bog
\bgc
\bco
\bom
\bmp
\bp
5103 If set, the programmable completion facilities (see P
\bPr
\bro
\bo-
\b-
5104 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
5106 p
\bpr
\bro
\bom
\bmp
\bpt
\btv
\bva
\bar
\brs
\bs
5107 If set, prompt strings undergo parameter expansion, com-
5108 mand substitution, arithmetic expansion, and quote
5109 removal after being expanded as described in P
\bPR
\bRO
\bOM
\bMP
\bPT
\bTI
\bIN
\bNG
\bG
5110 above. This option is enabled by default.
5111 r
\bre
\bes
\bst
\btr
\bri
\bic
\bct
\bte
\bed
\bd_
\b_s
\bsh
\bhe
\bel
\bll
\bl
5112 The shell sets this option if it is started in
5113 restricted mode (see R
\bRE
\bES
\bST
\bTR
\bRI
\bIC
\bCT
\bTE
\bED
\bD S
\bSH
\bHE
\bEL
\bLL
\bL below). The value
5114 may not be changed. This is not reset when the startup
5115 files are executed, allowing the startup files to dis-
5116 cover whether or not a shell is restricted.
5117 s
\bsh
\bhi
\bif
\bft
\bt_
\b_v
\bve
\ber
\brb
\bbo
\bos
\bse
\be
5118 If set, the s
\bsh
\bhi
\bif
\bft
\bt builtin prints an error message when
5119 the shift count exceeds the number of positional parame-
5121 s
\bso
\bou
\bur
\brc
\bce
\bep
\bpa
\bat
\bth
\bh
5122 If set, the s
\bso
\bou
\bur
\brc
\bce
\be (.
\b.) builtin uses the value of P
\bPA
\bAT
\bTH
\bH to
5123 find the directory containing the file supplied as an
5124 argument. This option is enabled by default.
5125 x
\bxp
\bpg
\bg_
\b_e
\bec
\bch
\bho
\bo
5126 If set, the e
\bec
\bch
\bho
\bo builtin expands backslash-escape
5127 sequences by default.
5128 s
\bsu
\bus
\bsp
\bpe
\ben
\bnd
\bd [-
\b-f
\bf]
5129 Suspend the execution of this shell until it receives a S
\bSI
\bIG
\bGC
\bCO
\bON
\bNT
\bT
5130 signal. A login shell cannot be suspended; the -
\b-f
\bf option can be
5131 used to override this and force the suspension. The return sta-
5132 tus is 0 unless the shell is a login shell and -
\b-f
\bf is not sup-
5133 plied, or if job control is not enabled.
5134 t
\bte
\bes
\bst
\bt _
\be_
\bx_
\bp_
\br
5135 [
\b[ _
\be_
\bx_
\bp_
\br ]
\b]
5136 Return a status of 0 or 1 depending on the evaluation of the
5137 conditional expression _
\be_
\bx_
\bp_
\br. Each operator and operand must be
5138 a separate argument. Expressions are composed of the primaries
5139 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
5140 accept any options, nor does it accept and ignore an argument of
5141 -
\b--
\b- as signifying the end of options.
5143 Expressions may be combined using the following operators,
5144 listed in decreasing order of precedence. The evaluation
5145 depends on the number of arguments; see below. Operator prece-
5146 dence is used when there are five or more arguments.
5147 !
\b! _
\be_
\bx_
\bp_
\br True if _
\be_
\bx_
\bp_
\br is false.
5148 (
\b( _
\be_
\bx_
\bp_
\br )
\b)
5149 Returns the value of _
\be_
\bx_
\bp_
\br. This may be used to override
5150 the normal precedence of operators.
5151 _
\be_
\bx_
\bp_
\br_
\b1 -a
\ba _
\be_
\bx_
\bp_
\br_
\b2
5152 True if both _
\be_
\bx_
\bp_
\br_
\b1 and _
\be_
\bx_
\bp_
\br_
\b2 are true.
5153 _
\be_
\bx_
\bp_
\br_
\b1 -o
\bo _
\be_
\bx_
\bp_
\br_
\b2
5154 True if either _
\be_
\bx_
\bp_
\br_
\b1 or _
\be_
\bx_
\bp_
\br_
\b2 is true.
5156 t
\bte
\bes
\bst
\bt and [
\b[ evaluate conditional expressions using a set of rules
5157 based on the number of arguments.
5160 The expression is false.
5162 The expression is true if and only if the argument is not
5165 If the first argument is !
\b!, the expression is true if and
5166 only if the second argument is null. If the first argu-
5167 ment is one of the unary conditional operators listed
5168 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
5169 true if the unary test is true. If the first argument is
5170 not a valid unary conditional operator, the expression is
5173 The following conditions are applied in the order listed.
5174 If the second argument is one of the binary conditional
5175 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
5176 result of the expression is the result of the binary test
5177 using the first and third arguments as operands. The -
\b-a
\ba
5178 and -
\b-o
\bo operators are considered binary operators when
5179 there are three arguments. If the first argument is !
\b!,
5180 the value is the negation of the two-argument test using
5181 the second and third arguments. If the first argument is
5182 exactly (
\b( and the third argument is exactly )
\b), the result
5183 is the one-argument test of the second argument. Other-
5184 wise, the expression is false.
5186 If the first argument is !
\b!, the result is the negation of
5187 the three-argument expression composed of the remaining
5188 arguments. Otherwise, the expression is parsed and eval-
5189 uated according to precedence using the rules listed
5192 The expression is parsed and evaluated according to
5193 precedence using the rules listed above.
5195 When used with t
\bte
\bes
\bst
\bt or [
\b[, the <
\b< and >
\b> operators sort lexico-
5196 graphically using ASCII ordering.
5198 t
\bti
\bim
\bme
\bes
\bs Print the accumulated user and system times for the shell and
5199 for processes run from the shell. The return status is 0.
5201 t
\btr
\bra
\bap
\bp [-
\b-l
\blp
\bp] [[_
\ba_
\br_
\bg] _
\bs_
\bi_
\bg_
\bs_
\bp_
\be_
\bc ...]
5202 The command _
\ba_
\br_
\bg is to be read and executed when the shell
5203 receives signal(s) _
\bs_
\bi_
\bg_
\bs_
\bp_
\be_
\bc. If _
\ba_
\br_
\bg is absent (and there is a
5204 single _
\bs_
\bi_
\bg_
\bs_
\bp_
\be_
\bc) or -
\b-, each specified signal is reset to its
5205 original disposition (the value it had upon entrance to the
5206 shell). If _
\ba_
\br_
\bg is the null string the signal specified by each
5207 _
\bs_
\bi_
\bg_
\bs_
\bp_
\be_
\bc is ignored by the shell and by the commands it invokes.
5208 If _
\ba_
\br_
\bg is not present and -
\b-p
\bp has been supplied, then the trap
5209 commands associated with each _
\bs_
\bi_
\bg_
\bs_
\bp_
\be_
\bc are displayed. If no
5210 arguments are supplied or if only -
\b-p
\bp is given, t
\btr
\bra
\bap
\bp prints the
5211 list of commands associated with each signal. The -
\b-l
\bl option
5212 causes the shell to print a list of signal names and their cor-
5213 responding numbers. Each _
\bs_
\bi_
\bg_
\bs_
\bp_
\be_
\bc is either a signal name
5214 defined in <_
\bs_
\bi_
\bg_
\bn_
\ba_
\bl_
\b._
\bh>, or a signal number. Signal names are
5215 case insensitive and the S
\bSI
\bIG
\bG prefix is optional.
5217 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
5218 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-
5219 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,
5220 _
\bs_
\be_
\bl_
\be_
\bc_
\bt command, every arithmetic _
\bf_
\bo_
\br command, and before the
5221 first command executes in a shell function (see S
\bSH
\bHE
\bEL
\bLL
\bL G
\bGR
\bRA
\bAM
\bMM
\bMA
\bAR
\bR
5222 above). Refer to the description of the e
\bex
\bxt
\btd
\bde
\beb
\bbu
\bug
\bg option to the
5223 s
\bsh
\bho
\bop
\bpt
\bt builtin for details of its effect on the D
\bDE
\bEB
\bBU
\bUG
\bG trap. If a
5224 _
\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
5225 function or a script executed with the .
\b. or s
\bso
\bou
\bur
\brc
\bce
\be builtins fin-
5228 If a _
\bs_
\bi_
\bg_
\bs_
\bp_
\be_
\bc is E
\bER
\bRR
\bR, the command _
\ba_
\br_
\bg is executed whenever a sim-
5229 ple command has a non-zero exit status, subject to the following
5230 conditions. The E
\bER
\bRR
\bR trap is not executed if the failed command
5231 is part of the command list immediately following a w
\bwh
\bhi
\bil
\ble
\be or
5232 u
\bun
\bnt
\bti
\bil
\bl keyword, part of the test in an _
\bi_
\bf statement, part of a
5233 command executed in a &
\b&&
\b& or |
\b||
\b| list, or if the command's return
5234 value is being inverted via !
\b!. These are the same conditions
5235 obeyed by the e
\ber
\brr
\bre
\bex
\bxi
\bit
\bt option.
5237 Signals ignored upon entry to the shell cannot be trapped or
5238 reset. Trapped signals that are not being ignored are reset to
5239 their original values in a subshell or subshell environment when
5240 one is created. The return status is false if any _
\bs_
\bi_
\bg_
\bs_
\bp_
\be_
\bc is
5241 invalid; otherwise t
\btr
\bra
\bap
\bp returns true.
5243 t
\bty
\byp
\bpe
\be [-
\b-a
\baf
\bft
\btp
\bpP
\bP] _
\bn_
\ba_
\bm_
\be [_
\bn_
\ba_
\bm_
\be ...]
5244 With no options, indicate how each _
\bn_
\ba_
\bm_
\be would be interpreted if
5245 used as a command name. If the -
\b-t
\bt option is used, t
\bty
\byp
\bpe
\be prints a
5246 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
5247 _
\bf_
\bi_
\bl_
\be if _
\bn_
\ba_
\bm_
\be is an alias, shell reserved word, function,
5248 builtin, or disk file, respectively. If the _
\bn_
\ba_
\bm_
\be is not found,
5249 then nothing is printed, and an exit status of false is
5250 returned. If the -
\b-p
\bp option is used, t
\bty
\byp
\bpe
\be either returns the
5251 name of the disk file that would be executed if _
\bn_
\ba_
\bm_
\be were speci-
5252 fied as a command name, or nothing if ``type -t name'' would not
5253 return _
\bf_
\bi_
\bl_
\be. The -
\b-P
\bP option forces a P
\bPA
\bAT
\bTH
\bH search for each _
\bn_
\ba_
\bm_
\be,
5254 even if ``type -t name'' would not return _
\bf_
\bi_
\bl_
\be. If a command is
5255 hashed, -
\b-p
\bp and -
\b-P
\bP print the hashed value, not necessarily the
5256 file that appears first in P
\bPA
\bAT
\bTH
\bH. If the -
\b-a
\ba option is used, t
\bty
\byp
\bpe
\be
5257 prints all of the places that contain an executable named _
\bn_
\ba_
\bm_
\be.
5258 This includes aliases and functions, if and only if the -
\b-p
\bp
5259 option is not also used. The table of hashed commands is not
5260 consulted when using -
\b-a
\ba. The -
\b-f
\bf option suppresses shell func-
5261 tion lookup, as with the c
\bco
\bom
\bmm
\bma
\ban
\bnd
\bd builtin. t
\bty
\byp
\bpe
\be returns true if
5262 all of the arguments are found, false if any are not found.
5264 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]]
5265 Provides control over the resources available to the shell and
5266 to processes started by it, on systems that allow such control.
5267 The -
\b-H
\bH and -
\b-S
\bS options specify that the hard or soft limit is set
5268 for the given resource. A hard limit cannot be increased by a
5269 non-root user once it is set; a soft limit may be increased up
5270 to the value of the hard limit. If neither -
\b-H
\bH nor -
\b-S
\bS is speci-
5271 fied, both the soft and hard limits are set. The value of _
\bl_
\bi_
\bm_
\bi_
\bt
5272 can be a number in the unit specified for the resource or one of
5273 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
5274 current hard limit, the current soft limit, and no limit,
5275 respectively. If _
\bl_
\bi_
\bm_
\bi_
\bt is omitted, the current value of the
5276 soft limit of the resource is printed, unless the -
\b-H
\bH option is
5277 given. When more than one resource is specified, the limit name
5278 and unit are printed before the value. Other options are inter-
5280 -
\b-a
\ba All current limits are reported
5281 -
\b-b
\bb The maximum socket buffer size
5282 -
\b-c
\bc The maximum size of core files created
5283 -
\b-d
\bd The maximum size of a process's data segment
5284 -
\b-e
\be The maximum scheduling priority ("nice")
5285 -
\b-f
\bf The maximum size of files written by the shell and its
5287 -
\b-i
\bi The maximum number of pending signals
5288 -
\b-l
\bl The maximum size that may be locked into memory
5289 -
\b-m
\bm The maximum resident set size (many systems do not honor
5291 -
\b-n
\bn The maximum number of open file descriptors (most systems
5292 do not allow this value to be set)
5293 -
\b-p
\bp The pipe size in 512-byte blocks (this may not be set)
5294 -
\b-q
\bq The maximum number of bytes in POSIX message queues
5295 -
\b-r
\br The maximum real-time scheduling priority
5296 -
\b-s
\bs The maximum stack size
5297 -
\b-t
\bt The maximum amount of cpu time in seconds
5298 -
\b-u
\bu The maximum number of processes available to a single
5300 -
\b-v
\bv The maximum amount of virtual memory available to the
5301 shell and, on some systems, to its children
5302 -
\b-x
\bx The maximum number of file locks
5303 -
\b-T
\bT The maximum number of threads
5305 If _
\bl_
\bi_
\bm_
\bi_
\bt is given, it is the new value of the specified resource
5306 (the -
\b-a
\ba option is display only). If no option is given, then -
\b-f
\bf
5307 is assumed. Values are in 1024-byte increments, except for -
\b-t
\bt,
5308 which is in seconds, -
\b-p
\bp, which is in units of 512-byte blocks,
5309 and -
\b-T
\bT, -
\b-b
\bb, -
\b-n
\bn, and -
\b-u
\bu, which are unscaled values. The return
5310 status is 0 unless an invalid option or argument is supplied, or
5311 an error occurs while setting a new limit.
5313 u
\bum
\bma
\bas
\bsk
\bk [-
\b-p
\bp] [-
\b-S
\bS] [_
\bm_
\bo_
\bd_
\be]
5314 The user file-creation mask is set to _
\bm_
\bo_
\bd_
\be. If _
\bm_
\bo_
\bd_
\be begins with
5315 a digit, it is interpreted as an octal number; otherwise it is
5316 interpreted as a symbolic mode mask similar to that accepted by
5317 _
\bc_
\bh_
\bm_
\bo_
\bd(1). If _
\bm_
\bo_
\bd_
\be is omitted, the current value of the mask is
5318 printed. The -
\b-S
\bS option causes the mask to be printed in sym-
5319 bolic form; the default output is an octal number. If the -
\b-p
\bp
5320 option is supplied, and _
\bm_
\bo_
\bd_
\be is omitted, the output is in a form
5321 that may be reused as input. The return status is 0 if the mode
5322 was successfully changed or if no _
\bm_
\bo_
\bd_
\be argument was supplied,
5323 and false otherwise.
5325 u
\bun
\bna
\bal
\bli
\bia
\bas
\bs [-a
\ba] [_
\bn_
\ba_
\bm_
\be ...]
5326 Remove each _
\bn_
\ba_
\bm_
\be from the list of defined aliases. If -
\b-a
\ba is
5327 supplied, all alias definitions are removed. The return value
5328 is true unless a supplied _
\bn_
\ba_
\bm_
\be is not a defined alias.
5330 u
\bun
\bns
\bse
\bet
\bt [-f
\bfv
\bv] [_
\bn_
\ba_
\bm_
\be ...]
5331 For each _
\bn_
\ba_
\bm_
\be, remove the corresponding variable or function.
5332 If no options are supplied, or the -
\b-v
\bv option is given, each _
\bn_
\ba_
\bm_
\be
5333 refers to a shell variable. Read-only variables may not be
5334 unset. If -
\b-f
\bf is specified, each _
\bn_
\ba_
\bm_
\be refers to a shell func-
5335 tion, and the function definition is removed. Each unset vari-
5336 able or function is removed from the environment passed to sub-
5337 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,
5338 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
5339 lose their special properties, even if they are subsequently
5340 reset. The exit status is true unless a _
\bn_
\ba_
\bm_
\be is readonly.
5342 w
\bwa
\bai
\bit
\bt [_
\bn _
\b._
\b._
\b.]
5343 Wait for each specified process and return its termination sta-
5344 tus. Each _
\bn may be a process ID or a job specification; if a
5345 job spec is given, all processes in that job's pipeline are
5346 waited for. If _
\bn is not given, all currently active child pro-
5347 cesses are waited for, and the return status is zero. If _
\bn
5348 specifies a non-existent process or job, the return status is
5349 127. Otherwise, the return status is the exit status of the
5350 last process or job waited for.
5352 R
\bRE
\bES
\bST
\bTR
\bRI
\bIC
\bCT
\bTE
\bED
\bD S
\bSH
\bHE
\bEL
\bLL
\bL
5353 If b
\bba
\bas
\bsh
\bh is started with the name r
\brb
\bba
\bas
\bsh
\bh, or the -
\b-r
\br option is supplied at
5354 invocation, the shell becomes restricted. A restricted shell is used
5355 to set up an environment more controlled than the standard shell. It
5356 behaves identically to b
\bba
\bas
\bsh
\bh with the exception that the following are
5357 disallowed or not performed:
5359 +
\bo changing directories with c
\bcd
\bd
5361 +
\bo setting or unsetting the values of S
\bSH
\bHE
\bEL
\bLL
\bL, P
\bPA
\bAT
\bTH
\bH, E
\bEN
\bNV
\bV, or B
\bBA
\bAS
\bSH
\bH_
\b_E
\bEN
\bNV
\bV
5363 +
\bo specifying command names containing /
\b/
5365 +
\bo specifying a file name containing a /
\b/ as an argument to the .
\b.
5368 +
\bo specifying a filename containing a slash as an argument to the
5369 -
\b-p
\bp option to the h
\bha
\bas
\bsh
\bh builtin command
5371 +
\bo importing function definitions from the shell environment at
5374 +
\bo parsing the value of S
\bSH
\bHE
\bEL
\bLL
\bLO
\bOP
\bPT
\bTS
\bS from the shell environment at
5377 +
\bo redirecting output using the >, >|, <>, >&, &>, and >> redirect-
5380 +
\bo using the e
\bex
\bxe
\bec
\bc builtin command to replace the shell with another
5383 +
\bo adding or deleting builtin commands with the -
\b-f
\bf and -
\b-d
\bd options
5384 to the e
\ben
\bna
\bab
\bbl
\ble
\be builtin command
5386 +
\bo using the e
\ben
\bna
\bab
\bbl
\ble
\be builtin command to enable disabled shell
5389 +
\bo specifying the -
\b-p
\bp option to the c
\bco
\bom
\bmm
\bma
\ban
\bnd
\bd builtin command
5391 +
\bo turning off restricted mode with s
\bse
\bet
\bt +
\b+r
\br or s
\bse
\bet
\bt +
\b+o
\bo r
\bre
\bes
\bst
\btr
\bri
\bic
\bct
\bte
\bed
\bd.
5393 These restrictions are enforced after any startup files are read.
5395 When a command that is found to be a shell script is executed (see C
\bCO
\bOM
\bM-
\b-
5396 M
\bMA
\bAN
\bND
\bD E
\bEX
\bXE
\bEC
\bCU
\bUT
\bTI
\bIO
\bON
\bN above), r
\brb
\bba
\bas
\bsh
\bh turns off any restrictions in the shell
5397 spawned to execute the script.
5399 S
\bSE
\bEE
\bE A
\bAL
\bLS
\bSO
\bO
5400 _
\bB_
\ba_
\bs_
\bh _
\bR_
\be_
\bf_
\be_
\br_
\be_
\bn_
\bc_
\be _
\bM_
\ba_
\bn_
\bu_
\ba_
\bl, Brian Fox and Chet Ramey
5401 _
\bT_
\bh_
\be _
\bG_
\bn_
\bu _
\bR_
\be_
\ba_
\bd_
\bl_
\bi_
\bn_
\be _
\bL_
\bi_
\bb_
\br_
\ba_
\br_
\by, Brian Fox and Chet Ramey
5402 _
\bT_
\bh_
\be _
\bG_
\bn_
\bu _
\bH_
\bi_
\bs_
\bt_
\bo_
\br_
\by _
\bL_
\bi_
\bb_
\br_
\ba_
\br_
\by, Brian Fox and Chet Ramey
5403 _
\bP_
\bo_
\br_
\bt_
\ba_
\bb_
\bl_
\be _
\bO_
\bp_
\be_
\br_
\ba_
\bt_
\bi_
\bn_
\bg _
\bS_
\by_
\bs_
\bt_
\be_
\bm _
\bI_
\bn_
\bt_
\be_
\br_
\bf_
\ba_
\bc_
\be _
\b(_
\bP_
\bO_
\bS_
\bI_
\bX_
\b) _
\bP_
\ba_
\br_
\bt _
\b2_
\b: _
\bS_
\bh_
\be_
\bl_
\bl _
\ba_
\bn_
\bd _
\bU_
\bt_
\bi_
\bl_
\bi_
\b-
5404 _
\bt_
\bi_
\be_
\bs, IEEE
5405 _
\bs_
\bh(1), _
\bk_
\bs_
\bh(1), _
\bc_
\bs_
\bh(1)
5406 _
\be_
\bm_
\ba_
\bc_
\bs(1), _
\bv_
\bi(1)
5407 _
\br_
\be_
\ba_
\bd_
\bl_
\bi_
\bn_
\be(3)
5409 F
\bFI
\bIL
\bLE
\bES
\bS
5410 _
\b/_
\bb_
\bi_
\bn_
\b/_
\bb_
\ba_
\bs_
\bh
5411 The b
\bba
\bas
\bsh
\bh executable
5412 _
\b/_
\be_
\bt_
\bc_
\b/_
\bp_
\br_
\bo_
\bf_
\bi_
\bl_
\be
5413 The systemwide initialization file, executed for login shells
5414 _
\b~_
\b/_
\b._
\bb_
\ba_
\bs_
\bh_
\b__
\bp_
\br_
\bo_
\bf_
\bi_
\bl_
\be
5415 The personal initialization file, executed for login shells
5416 _
\b~_
\b/_
\b._
\bb_
\ba_
\bs_
\bh_
\br_
\bc
5417 The individual per-interactive-shell startup file
5418 _
\b~_
\b/_
\b._
\bb_
\ba_
\bs_
\bh_
\b__
\bl_
\bo_
\bg_
\bo_
\bu_
\bt
5419 The individual login shell cleanup file, executed when a login
5421 _
\b~_
\b/_
\b._
\bi_
\bn_
\bp_
\bu_
\bt_
\br_
\bc
5422 Individual _
\br_
\be_
\ba_
\bd_
\bl_
\bi_
\bn_
\be initialization file
5424 A
\bAU
\bUT
\bTH
\bHO
\bOR
\bRS
\bS
5425 Brian Fox, Free Software Foundation
5428 Chet Ramey, Case Western Reserve University
5431 B
\bBU
\bUG
\bG R
\bRE
\bEP
\bPO
\bOR
\bRT
\bTS
\bS
5432 If you find a bug in b
\bba
\bas
\bsh
\bh,
\b, you should report it. But first, you should
5433 make sure that it really is a bug, and that it appears in the latest
5434 version of b
\bba
\bas
\bsh
\bh. The latest version is always available from
5435 _
\bf_
\bt_
\bp_
\b:_
\b/_
\b/_
\bf_
\bt_
\bp_
\b._
\bg_
\bn_
\bu_
\b._
\bo_
\br_
\bg_
\b/_
\bp_
\bu_
\bb_
\b/_
\bg_
\bn_
\bu_
\b/_
\bb_
\ba_
\bs_
\bh_
\b/.
5437 Once you have determined that a bug actually exists, use the _
\bb_
\ba_
\bs_
\bh_
\bb_
\bu_
\bg
5438 command to submit a bug report. If you have a fix, you are encouraged
5439 to mail that as well! Suggestions and `philosophical' bug reports may
5440 be mailed to _
\bb_
\bu_
\bg_
\b-_
\bb_
\ba_
\bs_
\bh_
\b@_
\bg_
\bn_
\bu_
\b._
\bo_
\br_
\bg or posted to the Usenet newsgroup
5441 g
\bgn
\bnu
\bu.
\b.b
\bba
\bas
\bsh
\bh.
\b.b
\bbu
\bug
\bg.
5443 ALL bug reports should include:
5445 The version number of b
\bba
\bas
\bsh
\bh
5446 The hardware and operating system
5447 The compiler used to compile
5448 A description of the bug behaviour
5449 A short script or `recipe' which exercises the bug
5451 _
\bb_
\ba_
\bs_
\bh_
\bb_
\bu_
\bg inserts the first three items automatically into the template
5452 it provides for filing a bug report.
5454 Comments and bug reports concerning this manual page should be directed
5455 to _
\bc_
\bh_
\be_
\bt_
\b@_
\bp_
\bo_
\b._
\bc_
\bw_
\br_
\bu_
\b._
\be_
\bd_
\bu.
5458 It's too big and too slow.
5460 There are some subtle differences between b
\bba
\bas
\bsh
\bh and traditional versions
5461 of s
\bsh
\bh, mostly because of the P
\bPO
\bOS
\bSI
\bIX
\bX specification.
5463 Aliases are confusing in some uses.
5465 Shell builtin commands and functions are not stoppable/restartable.
5467 Compound commands and command sequences of the form `a ; b ; c' are not
5468 handled gracefully when process suspension is attempted. When a
5469 process is stopped, the shell immediately executes the next command in
5470 the sequence. It suffices to place the sequence of commands between
5471 parentheses to force it into a subshell, which may be stopped as a
5474 Array variables may not (yet) be exported.
5476 There may be only one active coprocess at a time.
5480 GNU Bash-4.2 2010 December 28 BASH(1)