commit bash-20110415 snapshot

This commit is contained in:
Chet Ramey
2011-12-29 13:06:34 -05:00
parent af32e54dd7
commit f6da9f8595
36 changed files with 5132 additions and 4847 deletions
+307 -303
View File
@@ -11,7 +11,7 @@
%DVIPSWebPage: (www.radicaleye.com)
%DVIPSCommandLine: dvips -D 600 -t letter -o bashref.ps bashref.dvi
%DVIPSParameters: dpi=600
%DVIPSSource: TeX output 2011.03.09:1705
%DVIPSSource: TeX output 2011.04.11:1701
%%BeginProcSet: tex.pro 0 0
%!
/TeXDict 300 dict def TeXDict begin/N{def}def/B{bind def}N/S{exch}N/X{S
@@ -4319,26 +4319,25 @@ letter
TeXDict begin 1 0 bop 150 1318 a Fu(Bash)64 b(Reference)j(Man)-5
b(ual)p 150 1385 3600 34 v 2361 1481 a Ft(Reference)31
b(Do)s(cumen)m(tation)i(for)d(Bash)2428 1589 y(Edition)h(4.2,)g(for)f
Fs(Bash)g Ft(V)-8 b(ersion)31 b(4.2.)3145 1697 y(Decem)m(b)s(er)g(2010)
150 4935 y Fr(Chet)45 b(Ramey)-11 b(,)46 b(Case)g(W)-11
b(estern)46 b(Reserv)l(e)g(Univ)l(ersit)l(y)150 5068
y(Brian)f(F)-11 b(o)l(x,)45 b(F)-11 b(ree)45 b(Soft)l(w)l(are)h(F)-11
Fs(Bash)g Ft(V)-8 b(ersion)31 b(4.2.)3333 1697 y(April)f(2011)150
4935 y Fr(Chet)45 b(Ramey)-11 b(,)46 b(Case)g(W)-11 b(estern)46
b(Reserv)l(e)g(Univ)l(ersit)l(y)150 5068 y(Brian)f(F)-11
b(o)l(x,)45 b(F)-11 b(ree)45 b(Soft)l(w)l(are)h(F)-11
b(oundation)p 150 5141 3600 17 v eop end
%%Page: 2 2
TeXDict begin 2 1 bop 150 2889 a Ft(This)35 b(text)h(is)g(a)g(brief)f
(description)h(of)f(the)h(features)g(that)g(are)g(presen)m(t)g(in)f
(the)h(Bash)f(shell)h(\(v)m(ersion)150 2999 y(4.2,)c(28)f(Decem)m(b)s
(er)g(2010\).)150 3133 y(This)f(is)g(Edition)h(4.2,)h(last)g(up)s
(dated)d(28)i(Decem)m(b)s(er)h(2010,)h(of)d Fq(The)g(GNU)i(Bash)e
(Reference)i(Man)m(ual)p Ft(,)150 3243 y(for)e Fs(Bash)p
Ft(,)g(V)-8 b(ersion)31 b(4.2.)150 3377 y(Cop)m(yrigh)m(t)602
3374 y(c)577 3377 y Fp(\015)f Ft(1988{2011)35 b(F)-8
b(ree)31 b(Soft)m(w)m(are)h(F)-8 b(oundation,)31 b(Inc.)150
3512 y(P)m(ermission)h(is)h(gran)m(ted)g(to)f(mak)m(e)i(and)d
(distribute)h(v)m(erbatim)h(copies)g(of)f(this)g(man)m(ual)h(pro)m
(vided)f(the)150 3621 y(cop)m(yrigh)m(t)g(notice)f(and)f(this)g(p)s
(ermission)g(notice)h(are)g(preserv)m(ed)f(on)h(all)g(copies.)390
3756 y(P)m(ermission)k(is)h(gran)m(ted)f(to)h(cop)m(y)-8
(the)h(Bash)f(shell)h(\(v)m(ersion)150 2999 y(4.2,)c(11)f(April)f
(2011\).)150 3133 y(This)j(is)h(Edition)f(4.2,)j(last)f(up)s(dated)d
(11)j(April)e(2011,)k(of)d Fq(The)f(GNU)h(Bash)g(Reference)g(Man)m(ual)
p Ft(,)i(for)150 3243 y Fs(Bash)p Ft(,)29 b(V)-8 b(ersion)31
b(4.2.)150 3377 y(Cop)m(yrigh)m(t)602 3374 y(c)577 3377
y Fp(\015)f Ft(1988{2011)35 b(F)-8 b(ree)31 b(Soft)m(w)m(are)h(F)-8
b(oundation,)31 b(Inc.)150 3512 y(P)m(ermission)h(is)h(gran)m(ted)g(to)
f(mak)m(e)i(and)d(distribute)h(v)m(erbatim)h(copies)g(of)f(this)g(man)m
(ual)h(pro)m(vided)f(the)150 3621 y(cop)m(yrigh)m(t)g(notice)f(and)f
(this)g(p)s(ermission)g(notice)h(are)g(preserv)m(ed)f(on)h(all)g
(copies.)390 3756 y(P)m(ermission)k(is)h(gran)m(ted)f(to)h(cop)m(y)-8
b(,)38 b(distribute)d(and/or)g(mo)s(dify)f(this)h(do)s(cumen)m(t)g
(under)390 3866 y(the)j(terms)g(of)g(the)g(GNU)h(F)-8
b(ree)39 b(Do)s(cumen)m(tation)h(License,)g(V)-8 b(ersion)39
@@ -6157,7 +6156,7 @@ Fq(\014lename)g(expansion)f Ft(\(see)i(Section)f(3.5.8)i([Filename)f
b(to)g(b)s(e)f(brace)h(expanded)e(tak)m(e)j(the)f(form)f(of)150
3705 y(an)29 b(optional)i Fq(pream)m(ble)5 b Ft(,)30
b(follo)m(w)m(ed)i(b)m(y)d(either)h(a)g(series)g(of)g(comma-separated)h
(strings)e(or)h(a)g(seqeunce)150 3815 y(expression)36
(strings)e(or)h(a)g(sequence)150 3815 y(expression)36
b(b)s(et)m(w)m(een)g(a)g(pair)g(of)g(braces,)i(follo)m(w)m(ed)f(b)m(y)f
(an)g(optional)h Fq(p)s(ostscript)r Ft(.)56 b(The)36
b(pream)m(ble)g(is)150 3924 y(pre\014xed)28 b(to)h(eac)m(h)h(string)f
@@ -6949,267 +6948,269 @@ y Fj(3.6.3)63 b(App)s(ending)42 b(Redirected)e(Output)150
(ending)e(on)i(\014le)g(descriptor)g Fq(n)p Ft(,)g(or)g(the)g(standard)
f(output)h(\(\014le)g(descriptor)150 665 y(1\))31 b(if)f
Fq(n)g Ft(is)h(not)f(sp)s(eci\014ed.)40 b(If)30 b(the)h(\014le)f(do)s
(es)g(not)h(exist)g(it)g(is)f(created.)275 803 y(The)f(general)j
(format)e(for)h(app)s(ending)e(output)h(is:)390 940 y
Fs([)p Fi(n)11 b Fs(]>>)p Fi(word)150 1143 y Fj(3.6.4)63
(es)g(not)h(exist)g(it)g(is)f(created.)275 807 y(The)f(general)j
(format)e(for)h(app)s(ending)e(output)h(is:)390 948 y
Fs([)p Fi(n)11 b Fs(]>>)p Fi(word)150 1155 y Fj(3.6.4)63
b(Redirecting)40 b(Standard)h(Output)g(and)g(Standard)g(Error)150
1290 y Ft(This)33 b(construct)i(allo)m(ws)g(b)s(oth)f(the)g(standard)g
1302 y Ft(This)33 b(construct)i(allo)m(ws)g(b)s(oth)f(the)g(standard)g
(output)f(\(\014le)i(descriptor)f(1\))h(and)f(the)g(standard)f(error)
150 1399 y(output)d(\(\014le)h(descriptor)f(2\))h(to)g(b)s(e)f
150 1411 y(output)d(\(\014le)h(descriptor)f(2\))h(to)g(b)s(e)f
(redirected)h(to)g(the)f(\014le)h(whose)f(name)h(is)f(the)g(expansion)h
(of)f Fq(w)m(ord)t Ft(.)275 1537 y(There)f(are)i(t)m(w)m(o)h(formats)e
(of)f Fq(w)m(ord)t Ft(.)275 1553 y(There)f(are)i(t)m(w)m(o)h(formats)e
(for)h(redirecting)g(standard)e(output)h(and)g(standard)f(error:)390
1675 y Fs(&>)p Fi(word)150 1812 y Ft(and)390 1950 y Fs(>&)p
Fi(word)150 2087 y Ft(Of)h(the)g(t)m(w)m(o)i(forms,)e(the)h(\014rst)e
1695 y Fs(&>)p Fi(word)150 1837 y Ft(and)390 1978 y Fs(>&)p
Fi(word)150 2120 y Ft(Of)h(the)g(t)m(w)m(o)i(forms,)e(the)h(\014rst)e
(is)i(preferred.)39 b(This)30 b(is)g(seman)m(tically)j(equiv)-5
b(alen)m(t)32 b(to)390 2225 y Fs(>)p Fi(word)57 b Fs(2>&1)150
2427 y Fj(3.6.5)63 b(App)s(ending)42 b(Standard)f(Output)g(and)g
(Standard)g(Error)150 2574 y Ft(This)33 b(construct)i(allo)m(ws)g(b)s
b(alen)m(t)32 b(to)390 2262 y Fs(>)p Fi(word)57 b Fs(2>&1)275
2403 y Ft(\(see)31 b(Duplicating)h(File)f(Descriptors)g(b)s(elo)m(w\).)
150 2610 y Fj(3.6.5)63 b(App)s(ending)42 b(Standard)f(Output)g(and)g
(Standard)g(Error)150 2757 y Ft(This)33 b(construct)i(allo)m(ws)g(b)s
(oth)f(the)g(standard)g(output)f(\(\014le)i(descriptor)f(1\))h(and)f
(the)g(standard)f(error)150 2684 y(output)d(\(\014le)h(descriptor)f
(the)g(standard)f(error)150 2867 y(output)d(\(\014le)h(descriptor)f
(2\))h(to)g(b)s(e)f(app)s(ended)f(to)i(the)f(\014le)h(whose)f(name)g
(is)h(the)f(expansion)h(of)f Fq(w)m(ord)t Ft(.)275 2822
(is)h(the)f(expansion)h(of)f Fq(w)m(ord)t Ft(.)275 3008
y(The)f(format)i(for)f(app)s(ending)f(standard)h(output)g(and)f
(standard)h(error)g(is:)390 2959 y Fs(&>>)p Fi(word)150
3097 y Ft(This)g(is)g(seman)m(tically)j(equiv)-5 b(alen)m(t)32
b(to)390 3235 y Fs(>>)p Fi(word)57 b Fs(2>&1)150 3437
y Fj(3.6.6)63 b(Here)41 b(Do)s(cumen)m(ts)150 3584 y
Ft(This)c(t)m(yp)s(e)h(of)f(redirection)i(instructs)e(the)h(shell)f(to)
i(read)e(input)g(from)g(the)h(curren)m(t)f(source)h(un)m(til)g(a)150
3694 y(line)31 b(con)m(taining)g(only)g Fq(w)m(ord)i
(standard)h(error)g(is:)390 3150 y Fs(&>>)p Fi(word)150
3292 y Ft(This)g(is)g(seman)m(tically)j(equiv)-5 b(alen)m(t)32
b(to)390 3433 y Fs(>>)p Fi(word)57 b Fs(2>&1)275 3575
y Ft(\(see)31 b(Duplicating)h(File)f(Descriptors)g(b)s(elo)m(w\).)150
3782 y Fj(3.6.6)63 b(Here)41 b(Do)s(cumen)m(ts)150 3929
y Ft(This)c(t)m(yp)s(e)h(of)f(redirection)i(instructs)e(the)h(shell)f
(to)i(read)e(input)g(from)g(the)h(curren)m(t)f(source)h(un)m(til)g(a)
150 4038 y(line)31 b(con)m(taining)g(only)g Fq(w)m(ord)i
Ft(\(with)d(no)h(trailing)g(blanks\))f(is)g(seen.)41
b(All)31 b(of)f(the)h(lines)f(read)g(up)f(to)i(that)150
3803 y(p)s(oin)m(t)f(are)h(then)f(used)g(as)g(the)h(standard)f(input)f
(for)h(a)h(command.)275 3941 y(The)e(format)i(of)g(here-do)s(cumen)m
(ts)f(is:)390 4078 y Fs(<<[)p Fp(\000)p Fs(])p Fi(word)772
4188 y(here-document)390 4298 y(delimiter)275 4435 y
4148 y(p)s(oin)m(t)f(are)h(then)f(used)g(as)g(the)h(standard)f(input)f
(for)h(a)h(command.)275 4289 y(The)e(format)i(of)g(here-do)s(cumen)m
(ts)f(is:)390 4431 y Fs(<<[)p Fp(\000)p Fs(])p Fi(word)772
4541 y(here-document)390 4650 y(delimiter)275 4792 y
Ft(No)j(parameter)h(expansion,)g(command)f(substitution,)h(arithmetic)h
(expansion,)f(or)f(\014lename)g(ex-)150 4545 y(pansion)h(is)h(p)s
(expansion,)f(or)f(\014lename)g(ex-)150 4902 y(pansion)h(is)h(p)s
(erformed)f(on)g Fq(w)m(ord)t Ft(.)54 b(If)34 b(an)m(y)h(c)m(haracters)
i(in)d Fq(w)m(ord)k Ft(are)d(quoted,)i(the)e Fq(delimiter)42
b Ft(is)35 b(the)150 4654 y(result)40 b(of)g(quote)h(remo)m(v)-5
b Ft(is)35 b(the)150 5011 y(result)40 b(of)g(quote)h(remo)m(v)-5
b(al)42 b(on)e Fq(w)m(ord)t Ft(,)i(and)d(the)i(lines)f(in)g(the)g
(here-do)s(cumen)m(t)h(are)f(not)g(expanded.)150 4764
(here-do)s(cumen)m(t)h(are)f(not)g(expanded.)150 5121
y(If)32 b Fq(w)m(ord)k Ft(is)d(unquoted,)f(all)i(lines)f(of)f(the)h
(here-do)s(cumen)m(t)g(are)g(sub)5 b(jected)32 b(to)i(parameter)f
(expansion,)150 4874 y(command)25 b(substitution,)g(and)g(arithmetic)h
(expansion,)150 5230 y(command)25 b(substitution,)g(and)g(arithmetic)h
(expansion.)39 b(In)24 b(the)h(latter)h(case,)h(the)e(c)m(haracter)i
(sequence)150 4983 y Fs(\\newline)h Ft(is)j(ignored,)f(and)g(`)p
(sequence)150 5340 y Fs(\\newline)h Ft(is)j(ignored,)f(and)g(`)p
Fs(\\)p Ft(')h(m)m(ust)f(b)s(e)g(used)f(to)i(quote)g(the)g(c)m
(haracters)h(`)p Fs(\\)p Ft(',)e(`)p Fs($)p Ft(',)h(and)f(`)p
Fs(`)p Ft('.)275 5121 y(If)21 b(the)i(redirection)g(op)s(erator)g(is)f
(`)p Fs(<<-)p Ft(',)i(then)e(all)h(leading)g(tab)g(c)m(haracters)h(are)
e(stripp)s(ed)f(from)h(input)150 5230 y(lines)33 b(and)e(the)i(line)g
(con)m(taining)h Fq(delimiter)7 b Ft(.)47 b(This)31 b(allo)m(ws)j
(here-do)s(cumen)m(ts)f(within)e(shell)i(scripts)f(to)150
5340 y(b)s(e)e(inden)m(ted)g(in)g(a)h(natural)f(fashion.)p
eop end
Fs(`)p Ft('.)p eop end
%%Page: 30 36
TeXDict begin 30 35 bop 150 -116 a Ft(30)2572 b(Bash)31
b(Reference)g(Man)m(ual)150 299 y Fj(3.6.7)63 b(Here)41
b(Strings)150 446 y Ft(A)30 b(v)-5 b(arian)m(t)32 b(of)e(here)h(do)s
(cumen)m(ts,)f(the)g(format)h(is:)390 596 y Fs(<<<)47
b Fi(word)275 745 y Ft(The)28 b Fq(w)m(ord)k Ft(is)d(expanded)f(as)h
(describ)s(ed)f(ab)s(o)m(v)m(e,)i(with)f(the)g(exception)h(that)f
(pathname)g(expansion)150 855 y(is)h(not)h(applied,)f(and)g(supplied)f
(as)i(a)g(single)g(string)f(to)h(the)g(command)f(on)g(its)h(standard)e
(input.)150 1069 y Fj(3.6.8)63 b(Duplicating)41 b(File)g(Descriptors)
150 1216 y Ft(The)30 b(redirection)h(op)s(erator)390
1366 y Fs([)p Fi(n)11 b Fs(]<&)p Fi(word)150 1516 y Ft(is)35
b(Reference)g(Man)m(ual)275 299 y(If)21 b(the)i(redirection)g(op)s
(erator)g(is)f(`)p Fs(<<-)p Ft(',)i(then)e(all)h(leading)g(tab)g(c)m
(haracters)h(are)e(stripp)s(ed)f(from)h(input)150 408
y(lines)33 b(and)e(the)i(line)g(con)m(taining)h Fq(delimiter)7
b Ft(.)47 b(This)31 b(allo)m(ws)j(here-do)s(cumen)m(ts)f(within)e
(shell)i(scripts)f(to)150 518 y(b)s(e)e(inden)m(ted)g(in)g(a)h(natural)
f(fashion.)150 725 y Fj(3.6.7)63 b(Here)41 b(Strings)150
871 y Ft(A)30 b(v)-5 b(arian)m(t)32 b(of)e(here)h(do)s(cumen)m(ts,)f
(the)g(format)h(is:)390 1013 y Fs(<<<)47 b Fi(word)275
1155 y Ft(The)28 b Fq(w)m(ord)k Ft(is)d(expanded)f(as)h(describ)s(ed)f
(ab)s(o)m(v)m(e,)i(with)f(the)g(exception)h(that)f(pathname)g
(expansion)150 1264 y(is)h(not)h(applied,)f(and)g(supplied)f(as)i(a)g
(single)g(string)f(to)h(the)g(command)f(on)g(its)h(standard)e(input.)
150 1471 y Fj(3.6.8)63 b(Duplicating)41 b(File)g(Descriptors)150
1618 y Ft(The)30 b(redirection)h(op)s(erator)390 1760
y Fs([)p Fi(n)11 b Fs(]<&)p Fi(word)150 1901 y Ft(is)35
b(used)e(to)j(duplicate)f(input)f(\014le)g(descriptors.)53
b(If)34 b Fq(w)m(ord)k Ft(expands)c(to)h(one)g(or)g(more)g(digits,)h
(the)f(\014le)150 1626 y(descriptor)e(denoted)h(b)m(y)g
(the)f(\014le)150 2011 y(descriptor)e(denoted)h(b)m(y)g
Fq(n)f Ft(is)g(made)h(to)g(b)s(e)f(a)h(cop)m(y)g(of)g(that)g(\014le)g
(descriptor.)50 b(If)33 b(the)h(digits)g(in)f Fq(w)m(ord)150
1735 y Ft(do)c(not)h(sp)s(ecify)f(a)h(\014le)f(descriptor)g(op)s(en)g
2120 y Ft(do)c(not)h(sp)s(ecify)f(a)h(\014le)f(descriptor)g(op)s(en)g
(for)g(input,)g(a)h(redirection)g(error)f(o)s(ccurs.)40
b(If)29 b Fq(w)m(ord)j Ft(ev)-5 b(aluates)150 1845 y(to)31
b(If)29 b Fq(w)m(ord)j Ft(ev)-5 b(aluates)150 2230 y(to)31
b(`)p Fs(-)p Ft(',)g(\014le)g(descriptor)g Fq(n)f Ft(is)g(closed.)43
b(If)30 b Fq(n)g Ft(is)g(not)h(sp)s(eci\014ed,)f(the)h(standard)f
(input)g(\(\014le)h(descriptor)f(0\))150 1954 y(is)g(used.)275
2104 y(The)f(op)s(erator)390 2254 y Fs([)p Fi(n)11 b
Fs(]>&)p Fi(word)150 2404 y Ft(is)40 b(used)g(similarly)h(to)g
(input)g(\(\014le)h(descriptor)f(0\))150 2340 y(is)g(used.)275
2481 y(The)f(op)s(erator)390 2623 y Fs([)p Fi(n)11 b
Fs(]>&)p Fi(word)150 2765 y Ft(is)40 b(used)g(similarly)h(to)g
(duplicate)f(output)g(\014le)h(descriptors.)70 b(If)40
b Fq(n)f Ft(is)i(not)f(sp)s(eci\014ed,)i(the)f(standard)150
2513 y(output)30 b(\(\014le)g(descriptor)g(1\))h(is)f(used.)39
2874 y(output)30 b(\(\014le)g(descriptor)g(1\))h(is)f(used.)39
b(If)30 b(the)g(digits)h(in)e Fq(w)m(ord)34 b Ft(do)29
b(not)i(sp)s(ecify)e(a)i(\014le)f(descriptor)g(op)s(en)150
2623 y(for)38 b(output,)i(a)e(redirection)h(error)f(o)s(ccurs.)63
2984 y(for)38 b(output,)i(a)e(redirection)h(error)f(o)s(ccurs.)63
b(As)38 b(a)h(sp)s(ecial)f(case,)k(if)c Fq(n)f Ft(is)h(omitted,)k(and)
37 b Fq(w)m(ord)k Ft(do)s(es)150 2732 y(not)28 b(expand)f(to)i(one)f
37 b Fq(w)m(ord)k Ft(do)s(es)150 3093 y(not)28 b(expand)f(to)i(one)f
(or)f(more)h(digits,)i(the)e(standard)e(output)i(and)f(standard)g
(error)g(are)i(redirected)f(as)150 2842 y(describ)s(ed)h(previously)-8
b(.)150 3057 y Fj(3.6.9)63 b(Mo)m(ving)41 b(File)h(Descriptors)150
3203 y Ft(The)30 b(redirection)h(op)s(erator)390 3353
y Fs([)p Fi(n)11 b Fs(]<&)p Fi(digit)g Fs(-)150 3503
(error)g(are)i(redirected)f(as)150 3203 y(describ)s(ed)h(previously)-8
b(.)150 3409 y Fj(3.6.9)63 b(Mo)m(ving)41 b(File)h(Descriptors)150
3556 y Ft(The)30 b(redirection)h(op)s(erator)390 3698
y Fs([)p Fi(n)11 b Fs(]<&)p Fi(digit)g Fs(-)150 3840
y Ft(mo)m(v)m(es)33 b(the)f(\014le)g(descriptor)f Fq(digit)k
Ft(to)d(\014le)g(descriptor)g Fq(n)p Ft(,)f(or)h(the)g(standard)f
(input)f(\(\014le)j(descriptor)e(0\))150 3613 y(if)f
(input)f(\(\014le)j(descriptor)e(0\))150 3949 y(if)f
Fq(n)g Ft(is)h(not)f(sp)s(eci\014ed.)40 b Fq(digit)33
b Ft(is)e(closed)g(after)g(b)s(eing)f(duplicated)g(to)h
Fq(n)p Ft(.)275 3762 y(Similarly)-8 b(,)31 b(the)f(redirection)h(op)s
(erator)390 3912 y Fs([)p Fi(n)11 b Fs(]>&)p Fi(digit)g
Fs(-)150 4062 y Ft(mo)m(v)m(es)29 b(the)g(\014le)f(descriptor)f
Fq(n)p Ft(.)275 4091 y(Similarly)-8 b(,)31 b(the)f(redirection)h(op)s
(erator)390 4233 y Fs([)p Fi(n)11 b Fs(]>&)p Fi(digit)g
Fs(-)150 4374 y Ft(mo)m(v)m(es)29 b(the)g(\014le)f(descriptor)f
Fq(digit)k Ft(to)e(\014le)f(descriptor)g Fq(n)p Ft(,)g(or)g(the)g
(standard)f(output)h(\(\014le)g(descriptor)g(1\))150
4172 y(if)i Fq(n)g Ft(is)h(not)f(sp)s(eci\014ed.)150
4386 y Fj(3.6.10)63 b(Op)s(ening)42 b(File)g(Descriptors)g(for)g
(Reading)e(and)h(W)-10 b(riting)150 4533 y Ft(The)30
b(redirection)h(op)s(erator)390 4683 y Fs([)p Fi(n)11
b Fs(]<>)p Fi(word)150 4833 y Ft(causes)39 b(the)g(\014le)g(whose)g
4484 y(if)i Fq(n)g Ft(is)h(not)f(sp)s(eci\014ed.)150
4690 y Fj(3.6.10)63 b(Op)s(ening)42 b(File)g(Descriptors)g(for)g
(Reading)e(and)h(W)-10 b(riting)150 4837 y Ft(The)30
b(redirection)h(op)s(erator)390 4979 y Fs([)p Fi(n)11
b Fs(]<>)p Fi(word)150 5121 y Ft(causes)39 b(the)g(\014le)g(whose)g
(name)g(is)g(the)g(expansion)g(of)g Fq(w)m(ord)j Ft(to)d(b)s(e)g(op)s
(ened)f(for)g(b)s(oth)h(reading)g(and)150 4942 y(writing)33
(ened)f(for)g(b)s(oth)h(reading)g(and)150 5230 y(writing)33
b(on)f(\014le)h(descriptor)f Fq(n)p Ft(,)h(or)g(on)f(\014le)h
(descriptor)g(0)g(if)f Fq(n)g Ft(is)h(not)g(sp)s(eci\014ed.)47
b(If)32 b(the)h(\014le)f(do)s(es)h(not)150 5052 y(exist,)e(it)g(is)g
(created.)150 5307 y Fr(3.7)68 b(Executing)46 b(Commands)p
eop end
b(If)32 b(the)h(\014le)f(do)s(es)h(not)150 5340 y(exist,)e(it)g(is)g
(created.)p eop end
%%Page: 31 37
TeXDict begin 31 36 bop 150 -116 a Ft(Chapter)30 b(3:)41
b(Basic)32 b(Shell)e(F)-8 b(eatures)2246 b(31)150 299
y Fj(3.7.1)63 b(Simple)41 b(Command)h(Expansion)150 446
y Ft(When)33 b(a)g(simple)g(command)g(is)g(executed,)h(the)g(shell)f(p)
s(erforms)e(the)i(follo)m(wing)i(expansions,)e(assign-)150
555 y(men)m(ts,)e(and)f(redirections,)h(from)f(left)h(to)g(righ)m(t.)
199 702 y(1.)61 b(The)38 b(w)m(ords)f(that)i(the)g(parser)e(has)h(mark)
m(ed)g(as)h(v)-5 b(ariable)39 b(assignmen)m(ts)g(\(those)g(preceding)f
(the)330 812 y(command)30 b(name\))h(and)f(redirections)h(are)f(sa)m(v)
m(ed)i(for)e(later)h(pro)s(cessing.)199 952 y(2.)61 b(The)39
y Fr(3.7)68 b(Executing)46 b(Commands)150 523 y Fj(3.7.1)63
b(Simple)41 b(Command)h(Expansion)150 670 y Ft(When)33
b(a)g(simple)g(command)g(is)g(executed,)h(the)g(shell)f(p)s(erforms)e
(the)i(follo)m(wing)i(expansions,)e(assign-)150 779 y(men)m(ts,)e(and)f
(redirections,)h(from)f(left)h(to)g(righ)m(t.)199 913
y(1.)61 b(The)38 b(w)m(ords)f(that)i(the)g(parser)e(has)h(mark)m(ed)g
(as)h(v)-5 b(ariable)39 b(assignmen)m(ts)g(\(those)g(preceding)f(the)
330 1023 y(command)30 b(name\))h(and)f(redirections)h(are)f(sa)m(v)m
(ed)i(for)e(later)h(pro)s(cessing.)199 1157 y(2.)61 b(The)39
b(w)m(ords)g(that)i(are)f(not)g(v)-5 b(ariable)40 b(assignmen)m(ts)h
(or)e(redirections)i(are)f(expanded)f(\(see)h(Sec-)330
1062 y(tion)d(3.5)i([Shell)e(Expansions],)h(page)g(19\).)61
1267 y(tion)d(3.5)i([Shell)e(Expansions],)h(page)g(19\).)61
b(If)37 b(an)m(y)g(w)m(ords)f(remain)h(after)h(expansion,)h(the)e
(\014rst)330 1171 y(w)m(ord)31 b(is)g(tak)m(en)h(to)g(b)s(e)f(the)g
(\014rst)330 1376 y(w)m(ord)31 b(is)g(tak)m(en)h(to)g(b)s(e)f(the)g
(name)h(of)f(the)h(command)f(and)f(the)i(remaining)f(w)m(ords)g(are)g
(the)h(argu-)330 1281 y(men)m(ts.)199 1422 y(3.)61 b(Redirections)25
(the)h(argu-)330 1486 y(men)m(ts.)199 1620 y(3.)61 b(Redirections)25
b(are)f(p)s(erformed)f(as)h(describ)s(ed)f(ab)s(o)m(v)m(e)i(\(see)g
(Section)g(3.6)g([Redirections],)i(page)d(27\).)199 1562
(Section)g(3.6)g([Redirections],)i(page)d(27\).)199 1754
y(4.)61 b(The)25 b(text)h(after)f(the)g(`)p Fs(=)p Ft(')h(in)e(eac)m(h)
j(v)-5 b(ariable)25 b(assignmen)m(t)h(undergo)s(es)e(tilde)i
(expansion,)g(parameter)330 1672 y(expansion,)49 b(command)d
(expansion,)g(parameter)330 1864 y(expansion,)49 b(command)d
(substitution,)j(arithmetic)d(expansion,)k(and)45 b(quote)h(remo)m(v)-5
b(al)46 b(b)s(efore)330 1781 y(b)s(eing)30 b(assigned)h(to)g(the)f(v)-5
b(ariable.)275 1959 y(If)32 b(no)i(command)f(name)g(results,)h(the)g(v)
b(al)46 b(b)s(efore)330 1973 y(b)s(eing)30 b(assigned)h(to)g(the)f(v)-5
b(ariable.)275 2132 y(If)32 b(no)i(command)f(name)g(results,)h(the)g(v)
-5 b(ariable)34 b(assignmen)m(ts)g(a\013ect)h(the)f(curren)m(t)f(shell)
h(en)m(viron-)150 2069 y(men)m(t.)39 b(Otherwise,)27
h(en)m(viron-)150 2242 y(men)m(t.)39 b(Otherwise,)27
b(the)e(v)-5 b(ariables)26 b(are)g(added)f(to)h(the)f(en)m(vironmen)m
(t)h(of)g(the)f(executed)h(command)g(and)150 2178 y(do)35
(t)h(of)g(the)f(executed)h(command)g(and)150 2351 y(do)35
b(not)f(a\013ect)j(the)d(curren)m(t)h(shell)g(en)m(vironmen)m(t.)54
b(If)34 b(an)m(y)h(of)g(the)f(assignmen)m(ts)i(attempts)f(to)h(assign)
150 2288 y(a)j(v)-5 b(alue)39 b(to)g(a)g(readonly)f(v)-5
150 2461 y(a)j(v)-5 b(alue)39 b(to)g(a)g(readonly)f(v)-5
b(ariable,)42 b(an)c(error)g(o)s(ccurs,)j(and)c(the)i(command)f(exits)h
(with)g(a)f(non-zero)150 2397 y(status.)275 2544 y(If)33
(with)g(a)f(non-zero)150 2570 y(status.)275 2705 y(If)33
b(no)g(command)g(name)h(results,)g(redirections)g(are)g(p)s(erformed,)f
(but)g(do)h(not)f(a\013ect)i(the)f(curren)m(t)150 2654
(but)g(do)h(not)f(a\013ect)i(the)f(curren)m(t)150 2814
y(shell)d(en)m(vironmen)m(t.)41 b(A)30 b(redirection)h(error)f(causes)h
(the)g(command)f(to)h(exit)g(with)f(a)h(non-zero)g(status.)275
2800 y(If)26 b(there)i(is)f(a)h(command)f(name)h(left)g(after)g
2948 y(If)26 b(there)i(is)f(a)h(command)f(name)h(left)g(after)g
(expansion,)g(execution)h(pro)s(ceeds)e(as)g(describ)s(ed)f(b)s(elo)m
(w.)150 2910 y(Otherwise,)39 b(the)e(command)g(exits.)62
(w.)150 3058 y(Otherwise,)39 b(the)e(command)g(exits.)62
b(If)37 b(one)g(of)g(the)h(expansions)f(con)m(tained)h(a)g(command)f
(substitu-)150 3020 y(tion,)i(the)d(exit)h(status)g(of)f(the)h(command)
(substitu-)150 3167 y(tion,)i(the)d(exit)h(status)g(of)f(the)h(command)
f(is)h(the)f(exit)h(status)g(of)f(the)h(last)g(command)f(substitution)
150 3129 y(p)s(erformed.)55 b(If)35 b(there)g(w)m(ere)h(no)g(command)f
150 3277 y(p)s(erformed.)55 b(If)35 b(there)g(w)m(ere)h(no)g(command)f
(substitutions,)i(the)e(command)h(exits)g(with)f(a)h(status)g(of)150
3239 y(zero.)150 3450 y Fj(3.7.2)63 b(Command)41 b(Searc)m(h)f(and)h
(Execution)150 3597 y Ft(After)i(a)h(command)f(has)g(b)s(een)f(split)h
3387 y(zero.)150 3585 y Fj(3.7.2)63 b(Command)41 b(Searc)m(h)f(and)h
(Execution)150 3732 y Ft(After)i(a)h(command)f(has)g(b)s(een)f(split)h
(in)m(to)h(w)m(ords,)j(if)c(it)g(results)g(in)g(a)h(simple)f(command)g
(and)f(an)150 3707 y(optional)32 b(list)f(of)f(argumen)m(ts,)h(the)g
(follo)m(wing)g(actions)h(are)f(tak)m(en.)199 3853 y(1.)61
(and)f(an)150 3842 y(optional)32 b(list)f(of)f(argumen)m(ts,)h(the)g
(follo)m(wing)g(actions)h(are)f(tak)m(en.)199 3976 y(1.)61
b(If)24 b(the)g(command)g(name)g(con)m(tains)i(no)e(slashes,)i(the)e
(shell)h(attempts)g(to)g(lo)s(cate)h(it.)39 b(If)24 b(there)g(exists)
330 3963 y(a)h(shell)g(function)f(b)m(y)g(that)h(name,)h(that)f
330 4085 y(a)h(shell)g(function)f(b)m(y)g(that)h(name,)h(that)f
(function)f(is)h(in)m(v)m(ok)m(ed)h(as)e(describ)s(ed)g(in)g(Section)h
(3.3)h([Shell)330 4073 y(F)-8 b(unctions],)31 b(page)h(15.)199
4213 y(2.)61 b(If)41 b(the)g(name)h(do)s(es)f(not)g(matc)m(h)i(a)e
(3.3)h([Shell)330 4195 y(F)-8 b(unctions],)31 b(page)h(15.)199
4329 y(2.)61 b(If)41 b(the)g(name)h(do)s(es)f(not)g(matc)m(h)i(a)e
(function,)j(the)e(shell)f(searc)m(hes)i(for)e(it)h(in)f(the)g(list)h
(of)g(shell)330 4323 y(builtins.)e(If)30 b(a)h(matc)m(h)g(is)f(found,)g
(that)h(builtin)f(is)g(in)m(v)m(ok)m(ed.)199 4463 y(3.)61
(of)g(shell)330 4439 y(builtins.)e(If)30 b(a)h(matc)m(h)g(is)f(found,)g
(that)h(builtin)f(is)g(in)m(v)m(ok)m(ed.)199 4573 y(3.)61
b(If)40 b(the)g(name)h(is)f(neither)h(a)f(shell)h(function)f(nor)g(a)g
(builtin,)j(and)d(con)m(tains)h(no)g(slashes,)i(Bash)330
4573 y(searc)m(hes)c(eac)m(h)g(elemen)m(t)g(of)g Fs($PATH)d
4682 y(searc)m(hes)c(eac)m(h)g(elemen)m(t)g(of)g Fs($PATH)d
Ft(for)i(a)g(directory)h(con)m(taining)g(an)f(executable)h(\014le)f(b)m
(y)g(that)330 4682 y(name.)56 b(Bash)36 b(uses)f(a)h(hash)e(table)j(to)
(y)g(that)330 4792 y(name.)56 b(Bash)36 b(uses)f(a)h(hash)e(table)j(to)
f(remem)m(b)s(er)f(the)h(full)f(pathnames)g(of)h(executable)h(\014les)e
(to)330 4792 y(a)m(v)m(oid)e(m)m(ultiple)f Fs(PATH)f
(to)330 4902 y(a)m(v)m(oid)e(m)m(ultiple)f Fs(PATH)f
Ft(searc)m(hes)i(\(see)f(the)g(description)g(of)f Fs(hash)g
Ft(in)g(Section)i(4.1)f([Bourne)g(Shell)330 4902 y(Builtins],)37
Ft(in)g(Section)i(4.1)f([Bourne)g(Shell)330 5011 y(Builtins],)37
b(page)f(37\).)55 b(A)35 b(full)g(searc)m(h)g(of)g(the)g(directories)h
(in)f Fs($PATH)e Ft(is)i(p)s(erformed)f(only)h(if)g(the)330
5011 y(command)24 b(is)h(not)g(found)e(in)i(the)g(hash)f(table.)39
5121 y(command)24 b(is)h(not)g(found)e(in)i(the)g(hash)f(table.)39
b(If)25 b(the)f(searc)m(h)i(is)e(unsuccessful,)h(the)g(shell)g(searc)m
(hes)330 5121 y(for)e(a)h(de\014ned)e(shell)h(function)h(named)e
(hes)330 5230 y(for)e(a)h(de\014ned)e(shell)h(function)h(named)e
Fs(command_not_found_handle)p Ft(.)32 b(If)23 b(that)h(function)f
(exists,)330 5230 y(it)32 b(is)f(in)m(v)m(ok)m(ed)i(with)e(the)h
(exists,)330 5340 y(it)32 b(is)f(in)m(v)m(ok)m(ed)i(with)e(the)h
(original)g(command)f(and)g(the)h(original)g(command's)f(argumen)m(ts)h
(as)g(its)330 5340 y(argumen)m(ts,)h(and)e(the)i(function's)e(exit)i
(status)g(b)s(ecomes)f(the)g(exit)h(status)f(of)h(the)f(shell.)46
b(If)31 b(that)p eop end
(as)g(its)p eop end
%%Page: 32 38
TeXDict begin 32 37 bop 150 -116 a Ft(32)2572 b(Bash)31
b(Reference)g(Man)m(ual)330 299 y(function)g(is)g(not)g(de\014ned,)f
(the)i(shell)f(prin)m(ts)f(an)h(error)g(message)h(and)f(returns)e(an)i
(exit)h(status)g(of)330 408 y(127.)199 549 y(4.)61 b(If)33
b(the)g(searc)m(h)h(is)g(successful,)g(or)f(if)g(the)h(command)f(name)g
(con)m(tains)i(one)f(or)f(more)g(slashes,)i(the)330 658
y(shell)g(executes)h(the)f(named)f(program)g(in)h(a)g(separate)h
(execution)f(en)m(vironmen)m(t.)55 b(Argumen)m(t)35 b(0)330
768 y(is)30 b(set)h(to)h(the)e(name)h(giv)m(en,)g(and)f(the)h
b(Reference)g(Man)m(ual)330 299 y(argumen)m(ts,)i(and)e(the)i
(function's)e(exit)i(status)g(b)s(ecomes)f(the)g(exit)h(status)f(of)h
(the)f(shell.)46 b(If)31 b(that)330 408 y(function)g(is)g(not)g
(de\014ned,)f(the)i(shell)f(prin)m(ts)f(an)h(error)g(message)h(and)f
(returns)e(an)i(exit)h(status)g(of)330 518 y(127.)199
654 y(4.)61 b(If)33 b(the)g(searc)m(h)h(is)g(successful,)g(or)f(if)g
(the)h(command)f(name)g(con)m(tains)i(one)f(or)f(more)g(slashes,)i(the)
330 763 y(shell)g(executes)h(the)f(named)f(program)g(in)h(a)g(separate)
h(execution)f(en)m(vironmen)m(t.)55 b(Argumen)m(t)35
b(0)330 873 y(is)30 b(set)h(to)h(the)e(name)h(giv)m(en,)g(and)f(the)h
(remaining)f(argumen)m(ts)h(to)g(the)g(command)f(are)h(set)g(to)g(the)
330 877 y(argumen)m(ts)g(supplied,)e(if)h(an)m(y)-8 b(.)199
1018 y(5.)61 b(If)35 b(this)h(execution)h(fails)f(b)s(ecause)g(the)f
330 983 y(argumen)m(ts)g(supplied,)e(if)h(an)m(y)-8 b(.)199
1118 y(5.)61 b(If)35 b(this)h(execution)h(fails)f(b)s(ecause)g(the)f
(\014le)h(is)g(not)g(in)f(executable)j(format,)f(and)e(the)h(\014le)g
(is)g(not)330 1127 y(a)d(directory)-8 b(,)34 b(it)f(is)g(assumed)e(to)j
(is)g(not)330 1228 y(a)d(directory)-8 b(,)34 b(it)f(is)g(assumed)e(to)j
(b)s(e)d(a)i Fq(shell)g(script)h Ft(and)e(the)h(shell)f(executes)i(it)f
(as)g(describ)s(ed)e(in)330 1237 y(Section)g(3.8)h([Shell)e(Scripts],)g
(page)i(34.)199 1377 y(6.)61 b(If)38 b(the)h(command)f(w)m(as)h(not)g
(as)g(describ)s(ed)e(in)330 1338 y(Section)g(3.8)h([Shell)e(Scripts],)g
(page)i(34.)199 1473 y(6.)61 b(If)38 b(the)h(command)f(w)m(as)h(not)g
(b)s(egun)e(async)m(hronously)-8 b(,)42 b(the)c(shell)h(w)m(aits)h(for)
e(the)h(command)f(to)330 1487 y(complete)32 b(and)e(collects)i(its)f
(exit)g(status.)150 1697 y Fj(3.7.3)63 b(Command)41 b(Execution)f(En)m
(vironmen)m(t)150 1844 y Ft(The)30 b(shell)g(has)h(an)f
e(the)h(command)f(to)330 1583 y(complete)32 b(and)e(collects)i(its)f
(exit)g(status.)150 1785 y Fj(3.7.3)63 b(Command)41 b(Execution)f(En)m
(vironmen)m(t)150 1932 y Ft(The)30 b(shell)g(has)h(an)f
Fq(execution)h(en)m(vironmen)m(t)r Ft(,)h(whic)m(h)e(consists)h(of)f
(the)h(follo)m(wing:)225 1990 y Fp(\017)60 b Ft(op)s(en)32
(the)h(follo)m(wing:)225 2069 y Fp(\017)60 b Ft(op)s(en)32
b(\014les)g(inherited)g(b)m(y)h(the)f(shell)h(at)g(in)m(v)m(o)s
(cation,)j(as)c(mo)s(di\014ed)g(b)m(y)g(redirections)h(supplied)e(to)
330 2100 y(the)g Fs(exec)e Ft(builtin)225 2240 y Fp(\017)60
330 2178 y(the)g Fs(exec)e Ft(builtin)225 2314 y Fp(\017)60
b Ft(the)28 b(curren)m(t)g(w)m(orking)h(directory)g(as)f(set)h(b)m(y)f
Fs(cd)p Ft(,)g Fs(pushd)p Ft(,)g(or)g Fs(popd)p Ft(,)g(or)g(inherited)g
(b)m(y)g(the)h(shell)f(at)330 2349 y(in)m(v)m(o)s(cation)225
2489 y Fp(\017)60 b Ft(the)31 b(\014le)f(creation)i(mo)s(de)e(mask)g
(b)m(y)g(the)h(shell)f(at)330 2424 y(in)m(v)m(o)s(cation)225
2560 y Fp(\017)60 b Ft(the)31 b(\014le)f(creation)i(mo)s(de)e(mask)g
(as)h(set)g(b)m(y)f Fs(umask)f Ft(or)h(inherited)g(from)g(the)h
(shell's)f(paren)m(t)225 2630 y Fp(\017)60 b Ft(curren)m(t)30
b(traps)g(set)h(b)m(y)f Fs(trap)225 2770 y Fp(\017)60
(shell's)f(paren)m(t)225 2695 y Fp(\017)60 b Ft(curren)m(t)30
b(traps)g(set)h(b)m(y)f Fs(trap)225 2831 y Fp(\017)60
b Ft(shell)30 b(parameters)f(that)h(are)g(set)g(b)m(y)g(v)-5
b(ariable)30 b(assignmen)m(t)g(or)g(with)f Fs(set)f Ft(or)i(inherited)f
(from)g(the)330 2879 y(shell's)i(paren)m(t)f(in)g(the)h(en)m(vironmen)m
(t)225 3020 y Fp(\017)60 b Ft(shell)44 b(functions)f(de\014ned)f
(from)g(the)330 2941 y(shell's)i(paren)m(t)f(in)g(the)h(en)m(vironmen)m
(t)225 3077 y Fp(\017)60 b Ft(shell)44 b(functions)f(de\014ned)f
(during)h(execution)i(or)e(inherited)h(from)f(the)h(shell's)g(paren)m
(t)f(in)h(the)330 3129 y(en)m(vironmen)m(t)225 3269 y
(t)f(in)h(the)330 3186 y(en)m(vironmen)m(t)225 3322 y
Fp(\017)60 b Ft(options)33 b(enabled)g(at)h(in)m(v)m(o)s(cation)h
(\(either)f(b)m(y)f(default)g(or)g(with)g(command-line)g(argumen)m
(ts\))h(or)330 3379 y(b)m(y)c Fs(set)225 3519 y Fp(\017)60
(ts\))h(or)330 3432 y(b)m(y)c Fs(set)225 3567 y Fp(\017)60
b Ft(options)31 b(enabled)f(b)m(y)g Fs(shopt)f Ft(\(see)j(Section)f
(4.3.2)h([The)e(Shopt)g(Builtin],)h(page)g(57\))225 3659
(4.3.2)h([The)e(Shopt)g(Builtin],)h(page)g(57\))225 3703
y Fp(\017)60 b Ft(shell)31 b(aliases)g(de\014ned)f(with)g
Fs(alias)f Ft(\(see)i(Section)g(6.6)h([Aliases],)g(page)f(81\))225
3799 y Fp(\017)60 b Ft(v)-5 b(arious)50 b(pro)s(cess)f
3839 y Fp(\017)60 b Ft(v)-5 b(arious)50 b(pro)s(cess)f
Fl(id)p Ft(s,)55 b(including)49 b(those)i(of)e(bac)m(kground)h(jobs)f
(\(see)i(Section)g(3.2.3)g([Lists],)330 3909 y(page)31
(\(see)i(Section)g(3.2.3)g([Lists],)330 3948 y(page)31
b(9\),)g(the)g(v)-5 b(alue)31 b(of)f Fs($$)p Ft(,)g(and)g(the)h(v)-5
b(alue)31 b(of)f Fs($PPID)275 4085 y Ft(When)k(a)g(simple)h(command)f
b(alue)31 b(of)f Fs($PPID)275 4112 y Ft(When)k(a)g(simple)h(command)f
(other)g(than)g(a)h(builtin)f(or)g(shell)h(function)f(is)g(to)h(b)s(e)f
(executed,)i(it)f(is)150 4195 y(in)m(v)m(ok)m(ed)25 b(in)f(a)g
(executed,)i(it)f(is)150 4221 y(in)m(v)m(ok)m(ed)25 b(in)f(a)g
(separate)h(execution)g(en)m(vironmen)m(t)g(that)f(consists)g(of)h(the)
f(follo)m(wing.)40 b(Unless)24 b(otherwise)150 4305 y(noted,)31
f(follo)m(wing.)40 b(Unless)24 b(otherwise)150 4331 y(noted,)31
b(the)f(v)-5 b(alues)31 b(are)g(inherited)f(from)g(the)g(shell.)225
4451 y Fp(\017)60 b Ft(the)31 b(shell's)h(op)s(en)e(\014les,)i(plus)e
4468 y Fp(\017)60 b Ft(the)31 b(shell's)h(op)s(en)e(\014les,)i(plus)e
(an)m(y)h(mo)s(di\014cations)h(and)e(additions)h(sp)s(eci\014ed)g(b)m
(y)g(redirections)g(to)330 4560 y(the)g(command)225 4700
(y)g(redirections)g(to)330 4578 y(the)g(command)225 4713
y Fp(\017)60 b Ft(the)31 b(curren)m(t)f(w)m(orking)g(directory)225
4840 y Fp(\017)60 b Ft(the)31 b(\014le)f(creation)i(mo)s(de)e(mask)225
4981 y Fp(\017)60 b Ft(shell)32 b(v)-5 b(ariables)33
4849 y Fp(\017)60 b Ft(the)31 b(\014le)f(creation)i(mo)s(de)e(mask)225
4985 y Fp(\017)60 b Ft(shell)32 b(v)-5 b(ariables)33
b(and)e(functions)h(mark)m(ed)g(for)g(exp)s(ort,)g(along)h(with)f(v)-5
b(ariables)32 b(exp)s(orted)g(for)g(the)330 5090 y(command,)e(passed)g
b(ariables)32 b(exp)s(orted)g(for)g(the)330 5095 y(command,)e(passed)g
(in)g(the)h(en)m(vironmen)m(t)g(\(see)g(Section)g(3.7.4)i([En)m
(vironmen)m(t],)e(page)g(33\))225 5230 y Fp(\017)60 b
Ft(traps)31 b(caugh)m(t)h(b)m(y)f(the)g(shell)h(are)f(reset)h(to)g(the)
@@ -9443,28 +9444,29 @@ Ft(arra)m(y)j(v)-5 b(ariable)30 b(are)f(de\014ned.)38
b(The)630 2034 y(shell)26 b(function)g Fs(${FUNCNAME[$i]})c
Ft(is)k(de\014ned)f(in)g(the)h(\014le)h Fs(${BASH_SOURCE[$i]})21
b Ft(and)630 2144 y(called)32 b(from)d Fs(${BASH_SOURCE[$i+1]})150
2299 y(BASH_SUBSHELL)630 2408 y Ft(Incremen)m(ted)34
b(b)m(y)h(one)f(eac)m(h)i(time)f(a)f(subshell)g(or)g(subshell)f(en)m
(vironmen)m(t)i(is)f(spa)m(wned.)630 2518 y(The)c(initial)h(v)-5
b(alue)31 b(is)g(0.)150 2673 y Fs(BASH_VERSINFO)630 2783
y Ft(A)36 b(readonly)g(arra)m(y)g(v)-5 b(ariable)37 b(\(see)f(Section)h
(6.7)g([Arra)m(ys],)h(page)e(82\))h(whose)f(mem)m(b)s(ers)630
2892 y(hold)c(v)m(ersion)h(information)f(for)g(this)g(instance)h(of)g
(Bash.)46 b(The)32 b(v)-5 b(alues)32 b(assigned)h(to)g(the)630
3002 y(arra)m(y)e(mem)m(b)s(ers)e(are)i(as)g(follo)m(ws:)630
3157 y Fs(BASH_VERSINFO[0])1110 3267 y Ft(The)f(ma)5
b(jor)30 b(v)m(ersion)h(n)m(um)m(b)s(er)e(\(the)i Fq(release)5
b Ft(\).)630 3422 y Fs(BASH_VERSINFO[1])1110 3532 y Ft(The)30
b(minor)g(v)m(ersion)h(n)m(um)m(b)s(er)e(\(the)i Fq(v)m(ersion)p
Ft(\).)630 3687 y Fs(BASH_VERSINFO[2])1110 3797 y Ft(The)f(patc)m(h)h
(lev)m(el.)630 3952 y Fs(BASH_VERSINFO[3])1110 4061 y
Ft(The)f(build)f(v)m(ersion.)630 4217 y Fs(BASH_VERSINFO[4])1110
4326 y Ft(The)h(release)i(status)e(\(e.g.,)j Fq(b)s(eta1)7
b Ft(\).)630 4482 y Fs(BASH_VERSINFO[5])1110 4591 y Ft(The)30
b(v)-5 b(alue)31 b(of)f Fs(MACHTYPE)p Ft(.)150 4746 y
Fs(BASH_VERSION)630 4856 y Ft(The)g(v)m(ersion)h(n)m(um)m(b)s(er)e(of)h
(the)h(curren)m(t)f(instance)h(of)g(Bash.)150 5011 y
Fs(BASH_XTRACEFD)630 5121 y Ft(If)f(set)h(to)h(an)e(in)m(teger)i
2299 y(BASH_SUBSHELL)630 2408 y Ft(Incremen)m(ted)24
b(b)m(y)f(one)h(within)f(eac)m(h)i(subshell)d(or)i(subshell)e(en)m
(vironmen)m(t)i(when)f(the)h(shell)630 2518 y(b)s(egins)30
b(executing)h(in)f(that)h(en)m(vironmen)m(t.)42 b(The)30
b(initial)h(v)-5 b(alue)31 b(is)f(0.)150 2673 y Fs(BASH_VERSINFO)630
2783 y Ft(A)36 b(readonly)g(arra)m(y)g(v)-5 b(ariable)37
b(\(see)f(Section)h(6.7)g([Arra)m(ys],)h(page)e(82\))h(whose)f(mem)m(b)
s(ers)630 2892 y(hold)c(v)m(ersion)h(information)f(for)g(this)g
(instance)h(of)g(Bash.)46 b(The)32 b(v)-5 b(alues)32
b(assigned)h(to)g(the)630 3002 y(arra)m(y)e(mem)m(b)s(ers)e(are)i(as)g
(follo)m(ws:)630 3157 y Fs(BASH_VERSINFO[0])1110 3267
y Ft(The)f(ma)5 b(jor)30 b(v)m(ersion)h(n)m(um)m(b)s(er)e(\(the)i
Fq(release)5 b Ft(\).)630 3422 y Fs(BASH_VERSINFO[1])1110
3532 y Ft(The)30 b(minor)g(v)m(ersion)h(n)m(um)m(b)s(er)e(\(the)i
Fq(v)m(ersion)p Ft(\).)630 3687 y Fs(BASH_VERSINFO[2])1110
3797 y Ft(The)f(patc)m(h)h(lev)m(el.)630 3952 y Fs(BASH_VERSINFO[3])
1110 4061 y Ft(The)f(build)f(v)m(ersion.)630 4217 y Fs
(BASH_VERSINFO[4])1110 4326 y Ft(The)h(release)i(status)e(\(e.g.,)j
Fq(b)s(eta1)7 b Ft(\).)630 4482 y Fs(BASH_VERSINFO[5])1110
4591 y Ft(The)30 b(v)-5 b(alue)31 b(of)f Fs(MACHTYPE)p
Ft(.)150 4746 y Fs(BASH_VERSION)630 4856 y Ft(The)g(v)m(ersion)h(n)m
(um)m(b)s(er)e(of)h(the)h(curren)m(t)f(instance)h(of)g(Bash.)150
5011 y Fs(BASH_XTRACEFD)630 5121 y Ft(If)f(set)h(to)h(an)e(in)m(teger)i
(corresp)s(onding)e(to)h(a)g(v)-5 b(alid)31 b(\014le)g(descriptor,)g
(Bash)g(will)g(write)g(the)630 5230 y(trace)37 b(output)f(generated)h
(when)f(`)p Fs(set)29 b(-x)p Ft(')36 b(is)g(enabled)h(to)g(that)f
@@ -10657,169 +10659,171 @@ b(Reference)g(Man)m(ual)275 299 y(Aliases)i(are)h(not)e(expanded)g
(when)g(the)h(shell)g(is)g(not)g(in)m(teractiv)m(e,)j(unless)c(the)h
Fs(expand_aliases)150 408 y Ft(shell)e(option)f(is)h(set)g(using)f
Fs(shopt)f Ft(\(see)i(Section)g(4.3.2)h([The)e(Shopt)g(Builtin],)h
(page)g(57\).)275 542 y(The)38 b(rules)h(concerning)h(the)f
(page)g(57\).)275 540 y(The)38 b(rules)h(concerning)h(the)f
(de\014nition)g(and)g(use)g(of)g(aliases)i(are)e(somewhat)h(confusing.)
67 b(Bash)150 651 y(alw)m(a)m(ys)42 b(reads)f(at)h(least)g(one)f
67 b(Bash)150 650 y(alw)m(a)m(ys)42 b(reads)f(at)h(least)g(one)f
(complete)i(line)e(of)g(input)f(b)s(efore)h(executing)h(an)m(y)f(of)g
(the)g(commands)150 761 y(on)h(that)h(line.)77 b(Aliases)44
(the)g(commands)150 760 y(on)h(that)h(line.)77 b(Aliases)44
b(are)e(expanded)g(when)f(a)i(command)f(is)g(read,)k(not)c(when)g(it)g
(is)h(executed.)150 870 y(Therefore,)f(an)e(alias)h(de\014nition)e(app)
(is)h(executed.)150 869 y(Therefore,)f(an)e(alias)h(de\014nition)e(app)
s(earing)h(on)f(the)h(same)h(line)f(as)g(another)g(command)f(do)s(es)h
(not)150 980 y(tak)m(e)31 b(e\013ect)f(un)m(til)g(the)f(next)g(line)h
(not)150 979 y(tak)m(e)31 b(e\013ect)f(un)m(til)g(the)f(next)g(line)h
(of)f(input)f(is)h(read.)41 b(The)28 b(commands)h(follo)m(wing)i(the)e
(alias)h(de\014nition)150 1090 y(on)d(that)h(line)f(are)h(not)f
(alias)h(de\014nition)150 1088 y(on)d(that)h(line)f(are)h(not)f
(a\013ected)i(b)m(y)e(the)g(new)g(alias.)41 b(This)26
b(b)s(eha)m(vior)h(is)g(also)h(an)f(issue)g(when)f(functions)150
1199 y(are)d(executed.)39 b(Aliases)24 b(are)f(expanded)f(when)f(a)i
1198 y(are)d(executed.)39 b(Aliases)24 b(are)f(expanded)f(when)f(a)i
(function)g(de\014nition)f(is)h(read,)h(not)f(when)e(the)i(function)150
1309 y(is)i(executed,)j(b)s(ecause)d(a)h(function)f(de\014nition)f(is)i
1308 y(is)i(executed,)j(b)s(ecause)d(a)h(function)f(de\014nition)f(is)i
(itself)g(a)f(comp)s(ound)f(command.)39 b(As)25 b(a)h(consequence,)150
1418 y(aliases)36 b(de\014ned)d(in)h(a)g(function)g(are)h(not)f(a)m(v)
1417 y(aliases)36 b(de\014ned)d(in)h(a)g(function)g(are)h(not)f(a)m(v)
-5 b(ailable)37 b(un)m(til)d(after)h(that)g(function)f(is)g(executed.)
53 b(T)-8 b(o)35 b(b)s(e)150 1528 y(safe,)41 b(alw)m(a)m(ys)f(put)d
53 b(T)-8 b(o)35 b(b)s(e)150 1527 y(safe,)41 b(alw)m(a)m(ys)f(put)d
(alias)j(de\014nitions)e(on)g(a)h(separate)g(line,)i(and)d(do)g(not)g
(use)g Fs(alias)f Ft(in)h(comp)s(ound)150 1638 y(commands.)275
1771 y(F)-8 b(or)31 b(almost)g(ev)m(ery)g(purp)s(ose,)e(shell)i
(use)g Fs(alias)f Ft(in)h(comp)s(ound)150 1636 y(commands.)275
1768 y(F)-8 b(or)31 b(almost)g(ev)m(ery)g(purp)s(ose,)e(shell)i
(functions)f(are)g(preferred)g(o)m(v)m(er)h(aliases.)150
2001 y Fr(6.7)68 b(Arra)l(ys)150 2160 y Ft(Bash)33 b(pro)m(vides)g
1996 y Fr(6.7)68 b(Arra)l(ys)150 2155 y Ft(Bash)33 b(pro)m(vides)g
(one-dimensional)g(indexed)f(and)h(asso)s(ciativ)m(e)i(arra)m(y)e(v)-5
b(ariables.)49 b(An)m(y)33 b(v)-5 b(ariable)33 b(ma)m(y)150
2270 y(b)s(e)e(used)h(as)g(an)g(indexed)f(arra)m(y;)j(the)e
2265 y(b)s(e)e(used)h(as)g(an)g(indexed)f(arra)m(y;)j(the)e
Fs(declare)e Ft(builtin)h(will)i(explicitly)g(declare)g(an)f(arra)m(y)
-8 b(.)46 b(There)32 b(is)150 2379 y(no)h(maxim)m(um)g(limit)h(on)f
-8 b(.)46 b(There)32 b(is)150 2374 y(no)h(maxim)m(um)g(limit)h(on)f
(the)g(size)h(of)g(an)f(arra)m(y)-8 b(,)35 b(nor)d(an)m(y)i(requiremen)
m(t)f(that)h(mem)m(b)s(ers)e(b)s(e)g(indexed)150 2489
m(t)f(that)h(mem)m(b)s(ers)e(b)s(e)g(indexed)150 2484
y(or)26 b(assigned)h(con)m(tiguously)-8 b(.)41 b(Indexed)25
b(arra)m(ys)i(are)f(referenced)g(using)g(in)m(tegers)i(\(including)e
(arithmetic)150 2598 y(expressions)38 b(\(see)h(Section)g(6.5)h([Shell)
(arithmetic)150 2593 y(expressions)38 b(\(see)h(Section)g(6.5)h([Shell)
e(Arithmetic],)k(page)d(80\)\))h(and)d(are)i(zero-based;)k(asso)s
(ciativ)m(e)150 2708 y(arra)m(ys)31 b(use)f(arbitrary)g(strings.)275
2841 y(An)c(indexed)h(arra)m(y)h(is)f(created)h(automatically)j(if)c
(ciativ)m(e)150 2703 y(arra)m(ys)31 b(use)f(arbitrary)g(strings.)275
2835 y(An)c(indexed)h(arra)m(y)h(is)f(created)h(automatically)j(if)c
(an)m(y)g(v)-5 b(ariable)28 b(is)g(assigned)f(to)h(using)f(the)g(syn)m
(tax)390 2974 y Fs(name[)p Fi(subscript)11 b Fs(]=)p
Fi(value)150 3108 y Ft(The)37 b Fq(subscript)h Ft(is)f(treated)h(as)f
(an)g(arithmetic)i(expression)e(that)g(m)m(ust)g(ev)-5
b(aluate)39 b(to)f(a)g(n)m(um)m(b)s(er.)59 b(If)150 3217
y Fq(subscript)29 b Ft(ev)-5 b(aluates)29 b(to)g(a)g(n)m(um)m(b)s(er)d
(less)j(than)e(zero,)j(it)e(is)h(used)e(as)h(an)g(o\013set)h(from)f
(one)g(greater)h(than)150 3327 y(the)h(arra)m(y's)h(maxim)m(um)e(index)
h(\(so)g(a)h(sub)s(cript)d(of)i(-1)h(refers)e(to)i(the)f(last)h(elemen)
m(t)g(of)f(the)g(arra)m(y\).)41 b(T)-8 b(o)150 3436 y(explicitly)32
b(declare)f(an)g(arra)m(y)-8 b(,)31 b(use)390 3570 y
Fs(declare)46 b(-a)h Fi(name)150 3703 y Ft(The)30 b(syn)m(tax)390
3836 y Fs(declare)46 b(-a)h Fi(name)11 b Fs([)p Fi(subscript)g
Fs(])150 3969 y Ft(is)30 b(also)i(accepted;)g(the)e Fq(subscript)h
Ft(is)g(ignored.)275 4102 y(Asso)s(ciativ)m(e)h(arra)m(ys)f(are)g
(created)g(using)390 4236 y Fs(declare)46 b(-A)h Fi(name)11
b Fs(.)275 4369 y Ft(A)m(ttributes)46 b(ma)m(y)h(b)s(e)e(sp)s
(eci\014ed)g(for)h(an)g(arra)m(y)g(v)-5 b(ariable)47
b(using)e(the)h Fs(declare)e Ft(and)h Fs(readonly)150
4478 y Ft(builtins.)40 b(Eac)m(h)31 b(attribute)g(applies)g(to)g(all)g
(mem)m(b)s(ers)f(of)g(an)h(arra)m(y)-8 b(.)275 4612 y(Arra)m(ys)30
b(are)h(assigned)f(to)h(using)f(comp)s(ound)f(assignmen)m(ts)i(of)g
(the)f(form)390 4745 y Fs(name=\(value)p Fi(1)55 b Fs(...)47
b(value)p Fi(n)11 b Fs(\))150 4878 y Ft(where)37 b(eac)m(h)i
Fq(v)-5 b(alue)42 b Ft(is)c(of)g(the)f(form)g Fs([)p
Fi(subscript)11 b Fs(]=)p Fq(string)d Ft(.)58 b(Indexed)36
b(arra)m(y)i(assignmen)m(ts)g(do)g(not)150 4988 y(require)c(the)g(brac)
m(k)m(et)h(and)e(subscript.)50 b(When)34 b(assigning)g(to)g(indexed)g
(arra)m(ys,)h(if)f(the)g(optional)h(sub-)150 5097 y(script)c(is)h
(supplied,)f(that)h(index)f(is)h(assigned)g(to;)h(otherwise)f(the)f
(index)h(of)f(the)h(elemen)m(t)h(assigned)f(is)150 5207
y(the)f(last)g(index)f(assigned)g(to)h(b)m(y)g(the)f(statemen)m(t)i
(plus)e(one.)41 b(Indexing)30 b(starts)g(at)i(zero.)275
5340 y(When)e(assigning)h(to)g(an)f(asso)s(ciativ)m(e)j(arra)m(y)-8
b(,)32 b(the)e(subscript)f(is)i(required.)p eop end
(tax)390 2967 y Fs(name[)p Fi(subscript)11 b Fs(]=)p
Fi(value)150 3099 y Ft(The)34 b Fq(subscript)h Ft(is)g(treated)g(as)g
(an)f(arithmetic)i(expression)e(that)h(m)m(ust)g(ev)-5
b(aluate)36 b(to)f(a)g(n)m(um)m(b)s(er.)51 b(T)-8 b(o)150
3208 y(explicitly)32 b(declare)f(an)g(arra)m(y)-8 b(,)31
b(use)390 3340 y Fs(declare)46 b(-a)h Fi(name)150 3472
y Ft(The)30 b(syn)m(tax)390 3604 y Fs(declare)46 b(-a)h
Fi(name)11 b Fs([)p Fi(subscript)g Fs(])150 3736 y Ft(is)30
b(also)i(accepted;)g(the)e Fq(subscript)h Ft(is)g(ignored.)275
3868 y(Asso)s(ciativ)m(e)h(arra)m(ys)f(are)g(created)g(using)390
4000 y Fs(declare)46 b(-A)h Fi(name)11 b Fs(.)275 4132
y Ft(A)m(ttributes)46 b(ma)m(y)h(b)s(e)e(sp)s(eci\014ed)g(for)h(an)g
(arra)m(y)g(v)-5 b(ariable)47 b(using)e(the)h Fs(declare)e
Ft(and)h Fs(readonly)150 4242 y Ft(builtins.)40 b(Eac)m(h)31
b(attribute)g(applies)g(to)g(all)g(mem)m(b)s(ers)f(of)g(an)h(arra)m(y)
-8 b(.)275 4374 y(Arra)m(ys)30 b(are)h(assigned)f(to)h(using)f(comp)s
(ound)f(assignmen)m(ts)i(of)g(the)f(form)390 4506 y Fs(name=\(value)p
Fi(1)55 b Fs(...)47 b(value)p Fi(n)11 b Fs(\))150 4638
y Ft(where)37 b(eac)m(h)i Fq(v)-5 b(alue)42 b Ft(is)c(of)g(the)f(form)g
Fs([)p Fi(subscript)11 b Fs(]=)p Fq(string)d Ft(.)58
b(Indexed)36 b(arra)m(y)i(assignmen)m(ts)g(do)g(not)150
4747 y(require)c(the)g(brac)m(k)m(et)h(and)e(subscript.)50
b(When)34 b(assigning)g(to)g(indexed)g(arra)m(ys,)h(if)f(the)g
(optional)h(sub-)150 4857 y(script)c(is)h(supplied,)f(that)h(index)f
(is)h(assigned)g(to;)h(otherwise)f(the)f(index)h(of)f(the)h(elemen)m(t)
h(assigned)f(is)150 4966 y(the)f(last)g(index)f(assigned)g(to)h(b)m(y)g
(the)f(statemen)m(t)i(plus)e(one.)41 b(Indexing)30 b(starts)g(at)i
(zero.)275 5098 y(When)e(assigning)h(to)g(an)f(asso)s(ciativ)m(e)j
(arra)m(y)-8 b(,)32 b(the)e(subscript)f(is)i(required.)275
5230 y(This)f(syn)m(tax)j(is)e(also)i(accepted)g(b)m(y)f(the)f
Fs(declare)f Ft(builtin.)44 b(Individual)31 b(arra)m(y)h(elemen)m(ts)h
(ma)m(y)g(b)s(e)150 5340 y(assigned)e(to)g(using)f(the)g
Fs(name[)p Fq(subscript)r Fs(]=)p Fq(v)-5 b(alue)33 b
Ft(syn)m(tax)e(in)m(tro)s(duced)f(ab)s(o)m(v)m(e.)p eop
end
%%Page: 83 89
TeXDict begin 83 88 bop 150 -116 a Ft(Chapter)30 b(6:)41
b(Bash)30 b(F)-8 b(eatures)2484 b(83)275 299 y(This)30
b(syn)m(tax)j(is)e(also)i(accepted)g(b)m(y)f(the)f Fs(declare)f
Ft(builtin.)44 b(Individual)31 b(arra)m(y)h(elemen)m(ts)h(ma)m(y)g(b)s
(e)150 408 y(assigned)e(to)g(using)f(the)g Fs(name[)p
Fq(subscript)r Fs(]=)p Fq(v)-5 b(alue)33 b Ft(syn)m(tax)e(in)m(tro)s
(duced)f(ab)s(o)m(v)m(e.)275 543 y(An)m(y)j(elemen)m(t)i(of)f(an)f
(arra)m(y)h(ma)m(y)g(b)s(e)f(referenced)g(using)g Fs(${name[)p
Fq(subscript)r Fs(]})p Ft(.)46 b(The)33 b(braces)h(are)150
652 y(required)28 b(to)j(a)m(v)m(oid)f(con\015icts)g(with)f(the)h
(shell's)f(\014lename)h(expansion)f(op)s(erators.)41
b(If)28 b(the)i Fq(subscript)g Ft(is)150 762 y(`)p Fs(@)p
Ft(')f(or)g(`)p Fs(*)p Ft(',)g(the)g(w)m(ord)g(expands)f(to)i(all)f
(mem)m(b)s(ers)f(of)h(the)g(arra)m(y)h Fq(name)5 b Ft(.)40
b(These)29 b(subscripts)e(di\013er)i(only)150 872 y(when)36
b(the)g(w)m(ord)g(app)s(ears)g(within)g(double)g(quotes.)60
b(If)36 b(the)h(w)m(ord)f(is)g(double-quoted,)j Fs(${name[*]})150
981 y Ft(expands)20 b(to)h(a)g(single)g(w)m(ord)f(with)h(the)g(v)-5
b(Bash)30 b(F)-8 b(eatures)2484 b(83)275 299 y(An)m(y)33
b(elemen)m(t)i(of)f(an)f(arra)m(y)h(ma)m(y)g(b)s(e)f(referenced)g
(using)g Fs(${name[)p Fq(subscript)r Fs(]})p Ft(.)46
b(The)33 b(braces)h(are)150 408 y(required)28 b(to)j(a)m(v)m(oid)f
(con\015icts)g(with)f(the)h(shell's)f(\014lename)h(expansion)f(op)s
(erators.)41 b(If)28 b(the)i Fq(subscript)g Ft(is)150
518 y(`)p Fs(@)p Ft(')f(or)g(`)p Fs(*)p Ft(',)g(the)g(w)m(ord)g
(expands)f(to)i(all)f(mem)m(b)s(ers)f(of)h(the)g(arra)m(y)h
Fq(name)5 b Ft(.)40 b(These)29 b(subscripts)e(di\013er)i(only)150
628 y(when)36 b(the)g(w)m(ord)g(app)s(ears)g(within)g(double)g(quotes.)
60 b(If)36 b(the)h(w)m(ord)f(is)g(double-quoted,)j Fs(${name[*]})150
737 y Ft(expands)20 b(to)h(a)g(single)g(w)m(ord)f(with)h(the)g(v)-5
b(alue)21 b(of)f(eac)m(h)i(arra)m(y)f(mem)m(b)s(er)f(separated)h(b)m(y)
g(the)f(\014rst)g(c)m(haracter)150 1091 y(of)38 b(the)g
g(the)f(\014rst)g(c)m(haracter)150 847 y(of)38 b(the)g
Fs(IFS)f Ft(v)-5 b(ariable,)41 b(and)c Fs(${name[@]})e
Ft(expands)i(eac)m(h)i(elemen)m(t)g(of)f Fq(name)43 b
Ft(to)c(a)f(separate)h(w)m(ord.)150 1200 y(When)32 b(there)h(are)f(no)g
Ft(to)c(a)f(separate)h(w)m(ord.)150 956 y(When)32 b(there)h(are)f(no)g
(arra)m(y)h(mem)m(b)s(ers,)f Fs(${name[@]})e Ft(expands)h(to)i
(nothing.)47 b(If)31 b(the)i(double-quoted)150 1310 y(expansion)39
(nothing.)47 b(If)31 b(the)i(double-quoted)150 1066 y(expansion)39
b(o)s(ccurs)h(within)f(a)h(w)m(ord,)i(the)d(expansion)h(of)g(the)f
(\014rst)g(parameter)h(is)g(joined)f(with)h(the)150 1420
(\014rst)g(parameter)h(is)g(joined)f(with)h(the)150 1176
y(b)s(eginning)j(part)h(of)g(the)g(original)h(w)m(ord,)j(and)43
b(the)h(expansion)g(of)g(the)g(last)h(parameter)f(is)g(joined)150
1529 y(with)35 b(the)g(last)h(part)f(of)g(the)g(original)h(w)m(ord.)55
1285 y(with)35 b(the)g(last)h(part)f(of)g(the)g(original)h(w)m(ord.)55
b(This)34 b(is)h(analogous)h(to)g(the)f(expansion)g(of)g(the)g(sp)s
(ecial)150 1639 y(parameters)28 b(`)p Fs(@)p Ft(')g(and)f(`)p
(ecial)150 1395 y(parameters)28 b(`)p Fs(@)p Ft(')g(and)f(`)p
Fs(*)p Ft('.)39 b Fs(${#name[)p Fq(subscript)r Fs(]})24
b Ft(expands)j(to)h(the)g(length)g(of)f Fs(${name[)p
Fq(subscript)r Fs(]})p Ft(.)150 1748 y(If)j Fq(subscript)i
Fq(subscript)r Fs(]})p Ft(.)150 1504 y(If)j Fq(subscript)i
Ft(is)f(`)p Fs(@)p Ft(')f(or)h(`)p Fs(*)p Ft(',)g(the)g(expansion)g(is)
g(the)g(n)m(um)m(b)s(er)e(of)i(elemen)m(ts)h(in)f(the)g(arra)m(y)-8
b(.)42 b(Referencing)150 1858 y(an)30 b(arra)m(y)h(v)-5
b(ariable)31 b(without)g(a)f(subscript)g(is)g(equiv)-5
b(alen)m(t)32 b(to)f(referencing)g(with)f(a)g(subscript)g(of)g(0.)275
1992 y(An)35 b(arra)m(y)i(v)-5 b(ariable)37 b(is)g(considered)f(set)h
(if)f(a)h(subscript)e(has)h(b)s(een)g(assigned)g(a)h(v)-5
b(alue.)59 b(The)36 b(n)m(ull)150 2102 y(string)30 b(is)h(a)g(v)-5
b(alid)30 b(v)-5 b(alue.)275 2236 y(The)32 b Fs(unset)g
Ft(builtin)h(is)g(used)g(to)h(destro)m(y)g(arra)m(ys.)50
b Fs(unset)31 b Fq(name)5 b Ft([)p Fq(subscript)r Ft(])33
b(destro)m(ys)h(the)f(arra)m(y)150 2346 y(elemen)m(t)i(at)g(index)f
Fq(subscript)r Ft(.)50 b(Care)34 b(m)m(ust)f(b)s(e)h(tak)m(en)h(to)f(a)
m(v)m(oid)i(un)m(w)m(an)m(ted)e(side)g(e\013ects)h(caused)f(b)m(y)150
2456 y(\014lename)40 b(expansion.)69 b Fs(unset)39 b
Fq(name)5 b Ft(,)42 b(where)e Fq(name)45 b Ft(is)39 b(an)h(arra)m(y)-8
b(,)44 b(remo)m(v)m(es)d(the)f(en)m(tire)h(arra)m(y)-8
b(.)70 b(A)150 2565 y(subscript)29 b(of)i(`)p Fs(*)p
b(.)42 b(Referencing)150 1614 y(an)33 b(arra)m(y)g(v)-5
b(ariable)34 b(without)f(a)h(subscript)e(is)h(equiv)-5
b(alen)m(t)34 b(to)g(referencing)f(with)g(a)g(subscript)f(of)h(0.)49
b(If)150 1724 y(the)33 b Fq(subscript)h Ft(used)e(to)h(reference)h(an)f
(elemen)m(t)h(of)f(an)g(indexed)f(arra)m(y)i(ev)-5 b(aluates)34
b(to)g(a)f(n)m(um)m(b)s(er)f(less)150 1833 y(than)j(zero,)i(it)f(is)f
(used)g(as)g(an)g(o\013set)h(from)f(one)h(greater)g(than)f(the)g(arra)m
(y's)h(maxim)m(um)f(index)g(\(so)h(a)150 1943 y(sub)s(cript)29
b(of)h(-1)h(refers)f(to)h(the)g(last)g(elemen)m(t)h(of)f(the)f(arra)m
(y\).)275 2071 y(An)35 b(arra)m(y)i(v)-5 b(ariable)37
b(is)g(considered)f(set)h(if)f(a)h(subscript)e(has)h(b)s(een)g
(assigned)g(a)h(v)-5 b(alue.)59 b(The)36 b(n)m(ull)150
2180 y(string)30 b(is)h(a)g(v)-5 b(alid)30 b(v)-5 b(alue.)275
2308 y(The)32 b Fs(unset)g Ft(builtin)h(is)g(used)g(to)h(destro)m(y)g
(arra)m(ys.)50 b Fs(unset)31 b Fq(name)5 b Ft([)p Fq(subscript)r
Ft(])33 b(destro)m(ys)h(the)f(arra)m(y)150 2418 y(elemen)m(t)i(at)g
(index)f Fq(subscript)r Ft(.)50 b(Care)34 b(m)m(ust)f(b)s(e)h(tak)m(en)
h(to)f(a)m(v)m(oid)i(un)m(w)m(an)m(ted)e(side)g(e\013ects)h(caused)f(b)
m(y)150 2527 y(\014lename)40 b(expansion.)69 b Fs(unset)39
b Fq(name)5 b Ft(,)42 b(where)e Fq(name)45 b Ft(is)39
b(an)h(arra)m(y)-8 b(,)44 b(remo)m(v)m(es)d(the)f(en)m(tire)h(arra)m(y)
-8 b(.)70 b(A)150 2637 y(subscript)29 b(of)i(`)p Fs(*)p
Ft(')f(or)h(`)p Fs(@)p Ft(')f(also)h(remo)m(v)m(es)h(the)f(en)m(tire)g
(arra)m(y)-8 b(.)275 2700 y(The)41 b Fs(declare)p Ft(,)i
(arra)m(y)-8 b(.)275 2765 y(The)41 b Fs(declare)p Ft(,)i
Fs(local)p Ft(,)h(and)d Fs(readonly)f Ft(builtins)h(eac)m(h)j(accept)f
(a)f(`)p Fs(-a)p Ft(')g(option)h(to)f(sp)s(ecify)g(an)150
2809 y(indexed)25 b(arra)m(y)h(and)e(a)i(`)p Fs(-A)p
2874 y(indexed)25 b(arra)m(y)h(and)e(a)i(`)p Fs(-A)p
Ft(')f(option)h(to)g(sp)s(ecify)f(an)g(asso)s(ciativ)m(e)j(arra)m(y)-8
b(.)40 b(If)25 b(b)s(oth)g(options)g(are)h(supplied,)150
2919 y(`)p Fs(-A)p Ft(')k(tak)m(es)i(precedence.)41 b(The)30
2984 y(`)p Fs(-A)p Ft(')k(tak)m(es)i(precedence.)41 b(The)30
b Fs(read)f Ft(builtin)g(accepts)j(a)e(`)p Fs(-a)p Ft(')g(option)h(to)g
(assign)g(a)f(list)h(of)f(w)m(ords)g(read)150 3028 y(from)40
(assign)g(a)f(list)h(of)f(w)m(ords)g(read)150 3094 y(from)40
b(the)g(standard)f(input)h(to)h(an)f(arra)m(y)-8 b(,)44
b(and)39 b(can)i(read)f(v)-5 b(alues)40 b(from)g(the)g(standard)g
(input)f(in)m(to)150 3138 y(individual)26 b(arra)m(y)h(elemen)m(ts.)41
(input)f(in)m(to)150 3203 y(individual)26 b(arra)m(y)h(elemen)m(ts.)41
b(The)26 b Fs(set)f Ft(and)h Fs(declare)f Ft(builtins)g(displa)m(y)i
(arra)m(y)g(v)-5 b(alues)27 b(in)f(a)h(w)m(a)m(y)g(that)150
3248 y(allo)m(ws)32 b(them)e(to)h(b)s(e)f(reused)f(as)i(input.)150
3480 y Fr(6.8)68 b(The)45 b(Directory)g(Stac)l(k)150
3639 y Ft(The)21 b(directory)h(stac)m(k)h(is)e(a)h(list)g(of)f(recen)m
3313 y(allo)m(ws)32 b(them)e(to)h(b)s(e)f(reused)f(as)i(input.)150
3532 y Fr(6.8)68 b(The)45 b(Directory)g(Stac)l(k)150
3691 y Ft(The)21 b(directory)h(stac)m(k)h(is)e(a)h(list)g(of)f(recen)m
(tly-visited)j(directories.)39 b(The)20 b Fs(pushd)g
Ft(builtin)h(adds)g(directories)150 3749 y(to)42 b(the)f(stac)m(k)i(as)
Ft(builtin)h(adds)g(directories)150 3801 y(to)42 b(the)f(stac)m(k)i(as)
e(it)h(c)m(hanges)g(the)f(curren)m(t)g(directory)-8 b(,)45
b(and)40 b(the)i Fs(popd)e Ft(builtin)g(remo)m(v)m(es)j(sp)s(eci\014ed)
150 3859 y(directories)29 b(from)f(the)h(stac)m(k)h(and)d(c)m(hanges)j
150 3911 y(directories)29 b(from)f(the)h(stac)m(k)h(and)d(c)m(hanges)j
(the)e(curren)m(t)g(directory)h(to)g(the)g(directory)f(remo)m(v)m(ed.)
41 b(The)150 3968 y Fs(dirs)29 b Ft(builtin)h(displa)m(ys)h(the)f(con)m
(ten)m(ts)i(of)f(the)f(directory)h(stac)m(k.)275 4103
41 b(The)150 4020 y Fs(dirs)29 b Ft(builtin)h(displa)m(ys)h(the)f(con)m
(ten)m(ts)i(of)f(the)f(directory)h(stac)m(k.)275 4148
y(The)k(con)m(ten)m(ts)i(of)f(the)h(directory)f(stac)m(k)h(are)f(also)h
(visible)g(as)f(the)g(v)-5 b(alue)36 b(of)g(the)g Fs(DIRSTACK)e
Ft(shell)150 4212 y(v)-5 b(ariable.)150 4411 y Fj(6.8.1)63
b(Directory)40 b(Stac)m(k)g(Builtins)150 4583 y Fs(dirs)870
4717 y(dirs)47 b([+)p Fi(N)57 b Fs(|)48 b(-)p Fi(N)11
b Fs(])46 b([-clpv])630 4852 y Ft(Displa)m(y)35 b(the)f(list)g(of)g
Ft(shell)150 4258 y(v)-5 b(ariable.)150 4444 y Fj(6.8.1)63
b(Directory)40 b(Stac)m(k)g(Builtins)150 4609 y Fs(dirs)870
4737 y(dirs)47 b([+)p Fi(N)57 b Fs(|)48 b(-)p Fi(N)11
b Fs(])46 b([-clpv])630 4865 y Ft(Displa)m(y)35 b(the)f(list)g(of)g
(curren)m(tly)g(remem)m(b)s(ered)f(directories.)51 b(Directories)36
b(are)e(added)f(to)630 4962 y(the)28 b(list)h(with)f(the)g
b(are)e(added)f(to)630 4975 y(the)28 b(list)h(with)f(the)g
Fs(pushd)f Ft(command;)i(the)f Fs(popd)f Ft(command)h(remo)m(v)m(es)h
(directories)g(from)630 5071 y(the)i(list.)630 5230 y
(directories)g(from)630 5084 y(the)i(list.)630 5230 y
Fs(+)p Fi(N)384 b Ft(Displa)m(ys)23 b(the)f Fq(N)10 b
Ft(th)21 b(directory)h(\(coun)m(ting)h(from)e(the)h(left)g(of)g(the)g
(list)g(prin)m(ted)1110 5340 y(b)m(y)30 b Fs(dirs)f Ft(when)h(in)m(v)m