fix for EXIT trap in -c command; suspend -f now suspends even if job control is not enabled

This commit is contained in:
Chet Ramey
2022-05-18 09:50:42 -04:00
parent f9ed510acb
commit daff9ecae9
24 changed files with 8106 additions and 8115 deletions
+122 -120
View File
@@ -1,7 +1,7 @@
%!PS-Adobe-2.0
%%Creator: dvips(k) 2021.1 Copyright 2021 Radical Eye Software
%%Creator: dvips(k) 2022.1 (TeX Live 2022) Copyright 2022 Radical Eye Software
%%Title: bashref.dvi
%%CreationDate: Tue Apr 12 14:01:11 2022
%%CreationDate: Wed May 4 19:11:10 2022
%%Pages: 196
%%PageOrder: Ascend
%%BoundingBox: 0 0 612 792
@@ -12,7 +12,7 @@
%DVIPSWebPage: (www.radicaleye.com)
%DVIPSCommandLine: dvips -D 600 -t letter -o bashref.ps bashref.dvi
%DVIPSParameters: dpi=600
%DVIPSSource: TeX output 2022.04.12:1001
%DVIPSSource: TeX output 2022.05.04:1511
%%BeginProcSet: tex.pro 0 0
%!
/TeXDict 300 dict def TeXDict begin/N{def}def/B{bind def}N/S{exch}N/X{S
@@ -7614,7 +7614,7 @@ ifelse
TeXDict begin 1 0 bop 150 1318 a Fv(Bash)64 b(Reference)j(Man)-5
b(ual)p 150 1385 3600 34 v 2361 1481 a Fu(Reference)31
b(Do)s(cumen)m(tation)i(for)d(Bash)2428 1589 y(Edition)h(5.2,)g(for)f
Ft(Bash)g Fu(V)-8 b(ersion)31 b(5.2.)3333 1697 y(April)f(2022)150
Ft(Bash)g Fu(V)-8 b(ersion)31 b(5.2.)3364 1697 y(Ma)m(y)g(2022)150
4927 y Fs(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
@@ -7622,15 +7622,16 @@ b(oundation)p 150 5141 3600 17 v eop end
%%Page: 2 2
TeXDict begin 2 1 bop 150 4279 a Fu(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 4389 y(5.2,)c(11)f(April)f
(2022\).)150 4523 y(This)j(is)h(Edition)f(5.2,)j(last)f(up)s(dated)d
(11)j(April)e(2022,)k(of)d Fr(The)f(GNU)h(Bash)g(Reference)g(Man)m(ual)
p Fu(,)i(for)150 4633 y Ft(Bash)p Fu(,)29 b(V)-8 b(ersion)31
b(5.2.)150 4767 y(Cop)m(yrigh)m(t)602 4764 y(c)577 4767
y Fq(\015)f Fu(1988{2022)35 b(F)-8 b(ree)31 b(Soft)m(w)m(are)h(F)-8
b(oundation,)31 b(Inc.)390 4902 y(P)m(ermission)21 b(is)f(gran)m(ted)h
(to)g(cop)m(y)-8 b(,)24 b(distribute)c(and/or)h(mo)s(dify)e(this)i(do)s
(cumen)m(t)f(under)f(the)390 5011 y(terms)25 b(of)h(the)f(GNU)h(F)-8
(the)h(Bash)f(shell)h(\(v)m(ersion)150 4389 y(5.2,)c(2)e(Ma)m(y)i
(2022\).)150 4523 y(This)38 b(is)g(Edition)h(5.2,)j(last)d(up)s(dated)e
(2)i(Ma)m(y)h(2022,)j(of)38 b Fr(The)g(GNU)h(Bash)g(Reference)g(Man)m
(ual)p Fu(,)j(for)150 4633 y Ft(Bash)p Fu(,)29 b(V)-8
b(ersion)31 b(5.2.)150 4767 y(Cop)m(yrigh)m(t)602 4764
y(c)577 4767 y Fq(\015)f Fu(1988{2022)35 b(F)-8 b(ree)31
b(Soft)m(w)m(are)h(F)-8 b(oundation,)31 b(Inc.)390 4902
y(P)m(ermission)21 b(is)f(gran)m(ted)h(to)g(cop)m(y)-8
b(,)24 b(distribute)c(and/or)h(mo)s(dify)e(this)i(do)s(cumen)m(t)f
(under)f(the)390 5011 y(terms)25 b(of)h(the)f(GNU)h(F)-8
b(ree)27 b(Do)s(cumen)m(tation)g(License,)g(V)-8 b(ersion)26
b(1.3)g(or)f(an)m(y)h(later)g(v)m(ersion)390 5121 y(published)43
b(b)m(y)h(the)h(F)-8 b(ree)46 b(Soft)m(w)m(are)g(F)-8
@@ -8688,158 +8689,158 @@ y Fk(3.2.3)63 b(Pip)s(elines)150 446 y Fu(A)21 b Ft(pipeline)d
Fu(is)j(a)g(sequence)g(of)g(one)g(or)g(more)g(commands)f(separated)h(b)
m(y)g(one)g(of)g(the)g(con)m(trol)h(op)s(erators)150
555 y(`)p Ft(|)p Fu(')31 b(or)f(`)p Ft(|&)p Fu('.)275
683 y(The)f(format)i(for)f(a)h(pip)s(eline)f(is)390 810
695 y(The)f(format)i(for)f(a)h(pip)s(eline)f(is)390 834
y Ft([time)46 b([-p]])h([!])g Fj(command1)e Ft([)j(|)f(or)g(|&)g
Fj(command2)f Ft(])h(...)150 938 y Fu(The)25 b(output)f(of)i(eac)m(h)g
Fj(command2)f Ft(])h(...)150 974 y Fu(The)25 b(output)f(of)i(eac)m(h)g
(command)f(in)f(the)i(pip)s(eline)e(is)i(connected)g(via)f(a)h(pip)s(e)
e(to)i(the)f(input)f(of)h(the)h(next)150 1047 y(command.)40
e(to)i(the)f(input)f(of)h(the)h(next)150 1083 y(command.)40
b(That)29 b(is,)h(eac)m(h)h(command)e(reads)g(the)h(previous)f
(command's)g(output.)40 b(This)29 b(connection)150 1157
(command's)g(output.)40 b(This)29 b(connection)150 1193
y(is)h(p)s(erformed)f(b)s(efore)h(an)m(y)h(redirections)g(sp)s
(eci\014ed)f(b)m(y)g Fr(command1)p Fu(.)275 1284 y(If)k(`)p
(eci\014ed)f(b)m(y)g Fr(command1)p Fu(.)275 1333 y(If)k(`)p
Ft(|&)p Fu(')h(is)f(used,)i Fr(command1)7 b Fu('s)35
b(standard)f(error,)i(in)e(addition)h(to)h(its)f(standard)f(output,)i
(is)e(con-)150 1394 y(nected)h(to)g Fr(command2)7 b Fu('s)35
(is)e(con-)150 1442 y(nected)h(to)g Fr(command2)7 b Fu('s)35
b(standard)f(input)f(through)h(the)g(pip)s(e;)i(it)f(is)g(shorthand)e
(for)h Ft(2>&1)29 b(|)p Fu(.)53 b(This)150 1504 y(implicit)41
(for)h Ft(2>&1)29 b(|)p Fu(.)53 b(This)150 1552 y(implicit)41
b(redirection)f(of)g(the)g(standard)f(error)g(to)h(the)g(standard)f
(output)g(is)h(p)s(erformed)e(after)j(an)m(y)150 1613
(output)g(is)h(p)s(erformed)e(after)j(an)m(y)150 1661
y(redirections)31 b(sp)s(eci\014ed)f(b)m(y)g Fr(command1)p
Fu(.)275 1741 y(The)36 b(reserv)m(ed)g(w)m(ord)g Ft(time)g
Fu(.)275 1801 y(The)36 b(reserv)m(ed)g(w)m(ord)g Ft(time)g
Fu(causes)h(timing)g(statistics)h(to)f(b)s(e)f(prin)m(ted)g(for)g(the)h
(pip)s(eline)f(once)h(it)150 1850 y(\014nishes.)51 b(The)34
(pip)s(eline)f(once)h(it)150 1910 y(\014nishes.)51 b(The)34
b(statistics)i(curren)m(tly)e(consist)h(of)f(elapsed)h(\(w)m(all-clo)s
(c)m(k\))i(time)e(and)f(user)f(and)h(system)150 1960
(c)m(k\))i(time)e(and)f(user)f(and)h(system)150 2020
y(time)e(consumed)e(b)m(y)h(the)g(command's)g(execution.)44
b(The)31 b Ft(-p)f Fu(option)i(c)m(hanges)g(the)f(output)g(format)g(to)
150 2069 y(that)j(sp)s(eci\014ed)e(b)m(y)h Fm(posix)p
150 2130 y(that)j(sp)s(eci\014ed)e(b)m(y)h Fm(posix)p
Fu(.)49 b(When)33 b(the)g(shell)g(is)h(in)e Fm(posix)h
Fu(mo)s(de)g(\(see)h(Section)g(6.11)g([Bash)g(POSIX)150
2179 y(Mo)s(de],)j(page)e(106\),)j(it)e(do)s(es)e(not)i(recognize)g
2239 y(Mo)s(de],)j(page)e(106\),)j(it)e(do)s(es)e(not)i(recognize)g
Ft(time)e Fu(as)h(a)h(reserv)m(ed)f(w)m(ord)f(if)h(the)g(next)g(tok)m
(en)h(b)s(egins)150 2289 y(with)d(a)g(`)p Ft(-)p Fu('.)49
(en)h(b)s(egins)150 2349 y(with)d(a)g(`)p Ft(-)p Fu('.)49
b(The)33 b Ft(TIMEFORMAT)d Fu(v)-5 b(ariable)34 b(ma)m(y)g(b)s(e)f(set)
g(to)h(a)g(format)f(string)g(that)h(sp)s(eci\014es)f(ho)m(w)g(the)150
2398 y(timing)38 b(information)g(should)e(b)s(e)h(displa)m(y)m(ed.)62
2458 y(timing)38 b(information)g(should)e(b)s(e)h(displa)m(y)m(ed.)62
b(See)38 b(Section)g(5.2)g([Bash)g(V)-8 b(ariables],)41
b(page)d(78,)i(for)e(a)150 2508 y(description)27 b(of)g(the)h(a)m(v)-5
b(page)d(78,)i(for)e(a)150 2568 y(description)27 b(of)g(the)h(a)m(v)-5
b(ailable)29 b(formats.)40 b(The)26 b(use)h(of)g Ft(time)f
Fu(as)i(a)f(reserv)m(ed)g(w)m(ord)g(p)s(ermits)f(the)h(timing)150
2617 y(of)38 b(shell)g(builtins,)i(shell)e(functions,)i(and)d(pip)s
2677 y(of)38 b(shell)g(builtins,)i(shell)e(functions,)i(and)d(pip)s
(elines.)63 b(An)38 b(external)h Ft(time)e Fu(command)h(cannot)g(time)
150 2727 y(these)31 b(easily)-8 b(.)275 2854 y(When)26
150 2787 y(these)31 b(easily)-8 b(.)275 2927 y(When)26
b(the)h(shell)g(is)g(in)g Fm(posix)f Fu(mo)s(de)g(\(see)i(Section)f
(6.11)i([Bash)e(POSIX)f(Mo)s(de],)i(page)g(106\),)h Ft(time)150
2964 y Fu(ma)m(y)d(b)s(e)f(follo)m(w)m(ed)j(b)m(y)d(a)h(newline.)39
3036 y Fu(ma)m(y)d(b)s(e)f(follo)m(w)m(ed)j(b)m(y)d(a)h(newline.)39
b(In)25 b(this)h(case,)i(the)d(shell)h(displa)m(ys)g(the)g(total)h
(user)e(and)g(system)h(time)150 3073 y(consumed)33 b(b)m(y)h(the)h
(user)e(and)g(system)h(time)150 3146 y(consumed)33 b(b)m(y)h(the)h
(shell)f(and)f(its)i(c)m(hildren.)51 b(The)34 b Ft(TIMEFORMAT)d
Fu(v)-5 b(ariable)35 b(ma)m(y)g(b)s(e)e(used)g(to)i(sp)s(ecify)150
3183 y(the)c(format)f(of)h(the)f(time)h(information.)275
3311 y(If)36 b(the)h(pip)s(eline)g(is)g(not)g(executed)h(async)m
3255 y(the)c(format)f(of)h(the)f(time)h(information.)275
3395 y(If)36 b(the)h(pip)s(eline)g(is)g(not)g(executed)h(async)m
(hronously)f(\(see)h(Section)g(3.2.4)g([Lists],)i(page)e(10\),)i(the)
150 3420 y(shell)31 b(w)m(aits)g(for)f(all)h(commands)f(in)g(the)h(pip)
s(eline)f(to)h(complete.)275 3548 y(Eac)m(h)e(command)g(in)g(a)g(pip)s
(eline)g(is)g(executed)h(in)e(its)i(o)m(wn)f Fr(subshell)p
Fu(,)f(whic)m(h)h(is)g(a)g(separate)h(pro)s(cess)150
3657 y(\(see)g(Section)g(3.7.3)h([Command)e(Execution)h(En)m(vironmen)m
(t],)g(page)g(43\).)41 b(If)29 b(the)g Ft(lastpipe)e
Fu(option)j(is)150 3767 y(enabled)35 b(using)g(the)g
Ft(shopt)f Fu(builtin)g(\(see)i(Section)g(4.3.2)h([The)e(Shopt)f
(Builtin],)j(page)f(71\),)i(the)d(last)150 3876 y(elemen)m(t)d(of)e(a)h
(pip)s(eline)f(ma)m(y)h(b)s(e)f(run)f(b)m(y)h(the)h(shell)f(pro)s(cess)
g(when)f(job)h(con)m(trol)i(is)f(not)f(activ)m(e.)275
4004 y(The)24 b(exit)i(status)f(of)h(a)f(pip)s(eline)g(is)g(the)g(exit)
h(status)f(of)h(the)f(last)h(command)f(in)f(the)i(pip)s(eline,)g
(unless)150 4113 y(the)31 b Ft(pipefail)d Fu(option)j(is)g(enabled)f
(\(see)i(Section)f(4.3.1)i([The)d(Set)h(Builtin],)g(page)h(67\).)42
b(If)30 b Ft(pipefail)150 4223 y Fu(is)f(enabled,)g(the)f(pip)s
(eline's)g(return)g(status)h(is)f(the)h(v)-5 b(alue)29
b(of)f(the)h(last)g(\(righ)m(tmost\))i(command)d(to)h(exit)150
4333 y(with)34 b(a)h(non-zero)g(status,)i(or)d(zero)i(if)e(all)i
(commands)e(exit)h(successfully)-8 b(.)54 b(If)34 b(the)h(reserv)m(ed)g
(w)m(ord)f(`)p Ft(!)p Fu(')150 4442 y(precedes)e(the)f(pip)s(eline,)h
(the)f(exit)i(status)f(is)f(the)h(logical)i(negation)f(of)e(the)h(exit)
g(status)g(as)g(describ)s(ed)150 4552 y(ab)s(o)m(v)m(e.)63
b(The)38 b(shell)f(w)m(aits)i(for)e(all)i(commands)e(in)g(the)h(pip)s
(eline)f(to)h(terminate)h(b)s(efore)e(returning)g(a)150
4661 y(v)-5 b(alue.)150 4846 y Fk(3.2.4)63 b(Lists)41
b(of)h(Commands)150 4993 y Fu(A)37 b Ft(list)e Fu(is)i(a)g(sequence)g
(of)g(one)g(or)f(more)h(pip)s(elines)f(separated)h(b)m(y)g(one)g(of)f
(the)h(op)s(erators)g(`)p Ft(;)p Fu(',)i(`)p Ft(&)p Fu(',)150
5103 y(`)p Ft(&&)p Fu(',)31 b(or)f(`)p Ft(||)p Fu(',)g(and)g
(optionally)i(terminated)f(b)m(y)f(one)h(of)f(`)p Ft(;)p
Fu(',)h(`)p Ft(&)p Fu(',)g(or)f(a)h Ft(newline)p Fu(.)275
5230 y(Of)23 b(these)h(list)g(op)s(erators,)i(`)p Ft(&&)p
Fu(')d(and)g(`)p Ft(||)p Fu(')h(ha)m(v)m(e)h(equal)f(precedence,)i
(follo)m(w)m(ed)f(b)m(y)f(`)p Ft(;)p Fu(')g(and)f(`)p
Ft(&)p Fu(',)i(whic)m(h)150 5340 y(ha)m(v)m(e)32 b(equal)e(precedence.)
p eop end
150 3504 y(shell)31 b(w)m(aits)g(for)f(all)h(commands)f(in)g(the)h(pip)
s(eline)f(to)h(complete.)275 3644 y(Eac)m(h)d(command)g(in)f(a)i(m)m
(ulti-command)f(pip)s(eline,)h(where)e(pip)s(es)g(are)h(created,)i(is)e
(executed)h(in)f(its)150 3753 y(o)m(wn)h Fr(subshell)p
Fu(,)f(whic)m(h)h(is)g(a)g(separate)h(pro)s(cess)e(\(see)i(Section)g
(3.7.3)g([Command)f(Execution)g(En)m(viron-)150 3863
y(men)m(t],)d(page)e(43\).)40 b(If)23 b(the)h Ft(lastpipe)d
Fu(option)j(is)g(enabled)g(using)f(the)h Ft(shopt)e Fu(builtin)h(\(see)
i(Section)f(4.3.2)150 3973 y([The)i(Shopt)f(Builtin],)i(page)g(71\),)h
(the)e(last)h(elemen)m(t)g(of)f(a)g(pip)s(eline)g(ma)m(y)g(b)s(e)f(run)
g(b)m(y)g(the)h(shell)g(pro)s(cess)150 4082 y(when)j(job)h(con)m(trol)i
(is)f(not)f(activ)m(e.)275 4222 y(The)24 b(exit)i(status)f(of)h(a)f
(pip)s(eline)g(is)g(the)g(exit)h(status)f(of)h(the)f(last)h(command)f
(in)f(the)i(pip)s(eline,)g(unless)150 4331 y(the)31 b
Ft(pipefail)d Fu(option)j(is)g(enabled)f(\(see)i(Section)f(4.3.1)i
([The)d(Set)h(Builtin],)g(page)h(67\).)42 b(If)30 b Ft(pipefail)150
4441 y Fu(is)f(enabled,)g(the)f(pip)s(eline's)g(return)g(status)h(is)f
(the)h(v)-5 b(alue)29 b(of)f(the)h(last)g(\(righ)m(tmost\))i(command)d
(to)h(exit)150 4550 y(with)34 b(a)h(non-zero)g(status,)i(or)d(zero)i
(if)e(all)i(commands)e(exit)h(successfully)-8 b(.)54
b(If)34 b(the)h(reserv)m(ed)g(w)m(ord)f(`)p Ft(!)p Fu(')150
4660 y(precedes)e(the)f(pip)s(eline,)h(the)f(exit)i(status)f(is)f(the)h
(logical)i(negation)f(of)e(the)h(exit)g(status)g(as)g(describ)s(ed)150
4770 y(ab)s(o)m(v)m(e.)63 b(The)38 b(shell)f(w)m(aits)i(for)e(all)i
(commands)e(in)g(the)h(pip)s(eline)f(to)h(terminate)h(b)s(efore)e
(returning)g(a)150 4879 y(v)-5 b(alue.)150 5083 y Fk(3.2.4)63
b(Lists)41 b(of)h(Commands)150 5230 y Fu(A)37 b Ft(list)e
Fu(is)i(a)g(sequence)g(of)g(one)g(or)f(more)h(pip)s(elines)f(separated)
h(b)m(y)g(one)g(of)f(the)h(op)s(erators)g(`)p Ft(;)p
Fu(',)i(`)p Ft(&)p Fu(',)150 5340 y(`)p Ft(&&)p Fu(',)31
b(or)f(`)p Ft(||)p Fu(',)g(and)g(optionally)i(terminated)f(b)m(y)f(one)
h(of)f(`)p Ft(;)p Fu(',)h(`)p Ft(&)p Fu(',)g(or)f(a)h
Ft(newline)p Fu(.)p eop end
%%Page: 11 17
TeXDict begin 11 16 bop 150 -116 a Fu(Chapter)30 b(3:)41
b(Basic)32 b(Shell)e(F)-8 b(eatures)2246 b(11)275 299
y(A)29 b(sequence)h(of)g(one)g(or)g(more)g(newlines)f(ma)m(y)h(app)s
(ear)f(in)h(a)g Ft(list)e Fu(to)j(delimit)f(commands,)g(equiv-)150
408 y(alen)m(t)i(to)f(a)g(semicolon.)275 548 y(If)c(a)h(command)f(is)h
(terminated)g(b)m(y)g(the)g(con)m(trol)h(op)s(erator)f(`)p
y(Of)23 b(these)h(list)g(op)s(erators,)i(`)p Ft(&&)p
Fu(')d(and)g(`)p Ft(||)p Fu(')h(ha)m(v)m(e)h(equal)f(precedence,)i
(follo)m(w)m(ed)f(b)m(y)f(`)p Ft(;)p Fu(')g(and)f(`)p
Ft(&)p Fu(',)i(whic)m(h)150 408 y(ha)m(v)m(e)32 b(equal)e(precedence.)
275 536 y(A)f(sequence)h(of)g(one)g(or)g(more)g(newlines)f(ma)m(y)h
(app)s(ear)f(in)h(a)g Ft(list)e Fu(to)j(delimit)f(commands,)g(equiv-)
150 646 y(alen)m(t)i(to)f(a)g(semicolon.)275 773 y(If)c(a)h(command)f
(is)h(terminated)g(b)m(y)g(the)g(con)m(trol)h(op)s(erator)f(`)p
Ft(&)p Fu(',)h(the)e(shell)h(executes)h(the)f(command)150
658 y(async)m(hronously)g(in)h(a)g(subshell.)39 b(This)28
883 y(async)m(hronously)g(in)h(a)g(subshell.)39 b(This)28
b(is)h(kno)m(wn)f(as)h(executing)h(the)f(command)g(in)f(the)h
Fr(bac)m(kground)p Fu(,)150 767 y(and)42 b(these)i(are)f(referred)g(to)
Fr(bac)m(kground)p Fu(,)150 992 y(and)42 b(these)i(are)f(referred)g(to)
g(as)h Fr(async)m(hronous)i Fu(commands.)78 b(The)43
b(shell)g(do)s(es)g(not)g(w)m(ait)h(for)f(the)150 877
b(shell)g(do)s(es)g(not)g(w)m(ait)h(for)f(the)150 1102
y(command)34 b(to)h(\014nish,)f(and)f(the)h(return)f(status)i(is)f(0)g
(\(true\).)53 b(When)34 b(job)g(con)m(trol)h(is)f(not)h(activ)m(e)h
(\(see)150 986 y(Chapter)27 b(7)h([Job)f(Con)m(trol],)i(page)g(113\),)h
(the)d(standard)g(input)f(for)i(async)m(hronous)f(commands,)h(in)f(the)
150 1096 y(absence)k(of)f(an)m(y)h(explicit)h(redirections,)f(is)f
(redirected)h(from)f Ft(/dev/null)p Fu(.)275 1236 y(Commands)19
(\(see)150 1211 y(Chapter)27 b(7)h([Job)f(Con)m(trol],)i(page)g(113\),)
h(the)d(standard)g(input)f(for)i(async)m(hronous)f(commands,)h(in)f
(the)150 1321 y(absence)k(of)f(an)m(y)h(explicit)h(redirections,)f(is)f
(redirected)h(from)f Ft(/dev/null)p Fu(.)275 1448 y(Commands)19
b(separated)j(b)m(y)f(a)g(`)p Ft(;)p Fu(')g(are)h(executed)g(sequen)m
(tially;)k(the)21 b(shell)g(w)m(aits)h(for)f(eac)m(h)h(command)150
1345 y(to)31 b(terminate)h(in)e(turn.)39 b(The)30 b(return)f(status)i
1558 y(to)31 b(terminate)h(in)e(turn.)39 b(The)30 b(return)f(status)i
(is)f(the)h(exit)g(status)g(of)g(the)f(last)h(command)f(executed.)275
1485 y Fm(and)g Fu(and)h Fm(or)g Fu(lists)h(are)g(sequences)f(of)h(one)
1685 y Fm(and)g Fu(and)h Fm(or)g Fu(lists)h(are)g(sequences)f(of)h(one)
g(or)f(more)h(pip)s(elines)e(separated)i(b)m(y)g(the)f(con)m(trol)i(op)
s(er-)150 1594 y(ators)e(`)p Ft(&&)p Fu(')f(and)g(`)p
s(er-)150 1795 y(ators)e(`)p Ft(&&)p Fu(')f(and)g(`)p
Ft(||)p Fu(',)h(resp)s(ectiv)m(ely)-8 b(.)42 b Fm(and)30
b Fu(and)f Fm(or)h Fu(lists)h(are)g(executed)g(with)f(left)h(asso)s
(ciativit)m(y)-8 b(.)275 1734 y(An)30 b Fm(and)f Fu(list)i(has)f(the)h
(form)390 1874 y Fj(command1)46 b Ft(&&)h Fj(command2)150
2013 y Fr(command2)38 b Fu(is)30 b(executed)i(if,)e(and)g(only)g(if,)h
(ciativit)m(y)-8 b(.)275 1923 y(An)30 b Fm(and)f Fu(list)i(has)f(the)h
(form)390 2050 y Fj(command1)46 b Ft(&&)h Fj(command2)150
2178 y Fr(command2)38 b Fu(is)30 b(executed)i(if,)e(and)g(only)g(if,)h
Fr(command1)38 b Fu(returns)29 b(an)h(exit)h(status)g(of)g(zero)g
(\(success\).)275 2153 y(An)f Fm(or)f Fu(list)i(has)f(the)h(form)390
2293 y Fj(command1)46 b Ft(||)h Fj(command2)150 2432
(\(success\).)275 2305 y(An)f Fm(or)f Fu(list)i(has)f(the)h(form)390
2432 y Fj(command1)46 b Ft(||)h Fj(command2)150 2560
y Fr(command2)38 b Fu(is)30 b(executed)i(if,)e(and)g(only)g(if,)h
Fr(command1)38 b Fu(returns)29 b(a)i(non-zero)g(exit)g(status.)275
2572 y(The)h(return)g(status)i(of)f Fm(and)f Fu(and)h
2687 y(The)h(return)g(status)i(of)f Fm(and)f Fu(and)h
Fm(or)f Fu(lists)i(is)f(the)g(exit)h(status)g(of)f(the)g(last)h
(command)f(executed)150 2681 y(in)d(the)h(list.)150 2886
y Fk(3.2.5)63 b(Comp)s(ound)42 b(Commands)150 3033 y
(command)f(executed)150 2797 y(in)d(the)h(list.)150 2982
y Fk(3.2.5)63 b(Comp)s(ound)42 b(Commands)150 3129 y
Fu(Comp)s(ound)29 b(commands)h(are)i(the)f(shell)g(programming)f
(language)j(constructs.)42 b(Eac)m(h)32 b(construct)f(b)s(e-)150
3142 y(gins)25 b(with)f(a)i(reserv)m(ed)f(w)m(ord)f(or)h(con)m(trol)h
3239 y(gins)25 b(with)f(a)i(reserv)m(ed)f(w)m(ord)f(or)h(con)m(trol)h
(op)s(erator)f(and)g(is)g(terminated)g(b)m(y)g(a)g(corresp)s(onding)f
(reserv)m(ed)150 3252 y(w)m(ord)i(or)g(op)s(erator.)40
(reserv)m(ed)150 3348 y(w)m(ord)i(or)g(op)s(erator.)40
b(An)m(y)26 b(redirections)g(\(see)i(Section)f(3.6)g([Redirections],)h
(page)f(38\))h(asso)s(ciated)f(with)150 3361 y(a)k(comp)s(ound)f
(page)f(38\))h(asso)s(ciated)f(with)150 3458 y(a)k(comp)s(ound)f
(command)h(apply)f(to)i(all)g(commands)f(within)f(that)i(comp)s(ound)d
(command)i(unless)f(ex-)150 3471 y(plicitly)i(o)m(v)m(erridden.)275
3611 y(In)20 b(most)h(cases)g(a)g(list)h(of)f(commands)f(in)g(a)h(comp)
(command)i(unless)f(ex-)150 3568 y(plicitly)i(o)m(v)m(erridden.)275
3695 y(In)20 b(most)h(cases)g(a)g(list)h(of)f(commands)f(in)g(a)h(comp)
s(ound)f(command's)g(description)h(ma)m(y)g(b)s(e)f(separated)150
3720 y(from)30 b(the)h(rest)g(of)g(the)g(command)g(b)m(y)f(one)h(or)g
3805 y(from)30 b(the)h(rest)g(of)g(the)g(command)g(b)m(y)f(one)h(or)g
(more)g(newlines,)g(and)f(ma)m(y)i(b)s(e)e(follo)m(w)m(ed)i(b)m(y)f(a)g
(newline)150 3830 y(in)f(place)h(of)g(a)g(semicolon.)275
3969 y(Bash)45 b(pro)m(vides)h(lo)s(oping)g(constructs,)j(conditional)e
(newline)150 3914 y(in)f(place)h(of)g(a)g(semicolon.)275
4042 y(Bash)45 b(pro)m(vides)h(lo)s(oping)g(constructs,)j(conditional)e
(commands,)j(and)44 b(mec)m(hanisms)i(to)g(group)150
4079 y(commands)30 b(and)g(execute)i(them)e(as)g(a)h(unit.)150
4283 y Fk(3.2.5.1)63 b(Lo)s(oping)43 b(Constructs)150
4430 y Fu(Bash)31 b(supp)s(orts)d(the)j(follo)m(wing)g(lo)s(oping)g
(constructs.)275 4570 y(Note)k(that)f(wherev)m(er)g(a)g(`)p
4151 y(commands)30 b(and)g(execute)i(them)e(as)g(a)h(unit.)150
4336 y Fk(3.2.5.1)63 b(Lo)s(oping)43 b(Constructs)150
4483 y Fu(Bash)31 b(supp)s(orts)d(the)j(follo)m(wing)g(lo)s(oping)g
(constructs.)275 4611 y(Note)k(that)f(wherev)m(er)g(a)g(`)p
Ft(;)p Fu(')g(app)s(ears)f(in)h(the)g(description)g(of)g(a)g(command's)
g(syn)m(tax,)i(it)e(ma)m(y)h(b)s(e)150 4680 y(replaced)c(with)f(one)h
(or)f(more)g(newlines.)150 4847 y Ft(until)240 b Fu(The)30
g(syn)m(tax,)i(it)e(ma)m(y)h(b)s(e)150 4720 y(replaced)c(with)f(one)h
(or)f(more)g(newlines.)150 4866 y Ft(until)240 b Fu(The)30
b(syn)m(tax)h(of)f(the)h Ft(until)e Fu(command)h(is:)870
4984 y Ft(until)46 b Fj(test-commands)p Ft(;)e(do)j Fj
4993 y Ft(until)46 b Fj(test-commands)p Ft(;)e(do)j Fj
(consequent-commands)p Ft(;)c(done)630 5121 y Fu(Execute)f
Fr(consequen)m(t-commands)k Fu(as)41 b(long)h(as)f Fr(test-commands)46
b Fu(has)41 b(an)g(exit)h(status)630 5230 y(whic)m(h)c(is)h(not)g
@@ -10791,17 +10792,18 @@ Ft(^)p Fu(')g(then)f(an)m(y)630 4655 y(c)m(haracter)c(not)f(enclosed)g
(matc)m(hed)h(b)m(y)f(including)h(it)g(as)g(the)630 4765
y(\014rst)32 b(or)h(last)h(c)m(haracter)h(in)e(the)g(set.)50
b(A)33 b(`)p Ft(])p Fu(')g(ma)m(y)h(b)s(e)e(matc)m(hed)i(b)m(y)f
(including)g(it)g(as)h(the)630 4875 y(\014rst)25 b(c)m(haracter)i(in)e
(the)h(set.)40 b(The)25 b(sorting)h(order)f(of)h(c)m(haracters)h(in)f
(range)g(expressions)f(is)630 4984 y(determined)h(b)m(y)h(the)g(curren)
m(t)f(lo)s(cale)j(and)d(the)h(v)-5 b(alues)27 b(of)g(the)g
Ft(LC_COLLATE)d Fu(and)i Ft(LC_ALL)630 5094 y Fu(shell)31
b(v)-5 b(ariables,)31 b(if)f(set.)630 5230 y(F)-8 b(or)34
b(example,)g(in)f(the)g(default)g(C)f(lo)s(cale,)k(`)p
Ft([a-dx-z])p Fu(')31 b(is)i(equiv)-5 b(alen)m(t)34 b(to)g(`)p
Ft([abcdxyz])p Fu('.)630 5340 y(Man)m(y)68 b(lo)s(cales)h(sort)f(c)m
(haracters)h(in)e(dictionary)i(order,)76 b(and)67 b(in)g(these)h(lo)s
(cales)p eop end
(including)g(it)g(as)h(the)630 4875 y(\014rst)c(c)m(haracter)j(in)d
(the)h(set.)43 b(The)31 b(sorting)g(order)g(of)g(c)m(haracters)h(in)f
(range)g(expressions,)630 4984 y(and)f(the)h(c)m(haracters)h(included)e
(in)h(the)f(range,)i(are)f(determined)f(b)m(y)h(the)g(curren)m(t)f(lo)s
(cale)630 5094 y(and)g(the)g(v)-5 b(alues)31 b(of)g(the)f
Ft(LC_COLLATE)e Fu(and)h Ft(LC_ALL)g Fu(shell)i(v)-5
b(ariables,)31 b(if)f(set.)630 5230 y(F)-8 b(or)34 b(example,)g(in)f
(the)g(default)g(C)f(lo)s(cale,)k(`)p Ft([a-dx-z])p Fu(')31
b(is)i(equiv)-5 b(alen)m(t)34 b(to)g(`)p Ft([abcdxyz])p
Fu('.)630 5340 y(Man)m(y)68 b(lo)s(cales)h(sort)f(c)m(haracters)h(in)e
(dictionary)i(order,)76 b(and)67 b(in)g(these)h(lo)s(cales)p
eop end
%%Page: 37 43
TeXDict begin 37 42 bop 150 -116 a Fu(Chapter)30 b(3:)41
b(Basic)32 b(Shell)e(F)-8 b(eatures)2246 b(37)630 299