]> git.ipfire.org Git - thirdparty/bash.git/blame - documentation/article.ps
Imported from ../bash-1.14.7.tar.gz.
[thirdparty/bash.git] / documentation / article.ps
CommitLineData
726f6388
JA
1%!PS-Adobe-3.0
2%%Creator: groff version 1.08
3%%DocumentNeededResources: font Times-Bold
4%%+ font Times-Italic
5%%+ font Times-Roman
6%%+ font Courier
7%%DocumentSuppliedResources: procset grops 1.08 0
8%%Pages: 11
9%%PageOrder: Ascend
10%%Orientation: Portrait
11%%EndComments
12%%BeginProlog
13%%BeginResource: procset grops 1.08 0
14/setpacking where{
15pop
16currentpacking
17true setpacking
18}if
19/grops 120 dict dup begin
20/SC 32 def
21/A/show load def
22/B{0 SC 3 -1 roll widthshow}bind def
23/C{0 exch ashow}bind def
24/D{0 exch 0 SC 5 2 roll awidthshow}bind def
25/E{0 rmoveto show}bind def
26/F{0 rmoveto 0 SC 3 -1 roll widthshow}bind def
27/G{0 rmoveto 0 exch ashow}bind def
28/H{0 rmoveto 0 exch 0 SC 5 2 roll awidthshow}bind def
29/I{0 exch rmoveto show}bind def
30/J{0 exch rmoveto 0 SC 3 -1 roll widthshow}bind def
31/K{0 exch rmoveto 0 exch ashow}bind def
32/L{0 exch rmoveto 0 exch 0 SC 5 2 roll awidthshow}bind def
33/M{rmoveto show}bind def
34/N{rmoveto 0 SC 3 -1 roll widthshow}bind def
35/O{rmoveto 0 exch ashow}bind def
36/P{rmoveto 0 exch 0 SC 5 2 roll awidthshow}bind def
37/Q{moveto show}bind def
38/R{moveto 0 SC 3 -1 roll widthshow}bind def
39/S{moveto 0 exch ashow}bind def
40/T{moveto 0 exch 0 SC 5 2 roll awidthshow}bind def
41/SF{
42findfont exch
43[exch dup 0 exch 0 exch neg 0 0]makefont
44dup setfont
45[exch/setfont cvx]cvx bind def
46}bind def
47/MF{
48findfont
49[5 2 roll
500 3 1 roll
51neg 0 0]makefont
52dup setfont
53[exch/setfont cvx]cvx bind def
54}bind def
55/level0 0 def
56/RES 0 def
57/PL 0 def
58/LS 0 def
59/PLG{
60gsave newpath clippath pathbbox grestore
61exch pop add exch pop
62}bind def
63/BP{
64/level0 save def
651 setlinecap
661 setlinejoin
6772 RES div dup scale
68LS{
6990 rotate
70}{
710 PL translate
72}ifelse
731 -1 scale
74}bind def
75/EP{
76level0 restore
77showpage
78}bind def
79/DA{
80newpath arcn stroke
81}bind def
82/SN{
83transform
84.25 sub exch .25 sub exch
85round .25 add exch round .25 add exch
86itransform
87}bind def
88/DL{
89SN
90moveto
91SN
92lineto stroke
93}bind def
94/DC{
95newpath 0 360 arc closepath
96}bind def
97/TM matrix def
98/DE{
99TM currentmatrix pop
100translate scale newpath 0 0 .5 0 360 arc closepath
101TM setmatrix
102}bind def
103/RC/rcurveto load def
104/RL/rlineto load def
105/ST/stroke load def
106/MT/moveto load def
107/CL/closepath load def
108/FL{
109currentgray exch setgray fill setgray
110}bind def
111/BL/fill load def
112/LW/setlinewidth load def
113/RE{
114findfont
115dup maxlength 1 index/FontName known not{1 add}if dict begin
116{
1171 index/FID ne{def}{pop pop}ifelse
118}forall
119/Encoding exch def
120dup/FontName exch def
121currentdict end definefont pop
122}bind def
123/DEFS 0 def
124/EBEGIN{
125moveto
126DEFS begin
127}bind def
128/EEND/end load def
129/CNT 0 def
130/level1 0 def
131/PBEGIN{
132/level1 save def
133translate
134div 3 1 roll div exch scale
135neg exch neg exch translate
1360 setgray
1370 setlinecap
1381 setlinewidth
1390 setlinejoin
14010 setmiterlimit
141[]0 setdash
142/setstrokeadjust where{
143pop
144false setstrokeadjust
145}if
146/setoverprint where{
147pop
148false setoverprint
149}if
150newpath
151/CNT countdictstack def
152userdict begin
153/showpage{}def
154}bind def
155/PEND{
156clear
157countdictstack CNT sub{end}repeat
158level1 restore
159}bind def
160end def
161/setpacking where{
162pop
163setpacking
164}if
165%%EndResource
166%%IncludeResource: font Times-Bold
167%%IncludeResource: font Times-Italic
168%%IncludeResource: font Times-Roman
169%%IncludeResource: font Courier
170grops begin/DEFS 1 dict def DEFS begin/u{.001 mul}bind def end/RES 72 def/PL
171792 def/LS false def/ENC0[/asciicircum/asciitilde/Scaron/Zcaron/scaron/zcaron
172/Ydieresis/trademark/quotesingle/.notdef/.notdef/.notdef/.notdef/.notdef
173/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef
174/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/space
175/exclam/quotedbl/numbersign/dollar/percent/ampersand/quoteright/parenleft
176/parenright/asterisk/plus/comma/hyphen/period/slash/zero/one/two/three/four
177/five/six/seven/eight/nine/colon/semicolon/less/equal/greater/question/at/A/B/C
178/D/E/F/G/H/I/J/K/L/M/N/O/P/Q/R/S/T/U/V/W/X/Y/Z/bracketleft/backslash
179/bracketright/circumflex/underscore/quoteleft/a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q
180/r/s/t/u/v/w/x/y/z/braceleft/bar/braceright/tilde/.notdef/quotesinglbase
181/guillemotleft/guillemotright/bullet/florin/fraction/perthousand/dagger
182/daggerdbl/endash/emdash/ff/fi/fl/ffi/ffl/dotlessi/dotlessj/grave/hungarumlaut
183/dotaccent/breve/caron/ring/ogonek/quotedblleft/quotedblright/oe/lslash
184/quotedblbase/OE/Lslash/.notdef/exclamdown/cent/sterling/currency/yen/brokenbar
185/section/dieresis/copyright/ordfeminine/guilsinglleft/logicalnot/minus
186/registered/macron/degree/plusminus/twosuperior/threesuperior/acute/mu
187/paragraph/periodcentered/cedilla/onesuperior/ordmasculine/guilsinglright
188/onequarter/onehalf/threequarters/questiondown/Agrave/Aacute/Acircumflex/Atilde
189/Adieresis/Aring/AE/Ccedilla/Egrave/Eacute/Ecircumflex/Edieresis/Igrave/Iacute
190/Icircumflex/Idieresis/Eth/Ntilde/Ograve/Oacute/Ocircumflex/Otilde/Odieresis
191/multiply/Oslash/Ugrave/Uacute/Ucircumflex/Udieresis/Yacute/Thorn/germandbls
192/agrave/aacute/acircumflex/atilde/adieresis/aring/ae/ccedilla/egrave/eacute
193/ecircumflex/edieresis/igrave/iacute/icircumflex/idieresis/eth/ntilde/ograve
194/oacute/ocircumflex/otilde/odieresis/divide/oslash/ugrave/uacute/ucircumflex
195/udieresis/yacute/thorn/ydieresis]def/Courier@0 ENC0/Courier RE/Times-Roman@0
196ENC0/Times-Roman RE/Times-Italic@0 ENC0/Times-Italic RE/Times-Bold@0 ENC0
197/Times-Bold RE
198%%EndProlog
199%%Page: 1 1
200%%BeginPageSetup
201BP
202%%EndPageSetup
203/F0 12/Times-Bold@0 SF(Bash \255 The GNU shell*)227.904 120 Q/F1 10
204/Times-Italic@0 SF(Chet Rame)263.85 144 Q(y)-.3 E(Case W)221.72 156 Q
205(estern Reserve Univer)-.92 E(sity)-.1 E -.15(ch)250.425 168 S(et@po.cwru.edu)
206.15 E/F2 10/Times-Bold@0 SF 2.5(1. Intr)72 234 R(oduction)-.18 E(Bash)97 249.6
207Q/F3 10/Times-Roman@0 SF .904(is the shell, or command language interpreter)
2083.404 F 3.404(,t)-.4 G .904(hat will appear in the GNU operating system.)
209316.032 249.6 R .91(The name is an acron)72 261.6 R .91(ym for the `)-.15 F
210(`Bourne-Ag)-.74 E .91(ain SHell')-.05 F .911(', a pun on Ste)-.74 F 1.211 -.15
211(ve B)-.25 H .911(ourne, the author of the direct).15 F .212
212(ancestor of the current)72 273.6 R/F4 9/Times-Roman@0 SF(UNIX)2.712 E F3 2.712
213<8773>C(hell)199.131 273.6 Q F1(/bin/sh)2.712 E F3 2.712(,w)C .212
214(hich appeared in the Se)256.505 273.6 R -.15(ve)-.25 G .211
215(nth Edition Bell Labs Research v).15 F(er)-.15 E(-)-.2 E(sion of)72 285.6 Q F4
216(UNIX)2.5 E F3(.)A .387(Bash is an)97 301.2 R F2(sh)2.887 E F3 .387
217(\255compatible shell that incorporates useful features from the K)B .388
218(orn shell \()-.35 F F2(ksh)A F3 2.888(\)a)C .388(nd the C)469.334 301.2 R .023
219(shell \()72 313.2 R F2(csh)A F3 .023(\), described later in this article.)B
220.022(It is ultimately intended to be a conformant implementation of the)5.022 F
2213.568(IEEE POSIX Shell and Utilities speci\214cation \(IEEE W)72 325.2 R 3.568
222(orking Group 1003.2\).)-.8 F 3.569(It of)8.569 F 3.569(fers functional)-.25 F
223(impro)72 337.2 Q -.15(ve)-.15 G(ments o).15 E -.15(ve)-.15 G 2.5(rs).15 G 2.5
224(hf)155.28 337.2 S(or both interacti)166.11 337.2 Q .3 -.15(ve a)-.25 H
225(nd programming use.).15 E .697(While the GNU operating system will most lik)97
226352.8 R .697(ely include a v)-.1 F .697(ersion of the Berk)-.15 F(ele)-.1 E
2273.197(ys)-.15 G .696(hell csh, Bash)446.778 352.8 R .015(will be the def)72
228364.8 R .015(ault shell.)-.1 F(Lik)5.015 E 2.515(eo)-.1 G .015(ther GNU softw)
229199.1 364.8 R .016(are, Bash is quite portable.)-.1 F .016
230(It currently runs on nearly e)5.016 F -.15(ve)-.25 G(ry).15 E -.15(ve)72 376.8
231S .367(rsion of).15 F F4(UNIX)2.867 E F3 .367(and a fe)2.867 F 2.867(wo)-.25 G
232.367(ther operating systems \255 an independently-supported port e)187.933
233376.8 R .366(xists for OS/2, and)-.15 F .706
234(there are rumors of ports to DOS and W)72 388.8 R(indo)-.4 E .706(ws NT)-.25 F
2355.706(.P)-.74 G .706(orts to)295.97 388.8 R F4(UNIX)3.206 E F3(-lik)A 3.206(es)
236-.1 G .706(ystems such as QNX and Minix)372.979 388.8 R
237(are part of the distrib)72 400.8 Q(ution.)-.2 E .405
238(The original author of Bash w)97 416.4 R .405(as Brian F)-.1 F .405
239(ox, an emplo)-.15 F .405(yee of the Free Softw)-.1 F .405(are F)-.1 F 2.905
240(oundation. The)-.15 F(cur)2.905 E(-)-.2 E(rent de)72 428.4 Q -.15(ve)-.25 G
241(loper and maintainer is Chet Rame).15 E 1.3 -.65(y, a v)-.15 H(olunteer who w)
242.45 E(orks at Case W)-.1 E(estern Reserv)-.8 E 2.5(eU)-.15 G(ni)458.91 428.4 Q
243-.15(ve)-.25 G(rsity).15 E(.)-.65 E F2 2.5(2. What')72 452.4 R 2.5(sP)-.37 G
244(OSIX, anyway?)123.85 452.4 Q F1(POSIX)97 468 Q F3 .239
245(is a name originally coined by Richard Stallman for a f)4.405 F .239
246(amily of open system standards based)-.1 F(on)72 480 Q F4(UNIX)3.24 E F3 5.74
247(.T)C .74(here are a number of aspects of)122.081 480 R F4(UNIX)3.24 E F3 .74
248(under consideration for standardization, from the basic)3.24 F .192
249(system services at the system call and C library le)72 492 R -.15(ve)-.25 G
2502.692(lt).15 G 2.692(oa)290.156 492 S .192
251(pplications and tools to system administration and)302.288 492 R 2.5
252(management. Each)72 504 R(area of standardization is assigned to a w)2.5 E
253(orking group in the 1003 series.)-.1 E 2.814
254(The POSIX Shell and Utilities standard has been de)97 519.6 R -.15(ve)-.25 G
2552.814(loped by IEEE W).15 F 2.813(orking Group 1003.2)-.8 F .254
256(\(POSIX.2\).\210 It concentrates on the command interpreter interf)72 531.6 R
257.253(ace and utility programs commonly e)-.1 F -.15(xe)-.15 G(cuted).15 E 1.112
258(from the command line or by other programs.)72 543.6 R 1.112(An initial v)
2596.112 F 1.113(ersion of the standard has been appro)-.15 F -.15(ve)-.15 G 3.613
260(da).15 G(nd)494 543.6 Q .365(published by the IEEE, and w)72 555.6 R .365
261(ork is currently underw)-.1 F .365(ay to update it.)-.1 F .365
262(There are four primary areas of w)5.365 F(ork)-.1 E(in the 1003.2 standard:)72
263567.6 Q 21.5<8341>72 583.2 S .835(spects of the shell')104.22 583.2 R 3.335(ss)
264-.55 G .835(yntax and command language.)192 583.2 R 3.335(An)5.835 G .835
265(umber of special b)338.095 583.2 R .835(uiltins such as)-.2 F F2(cd)3.335 E F3
266(and)3.335 E F2(exec)97 595.2 Q F3 .545(are being speci\214ed as part of the s\
267hell, since their functionality usually cannot be implemented)3.046 F
268(by a separate e)97 607.2 Q -.15(xe)-.15 G(cutable;).15 E 21.5<8341>72 622.8 S
269.73(set of utilities to be called by shell scripts and applications.)107.45
270622.8 R .731(Examples are programs lik)5.731 F(e)-.1 E F1 2.397(sed, tr)3.231 F
271(,)-1.11 E F3(and)97 634.8 Q F1(awk.)2.853 E F3 .352
272(Utilities commonly implemented as shell b)4.519 F .352
273(uiltins are described in this section, such as)-.2 F F2(test)2.852 E F3(and)97
274646.8 Q F2(kill)3.422 E F3 5.922(.A)C 3.422(ne)144.404 646.8 S .922
275(xpansion of this section')157.116 646.8 R 3.423(ss)-.55 G .923
276(cope, termed the User Portability Extension, or UPE, has)268.586 646.8 R
277(standardized interacti)97 658.8 Q .3 -.15(ve p)-.25 H(rograms such as).15 E F1
278(vi)2.5 E F3(and)4.166 E F1(mailx;)2.5 E .32 LW 76 668.8 72 668.8 DL 80 668.8
27976 668.8 DL 84 668.8 80 668.8 DL 88 668.8 84 668.8 DL 92 668.8 88 668.8 DL 96
280668.8 92 668.8 DL 100 668.8 96 668.8 DL 104 668.8 100 668.8 DL 108 668.8 104
281668.8 DL 112 668.8 108 668.8 DL 116 668.8 112 668.8 DL 120 668.8 116 668.8 DL
282124 668.8 120 668.8 DL 128 668.8 124 668.8 DL 132 668.8 128 668.8 DL 136 668.8
283132 668.8 DL 140 668.8 136 668.8 DL 144 668.8 140 668.8 DL/F5 8/Times-Roman@0
284SF(*An earlier v)72 678.8 Q
285(ersion of this article appeared in The Linux Journal.)-.12 E<87>72 688.8 Q/F6
2867/Times-Roman@0 SF(UNIX)2 E F5(is a trademark of Bell Laboratories.)2 E
287(\210IEEE,)72 698.8 Q/F7 8/Times-Italic@0 SF .042(IEEE Standar)2.042 F 2.042
288(df)-.296 G .042(or Information T)150.046 698.8 R(ec)-.736 E(hnolo)-.12 E .042
289(gy -- P)-.08 F .042(ortable Oper)-.64 F .042
290(ating System Interface \(POSIX\) P)-.12 F .042(art 2: Shell and Utili-)-.64 F
291(ties)72 708.8 Q F5 2(,1)C(992.)91.112 708.8 Q EP
292%%Page: 2 2
293%%BeginPageSetup
294BP
295%%EndPageSetup
296/F0 10/Times-Roman@0 SF 2.5(-2-)279.67 48 S 21.5<8341>72 84 S .288
297(group of functional interf)107.008 84 R .287(aces to services pro)-.1 F .287
298(vided by the shell, such as the traditional)-.15 F/F1 10/Courier@0 SF
299(system\(\))2.787 E F0 3.289(Cl)97 96 S .789(ibrary function.)109.739 96 R .789
300(There are functions to perform shell w)5.789 F .789(ord e)-.1 F .79
301(xpansions, perform \214lename e)-.15 F(xpan-)-.15 E .324(sion \()97 108 R/F2
30210/Times-Italic@0 SF(globbing)A F0 .324(\), obtain v)B .323
303(alues of POSIX.2 system con\214guration v)-.25 F .323(ariables, retrie)-.25 F
304.623 -.15(ve v)-.25 H .323(alues of en)-.1 F(viron-)-.4 E(ment v)97 120 Q
305(ariables \()-.25 E F1(getenv\(\))A F0(\), and other services;).833 E 21.5
306<8341>72 135.6 S(suite of `)106.72 135.6 Q(`de)-.74 E -.15(ve)-.25 G(lopment')
307.15 E 2.5('u)-.74 G(tilities such as)209.54 135.6 Q F2(c89)2.5 E F0
308(\(the POSIX.2 v)4.166 E(ersion of)-.15 E F2(cc)2.5 E F0(\), and)A F2(yacc.)2.5
309E F0 .483(Bash is concerned with the aspects of the shell')97 151.2 R 2.983(sb)
310-.55 G(eha)301.597 151.2 Q .484(vior de\214ned by POSIX.2.)-.2 F .484
311(The shell command)5.484 F 1.439
312(language has of course been standardized, including the basic \215o)72 163.2 R
3133.938(wc)-.25 G 1.438(ontrol and program e)359.688 163.2 R -.15(xe)-.15 G 1.438
314(cution con-).15 F 1.145(structs, I/O redirection and pipelining, ar)72 175.2 R
3151.145(gument handling, v)-.18 F 1.145(ariable e)-.25 F 1.146
316(xpansion, and quoting.)-.15 F(The)6.146 E F2(special)3.646 E F0 -.2(bu)72
317187.2 S .676(iltins, which must be implemented as part of the shell to pro).2 F
318.676(vide the desired functionality)-.15 F 3.176(,a)-.65 G .676(re speci\214ed)
319457.504 187.2 R .7(as being part of the shell; e)72 199.2 R .7
320(xamples of these are)-.15 F/F3 10/Times-Bold@0 SF -2.3 -.15(ev a)3.201 H(l).15
321E F0(and)3.201 E F3(export)3.201 E F0 5.701(.O)C .701
322(ther utilities appear in the sections of)352.034 199.2 R .256(POSIX.2 not de)
32372 211.2 R -.2(vo)-.25 G .256(ted to the shell which are commonly \(and in som\
324e cases must be\) implemented as b).2 F(uiltin)-.2 E .213(commands, such as)72
325223.2 R F3 -.18(re)2.713 G(ad).18 E F0(and)2.713 E F3(test)2.713 E F0 5.213(.P)
326C .213(OSIX.2 also speci\214es aspects of the shell')220.018 223.2 R 2.713(si)
327-.55 G(nteracti)398.159 223.2 Q .513 -.15(ve b)-.25 H(eha).15 E .214
328(vior as part)-.2 F .598
329(of the UPE, including job control and command line editing.)72 235.2 R .598
330(Interestingly enough, only)5.598 F F2(vi)3.098 E F0 .598(-style line edit-)B
331(ing commands ha)72 247.2 Q .3 -.15(ve b)-.2 H(een standardized;).15 E F2
332(emacs)2.5 E F0(editing commands were left out due to objections.)2.5 E 1.128
333(While POSIX.2 includes much of what the shell has traditionally pro)97 262.8 R
3341.129(vided, some important things)-.15 F(ha)72 274.8 Q .58 -.15(ve b)-.2 H .28
335(een omitted as being `).15 F(`be)-.74 E .28(yond its scope.)-.15 F 4.26 -.74
336('' T)-.7 H .28(here is, for instance, no mention of a dif).74 F .28
337(ference between)-.25 F(a)72 286.8 Q F2(lo)3.354 E(gin)-.1 E F0 .854
338(shell and an)5.02 F 3.354(yo)-.15 G .854(ther interacti)167.956 286.8 R 1.154
339-.15(ve s)-.25 H .854(hell \(since POSIX.2 does not specify a login program\).)
340.15 F .855(No \214x)5.855 F(ed)-.15 E
341(startup \214les are de\214ned, either \255 the standard does not mention)72
342298.8 Q F2(.pr)2.5 E(o\214le)-.45 E F0(.)1.666 E F3 2.5(3. Basic)72 322.8 R
343(Bash featur)2.5 E(es)-.18 E F0 1.448(Since the Bourne shell pro)97 338.4 R
3441.448(vides Bash with most of its philosophical underpinnings, Bash inherits)
345-.15 F .64(most of its features and functionality from sh.)72 350.4 R .641
346(Bash implements all of the traditional sh \215o)5.641 F 3.141(wc)-.25 G .641
347(ontrol con-)459.199 350.4 R .8(structs \()72 362.4 R F2(for)A F0(,)A F2(if)3.3
348E F0(,)A F2(while)3.3 E F0 3.3(,e)C 3.3(tc.\). All)165.48 362.4 R .799
349(of the Bourne shell b)3.3 F .799
350(uiltins, including those not speci\214ed in the POSIX.2)-.2 F .536
351(standard, appear in Bash.)72 374.4 R(Shell)5.536 E F2(functions)3.036 E F0
3523.036(,i)C .536(ntroduced in the SVR2 v)248.536 374.4 R .537
353(ersion of the Bourne shell, are similar)-.15 F .779(to shell scripts, b)72
354386.4 R .779(ut are de\214ned using a special syntax and are e)-.2 F -.15(xe)
355-.15 G .779(cuted in the same process as the calling).15 F 2.841(shell. Bash)72
356398.4 R .341(has shell functions which beha)2.841 F .641 -.15(ve i)-.2 H 2.841
357(naf).15 G .341(ashion upw)278.759 398.4 R .342
358(ard-compatible with sh functions.)-.1 F .342(There are)5.342 F 1.447
359(certain shell v)72 410.4 R 1.446(ariables that Bash interprets in the same w)
360-.25 F 1.446(ay as sh, such as)-.1 F F3(PS1)3.946 E F0(,)A F3(IFS)3.946 E F0
3613.946(,a)C(nd)435.018 410.4 Q F3 -.74(PA)3.946 G(TH)-.21 E F0 6.446(.B)C(ash)
362490.67 410.4 Q 1.423(implements essentially the same grammar)72 422.4 R 3.924
363(,p)-.4 G 1.424(arameter and v)256.476 422.4 R 1.424(ariable e)-.25 F 1.424
364(xpansion semantics, redirection, and)-.15 F 1.06(quoting as the Bourne shell.)
36572 434.4 R 1.06(Where dif)6.06 F 1.06
366(ferences appear between the POSIX.2 standard and traditional sh)-.25 F(beha)72
367446.4 Q(vior)-.2 E 2.5(,B)-.4 G(ash follo)118.06 446.4 Q(ws POSIX.)-.25 E 1.608
368(The K)97 462 R 1.608(orn Shell \()-.35 F F3(ksh)A F0 4.108(\)i)C 4.108(sad)
369194.192 462 S 1.608(escendent of the Bourne shell written at A)215.738 462 R
3701.609(T&T Bell Laboratories by)-1.11 F(Da)72 474 Q 1.059(vid K)-.2 F 3.559
371(orn\207. It)-.35 F(pro)3.559 E 1.059
372(vides a number of useful features that POSIX and Bash ha)-.15 F 1.359 -.15
373(ve a)-.2 H 3.558(dopted. Man).15 F 3.558(yo)-.15 G 3.558(ft)484.892 474 S(he)
374494.56 474 Q(interacti)72 486 Q 1.312 -.15(ve f)-.25 H 1.012
375(acilities in POSIX.2 ha).05 F 1.312 -.15(ve t)-.2 H 1.012
376(heir roots in the ksh: for e).15 F 1.013
377(xample, the POSIX and ksh job control)-.15 F -.1(fa)72 498 S .513
378(cilities are nearly identical. Bash includes features from the K).1 F .513
379(orn Shell for both interacti)-.35 F .813 -.15(ve u)-.25 H .513(se and shell)
380.15 F 3.905(programming. F)72 510 R 1.405(or programming, Bash pro)-.15 F 1.405
381(vides v)-.15 F 1.405(ariables such as)-.25 F F3(RANDOM)3.905 E F0(and)3.905 E
382F3(REPL)3.905 E(Y)-.92 E F0 3.905(,t)C(he)460.665 510 Q F3(typeset)3.905 E F0
383-.2(bu)72 522 S .398(iltin, the ability to remo).2 F .698 -.15(ve s)-.15 H .398
384(ubstrings from v).15 F .398(ariables based on patterns, and shell arithmetic.)
385-.25 F F3(RANDOM)5.397 E F0 -.15(ex)72 534 S .489
386(pands to a random number each time it is referenced; assigning a v).15 F .49
387(alue to)-.25 F F3(RANDOM)2.99 E F0 .49(seeds the random)2.99 F .055
388(number generator)72 546 R(.)-.55 E F3(REPL)5.055 E(Y)-.92 E F0 .054
389(is the def)2.554 F .054(ault v)-.1 F .054(ariable used by the)-.25 F F3 -.18
390(re)2.554 G(ad).18 E F0 -.2(bu)2.554 G .054(iltin when no v).2 F .054
391(ariable names are sup-)-.25 F .742(plied as ar)72 558 R 3.243(guments. The)
392-.18 F F3(typeset)3.243 E F0 -.2(bu)3.243 G .743(iltin is used to de\214ne v).2
393F .743(ariables and gi)-.25 F 1.043 -.15(ve t)-.25 H .743(hem attrib).15 F .743
394(utes such as)-.2 F F3 -.18(re)3.243 G(ad-).18 E(only)72 570 Q F0 5.512(.B)C
395.512(ash arithmetic allo)105.022 570 R .512(ws the e)-.25 F -.25(va)-.25 G .511
396(luation of an e).25 F .511(xpression and the substitution of the result.)-.15
397F .511(Shell v)5.511 F(ari-)-.25 E .222
398(ables may be used as operands, and the result of an e)72 582 R .222
399(xpression may be assigned to a v)-.15 F 2.722(ariable. Nearly)-.25 F .222
400(all of)2.722 F(the operators from the C language are a)72 594 Q -.25(va)-.2 G
401(ilable, with the same precedence rules:).25 E F1 6($e)97 612 S
402(cho $\(\(3 + 5 * 32\)\))115 612 Q(163)97 624 Q F0 -.15(Fo)72 645.6 S 3.24(ri)
403.15 G(nteracti)91.76 645.6 Q 1.04 -.15(ve u)-.25 H .74
404(se, Bash implements ksh-style aliases and b).15 F .74(uiltins such as)-.2 F F3
405(fc)3.24 E F0 .74(\(discussed belo)3.24 F .74(w\) and)-.25 F F3(jobs)3.24 E F0
406(.)A .291(Bash aliases allo)72 657.6 R 2.791(was)-.25 G .291
407(tring to be substituted for a command name.)160.124 657.6 R(The)5.291 E 2.791
408(yc)-.15 G .291(an be used to create a mnemonic)371.733 657.6 R .568(for a)72
409669.6 R/F4 9/Times-Roman@0 SF(UNIX)3.068 E F0 .568(command name \()3.068 F F1
410.568(alias del=rm)B F0 .568(\), to e)B .567(xpand a single w)-.15 F .567
411(ord to a comple)-.1 F 3.067(xc)-.15 G .567(ommand \()432.603 669.6 R F1(alias)
412A .255(news='xterm -g 80x45 -title trn -e trn -e -S1 -N &')72 681.6 R F0 .255
413(\), or to ensure that a command)B(is in)72 693.6 Q -.2(vo)-.4 G -.1(ke).2 G
4142.5(dw).1 G(ith a basic set of options \()122.41 693.6 Q F1
415(alias ls="/bin/ls -F")A F0(\).)A .32 LW 76 703.6 72 703.6 DL 80 703.6 76 703.6
416DL 84 703.6 80 703.6 DL 88 703.6 84 703.6 DL 92 703.6 88 703.6 DL 96 703.6 92
417703.6 DL 100 703.6 96 703.6 DL 104 703.6 100 703.6 DL 108 703.6 104 703.6 DL
418112 703.6 108 703.6 DL 116 703.6 112 703.6 DL 120 703.6 116 703.6 DL 124 703.6
419120 703.6 DL 128 703.6 124 703.6 DL 132 703.6 128 703.6 DL 136 703.6 132 703.6
420DL 140 703.6 136 703.6 DL 144 703.6 140 703.6 DL/F5 8/Times-Roman@0 SF
421(\207Morris Bolsk)72 713.6 Q 2(ya)-.12 G(nd Da)127.88 713.6 Q(vid K)-.16 E
422(orn,)-.28 E/F6 8/Times-Italic@0 SF(The K)2 E(ornShell Command and Pr)-.32 E
423-.08(og)-.36 G -.12(ra).08 G(mming Langua).12 E -.08(ge)-.08 G F5 2(,P).08 G
424(rentice Hall, 1989.)363.064 713.6 Q EP
425%%Page: 3 3
426%%BeginPageSetup
427BP
428%%EndPageSetup
429/F0 10/Times-Roman@0 SF 2.5(-3-)279.67 48 S .293(The C shell \()97 84 R/F1 10
430/Times-Bold@0 SF(csh)A F0 .293(\)\207, originally written by Bill Jo)B 2.792
431(yw)-.1 G .292(hile at Berk)304.534 84 R(ele)-.1 E 1.592 -.65(y, i)-.15 H 2.792
432(sw).65 G .292(idely used and quite popular)389.512 84 R 1.252
433(for its interacti)72 96 R 1.552 -.15(ve f)-.25 H 3.752(acilities. Bash).05 F
4341.253(includes a csh-compatible history e)3.752 F 1.253(xpansion mechanism \(`)
435-.15 F 1.253(`! history')-.74 F('\),)-.74 E .019(brace e)72 108 R .018
436(xpansion, access to a stack of directories via the)-.15 F F1(pushd)2.518 E F0
437(,)A F1(popd)2.518 E F0 2.518(,a)C(nd)357.31 108 Q F1(dirs)2.518 E F0 -.2(bu)
4382.518 G .018(iltins, and tilde e).2 F(xpansion,)-.15 E 1.293
439(to generate users' home directories.)72 120 R -.35(Ti)6.294 G 1.294(lde e).35
440F 1.294(xpansion has also been adopted by both the K)-.15 F 1.294
441(orn Shell and)-.35 F(POSIX.2.)72 132 Q .148
442(There were certain areas in which POSIX.2 felt standardization w)97 147.6 R
443.149(as necessary)-.1 F 2.649(,b)-.65 G .149(ut no e)420.643 147.6 R .149
444(xisting imple-)-.15 F 1.598(mentation pro)72 159.6 R 1.598
445(vided the proper beha)-.15 F(vior)-.2 E 6.598(.T)-.55 G 1.598(he w)251.56
446159.6 R 1.597(orking group in)-.1 F -.15(ve)-.4 G 1.597
447(nted and standardized functionality in).15 F .674
448(these areas, which Bash implements.)72 171.6 R(The)5.674 E F1(command)3.174 E
449F0 -.2(bu)3.174 G .674(iltin w).2 F .674(as in)-.1 F -.15(ve)-.4 G .674
450(nted so that shell functions could be).15 F .996(written to replace b)72 183.6
451R .996(uiltins; it mak)-.2 F .996(es the capabilities of the b)-.1 F .995
452(uiltin a)-.2 F -.25(va)-.2 G .995(ilable to the function.).25 F .995
453(The reserv)5.995 F(ed)-.15 E -.1(wo)72 195.6 S 1.566(rd `).1 F(`!')-.74 E
4544.066('w)-.74 G 1.566(as added to ne)122.872 195.6 R -.05(ga)-.15 G 1.567
455(te the return v).05 F 1.567(alue of a command or pipeline; it w)-.25 F 1.567
456(as nearly impossible to)-.1 F -.15(ex)72 207.6 S .089(press `).15 F .089
457(`if not x')-.74 F 2.589('c)-.74 G .089(leanly using the sh language.)152.366
458207.6 R .089(There e)5.089 F .088
459(xist multiple incompatible implementations of the)-.15 F F1(test)72 219.6 Q F0
460-.2(bu)3.163 G .663(iltin, which tests \214les for type and other attrib).2 F
461.664(utes and performs arithmetic and string comparisons.)-.2 F .5
462(POSIX considered none of these correct, so the standard beha)72 231.6 R .5
463(vior w)-.2 F .5(as speci\214ed in terms of the number of)-.1 F(ar)72 243.6 Q
464.412(guments to the command.)-.18 F .412(POSIX.2 dictates e)5.412 F .412
465(xactly what will happen when four or fe)-.15 F .412(wer ar)-.25 F .412
466(guments are)-.18 F(gi)72 255.6 Q -.15(ve)-.25 G 5.01(nt).15 G(o)101.61 255.6 Q
467F1(test)5.01 E F0 5.01(,a)C 2.51(nd lea)138.56 255.6 R -.15(ve)-.2 G 5.01(st)
468.15 G 2.51(he beha)186 255.6 R 2.51(vior unde\214ned when more ar)-.2 F 2.51
469(guments are supplied.)-.18 F 2.51(Bash uses the)7.51 F
470(POSIX.2 algorithm, which w)72 267.6 Q(as concei)-.1 E -.15(ve)-.25 G 2.5(db)
471.15 G 2.5(yD)247.31 267.6 S -.2(av)262.03 267.6 S(id K).2 E(orn.)-.35 E F1 2.5
472(3.1. F)72 291.6 R(eatur)-.25 E(es not in the Bour)-.18 E(ne Shell)-.15 E F0
473.718(There are a number of minor dif)97 307.2 R .719
474(ferences between Bash and the v)-.25 F .719
475(ersion of sh present on most other)-.15 F -.15(ve)72 319.2 S .874(rsions of)
476.15 F/F2 9/Times-Roman@0 SF(UNIX)3.374 E F0 5.873(.T)C .873
477(he majority of these are due to the POSIX standard, b)157.232 319.2 R .873
478(ut some are the result of Bash)-.2 F .188
479(adopting features from other shells.)72 331.2 R -.15(Fo)5.188 G 2.689(ri).15 G
480.189(nstance, Bash includes the ne)239.069 331.2 R 2.689(w`)-.25 G(`!')369.554
481331.2 Q 2.689('r)-.74 G(eserv)388.153 331.2 Q .189(ed w)-.15 F .189(ord, the)
482-.1 F F1(command)2.689 E F0 -.2(bu)72 343.2 S .116(iltin, the ability of the).2
483F F1 -.18(re)2.616 G(ad).18 E F0 -.2(bu)2.615 G .115
484(iltin to correctly return a line ending with a backslash, symbolic ar).2 F
485(guments)-.18 E .798(to the)72 355.2 R F1(umask)3.298 E F0 -.2(bu)3.298 G .798
486(iltin, v).2 F .798(ariable substring remo)-.25 F -.25(va)-.15 G .798(l, a w)
487.25 F .799(ay to get the length of a v)-.1 F .799(ariable, and the ne)-.25 F
4883.299(wa)-.25 G(lgo-)487.89 355.2 Q(rithm for the)72 367.2 Q F1(test)2.5 E F0
489-.2(bu)2.5 G(iltin from the POSIX.2 standard, none of which appear in sh.).2 E
490.998(Bash also implements the `)97 382.8 R(`$\(...\)')-.74 E 3.498('c)-.74 G
491.998(ommand substitution syntax, which supersedes the sh `...` con-)244.93
492382.8 R 2.654(struct. The)72 394.8 R -.74(``)2.654 G($\(...\)').74 E 2.654('c)
493-.74 G .154(onstruct e)158.172 394.8 R .154
494(xpands to the output of the command contained within the parentheses, with)
495-.15 F .467(trailing ne)72 406.8 R .467(wlines remo)-.25 F -.15(ve)-.15 G 2.967
496(d. The).15 F .467(sh syntax is accepted for backw)2.967 F .467
497(ards compatibility)-.1 F 2.966(,b)-.65 G .466(ut the `)415.026 406.8 R
498(`$\(...\)')-.74 E 2.966('f)-.74 G .466(orm is)478.254 406.8 R(preferred becau\
499se its quoting rules are much simpler and it is easier to nest.)72 418.8 Q .772
500(The Bourne shell does not pro)97 434.4 R .772(vide such features as brace e)
501-.15 F .772(xpansion, the ability to de\214ne a v)-.15 F(ariable)-.25 E .283
502(and a function with the same name, local v)72 446.4 R .282
503(ariables in shell functions, the ability to enable and disable indi-)-.25 F
504.547(vidual b)72 458.4 R .547(uiltins or write a function to replace a b)-.2 F
505.547(uiltin, or a means to e)-.2 F .547(xport a shell function to a child pro-)
506-.15 F(cess.)72 470.4 Q .32
507(Bash has closed a long-standing shell security hole by not using the)97 486 R
508F1($IFS)2.82 E F0 -.25(va)2.82 G .32(riable to split each w).25 F(ord)-.1 E
5091.254(read by the shell, b)72 498 R 1.254(ut splitting only the results of e)
510-.2 F 1.255(xpansion \(ksh and the 4.4 BSD sh ha)-.15 F 1.555 -.15(ve \214)-.2
511H -.15(xe).15 G 3.755(dt).15 G 1.255(his as)480.245 498 R 2.752(well\). Useful)
51272 510 R(beha)2.751 E .251(vior such as a means to abort e)-.2 F -.15(xe)-.15 G
513.251(cution of a script read with the `).15 F(`.)-.74 E 1.731 -.74('' c)-.7 H
514.251(ommand using the).74 F F1 -.18(re)72 522 S(tur).18 E(n)-.15 E F0 -.2(bu)
5152.742 G .242(iltin or automatically e).2 F .242(xporting v)-.15 F .243
516(ariables in the shell')-.25 F 2.743(se)-.55 G -.4(nv)336.842 522 S .243
517(ironment to children is also not present).4 F .969(in the Bourne shell.)72 534
518R .968(Bash pro)5.968 F .968(vides a much more po)-.15 F .968(werful en)-.25 F
519.968(vironment for both interacti)-.4 F 1.268 -.15(ve u)-.25 H .968
520(se and pro-).15 F(gramming.)72 546 Q F1 2.5(4. Bash-speci\214c)72 570 R -.25
521(Fe)2.5 G(atur).25 E(es)-.18 E F0 .491(This section details a fe)97 585.6 R
5222.991(wo)-.25 G 2.991(ft)208.355 585.6 S .491(he features which mak)217.456
523585.6 R 2.991(eB)-.1 G .491(ash unique.)323.18 585.6 R .492(Most of them pro)
5245.491 F .492(vide impro)-.15 F -.15(ve)-.15 G(d).15 E(interacti)72 597.6 Q
5251.182 -.15(ve u)-.25 H .882(se, b).15 F .882(ut a fe)-.2 F 3.382(wp)-.25 G .882
526(rogramming impro)183.31 597.6 R -.15(ve)-.15 G .882
527(ments are present as well.).15 F .882(Full descriptions of these fea-)5.882 F
528(tures can be found in the Bash documentation.)72 609.6 Q F1 2.5(4.1. Startup)
52972 633.6 R(Files)2.5 E F0 .161(Bash e)97 649.2 R -.15(xe)-.15 G .161
530(cutes startup \214les dif).15 F .161(ferently than other shells.)-.25 F .162
531(The Bash beha)5.161 F .162(vior is a compromise between)-.2 F .116
532(the csh principle of startup \214les with \214x)72 661.2 R .116(ed names e)
533-.15 F -.15(xe)-.15 G .116(cuted for each shell and the sh `).15 F
534(`minimalist')-.74 E 2.615('b)-.74 G(eha)472.26 661.2 Q(vior)-.2 E(.)-.55 E
5352.844(An interacti)72 673.2 R 3.144 -.15(ve i)-.25 H 2.844
536(nstance of Bash started as a login shell reads and e).15 F -.15(xe)-.15 G
537(cutes).15 E/F3 10/Times-Italic@0 SF(~/.bash_pr)5.345 E(o\214le)-.45 E F0 2.845
538(\(the \214le)7.011 F .954(.bash_pro\214le in the user')72 685.2 R 3.454(sh)
539-.55 G .953(ome directory\), if it e)186.086 685.2 R 3.453(xists. An)-.15 F
540(interacti)3.453 E 1.253 -.15(ve n)-.25 H .953(on-login shell reads and e).15 F
541-.15(xe)-.15 G(cutes).15 E .32 LW 76 695.2 72 695.2 DL 80 695.2 76 695.2 DL 84
542695.2 80 695.2 DL 88 695.2 84 695.2 DL 92 695.2 88 695.2 DL 96 695.2 92 695.2
543DL 100 695.2 96 695.2 DL 104 695.2 100 695.2 DL 108 695.2 104 695.2 DL 112
544695.2 108 695.2 DL 116 695.2 112 695.2 DL 120 695.2 116 695.2 DL 124 695.2 120
545695.2 DL 128 695.2 124 695.2 DL 132 695.2 128 695.2 DL 136 695.2 132 695.2 DL
546140 695.2 136 695.2 DL 144 695.2 140 695.2 DL/F4 8/Times-Roman@0 SF .764
547(\207Bill Jo)72 705.2 R 1.804 -.52(y, A)-.08 H 2.764(nI).52 G .764
548(ntroduction to the C Shell,)121.252 705.2 R/F5 8/Times-Italic@0 SF .763
549(UNIX User')2.764 F 2.763(sS)-.32 G .763(upplementary Documents)260.942 705.2 R
550F4 2.763(,U)C(ni)354.228 705.2 Q -.12(ve)-.2 G .763
551(rsity of California at Berk).12 F(ele)-.08 E -.52(y,)-.12 G(1986.)72 715.2 Q
552EP
553%%Page: 4 4
554%%BeginPageSetup
555BP
556%%EndPageSetup
557/F0 10/Times-Roman@0 SF 2.5(-4-)279.67 48 S/F1 10/Times-Italic@0 SF(~/.bashr)72
55884 Q(c)-.37 E F0 5.537(.A)1.666 G(non-interacti)127.42 84 Q .837 -.15(ve s)-.25
559H .537(hell \(one be).15 F .538(gun to e)-.15 F -.15(xe)-.15 G .538
560(cute a shell script, for e).15 F .538(xample\) reads no \214x)-.15 F .538
561(ed startup)-.15 F .342(\214le, b)72 96 R .342(ut uses the v)-.2 F .342
562(alue of the v)-.25 F(ariable)-.25 E/F2 10/Times-Bold@0 SF($ENV)2.842 E F0
5632.841(,i)C 2.841(fs)260.187 96 S .341(et, as the name of a startup \214le.)
564270.248 96 R .341(The ksh practice of read-)5.341 F(ing)72 108 Q F2($ENV)3.114
565E F0 .614(for e)3.114 F -.15(ve)-.25 G .614(ry shell, with the accompan).15 F
566.615(ying dif)-.15 F .615(\214culty of de\214ning the proper v)-.25 F .615
567(ariables and functions)-.25 F .721(for interacti)72 120 R 1.021 -.15(ve a)-.25
568H .721(nd non-interacti).15 F 1.021 -.15(ve s)-.25 H .721(hells or ha).15 F
569.721(ving the \214le read only for interacti)-.2 F 1.02 -.15(ve s)-.25 H .72
570(hells, w).15 F .72(as considered)-.1 F .158(too comple)72 132 R 2.658(x. Ease)
571-.15 F .158(of use w)2.658 F .158(on out here.)-.1 F(Interestingly)5.158 E
5722.658(,t)-.65 G .158(he ne)295.822 132 R .159
573(xt release of ksh will change to reading)-.15 F F2($ENV)2.659 E F0
574(only for interacti)72 144 Q .3 -.15(ve s)-.25 H(hells.).15 E F2 2.5(4.2. New)
57572 168 R(Builtin Commands)2.5 E F0 1.02(There are a fe)97 183.6 R 3.52(wb)-.25
576G 1.02(uiltins which are ne)170.59 183.6 R 3.52(wo)-.25 G 3.52(rh)267.74 183.6
577S -2.25 -.2(av e)279.59 183.6 T 1.02(been e)3.72 F 1.02(xtended in Bash.)-.15 F
578(The)6.02 E F2(enable)3.52 E F0 -.2(bu)3.52 G 1.02(iltin allo).2 F(ws)-.25 E
579-.2(bu)72 195.6 S .736(iltin commands to be turned on and of).2 F 3.236(fa)-.25
580G(rbitrarily)250.198 195.6 Q 5.736(.T)-.65 G 3.237(ou)298.644 195.6 S .737
581(se the v)311.881 195.6 R .737(ersion of)-.15 F F1(ec)3.237 E(ho)-.15 E F0 .737
582(found in a user')4.903 F 3.237(ss)-.55 G(earch)482.35 195.6 Q .625
583(path rather than the Bash b)72 207.6 R(uiltin,)-.2 E/F3 10/Courier@0 SF .625
584(enable -n echo)3.125 F F0(suf)3.125 E 3.125(\214ces. The)-.25 F F2(help)3.124
585E F0 -.2(bu)3.124 G .624(iltin pro).2 F .624(vides quick synopses)-.15 F .703
586(of the shell f)72 219.6 R .704
587(acilities without requiring access to a manual page.)-.1 F F2(Builtin)5.704 E
588F0 .704(is similar to)3.204 F F2(command)3.204 E F0 .704(in that it)3.204 F
589.342(bypasses shell functions and directly e)72 231.6 R -.15(xe)-.15 G .342
590(cutes b).15 F .342(uiltin commands.)-.2 F .342
591(Access to a csh-style stack of directories)5.342 F .072(is pro)72 243.6 R .073
592(vided via the)-.15 F F2(pushd)2.573 E F0(,)A F2(popd)2.573 E F0 2.573(,a)C(nd)
593211.197 243.6 Q F2(dirs)2.573 E F0 -.2(bu)2.573 G(iltins.).2 E F2(Pushd)5.073 E
594F0(and)2.573 E F2(popd)2.573 E F0 .073(insert and remo)2.573 F .373 -.15(ve d)
595-.15 H .073(irectories from the).15 F 2.858(stack, respecti)72 255.6 R -.15(ve)
596-.25 G(ly).15 E 5.358(,a)-.65 G(nd)159.976 255.6 Q F2(dirs)5.358 E F0 2.858
597(lists the stack contents.)5.358 F 2.858(On systems that allo)7.858 F 5.358
598<778c>-.25 G 2.857(ne-grained control of)413.866 255.6 R 1.339(resources, the)
59972 267.6 R F2(ulimit)3.839 E F0 -.2(bu)3.839 G 1.339
600(iltin can be used to tune these settings.).2 F F2(Ulimit)6.34 E F0(allo)3.84 E
6011.34(ws a user to control, among)-.25 F 1.086
602(other things, whether core dumps are to be generated, ho)72 279.6 R 3.586(wm)
603-.25 G 1.086(uch memory the shell or a child process is)327.002 279.6 R(allo)72
604291.6 Q .496(wed to allocate, and ho)-.25 F 2.996(wl)-.25 G(ar)193.96 291.6 Q
605.496(ge a \214le created by a child process can gro)-.18 F 4.296 -.65(w. T)-.25
606H(he).65 E F2(suspend)2.996 E F0 .497(command will)2.997 F .744
607(stop the shell process when job control is acti)72 303.6 R -.15(ve)-.25 G
6083.243(;m).15 G .743(ost other shells do not allo)282.443 303.6 R 3.243(wt)-.25
609G(hemselv)404.431 303.6 Q .743(es to be stopped)-.15 F(lik)72 315.6 Q 2.717(et)
610-.1 G(hat.)92.397 315.6 Q F2 -.74(Ty)5.217 G(pe,).74 E F0 .217
611(the Bash answer to)2.717 F F2(which)2.717 E F0(and)2.717 E F2(whence,)2.717 E
612F0(sho)2.717 E .218(ws what will happen when a w)-.25 F .218(ord is typed as a)
613-.1 F(command:)72 327.6 Q F3 6($t)97 345.6 S(ype export)115 345.6 Q
614(export is a shell builtin)97 357.6 Q 6($t)97 369.6 S(ype -t export)115 369.6 Q
615(builtin)97 381.6 Q 6($t)97 393.6 S(ype bash)115 393.6 Q(bash is /bin/bash)97
616405.6 Q 6($t)97 417.6 S(ype cd)115 417.6 Q(cd is a function)97 429.6 Q(cd \(\))
61797 441.6 Q({)97 453.6 Q(builtin cd ${1+"$@"} && xtitle $HOST: $PWD)121 465.6 Q
618(})97 477.6 Q F0 -1.11(Va)72 499.2 S .682(rious modes tell what a command w)
6191.11 F .681(ord is \(reserv)-.1 F .681(ed w)-.15 F .681
620(ord, alias, function, b)-.1 F .681(uiltin, or \214le\) or which v)-.2 F(er)
621-.15 E(-)-.2 E 1.15(sion of a command will be e)72 511.2 R -.15(xe)-.15 G 1.15
622(cuted based on a user').15 F 3.65(ss)-.55 G 1.15(earch path.)305.7 511.2 R
6231.15(Some of this functionality has been)6.15 F
624(adopted by POSIX.2 and folded into the)72 523.2 Q F2(command)2.5 E F0(utility)
6252.5 E(.)-.65 E F2 2.5(4.3. Editing)72 547.2 R(and Completion)2.5 E F0 .584
626(One area in which Bash shines is command line editing.)97 562.8 R .584
627(Bash uses the)5.584 F F1 -.37(re)3.084 G(adline).37 E F0 .583
628(library to read and)4.749 F .942(edit lines when interacti)72 574.8 R -.15(ve)
629-.25 G 5.942(.R).15 G .942(eadline is a po)194.798 574.8 R .942
630(werful and \215e)-.25 F .942(xible input f)-.15 F .943
631(acility that a user can con\214gure to)-.1 F(indi)72 586.8 Q .732
632(vidual tastes.)-.25 F .732(It allo)5.732 F .732
633(ws lines to be edited using either emacs or vi commands, where those commands)
634-.25 F .2(are appropriate.)72 598.8 R .2
635(The full capability of emacs is not present \255 there is no w)5.2 F .2
636(ay to e)-.1 F -.15(xe)-.15 G .2(cute a named command).15 F 1.15
637(with M-x, for instance \255 b)72 610.8 R 1.15(ut the e)-.2 F 1.149
638(xisting commands are more than adequate.)-.15 F 1.149
639(The vi mode is compliant)6.149 F
640(with the command line editing standardized by POSIX.2.)72 622.8 Q 1.69
641(Readline is fully customizable.)97 638.4 R 1.691
642(In addition to the basic commands and k)6.69 F 1.991 -.15(ey b)-.1 H 1.691
643(indings, the library).15 F(allo)72 650.4 Q .83
644(ws users to de\214ne additional k)-.25 F 1.13 -.15(ey b)-.1 H .83
645(indings using a startup \214le.).15 F(The)5.83 E F1(inputr)3.329 E(c)-.37 E F0
646.829(\214le, which def)4.995 F .829(aults to the)-.1 F(\214le)72 662.4 Q F1
647(~/.inputr)4.287 E(c)-.37 E F0 4.287(,i)1.666 G 4.287(sr)137.43 662.4 S 1.788(\
648ead each time readline initializes, permitting users to maintain a consistent \
649interf)148.937 662.4 R(ace)-.1 E .547(across a set of programs.)72 674.4 R .546
650(Readline includes an e)5.546 F .546(xtensible interf)-.15 F .546
651(ace, so each program using the library can)-.1 F .23(add its o)72 686.4 R .23
652(wn bindable commands and program-speci\214c k)-.25 F .531 -.15(ey b)-.1 H
6532.731(indings. Bash).15 F .231(uses this f)2.731 F .231
654(acility to add bindings)-.1 F(that perform history e)72 698.4 Q
655(xpansion or shell w)-.15 E(ord e)-.1 E(xpansions on the current input line.)
656-.15 E .707(Readline interprets a number of v)97 714 R .706
657(ariables which further tune its beha)-.25 F(vior)-.2 E 5.706(.V)-.55 G .706
658(ariables e)408.432 714 R .706(xist to control)-.15 F .157
659(whether or not eight-bit characters are directly read as input or con)72 726 R
660-.15(ve)-.4 G .158(rted to meta-pre\214x).15 F .158(ed k)-.15 F .458 -.15(ey s)
661-.1 H .158(equences \(a).15 F EP
662%%Page: 5 5
663%%BeginPageSetup
664BP
665%%EndPageSetup
666/F0 10/Times-Roman@0 SF 2.5(-5-)279.67 48 S(meta-pre\214x)72 84 Q 1.575(ed k)
667-.15 F 1.875 -.15(ey s)-.1 H 1.575
668(equence consists of the character with the eighth bit zeroed, preceded by the)
669.15 F/F1 10/Times-Italic@0 SF(meta-)4.074 E(pr)72 96 Q(e\214x)-.37 E F0
670(character)4.45 E 2.784(,u)-.4 G .284
671(sually escape, which selects an alternate k)145.374 96 R -.15(ey)-.1 G .285
672(map\), to decide whether to output characters).15 F .485
673(with the eighth bit set directly or as a meta-pre\214x)72 108 R .485(ed k)-.15
674F .784 -.15(ey s)-.1 H .484(equence, whether or not to wrap to a ne).15 F 2.984
675(ws)-.25 G(creen)482.35 108 Q .157
676(line when a line being edited is longer than the screen width, the k)72 120 R
677-.15(ey)-.1 G .158(map to which subsequent k).15 F .458 -.15(ey b)-.1 H
678(indings).15 E .531(should apply)72 132 R 3.031(,o)-.65 G 3.031(re)133.802 132
679S -.15(ve)144.353 132 S 3.031(nw).15 G .531(hat happens when readline w)168.894
680132 R .531(ants to ring the terminal')-.1 F 3.03(sb)-.55 G 3.03(ell. All)399.37
681132 R .53(of these v)3.03 F(ariables)-.25 E(can be set in the inputrc \214le.)
68272 144 Q .284(The startup \214le understands a set of C preprocessor)97 159.6 R
683(-lik)-.2 E 2.785(ec)-.1 G .285(onditional constructs which allo)329.49 159.6 R
6842.785(wv)-.25 G(ariables)472.9 159.6 Q .12(or k)72 171.6 R .42 -.15(ey b)-.1 H
685.119(indings to be assigned based on the application using readline, the termi\
686nal currently being used, or).15 F .338(the editing mode.)72 183.6 R .338
687(Users can add program-speci\214c bindings to mak)5.338 F 2.838(et)-.1 G .338
688(heir li)353.02 183.6 R -.15(ve)-.25 G 2.838(se).15 G 2.838(asier: I)397.176
689183.6 R(ha)2.838 E .639 -.15(ve b)-.2 H .339(indings that).15 F
690(let me edit the v)72 195.6 Q(alue of)-.25 E/F2 10/Times-Bold@0 SF($P)2.5 E
691-.95(AT)-.74 G(H).95 E F0(and double-quote the current or pre)2.5 E(vious w)
692-.25 E(ord:)-.1 E/F3 10/Courier@0 SF 6(#M)97 213.6 S
693(acros that are convenient for shell interaction)115 213.6 Q($if Bash)97 225.6
694Q 6(#e)97 237.6 S(dit the path)115 237.6 Q
695("\\C-xp": "PATH=${PATH}\\e\\C-e\\C-a\\ef\\C-f")97 249.6 Q 6(#p)97 261.6 S
696(repare to type a quoted word -- insert open and close double)115 261.6 Q 6(#q)
69797 273.6 S(uotes and move to just after the open quote)115 273.6 Q
698("\\C-x\\"": "\\"\\"\\C-b")97 285.6 Q 6(#Q)97 297.6 S
699(uote the current or previous word)115 297.6 Q("\\C-xq": "\\eb\\"\\ef\\"")97
700309.6 Q($endif)97 321.6 Q F0 .322(There is a readline command to re-read the \
701\214le, so users can edit the \214le, change some bindings, and be)72 343.2 R
702(gin)-.15 E(to use them almost immediately)72 355.2 Q(.)-.65 E .851
703(Bash implements the)97 370.8 R F2(bind)3.351 E F0 -.2(bu)3.351 G .851
704(iltin for more dyamic control of readline than the startup \214le permits.).2
705F F2(Bind)72 382.8 Q F0 .167(is used in se)2.667 F -.15(ve)-.25 G .167(ral w)
706.15 F 2.667(ays. In)-.1 F F1(list)2.667 E F0 .167
707(mode, it can display the current k)4.333 F .466 -.15(ey b)-.1 H .166
708(indings, list all the readline edit-).15 F .149(ing directi)72 394.8 R -.15
709(ve)-.25 G 2.649(sa).15 G -.25(va)132.798 394.8 S .149
710(ilable for binding, list which k).25 F -.15(ey)-.1 G 2.649(si).15 G -1.9 -.4
711(nv o)282.352 394.8 T .349 -.1(ke a g).4 H -2.15 -.25(iv e).1 H 2.65(nd).25 G
712(irecti)345.3 394.8 Q -.15(ve)-.25 G 2.65(,o).15 G 2.65(ro)385.04 394.8 S .15
713(utput the current set of k)396.02 394.8 R -.15(ey)-.1 G .526(bindings in a fo\
714rmat that can be incorporated directly into an inputrc \214le.)72 406.8 R(In)
7155.526 E F1(batc)3.026 E(h)-.15 E F0 .526(mode, it reads a series)4.692 F .71
716(of k)72 418.8 R 1.01 -.15(ey b)-.1 H .71
717(indings directly from a \214le and passes them to readline.).15 F .71
718(In its most common usage,)5.71 F F2(bind)3.21 E F0(tak)3.21 E .71(es a)-.1 F
719.534(single string and passes it directly to readline, which interprets the li\
720ne as if it had just been read from the)72 430.8 R(inputrc \214le.)72 442.8 Q
721(Both k)5 E .3 -.15(ey b)-.1 H(indings and v).15 E
722(ariable assignments may appear in the string gi)-.25 E -.15(ve)-.25 G 2.5(nt)
723.15 G(o)427.74 442.8 Q F2(bind)2.5 E F0(.)A .401(The readline library also pro)
72497 458.4 R .402(vides an interf)-.15 F .402(ace for)-.1 F F1(wor)2.902 E 2.902
725(dc)-.37 G(ompletion)328.546 458.4 Q F0 5.402(.W)C .402(hen the)385.888 458.4 R
726F1(completion)2.902 E F0(character)4.568 E 1.261(\(usually T)72 470.4 R 1.261
727(AB\) is typed, readline looks at the w)-.93 F 1.26
728(ord currently being entered and computes the set of \214le-)-.1 F .523
729(names of which the current w)72 482.4 R .523(ord is a v)-.1 F .523
730(alid pre\214x.)-.25 F .524
731(If there is only one possible completion, the rest of the)5.523 F .358
732(characters are inserted directly)72 494.4 R 2.858(,o)-.65 G .358(therwise the\
733 common pre\214x of the set of \214lenames is added to the current)205.232
734494.4 R -.1(wo)72 506.4 S 3.199(rd. A).1 F .699(second T)3.199 F .699(AB chara\
735cter entered immediately after a non-unique completion causes readline to list)
736-.93 F 1.814(the possible completions; there is an option to ha)72 518.4 R
7372.113 -.15(ve t)-.2 H 1.813(he list displayed immediately).15 F 6.813(.R)-.65 G
7381.813(eadline pro)436.517 518.4 R(vides)-.15 E .482
739(hooks so that applications can pro)72 530.4 R .482
740(vide speci\214c types of completion before the def)-.15 F .483
741(ault \214lename completion)-.1 F .132(is attempted.)72 542.4 R .132
742(This is quite \215e)5.132 F .132(xible, though it is not completely user)-.15
743F 2.632(-programmable. Bash,)-.2 F .132(for e)2.632 F .132(xample, can)-.15 F
744.37(complete \214lenames, command names \(including aliases, b)72 554.4 R .37
745(uiltins, shell reserv)-.2 F .37(ed w)-.15 F .37(ords, shell functions, and)-.1
746F -.15(exe)72 566.4 S .424(cutables found in the \214le system\), shell v).15 F
747.424(ariables, usernames, and hostnames.)-.25 F .423
748(It uses a set of heuristics)5.424 F(that, while not perfect, is generally qui\
749te good at determining what type of completion to attempt.)72 578.4 Q F2 2.5
750(4.4. History)72 602.4 R F0 .144(Access to the list of commands pre)97 618 R
751.144(viously entered \(the)-.25 F F1 .144(command history)2.644 F F0 2.644(\)i)
752C 2.644(sp)398.014 618 S(ro)409.548 618 Q .144(vided jointly by Bash)-.15 F
753.078(and the readline library)72 630 R 5.077(.B)-.65 G .077(ash pro)178.861 630
754R .077(vides v)-.15 F .077(ariables \()-.25 F F2($HISTFILE)A F0(,)A F2
755($HISTSIZE)2.577 E F0 2.577(,a)C(nd)391.916 630 Q F2($HISTCONTR)2.577 E(OL)-.3
756E F0 2.577(\)a)C(nd)494 630 Q(the)72 642 Q F2(history)2.89 E F0(and)2.89 E F2
757(fc)2.89 E F0 -.2(bu)2.89 G .39(iltins to manipulate the history list.).2 F
758.391(The v)5.391 F .391(alue of)-.25 F F2($HISTFILE)2.891 E F0 .391
759(specifes the \214le where)2.891 F .49(Bash writes the command history on e)72
760654 R .489(xit and reads it on startup.)-.15 F F2($HISTSIZE)5.489 E F0 .489
761(is used to limit the number)2.989 F .642(of commands sa)72 666 R -.15(ve)-.2 G
7623.142(di).15 G 3.142(nt)158.286 666 S .642(he history)169.208 666 R(.)-.65 E F2
763($HISTCONTR)5.642 E(OL)-.3 E F0(pro)3.142 E .642
764(vides a crude form of control o)-.15 F -.15(ve)-.15 G 3.142(rw).15 G .642
765(hich com-)463.088 666 R .32(mands are sa)72 678 R -.15(ve)-.2 G 2.819(do).15 G
7662.819(nt)146.199 678 S .319(he history list: a v)156.798 678 R .319(alue of)
767-.25 F F1(ignor)2.819 E(espace)-.37 E F0 .319(means to not sa)4.485 F .619 -.15
768(ve c)-.2 H .319(ommands which be).15 F .319(gin with)-.15 F 2.866(as)72 690 S
769.366(pace; a v)83.196 690 R .366(alue of)-.25 F F1(ignor)2.866 E(edups)-.37 E
770F0 .367(means to not sa)4.533 F .667 -.15(ve c)-.2 H .367
771(ommands identical to the last command sa).15 F -.15(ve)-.2 G(d.).15 E F2
772($HIST)5.367 E(-)-.92 E(CONTR)72 702 Q(OL)-.3 E F0 -.1(wa)3.778 G 3.778(sn).1 G
773(amed)150.266 702 Q F2($history_contr)3.778 E(ol)-.18 E F0 1.278(in earlier v)
7743.778 F 1.278(ersions of Bash; the old name is still accepted for)-.15 F(backw)
77572 714 Q .575(ards compatibility)-.1 F 5.575(.T)-.65 G(he)184.61 714 Q F2
776(history)3.075 E F0 .575
777(command can read or write \214les containing the history list and dis-)3.075 F
778.167(play the current list contents.)72 726 R(The)5.167 E F2(fc)2.667 E F0 -.2
779(bu)2.667 G .167(iltin, adopted from POSIX.2 and the K).2 F .167
780(orn Shell, allo)-.35 F .167(ws display and)-.25 F EP
781%%Page: 6 6
782%%BeginPageSetup
783BP
784%%EndPageSetup
785/F0 10/Times-Roman@0 SF 2.5(-6-)279.67 48 S(re-e)72 84 Q -.15(xe)-.15 G .58
786(cution, with optional editing, of commands from the history list.).15 F .58
787(The readline library of)5.58 F .58(fers a set of)-.25 F 1.255(commands to sea\
788rch the history list for a portion of the current input line or a string typed\
789 by the user)72 96 R(.)-.55 E(Finally)72 108 Q 3.499(,t)-.65 G(he)108.469 108 Q
790/F1 10/Times-Italic@0 SF(history)3.499 E F0(library)5.165 E 3.499(,g)-.65 G 1
791(enerally incorporated directly into the readline library)191.362 108 R 3.5(,i)
792-.65 G 1(mplements a f)420.44 108 R(acility)-.1 E .613(for history recall, e)72
793120 R .613(xpansion, and re-e)-.15 F -.15(xe)-.15 G .613(cution of pre).15 F
794.613(vious commands v)-.25 F .613(ery similar to csh \(`)-.15 F .612
795(`bang history')-.74 F(',)-.74 E(so called because the e)72 132 Q
796(xclamation point introduces a history substitution\):)-.15 E/F2 10/Courier@0
797SF 6($e)97 150 S(cho a b c d e)115 150 Q 6(abcde)97 162 S 6($!)97 174 S 6
798(!fghi)115 174 S(echo a b c d e f g h i)97 186 Q 6(abcdefghi)97 198 S 6($!)97
799210 S(-2)115 210 Q(echo a b c d e)97 222 Q 6(abcde)97 234 S 6($e)97 246 S
800(cho !-2:1-4)115 246 Q(echo a b c d)97 258 Q 6(abcd)97 270 S F0 1.456
801(The command history is only sa)72 291.6 R -.15(ve)-.2 G 3.957(dw).15 G 1.457
802(hen the shell is interacti)232.599 291.6 R -.15(ve)-.25 G 3.957(,s).15 G 3.957
803(oi)352.804 291.6 S 3.957(ti)364.541 291.6 S 3.957(sn)374.058 291.6 S 1.457
804(ot a)386.905 291.6 R -.25(va)-.2 G 1.457(ilable for use by shell).25 F
805(scripts.)72 303.6 Q/F3 10/Times-Bold@0 SF 2.5(4.5. New)72 327.6 R(Shell V)2.5
806E(ariables)-.92 E F0 .59(There are a number of con)97 343.2 R -.15(ve)-.4 G
807.589(nience v).15 F .589(ariables that Bash interprets to mak)-.25 F 3.089(el)
808-.1 G .589(ife easier)403.093 343.2 R 5.589(.T)-.55 G .589(hese include)453.701
809343.2 R F3(FIGNORE)72 355.2 Q F0 3.973(,w)C 1.473
810(hich is a set of \214lename suf)132.363 355.2 R<8c78>-.25 E 1.474
811(es identifying \214les to e)-.15 F 1.474(xclude when completing \214lenames;)
812-.15 F F3(HOSTTYPE)72 367.2 Q F0 2.932(,w)C .432
813(hich is automatically set to a string describing the type of hardw)139.112
814367.2 R .431(are on which Bash is cur)-.1 F(-)-.2 E .335(rently e)72 379.2 R
815-.15(xe)-.15 G(cuting;).15 E F3(command_oriented_history)2.835 E F0 2.835(,w)C
816.335(hich directs Bash to sa)272.685 379.2 R .635 -.15(ve a)-.2 H .336
817(ll lines of a multiple-line com-).15 F 1.071(mand such as a)72 391.2 R F1
818(while)3.571 E F0(or)3.571 E F1(for)3.571 E F0 1.071
819(loop in a single history entry)3.571 F 3.57(,a)-.65 G(llo)321.92 391.2 Q 1.07
820(wing easy re-editing; and)-.25 F F3(IGNOREEOF)3.57 E F0(,)A .747(whose v)72
821403.2 R .747(alue indicates the number of consecuti)-.25 F 1.047 -.15(ve E)-.25
822H .747(OF characters that an interacti).15 F 1.048 -.15(ve s)-.25 H .748
823(hell will read before).15 F -.15(ex)72 415.2 S 1.432(iting \255 an easy w).15
824F 1.432(ay to k)-.1 F 1.432(eep yourself from being logged out accidentally)-.1
825F 6.432(.T)-.65 G(he)399.926 415.2 Q F3(auto_r)3.932 E(esume)-.18 E F0 -.25(va)
8263.932 G(riable).25 E .571(alters the w)72 427.2 R .571
827(ay the shell treats simple command names: if job control is acti)-.1 F -.15
828(ve)-.25 G 3.071(,a).15 G .571(nd this v)396.954 427.2 R .571
829(ariable is set, sin-)-.25 F(gle-w)72 439.2 Q .239(ord simple commands without\
830 redirections cause the shell to \214rst look for and restart a suspended job)
831-.1 F(with that name before starting a ne)72 451.2 Q 2.5(wp)-.25 G(rocess.)
832225.33 451.2 Q F3 2.5(4.6. Brace)72 475.2 R(Expansion)2.5 E F0 .653
833(Since sh of)97 490.8 R .653(fers no con)-.25 F -.15(ve)-.4 G .653(nient w).15
834F .653(ay to generate arbitrary strings that share a common pre\214x or suf)-.1
835F<8c78>-.25 E 2.124(\(\214lename e)72 502.8 R 2.124
836(xpansion requires that the \214lenames e)-.15 F 2.123(xist\), Bash implements)
837-.15 F F1(br)4.623 E 2.123(ace e)-.15 F(xpansion)-.2 E F0 4.623(,ac)C
838(apability)469 502.8 Q(pick)72 514.8 Q .773(ed up from csh.)-.1 F .774(Brace e)
8395.773 F .774(xpansion is similar to \214lename e)-.15 F .774(xpansion, b)-.15 F
840.774(ut the strings generated need not)-.2 F 1.107(correspond to e)72 526.8 R
8411.107(xisting \214les.)-.15 F 3.607(Ab)6.107 G 1.107(race e)207.655 526.8 R
8421.107(xpression consists of an optional)-.15 F F1(pr)3.606 E(eamble)-.37 E F0
8433.606(,f)1.666 G(ollo)419.286 526.8 Q 1.106(wed by a pair of)-.25 F 2.809
844(braces enclosing a series of comma-separated strings, and an optional)72 538.8
845R F1(postamble)5.31 E F0 7.81(.T)1.666 G 2.81(he preamble is)440.06 538.8 R(pr\
846epended to each string within the braces, and the postamble is then appended t\
847o each resulting string:)72 550.8 Q F2 6($e)97 568.8 S(cho a{d,c,b}e)115 568.8
848Q(ade ace abe)97 580.8 Q F0 .306(As this e)72 602.4 R .306
849(xample demonstrates, the results of brace e)-.15 F .305
850(xpansion are not sorted, as the)-.15 F 2.805(ya)-.15 G .305
851(re by \214lename e)416.315 602.4 R(xpan-)-.15 E(sion.)72 614.4 Q F3 2.5
852(4.7. Pr)72 638.4 R(ocess Substitution)-.18 E F0 .457
853(On systems that can support it, Bash pro)97 654 R .457(vides a f)-.15 F .457
854(acility kno)-.1 F .458(wn as)-.25 F F1(pr)2.958 E .458(ocess substitution)-.45
855F F0 5.458(.P)C .458(rocess sub-)458.832 654 R .347(stitution is similar to co\
856mmand substitution in that its speci\214cation includes a command to e)72 666 R
857-.15(xe)-.15 G .346(cute, b).15 F .346(ut the)-.2 F .181
858(shell does not collect the command')72 678 R 2.681(so)-.55 G .181
859(utput and insert it into the command line.)228.076 678 R(Rather)5.181 E 2.681
860(,B)-.4 G .182(ash opens a pipe)437.635 678 R 1.763
861(to the command, which is run in the background.)72 690 R 1.763
862(The shell uses named pipes \(FIFOs\) or the)6.763 F F1(/de)4.263 E(v/fd)-.15 E
863F0 .961(method of naming open \214les to e)72 702 R .962
864(xpand the process substitution to a \214lename which connects to the pipe)-.15
865F .104(when opened.)72 714 R .103(This \214lename becomes the result of the e)
8665.104 F 2.603(xpansion. Process)-.15 F .103(substitution can be used to com-)
8672.603 F(pare the outputs of tw)72 726 Q 2.5(od)-.1 G(if)171.61 726 Q(ferent v)
868-.25 E(ersions of an application as part of a re)-.15 E(gression test:)-.15 E
869EP
870%%Page: 7 7
871%%BeginPageSetup
872BP
873%%EndPageSetup
874/F0 10/Times-Roman@0 SF 2.5(-7-)279.67 48 S/F1 10/Courier@0 SF 6($c)97 84 S
875(mp <\(old_prog\) <\(new_prog\))115 84 Q/F2 10/Times-Bold@0 SF 2.5(4.8. Pr)72
876114 R(ompt Customization)-.18 E F0 2.229(One of the more popular interacti)97
877129.6 R 2.529 -.15(ve f)-.25 H 2.229(eatures that Bash pro).15 F 2.23
878(vides is the ability to customize the)-.15 F 3.234(prompt. Both)72 141.6 R F2
879($PS1)3.234 E F0(and)3.234 E F2($PS2,)3.234 E F0 .734
880(the primary and secondary prompts, are e)3.234 F .733
881(xpanded before being displayed.)-.15 F -.15(Pa)72 153.6 S .804(rameter and v)
882.15 F .804(ariable e)-.25 F .805
883(xpansion is performed when the prompt string is e)-.15 F .805(xpanded, so an)
884-.15 F 3.305(ys)-.15 G .805(hell v)453.735 153.6 R(ariable)-.25 E .729
885(can be put into the prompt \(e.g.,)72 165.6 R F2($SHL)3.228 E(VL)-.92 E F0
8863.228(,w)C .728(hich indicates ho)258.568 165.6 R 3.228(wd)-.25 G .728
887(eeply the current shell is nested\).)342.992 165.6 R(Bash)5.728 E 1.895
888(specially interprets characters in the prompt string preceded by a backslash.)
88972 177.6 R 1.895(Some of these backslash)6.895 F .874
890(escapes are replaced with the current time, the date, the current w)72 189.6 R
891.874(orking directory)-.1 F 3.373(,t)-.65 G .873(he username, and the)416.961
892189.6 R .78(command number or history number of the command being entered.)72
893201.6 R .781(There is e)5.781 F -.15(ve)-.25 G 3.281(nab).15 G .781
894(ackslash escape to)429.128 201.6 R .007
895(cause the shell to change its prompt when running as root after an)72 213.6 R
896/F3 10/Times-Italic@0 SF(su)2.507 E F0 5.007(.B)C .007
897(efore printing each primary prompt,)360.392 213.6 R .305(Bash e)72 225.6 R
898.305(xpands the v)-.15 F(ariable)-.25 E F2($PR)2.805 E(OMPT_COMMAND)-.3 E F0
899.305(and, if it has a v)2.805 F .306(alue, e)-.25 F -.15(xe)-.15 G .306
900(cutes the e).15 F .306(xpanded v)-.15 F .306(alue as)-.25 F 3.735(ac)72 237.6
901S 1.235(ommand, allo)84.615 237.6 R 1.234
902(wing additional prompt customization.)-.25 F -.15(Fo)6.234 G 3.734(re).15 G
9031.234(xample, this assignment causes the current)327.3 237.6 R(user)72 249.6 Q
9042.917(,t)-.4 G .417
905(he current host, the time, the last component of the current w)96.457 249.6 R
906.417(orking directory)-.1 F 2.917(,t)-.65 G .418(he le)417.188 249.6 R -.15(ve)
907-.25 G 2.918(lo).15 G 2.918(fs)456.504 249.6 S .418(hell nest-)466.642 249.6 R
908(ing, and the history number of the current command to be embedded into the pr\
909imary prompt:)72 261.6 Q F1 6($P)97 279.6 S
910(S1='\\u@\\h [\\t] \\W\($SHLVL:\\!\)\\$ ')115 279.6 Q
911(chet@odin [21:03:44] documentation\(2:636\)$ cd ..)97 291.6 Q
912(chet@odin [21:03:54] src\(2:637\)$)97 303.6 Q F0 .146
913(The string being assigned is surrounded by single quotes so that if it is e)72
914325.2 R .146(xported, the v)-.15 F .146(alue of)-.25 F F2($SHL)2.646 E(VL)-.92
915E F0(will)2.646 E(be updated by a child shell:)72 337.2 Q F1
916(chet@odin [21:17:35] src\(2:638\)$ export PS1)97 355.2 Q
917(chet@odin [21:17:40] src\(2:639\)$ bash)97 367.2 Q
918(chet@odin [21:17:46] src\(3:696\)$)97 379.2 Q F0
919(The \\$ escape is displayed as `)72 400.8 Q(`)-.74 E F2($)A F0 1.48 -.74('' w)
920D(hen running as a normal user).74 E 2.5(,b)-.4 G(ut as `)342.08 400.8 Q(`)-.74
921E F2(#)A F0 1.48 -.74('' w)D(hen running as root.).74 E F2 2.5(4.9. File)72
922424.8 R(System V)2.5 E(iews)-.37 E F0 .029(Since Berk)97 440.4 R(ele)-.1 E
9232.529(yi)-.15 G .029
924(ntroduced symbolic links in 4.2 BSD, one of their most anno)162.908 440.4 R
925.03(ying properties has been)-.1 F 1.701(the `)72 452.4 R(`w)-.74 E(arping')-.1
926E 4.201('t)-.74 G 4.201(oac)139.912 452.4 S 1.701(ompletely dif)162.194 452.4 R
9271.701(ferent area of the \214le system when using)-.25 F F2(cd)4.2 E F0 4.2(,a)
928C 1.7(nd the resultant non-)416.41 452.4 R(intuiti)72 464.4 Q .658 -.15(ve b)
929-.25 H(eha).15 E .359(vior of `)-.2 F(`)-.74 E F2 .359(cd ..)B F0 -.74('')C
9305.359(.T).74 G(he)200.304 464.4 Q/F4 9/Times-Roman@0 SF(UNIX)2.859 E F0 -.1(ke)
9312.859 G .359(rnel treats symbolic links).1 F F3(physically)2.859 E F0 5.359(.W)
9321.666 G .359(hen the k)411.574 464.4 R .359(ernel is trans-)-.1 F .401(lating \
933a pathname in which one component is a symbolic link, it replaces all or part \
934of the pathname while)72 476.4 R .946(processing the link.)72 488.4 R .946
935(If the contents of the symbolic link be)5.946 F .946(gin with a slash, the k)
936-.15 F .947(ernel replaces the path-)-.1 F .661
937(name entirely; if not, the link contents replace the current component.)72
938500.4 R .66(In either case, the symbolic link is)5.66 F 2.546(visible. If)72
939512.4 R .046(the link v)2.546 F .047
940(alue is an absolute pathname, the user \214nds himself in a completely dif)
941-.25 F .047(ferent part of the)-.25 F(\214le system.)72 524.4 Q .599(Bash pro)
94297 540 R .599(vides a)-.15 F F3(lo)3.099 E(gical)-.1 E F0(vie)4.765 E 3.099(wo)
943-.25 G 3.099(ft)224.761 540 S .599(he \214le system.)233.97 540 R .599
944(In this def)5.599 F .599(ault mode, command and \214lename com-)-.1 F .522
945(pletion and b)72 552 R .522(uiltin commands such as)-.2 F F2(cd)3.022 E F0
946(and)3.022 E F2(pushd)3.022 E F0 .522(which change the current w)3.022 F .522
947(orking directory transpar)-.1 F(-)-.2 E .127(ently follo)72 564 R 2.627(ws)
948-.25 G .127(ymbolic links as if the)127.004 564 R 2.627(yw)-.15 G .127
949(ere directories.)231.099 564 R(The)5.126 E F2($PWD)2.626 E F0 -.25(va)2.626 G
950.126(riable, which holds the shell').25 F 2.626(si)-.55 G .126(dea of)479.164
951564 R .366(the current w)72 576 R .366(orking directory)-.1 F 2.866(,d)-.65 G
952.367(epends on the path used to reach the directory rather than its ph)200.184
953576 R .367(ysical loca-)-.05 F(tion in the local \214le system hierarch)72 588
954Q 3.8 -.65(y. F)-.05 H(or e).5 E(xample:)-.15 E F1 6($c)97 606 S 6(d/)115 606 S
955(usr/local/bin)133 606 Q 6($e)97 618 S(cho $PWD)115 618 Q(/usr/local/bin)97 630
956Q 6($p)97 642 S(wd)115 642 Q(/usr/local/bin)97 654 Q 6($/)97 666 S(bin/pwd)115
957666 Q(/net/share/sun4/local/bin)97 678 Q 6($c)97 690 S 6(d.)115 690 S(.)133 690
958Q 6($p)97 702 S(wd)115 702 Q(/usr/local)97 714 Q 6($/)97 726 S(bin/pwd)115 726
959Q EP
960%%Page: 8 8
961%%BeginPageSetup
962BP
963%%EndPageSetup
964/F0 10/Times-Roman@0 SF 2.5(-8-)279.67 48 S/F1 10/Courier@0 SF
965(/net/share/sun4/local)97 84 Q 6($c)97 96 S 6(d.)115 96 S(.)133 96 Q 6($p)97
966108 S(wd)115 108 Q(/usr)97 120 Q 6($/)97 132 S(bin/pwd)115 132 Q(/usr)97 144 Q
967F0 .3(One problem with this, of course, arises when programs that do not under\
968stand the shell')72 165.6 R 2.8(sl)-.55 G .3(ogical notion of)440.07 165.6 R
969.717(the \214le system interpret `)72 177.6 R(`..)-.74 E 2.197 -.74('' d)-.7 H
970(if).74 E(ferently)-.25 E 5.717(.T)-.65 G .717
971(his generally happens when Bash completes \214lenames contain-)246.521 177.6 R
972.977(ing `)72 189.6 R(`..)-.74 E 2.457 -.74('' a)-.7 H .977
973(ccording to a logical hierarch).74 F 3.476(yw)-.05 G .976
974(hich does not correspond to their ph)249.056 189.6 R .976(ysical location.)
975-.05 F -.15(Fo)5.976 G 3.476(ru).15 G(sers)488.45 189.6 Q
976(who \214nd this troublesome, a corresponding)72 201.6 Q/F2 10/Times-Italic@0
977SF(physical)2.5 E F0(vie)4.166 E 2.5(wo)-.25 G 2.5(ft)312.006 201.6 S
978(he \214le system is a)320.616 201.6 Q -.25(va)-.2 G(ilable:).25 E F1 6($c)97
979219.6 S 6(d/)115 219.6 S(usr/local/bin)133 219.6 Q 6($p)97 231.6 S(wd)115 231.6
980Q(/usr/local/bin)97 243.6 Q 6($s)97 255.6 S(et -o physical)115 255.6 Q 6($p)97
981267.6 S(wd)115 267.6 Q(/net/share/sun4/local/bin)97 279.6 Q/F3 10/Times-Bold@0
982SF 2.5(4.10. Inter)72 309.6 R(nationalization)-.15 E F0 .052
983(One of the most signi\214cant impro)97 325.2 R -.15(ve)-.15 G .052(ments in v)
984.15 F .053(ersion 1.13 of Bash w)-.15 F .053(as the change to `)-.1 F .053
985(`eight-bit clean-)-.74 F(liness')72 337.2 Q 2.846('. Pre)-.74 F .346(vious v)
986-.25 F .345
987(ersions used the eighth bit of characters to mark whether or not the)-.15 F
9882.845(yw)-.15 G .345(ere quoted when)437.22 337.2 R 1.495(performing w)72 349.2
989R 1.495(ord e)-.1 F 3.995(xpansions. While)-.15 F 1.495(this did not af)3.995 F
9901.496(fect the majority of users, most of whom used only)-.25 F(se)72 361.2 Q
991-.15(ve)-.25 G 1.236(n-bit ASCII characters, some found it con\214ning.).15 F
992(Be)6.236 E 1.236(ginning with v)-.15 F 1.236(ersion 1.13, Bash implemented a)
993-.15 F(dif)72 373.2 Q .02
994(ferent quoting mechanism that did not alter the eighth bit of characters.)-.25
995F .021(This allo)5.021 F .021(wed Bash to manipulate)-.25 F .263
996(\214les with `)72 385.2 R(`odd')-.74 E 2.763('c)-.74 G .262
997(haracters in their names, b)146.019 385.2 R .262
998(ut did nothing to help users enter those names, so v)-.2 F .262(ersion 1.13)
999-.15 F 1.458
1000(introduced changes to readline that made it eight-bit clean as well.)72 397.2
1001R 1.458(Options e)6.458 F 1.458(xist that force readline to)-.15 F .744(attach\
1002 no special signi\214cance to characters with the eighth bit set \(the def)72
1003409.2 R .744(ault beha)-.1 F .744(vior is to con)-.2 F -.15(ve)-.4 G .744
1004(rt these).15 F 1.88(characters to meta-pre\214x)72 421.2 R 1.88(ed k)-.15 F
10052.18 -.15(ey s)-.1 H 1.88
1006(equences\) and to output these characters without con).15 F -.15(ve)-.4 G 1.88
1007(rsion to meta-).15 F(pre\214x)72 433.2 Q .582(ed sequences.)-.15 F .581
1008(These changes, along with the e)5.582 F .581(xpansion of k)-.15 F -.15(ey)-.1
1009G .581(maps to a full eight bits, enable read-).15 F(line to w)72 445.2 Q
1010(ork with most of the ISO-8859 f)-.1 E(amily of character sets, used by man)-.1
1011E 2.5(yE)-.15 G(uropean countries.)394.94 445.2 Q F3 2.5(4.11. POSIX)72 469.2 R
1012(Mode)2.5 E F0 .584(Although Bash is intended to be POSIX.2 conformant, there \
1013are areas in which the def)97 484.8 R .584(ault beha)-.1 F(vior)-.2 E .463
1014(is not compatible with the standard.)72 496.8 R -.15(Fo)5.463 G 2.962(ru).15 G
1015.462(sers who wish to operate in a strict POSIX.2 en)244.25 496.8 R .462
1016(vironment, Bash)-.4 F .505(implements a)72 508.8 R F2 .505(POSIX mode)3.005 F
1017F0 5.505(.W)C .505(hen this mode is acti)199 508.8 R -.15(ve)-.25 G 3.005(,B)
1018.15 G .505(ash modi\214es its def)304.455 508.8 R .505
1019(ault operation where it dif)-.1 F(fers)-.25 E .267
1020(from POSIX.2 to match the standard.)72 520.8 R .266
1021(POSIX mode is entered when Bash is started with the)5.267 F F3(-posix)2.766 E
1022F0(option.)2.766 E .149(This feature is also a)72 532.8 R -.25(va)-.2 G .149
1023(ilable as an option to the).25 F F3(set)2.649 E F0 -.2(bu)2.649 G(iltin,).2 E
1024F3 .149(set -o posix)2.649 F F0 5.149(.F)C .149
1025(or compatibility with other GNU)371.744 532.8 R(softw)72 544.8 Q 4.02(are tha\
1026t attempts to be POSIX.2 compliant, Bash also enters POSIX mode if the v)-.1 F
1027(ariable)-.25 E F3($POSIXL)72 556.8 Q(Y_CORRECT)-.92 E F0 5.824
1028(is set when Bash is started or assigned a v)8.324 F 5.825(alue during e)-.25 F
1029-.15(xe)-.15 G(cution.).15 E F3($POSIX_PED)72 568.8 Q(ANTIC)-.35 E F0 .27
1030(is accepted as well, to be compatible with some older GNU utilities.)2.77 F
1031.27(When Bash is)5.27 F .428(started in POSIX mode, for e)72 580.8 R .428
1032(xample, it sources the \214le named by the v)-.15 F .429(alue of)-.25 F F3
1033($ENV)2.929 E F0 .429(rather than the `)2.929 F(`nor)-.74 E(-)-.2 E(mal')72
1034592.8 Q 2.5('s)-.74 G(tartup \214les, and does not allo)99.31 592.8 Q 2.5(wr)
1035-.25 G(eserv)227.66 592.8 Q(ed w)-.15 E(ords to be aliased.)-.1 E F3 2.5
1036(5. New)72 616.8 R -.25(Fe)2.5 G(atur).25 E(es and Futur)-.18 E 2.5(eP)-.18 G
1037(lans)201.65 616.8 Q F0 1.632(There are se)97 632.4 R -.15(ve)-.25 G 1.632
1038(ral features introduced in the current v).15 F 1.631(ersion of Bash, v)-.15 F
10391.631(ersion 1.14, and a number)-.15 F .241
1040(under consideration for future releases.)72 644.4 R .242
1041(This section will brie\215y detail the ne)5.242 F 2.742(wf)-.25 G .242
1042(eatures in v)395.702 644.4 R .242(ersion 1.14 and)-.15 F(describe se)72 656.4
1043Q -.15(ve)-.25 G(ral features that may appear in later v).15 E(ersions.)-.15 E
1044F3 2.5(5.1. New)72 680.4 R -.25(Fe)2.5 G(atur).25 E(es in Bash-1.14)-.18 E F0
1045.884(The ne)97 696 R 3.384(wf)-.25 G .884(eatures a)139.058 696 R -.25(va)-.2 G
1046.884(ilable in Bash-1.14 answer se).25 F -.15(ve)-.25 G .883
1047(ral of the most common requests for enhance-).15 F 2.931(ments. Most)72 708 R
1048(notably)2.931 E 2.931(,t)-.65 G .432(here is a mechanism for including non-vi\
1049sible character sequences in prompts, such)164.873 708 R 1.533
1050(as those which cause a terminal to print characters in dif)72 720 R 1.532
1051(ferent colors or in standout mode.)-.25 F 1.532(There w)6.532 F(as)-.1 E EP
1052%%Page: 9 9
1053%%BeginPageSetup
1054BP
1055%%EndPageSetup
1056/F0 10/Times-Roman@0 SF 2.5(-9-)279.67 48 S 1.967(nothing pre)72 84 R -.15(ve)
1057-.25 G 1.967(nting the use of these sequences in earlier v).15 F 1.967
1058(ersions, b)-.15 F 1.967(ut the readline redisplay algorithm)-.2 F
1059(assumed each character occupied ph)72 96 Q(ysical screen space and w)-.05 E
1060(ould wrap lines prematurely)-.1 E(.)-.65 E .13(Readline has a fe)97 111.6 R
10612.63(wn)-.25 G .63 -.25(ew va)180.58 111.6 T .13(riables, se).25 F -.15(ve)-.25
1062G .13(ral ne).15 F 2.63(wb)-.25 G .13
1063(indable commands, and some additional emacs mode)290.19 111.6 R(def)72 123.6 Q
1064.918(ault k)-.1 F 1.218 -.15(ey b)-.1 H 3.418(indings. A).15 F(ne)3.418 E 3.418
1065(wh)-.25 G .919
1066(istory search mode has been implemented: in this mode, readline searches)
1067199.03 123.6 R .336(the history for lines be)72 135.6 R .336
1068(ginning with the characters between the be)-.15 F .336
1069(ginning of the current line and the cursor)-.15 F(.)-.55 E .555(The e)72 147.6
1070R .556(xisting readline incremental search commands no longer match identical \
1071lines more than once.)-.15 F(File-)5.556 E 1.979(name completion no)72 159.6 R
10724.479(we)-.25 G 1.979(xpands v)173.357 159.6 R 1.979
1073(ariables in directory names.)-.25 F 1.978(The history e)6.978 F 1.978
1074(xpansion f)-.15 F 1.978(acilities are no)-.1 F(w)-.25 E 1.449
1075(nearly completely csh-compatible: missing modi\214ers ha)72 171.6 R 1.749 -.15
1076(ve b)-.2 H 1.449(een added and history substitution has been).15 F -.15(ex)72
1077183.6 S(tended.).15 E(Se)97 199.2 Q -.15(ve)-.25 G .474
1078(ral of the features described earlier).15 F 2.973(,s)-.4 G .473(uch as)266.483
1079199.2 R/F1 10/Times-Bold@0 SF .473(set -o posix)2.973 F F0(and)2.973 E F1
1080($POSIX_PED)2.973 E(ANTIC)-.35 E F0 2.973(,a)C .473(re ne)466.094 199.2 R 2.973
1081(wi)-.25 G(n)499 199.2 Q -.15(ve)72 211.2 S .106(rsion 1.14.).15 F .106
1082(There is a ne)5.106 F 2.606(ws)-.25 G .106(hell v)194.156 211.2 R(ariable,)
1083-.25 E F1(OSTYPE)2.606 E F0 2.606(,t)C 2.606(ow)296.724 211.2 S .106
1084(hich Bash assigns a v)311.55 211.2 R .106(alue that identi\214es the v)-.25 F
1085(er)-.15 E(-)-.2 E 1.38(sion of)72 223.2 R/F2 9/Times-Roman@0 SF(UNIX)3.88 E F0
1086(it')3.88 E 3.879(sr)-.55 G 1.379(unning on \(great for putting architecture-s\
1087peci\214c binary directories into the)150.57 223.2 R F1($P)3.879 E -.95(AT)-.74
1088G(H).95 E F0(\).)A -1 -.8(Tw o)72 235.2 T -.25(va)6.215 G 2.915(riables ha).25
1089F 3.215 -.15(ve b)-.2 H 2.915(een renamed:).15 F F1($HISTCONTR)5.416 E(OL)-.3 E
1090F0(replaces)5.416 E F1($history_contr)5.416 E(ol)-.18 E F0 5.416(,a)C(nd)
1091432.454 235.2 Q F1($HOSTFILE)5.416 E F0(replaces)72 247.2 Q F1
1092($hostname_completion_\214le)2.521 E F0 5.021(.I)C 2.521(nb)234.242 247.2 S
1093.021(oth cases, the old names are accepted for backw)246.763 247.2 R .02
1094(ards compatibil-)-.1 F(ity)72 259.2 Q 5.676(.T)-.65 G .677(he ksh)96.196 259.2
1095R/F3 10/Times-Italic@0 SF(select)3.177 E F0 .677(construct, which allo)4.843 F
1096.677(ws the generation of simple menus, has been implemented.)-.25 F(Ne)5.677 E
1097(w)-.25 E 2.892(capabilities ha)72 271.2 R 3.192 -.15(ve b)-.2 H 2.892
1098(een added to e).15 F 2.892(xisting v)-.15 F(ariables:)-.25 E F1($auto_r)5.392
1099E(esume)-.18 E F0 2.892(can no)5.392 F 5.392(wt)-.25 G(ak)404.13 271.2 Q 5.391
1100(ev)-.1 G 2.891(alues of)428.051 271.2 R F3 -.2(ex)5.391 G(act).2 E F0(or)7.057
1101E F3(substring)72 283.2 Q F0 3.278(,a)1.666 G(nd)121.114 283.2 Q F1($HISTCONTR)
11023.278 E(OL)-.3 E F0 .778(understands the v)3.278 F(alue)-.25 E F3(ignor)3.278 E
1103(eboth)-.37 E F0 3.278(,w)1.666 G .778(hich combines the tw)366.248 283.2 R
11043.278(op)-.1 G(re)467.03 283.2 Q(viously)-.25 E 1.556(acceptable v)72 295.2 R
11054.056(alues. The)-.25 F F1(dirs)4.056 E F0 -.2(bu)4.056 G 1.556
1106(iltin has acquired options to print out speci\214c members of the directory).2
1107F 3.062(stack. The)72 307.2 R F1($nolinks)3.062 E F0 -.25(va)3.062 G .562
1108(riable, which forces a ph).25 F .562(ysical vie)-.05 F 3.062(wo)-.25 G 3.062
1109(ft)322.028 307.2 S .563(he \214le system, has been superseded by the)331.2
1110307.2 R F1<ad50>72 319.2 Q F0 .494(option to the)2.994 F F1(set)2.994 E F0 -.2
1111(bu)2.994 G .494(iltin \(equi).2 F -.25(va)-.25 G .494(lent to).25 F F1 .494
1112(set -o ph)2.994 F(ysical)-.15 E F0 .493(\); the v)B .493
1113(ariable is retained for backw)-.25 F .493(ards compati-)-.1 F(bility)72 331.2
1114Q 5.196(.T)-.65 G .196(he v)106.276 331.2 R .196(ersion string contained in)
1115-.15 F F1($B)2.696 E(ASH_VERSION)-.3 E F0(no)2.696 E 2.696(wi)-.25 G .196
1116(ncludes an indication of the patch le)335.558 331.2 R -.15(ve)-.25 G 2.696(la)
1117.15 G(s)500.11 331.2 Q .665(well as the `)72 343.2 R(`b)-.74 E .665(uild v)-.2
1118F(ersion')-.15 E 3.165('. Some)-.74 F .665(little-used features ha)3.165 F .965
1119-.15(ve b)-.2 H .665(een remo).15 F -.15(ve)-.15 G 3.165(d: the).15 F F1(by)
11203.165 E(e)-.1 E F0(synon)3.165 E .665(ym for)-.15 F F1(exit)3.165 E F0(and)
11213.165 E(the)72 355.2 Q F1($NO_PR)3.498 E(OMPT_V)-.3 E(ARS)-1.35 E F0 -.25(va)
11223.498 G .998(riable are gone.).25 F .998(There is no)5.998 F 3.498(wa)-.25 G
11233.498(no)331.114 355.2 S -2.19 -.18(rg a)344.612 355.2 T .998
1124(nized test suite that can be run as a).18 F(re)72 367.2 Q
1125(gression test when b)-.15 E(uilding a ne)-.2 E 2.5(wv)-.25 G(ersion of Bash.)
1126222.34 367.2 Q 1.696(The documentation has been thoroughly o)97 382.8 R -.15
1127(ve)-.15 G 1.696(rhauled: there is a ne).15 F 4.196(wm)-.25 G 1.695
1128(anual page on the readline)392.25 382.8 R .467(library and the)72 394.8 R F3
1129(info)2.967 E F0 .467(\214le has been updated to re\215ect the current v)2.967
1130F 2.968(ersion. As)-.15 F(al)2.968 E -.1(wa)-.1 G .468(ys, as man).1 F 2.968
1131(yb)-.15 G .468(ugs as possi-)451.954 394.8 R(ble ha)72 406.8 Q .3 -.15(ve b)
1132-.2 H(een \214x).15 E(ed, although some surely remain.)-.15 E F1 2.5
1133(5.2. Other)72 430.8 R -.25(Fe)2.5 G(atur).25 E(es)-.18 E F0 1.68
1134(There are a fe)97 446.4 R 4.18(wf)-.25 G 1.68
1135(eatures that I hope to include in later Bash releases.)171.76 446.4 R 1.68
1136(Some are based on w)6.68 F(ork)-.1 E(already done in other shells.)72 458.4 Q
1137.958(In addition to simple v)97 474 R .959
1138(ariables, a future release of Bash will include one-dimensional arrays, using)
1139-.25 F .206(the ksh implementation of arrays as a model.)72 486 R .205
1140(Additions to the ksh syntax, such as)5.205 F F3(varname)2.705 E F0 .205
1141(=\( ... \) to assign)B 2.587(al)72 498 S .087(ist of w)81.807 498 R .088
1142(ords directly to an array and a mechanism to allo)-.1 F 2.588(wt)-.25 G(he)
1143320.248 498 Q F1 -.18(re)2.588 G(ad).18 E F0 -.2(bu)2.588 G .088
1144(iltin to read a list of v).2 F .088(alues directly)-.25 F .092(into an array)
114572 510 R 2.592(,w)-.65 G .092(ould be desirable.)134.286 510 R(Gi)5.092 E -.15
1146(ve)-.25 G 2.592(nt).15 G .092(hose e)239.794 510 R .092(xtensions, the ksh)
1147-.15 F F1 .092(set \255A)2.592 F F0 .091(syntax may not be w)2.591 F .091
1148(orth support-)-.1 F(ing \(the)72 522 Q F1<ad41>2.5 E F0
1149(option assigns a list of v)2.5 E(alues to an array)-.25 E 2.5(,b)-.65 G
1150(ut is a rather peculiar special case\).)292.41 522 Q .76
1151(Some shells include a means of)97 537.6 R F3(pr)3.26 E -.1(og)-.45 G -.15(ra)
1152.1 G(mmable).15 E F0 -.1(wo)3.26 G .76
1153(rd completion, where the user speci\214es on a per).1 F(-)-.2 E .163
1154(command basis ho)72 549.6 R 2.663(wt)-.25 G .163(he ar)159.179 549.6 R .163(g\
1155uments of the command are to be treated when completion is attempted: as \214l\
1156e-)-.18 F .194(names, hostnames, e)72 561.6 R -.15(xe)-.15 G .194
1157(cutable \214les, and so on.).15 F .195
1158(The other aspects of the current Bash implementation could)5.195 F .482
1159(remain as-is; the e)72 573.6 R .482(xisting heuristics w)-.15 F .481
1160(ould still be v)-.1 F 2.981(alid. Only)-.25 F .481(when completing the ar)
11612.981 F .481(guments to a simple)-.18 F(command w)72 585.6 Q
1162(ould the programmable completion be in ef)-.1 E(fect.)-.25 E .479(It w)97
1163601.2 R .479(ould also be nice to gi)-.1 F .779 -.15(ve t)-.25 H .479
1164(he user \214ner).15 F .479(-grained control o)-.2 F -.15(ve)-.15 G 2.98(rw).15
1165G .48(hich commands are sa)363.92 601.2 R -.15(ve)-.2 G 2.98(do).15 G .48
1166(nto the)476.02 601.2 R 1.786(history list.)72 613.2 R 1.786
1167(One proposal is for a v)6.786 F 1.786(ariable, tentati)-.25 F -.15(ve)-.25 G
11681.786(ly named).15 F F1(HISTIGNORE)4.286 E F0 4.285(,w)C 1.785(hich w)415.145
1169613.2 R 1.785(ould contain a)-.1 F .496(colon-separated list of commands.)72
1170625.2 R .496(Lines be)5.496 F .496
1171(ginning with these commands, after the restrictions of)-.15 F F1($HIST)2.997 E
1172(-)-.92 E(CONTR)72 637.2 Q(OL)-.3 E F0(ha)2.65 E .45 -.15(ve b)-.2 H .15
1173(een applied, w).15 F .15(ould not be placed onto the history list.)-.1 F .15
1174(The shell pattern-matching capa-)5.15 F(bilities could also be a)72 649.2 Q
1175-.25(va)-.2 G(ilable when specifying the contents of).25 E F1($HISTIGNORE)2.5 E
1176F0(.)A .729(One thing that ne)97 664.8 R .729(wer shells such as)-.25 F F1
1177(wksh)3.229 E F0 .729(\(also kno)3.229 F .729(wn as)-.25 F F1(dtksh)3.23 E F0
11783.23(\)p)C(ro)370.79 664.8 Q .73(vide is a command to dynami-)-.15 F 1.189
1179(cally load code implementing additional b)72 676.8 R 1.189
1180(uiltin commands into a running shell.)-.2 F 1.188(This ne)6.188 F 3.688(wb)
1181-.25 G 1.188(uiltin w)454.292 676.8 R(ould)-.1 E(tak)72 688.8 Q 2.69(ea)-.1 G
11822.69(no)95.69 688.8 S .19(bject \214le or shared library implementing the `)
1183108.38 688.8 R(`body')-.74 E 2.69('o)-.74 G 2.69(ft)327.83 688.8 S .19(he b)
1184336.63 688.8 R .19(uiltin \()-.2 F F3(xxx_b)A(uiltin\(\))-.2 E F0 .19
1185(for those f)2.69 F(amiliar)-.1 E .052
1186(with Bash internals\) and a structure containing the name of the ne)72 700.8 R
11872.552(wc)-.25 G .051(ommand, the function to call when the)349.544 700.8 R(ne)
118872 712.8 Q 3.458(wb)-.25 G .958(uiltin is in)96.668 712.8 R -.2(vo)-.4 G -.1
1189(ke).2 G 3.458(d\().1 G .959
1190(presumably de\214ned in the shared object speci\214ed as an ar)169.682 712.8 R
1191.959(gument\), and the docu-)-.18 F 1.352(mentation to be printed by the)72
1192724.8 R F1(help)3.851 E F0 1.351
1193(command \(possibly present in the shared object as well\).)3.851 F 1.351(It w)
11946.351 F(ould)-.1 E EP
1195%%Page: 10 10
1196%%BeginPageSetup
1197BP
1198%%EndPageSetup
1199/F0 10/Times-Roman@0 SF 2.5(-1)277.17 48 S 2.5(0-)288 48 S
1200(manage the details of e)72 84 Q(xtending the internal table of b)-.15 E
1201(uiltins.)-.2 E 3.291(Af)97 99.6 S 1.291 -.25(ew o)110.841 99.6 T .791(ther b)
1202.25 F .791(uiltins w)-.2 F .791(ould also be desirable: tw)-.1 F 3.291(oa)-.1 G
1203.791(re the POSIX.2)307.609 99.6 R/F1 10/Times-Bold@0 SF(getconf)3.292 E F0
1204.792(command, which prints)3.292 F 1.412(the v)72 111.6 R 1.412
1205(alues of system con\214guration v)-.25 F 1.411
1206(ariables de\214ned by POSIX.2, and a)-.25 F F1(diso)3.911 E(wn)-.1 E F0 -.2
1207(bu)3.911 G 1.411(iltin, which causes a).2 F 1.173
1208(shell running with job control acti)72 123.6 R 1.473 -.15(ve t)-.25 H 3.673
1209(o`).15 G(`for)240.45 123.6 Q 1.173(get about')-.18 F 3.673('o)-.74 G 1.173
1210(ne or more background jobs in its internal jobs)307.966 123.6 R 3.465
1211(table. Using)72 135.6 R F1(getconf)3.465 E F0 3.465(,f)C .965(or e)167.655
1212135.6 R .965(xample, a user could retrie)-.15 F 1.264 -.15(ve a v)-.25 H .964
1213(alue for)-.1 F F1($P)3.464 E -.95(AT)-.74 G(H).95 E F0 .964
1214(guaranteed to \214nd all of the)3.464 F .884
1215(POSIX standard utilities, or \214nd out ho)72 147.6 R 3.385(wl)-.25 G .885
1216(ong \214lenames may be in the \214le system containing a speci\214ed)247.39
1217147.6 R(directory)72 159.6 Q(.)-.65 E 1.521
1218(There are no implementation timetables for an)97 175.2 R 4.021(yo)-.15 G 4.021
1219(ft)305.517 175.2 S 1.52(hese features, nor are there concrete plans to)315.648
1220175.2 R(include them.)72 187.2 Q(If an)5 E
1221(yone has comments on these proposals, feel free to send me electronic mail.)
1222-.15 E F1 2.5(6. Re\215ections)72 211.2 R(and Lessons Lear)2.5 E(ned)-.15 E F0
1223.433(The lesson that has been repeated most often during Bash de)97 226.8 R
1224-.15(ve)-.25 G .433(lopment is that there are dark corners).15 F .093
1225(in the Bourne Shell, and people use all of them.)72 238.8 R .092
1226(In the original description of the Bourne shell, quoting and)5.093 F .073(the\
1227 shell grammar are both poorly speci\214ed and incomplete; subsequent descript\
1228ions ha)72 250.8 R .373 -.15(ve n)-.2 H .073(ot helped much.).15 F 1.856
1229(The grammar presented in Bourne')72 262.8 R 4.356(sp)-.55 G 1.856
1230(aper describing the shell distrib)232.64 262.8 R 1.855(uted with the Se)-.2 F
1231-.15(ve)-.25 G 1.855(nth Edition of).15 F/F2 9/Times-Roman@0 SF(UNIX)72 274.8 Q
1232F0 2.5<8769>C 2.5(ss)104.771 274.8 S 2.5(of)115.051 274.8 S(ar of)125.781 274.8
1233Q 2.5(ft)-.25 G(hat it does not allo)152.741 274.8 Q 2.5(wt)-.25 G(he command)
1234238.881 274.8 Q/F3 10/Courier@0 SF(who|wc)2.5 E F0 5(.I)C 2.5(nf)339.591 274.8
1235S(act, as T)350.321 274.8 Q(om Duf)-.8 E 2.5(fs)-.25 G(tates:)423.421 274.8 Q
12361.375(Nobody really kno)97 290.4 R 1.375(ws what the Bourne shell')-.25 F 3.875
1237(sg)-.55 G 1.375(rammar is.)296.635 290.4 R(Ev)6.376 E 1.376(en e)-.15 F 1.376
1238(xamination of the source)-.15 F(code is little help.\210)97 302.4 Q .382
1239(The POSIX.2 standard includes a)72 318 R/F4 10/Times-Italic@0 SF(yacc)2.882 E
1240F0 .382(grammar that comes close to capturing the Bourne shell')2.882 F 2.882
1241(sb)-.55 G(eha)472.11 318 Q(vior)-.2 E(,)-.4 E -.2(bu)72 330 S 3.246(ti).2 G
12423.246(td)90.606 330 S(isallo)101.632 330 Q .747(ws some constructs which sh ac\
1243cepts without complaint \255 and there are scripts out there that)-.25 F .501
1244(use them.)72 342 R .501(It took a fe)5.501 F 3.001(wv)-.25 G .501
1245(ersions and se)176.256 342 R -.15(ve)-.25 G .501(ral b).15 F .5
1246(ug reports before Bash implemented sh-compatible quoting,)-.2 F .094
1247(and there are still some `)72 354 R(`le)-.74 E -.05(ga)-.15 G(l').05 E 2.594
1248('s)-.74 G 2.594(hc)205.294 354 S .094
1249(onstructs which Bash \215ags as syntax errors.)217.328 354 R .095
1250(Complete sh compatibility)5.095 F(is a tough nut.)72 366 Q 1.231
1251(The shell is bigger and slo)97 381.6 R 1.231(wer than I w)-.25 F 1.231
1252(ould lik)-.1 F 1.23(e, though the current v)-.1 F 1.23
1253(ersion is substantially f)-.15 F(aster)-.1 E .086(than pre)72 393.6 R(viously)
1254-.25 E 5.086(.T)-.65 G .087(he readline library could stand a substantial re)
1255146.822 393.6 R 2.587(write. A)-.25 F .087(hand-written parser to replace the)
12562.587 F(current)72 405.6 Q F4(yacc)2.978 E F0 .478(-generated one w)B .477
1257(ould probably result in a speedup, and w)-.1 F .477(ould solv)-.1 F 2.977(eo)
1258-.15 G .477(ne glaring problem:)406.469 405.6 R(the)5.477 E .199
1259(shell could parse commands in `)72 417.6 R(`$\(...\)')-.74 E 2.699('c)-.74 G
1260.199(onstructs as the)236.954 417.6 R 2.699(ya)-.15 G .2
1261(re entered, rather than reporting errors when the)311.001 417.6 R
1262(construct is e)72 429.6 Q(xpanded.)-.15 E 1.064(As al)97 445.2 R -.1(wa)-.1 G
12631.064(ys, there is some chaf).1 F 3.564(ft)-.25 G 3.564(og)230.404 445.2 S
12643.564(ow)243.968 445.2 S 1.064(ith the wheat.)259.752 445.2 R 1.063
1265(Areas of duplicated functionality need to be)6.063 F .382(cleaned up.)72 457.2
1266R .382(There are se)5.382 F -.15(ve)-.25 G .382
1267(ral cases where Bash treats a v).15 F .382
1268(ariable specially to enable functionality a)-.25 F -.25(va)-.2 G(ilable).25 E
1269.185(another w)72 469.2 R .185(ay \()-.1 F F1($notify)A F0(vs.)2.684 E F1 .184
1270(set -o notify)5.184 F F0(and)2.684 E F1($nolinks)2.684 E F0(vs.)2.684 E F1
1271.184(set -o ph)2.684 F(ysical)-.15 E F0 2.684(,f)C .184
1272(or instance\); the special treatment)368.294 469.2 R 3.421(of the v)72 481.2 R
12733.421(ariable name should probably be remo)-.25 F -.15(ve)-.15 G 5.921(d. A).15
1274F(fe)5.921 E 5.921(wm)-.25 G 3.422(ore things could stand remo)346.47 481.2 R
1275-.25(va)-.15 G 3.422(l; the).25 F F1($allo)72 493.2 Q(w_null_glob_expansion)-.1
1276E F0(and)4.112 E F1($glob_dot_\214lenames)4.112 E F0 -.25(va)4.111 G 1.611
1277(riables are of particularly questionable v).25 F(alue.)-.25 E(The)72 505.2 Q
1278F1($[...])3.977 E F0 1.477(arithmetic e)3.977 F -.25(va)-.25 G 1.478
1279(luation syntax is redundant no).25 F 3.978(wt)-.25 G 1.478
1280(hat the POSIX-mandated)312.76 505.2 R F1($\(\(...\)\))3.978 E F0 1.478
1281(construct has)3.978 F .326(been implemented, and could be deleted.)72 517.2 R
1282.326(It w)5.326 F .326(ould be nice if the te)-.1 F .326(xt output by the)-.15
1283F F1(help)2.825 E F0 -.2(bu)2.825 G .325(iltin were e).2 F(xter)-.15 E(-)-.2 E
1284.061(nal to the shell rather than compiled into it.)72 529.2 R .062(The beha)
12855.062 F .062(vior enabled by)-.2 F F1($command_oriented_history)2.562 E F0
12862.562(,w)C(hich)486.78 529.2 Q 1.125(causes the shell to attempt to sa)72 541.2
1287R 1.424 -.15(ve a)-.2 H 1.124
1288(ll lines of a multi-line command in a single history entry).15 F 3.624(,s)-.65
1289G 1.124(hould be)468.156 541.2 R(made the def)72 553.2 Q(ault and the v)-.1 E
1290(ariable remo)-.25 E -.15(ve)-.15 G(d.).15 E F1 2.5(7. A)72 577.2 R -.1(va)-1 G
1291(ilability).1 E F0 8.538(As with all other GNU softw)97 592.8 R 8.538
1292(are, Bash is a)-.1 F -.25(va)-.2 G 8.539(ilable for anon).25 F 8.539
1293(ymous FTP from)-.15 F F4(pr)72 604.8 Q(ep.ai.mit.edu:/pub/gnu)-.37 E F0 4.552
1294(and from other GNU softw)8.718 F 4.552(are mirror sites.)-.1 F 4.552
1295(The current v)9.552 F 4.552(ersion is in)-.15 F F4(bash-1.14.1.tar)72 616.8 Q
1296(.gz)-1.11 E F0 .074(in that directory)4.24 F 5.075(.U)-.65 G(se)226.084 616.8
1297Q F4(ar)2.575 E -.15(ch)-.37 G(ie).15 E F0 .075(to \214nd the nearest archi)
12984.241 F .375 -.15(ve s)-.25 H 2.575(ite. The).15 F .075(latest v)2.575 F .075
1299(ersion is al)-.15 F -.1(wa)-.1 G(ys).1 E -.2(av)72 628.8 S 3.659
1300(ailable for FTP from)-.05 F F4(bash.CWR)6.159 E -.25(U.)-.4 G(Edu:/pub/dist.)
1301.25 E F0 3.658(Bash documentation is a)7.825 F -.25(va)-.2 G 3.658
1302(ilable for FTP from).25 F F4(bash.CWR)72 640.8 Q -.25(U.)-.4 G(Edu:/pub/bash.)
1303.25 E F0 1.168(The Free Softw)97 656.4 R 1.168(are F)-.1 F 1.168
1304(oundation sells tapes and CD-R)-.15 F 1.169
1305(OMs containing Bash; send electronic mail to)-.4 F F3(gnu@prep.ai.mit.edu)72
1306668.4 Q F0(or call)2.5 E F3(+1-617-876-3296)2.5 E F0(for more information.)2.5
1307E .32 LW 76 678.4 72 678.4 DL 80 678.4 76 678.4 DL 84 678.4 80 678.4 DL 88
1308678.4 84 678.4 DL 92 678.4 88 678.4 DL 96 678.4 92 678.4 DL 100 678.4 96 678.4
1309DL 104 678.4 100 678.4 DL 108 678.4 104 678.4 DL 112 678.4 108 678.4 DL 116
1310678.4 112 678.4 DL 120 678.4 116 678.4 DL 124 678.4 120 678.4 DL 128 678.4 124
1311678.4 DL 132 678.4 128 678.4 DL 136 678.4 132 678.4 DL 140 678.4 136 678.4 DL
1312144 678.4 140 678.4 DL/F5 8/Times-Roman@0 SF 1.39(\207S. R. Bourne, `)72 688.4
1313R 1.389(`UNIX T)-.592 F 1.389(ime-Sharing System:)-.28 F 1.389(The UNIX Shell')
13145.389 F(',)-.592 E/F6 8/Times-Italic@0 SF 1.389(Bell System T)3.389 F(ec)-.736
1315E 1.389(hnical J)-.12 F(ournal)-.2 E F5 3.389(,5)C 1.389(7\(6\), July-August,)
1316408.171 688.4 R(1978, pp. 1971-1990.)72 698.4 Q<8854>72 708.4 Q .684(om Duf)
1317-.64 F .684(f, `)-.2 F .684(`Rc \255 A Shell for Plan 9 and)-.592 F/F7 7
1318/Times-Roman@0 SF(UNIX)2.684 E F5(systems')2.684 E(',)-.592 E F6(Pr)2.684 E
1319.684(oc. of the Summer 1990 EUUG Confer)-.36 F(ence)-.296 E F5 2.685(,L)C .685
1320(ondon, July)428.499 708.4 R(,)-.52 E(1990, pp. 21-33.)72 718.4 Q EP
1321%%Page: 11 11
1322%%BeginPageSetup
1323BP
1324%%EndPageSetup
1325/F0 10/Times-Roman@0 SF 2.5(-1)277.17 48 S 2.5(1-)288 48 S .695
1326(Bash is also distrib)97 84 R .694(uted with se)-.2 F -.15(ve)-.25 G .694
1327(ral v).15 F .694(ersions of)-.15 F/F1 9/Times-Roman@0 SF(UNIX)3.194 E F0 .694
1328(-compatible systems.)B .694(It is included as /bin/sh)5.694 F .948
1329(and /bin/bash on se)72 96 R -.15(ve)-.25 G .948(ral Linux distrib).15 F .948
1330(utions \(more about the dif)-.2 F .948(ference in a moment\), and as contrib)
1331-.25 F(uted)-.2 E(softw)72 108 Q(are in BSDI')-.1 E 2.5(sB)-.55 G
1332(SD/386* and FreeBSD.)157.73 108 Q .599(The Linux distrib)97 123.6 R .599
1333(ution deserv)-.2 F .599(es special mention.)-.15 F .598(There are tw)5.599 F
13343.098(oc)-.1 G .598(on\214gurations included in the stan-)364.948 123.6 R .547
1335(dard Bash distrib)72 135.6 R .547(ution: a `)-.2 F(`normal')-.74 E 3.047('c)
1336-.74 G .548
1337(on\214guration, in which all of the standard features are included, and a)
1338222.755 135.6 R -.74(``)72 147.6 S(minimal').74 E 2.792('c)-.74 G .292(on\214g\
1339uration, which omits job control, aliases, history and command line editing, t\
1340he directory)124.412 147.6 R .747(stack and)72 159.6 R/F2 10/Times-Bold@0 SF
1341(pushd/popd/dirs,)3.247 E F0 .747
1342(process substitution, prompt string special character decoding, and the)3.247
1343F/F3 10/Times-Italic@0 SF(select)3.247 E F0 3.369(construct. This)72 171.6 R
1344.869(minimal v)3.369 F .869
1345(ersion is designed to be a drop-in replacement for the traditional)-.15 F F1
1346(UNIX)3.368 E F0(/bin/sh,)3.368 E(and is included as the Linux /bin/sh in se)72
1347183.6 Q -.15(ve)-.25 G(ral packagings.).15 E F2 2.5(8. Conclusion)72 207.6 R F0
1348.8(Bash is a w)97 223.2 R(orth)-.1 E 3.3(ys)-.05 G .8(uccessor to sh.)173.379
1349223.2 R .8(It is suf)5.8 F .8(\214ciently portable to run on nearly e)-.25 F
1350-.15(ve)-.25 G .8(ry v).15 F .8(ersion of)-.15 F F1(UNIX)3.3 E F0 .311
1351(from 4.3 BSD to SVR4.2, and se)72 235.2 R -.15(ve)-.25 G(ral).15 E F1(UNIX)
13522.811 E F0 -.1(wo)2.811 G(rkalik).1 E 2.811(es. It)-.1 F .31(is rob)2.81 F .31
1353(ust enough to replace sh on most of those)-.2 F 1.515(systems, and pro)72
1354247.2 R 1.515(vides more functionality)-.15 F 6.515(.I)-.65 G 4.015(th)254.315
1355247.2 S 1.515(as se)266.11 247.2 R -.15(ve)-.25 G 1.515(ral thousand re).15 F
13561.515(gular users, and their feedback has)-.15 F(helped to mak)72 259.2 Q 2.5
1357(ei)-.1 G 2.5(ta)138.28 259.2 S 2.5(sg)148 259.2 S
1358(ood as it is today \255 a testament to the bene\214ts of free softw)159.39
1359259.2 Q(are.)-.1 E .32 LW 76 698 72 698 DL 80 698 76 698 DL 84 698 80 698 DL 88
1360698 84 698 DL 92 698 88 698 DL 96 698 92 698 DL 100 698 96 698 DL 104 698 100
1361698 DL 108 698 104 698 DL 112 698 108 698 DL 116 698 112 698 DL 120 698 116 698
1362DL 124 698 120 698 DL 128 698 124 698 DL 132 698 128 698 DL 136 698 132 698 DL
1363140 698 136 698 DL 144 698 140 698 DL/F4 8/Times-Roman@0 SF
1364(*BSD/386 is a trademark of Berk)72 708 Q(ele)-.08 E 2(yS)-.12 G(oftw)198.896
1365708 Q(are Design, Inc.)-.08 E EP
1366%%Trailer
1367end
1368%%EOF