(206)FOR-UNIX/ (206)782-7733

FAX: (206)782-7191
E-mail: sales@ssc. com
URL: http://www. ssc. com
Li nux Journal—The Pr emier Linux Magazi ne
Techni cal Books and CDs
SAMBA: Integrat i ng UNI X and Wi ndows
Shell Tutori als, KSH Refer ence
VI & Emacs Refer ences, VI Tutori al
OTHER SSC PRODUCTS:
©Copright 1999 S pecial ized Sstems Consul tant s, Ic. ,
P.O. Box 5554 9, Seat tle, WA98155-0549.
Al l Right s Reseved.
1
This car d descr ibes vesion 2 .02.0 of bash.
Seveal t peaces ae used t o c lari fy the meaning:
• Se i f a Bo l dis used or comput er input .
• Sotito lto|ic is usoo to itoicot o usot ituut oto tot
sytt octic u|ocolo|oot s sucl os votio||o ot cto
• Sotito Potot is usoo tot oxu|ototot y t oxt
||ot|
ot tot o suocos oto ot to | clotoct ots lt o ooi tio t
uotos oto t ot titot oo |y oty ot tlo to||ouitj
clotoct ots
ì suo co t o| tou| i to
cottoto uot os
|ist uiuo|itos Cot |o souotot oo |y
oto outi o to||y |o tot titot oo |y
t
toto
|oyuoto |osl | otjuojo
oyuot os ot o suocio| ot|y ottot o ot tou| ito ottot
ototlot |oyuot o oto itcottoit otlot cott oxt s
uot |osl uottot t Soo Patter ns.
uiuo|ito
|y o uiuo ì
sttitj
su|stitutiot
cottoto |ito ui tl oit totott t oxt o j tou|ocitj o
voti o||o ui tl its vo|uo |osl uottot ts toty
su|sti tutiots 7lis cot o |ists t lot it tlo otoot tloy ot o
uott ottoo
uoto
tocossoty it it cott oits suocio| clotoct ots
DL I l!l7l C!S
lt |osl is itvo|oo os t |osl o t ui tl tlo outiot it is
tosttict oo 7lo to||ouitj octi ots ot o tot o||ouoo it o
tost t ict oo slo||
clotjitj oi toctot y ui tl co
sottitj ot utsot t itj S LLL ot PA7
usitj uot l totos tot cottotos t lot cott oit
usitj o uotl toto tlot cott oits tot t lo cottoto
ituot ti tj tutct iots t tot tlo otvi tottott
uot sitj S LLLCP7S ot st ot t uu
tooi toctitj outuut ui tl oty ot ot
usitj oxoc to t ut o oitt otott cottoto
o ooitj ot oo| ot itj |ui|titcottotos ui tl oto|| o
usitj t o |yuoss o tost t ict oo PA7
usitj sot t ot sot o tosttictoo
7loso tost t ict iots oto it o ttoct ottot oxocutitj o||
st ottuu t i|os o||ouitj tlo outlot ot tlo st ot t uu t i|os tu||
cottto| it sottitj uu tlo tostt ictoo otvitottott lt
utoct ico tosttictoo slo||s ot o tot usoo tucl os tloy
ot o oitticu| t to sot uu cottoct| yì
PL S7 P lC 7LD baah
o a eo tha eee e a a e t he at to
epo t t e ae o a ee op o a o o
e eeea eaae t e o ae e eto a to
baaa o
o epot

baah a e pta t he oe et t e opt oa toaet a the
a t oa oe ette a ate o op toa aho
beo
baahoutiots otjs
otos outiot utocossitj
otos outiot utocossitj
cto oxocuto cto ootou| t tooos
cottoto ttot t i|o totoo it
titst ottty ot otjs oto touto vio
uotl soot clì
utitt o|| oou||o ouot oo st t itjs
tlot ot o ut ocoooo |y o to
stoout 7lis itu|ios to
cottotos oto oxocutoo
sot itt otoctivo tooo
sot tosttict oo tooo
t ooo cottotos t tot st oi t
ootou| tì
soto os |ut out uut it !U
jottoxt tot tot
soto os
oisu|oy o lo| u tossojo oto oxit
succosstu||y
oct | i|o o | ojit s lo| |
oo tot uso tlo tooo| ito |i|tot y
to t ooo cottotos ulot
itt otoct ivo
oo tot tooo oty ot tlo
iti tio| i ot iot t i|os Soo
I nvocation And Startup, below
do not read ˜/.bashr c if
int eract ive. See I nvocation And
Star tup, below
follow t he IEEE POSI X 1003.2
st andard
ti|o uso ti|o itst ooo ot ˜ |oslt c it
itt otoct ivo
soto os
soto os
utitt votsio t ittottot iot ot
stoout oto oxi t succosstu||y
CCMM A! D Ll !L AP UML! 7S
7loto oto t i vo uoys t lot |osl tuts totto| itt otoctivo
totto| to tittotoct ivo os sl it PCSl tooo ot
itvo|oo vio t slo
1 !otto| itt otoct ivo Lojit slo| |s t ut cottotos it
ot c ut ot i|o 7lo titst ot ˜|osl ut ot i|o ˜ |osl | oji t
oto ˜ut ot i|o tlot is t outo is oxocut oo 7lis st ojo is
s|iuuoo it is usoo
Uuot |oj out |osl tuts ˜ |osl | ojout it it oxist s
ltt otoct ivo tot|ojit s lo||s oxocuto ˜ |oslt c it it
oxist s 7lo iti|o outiot clotjos tlo t i|o t lot is
us oo
2 !otto| to titt otoct ivo !otitt otoct ivo slo|| s oo
votio||o cottoto oto otitltotic su|st itutiot o t tlo
vo|uo ot BAS L! oto it tlo tosu| t totos ot
oxist itj t i|o tlot ti|o is oxocut oo
l! CCA7 lC! A! D S 7AP 7UP
S
S ltvo|oo os sl l tt otoct ivo |ojit s lo|| s t ooo o to
oxocuto ot c ut ot i|o oto ˜ut ot i|o it tloy oxist 7loso
t i|os ot o s|iuuoo it is usoo l tt otoctivo
slo||s oxuo to L! oto oxocut o tlot t i|o it it oxist s
!otitt otoct ivo slo||s oo tot t ooo oty stot t uu t i|os
Attot tlo st ot t uu t i|os ot o oxocut oo |osl ott ots PCSl
tooo
1 PCSl tooo !lot stot t oo ui tl itt otoctivo
slo||s oxuo to L! oto ox o cut o tlo jivot t i|o !o
otlot st ot t uut i | os oto tooo
c ltvo|oo vio t slo lt tut ttot t slo oto tot itvo|oo os
sl |osl t oo os ˜ |oslt c 7lo outi o t s|ius tlis
st ou oto tlo outi o t clotjos tlo t i|o |ut t slo
us uo| |y ooos tot uoss tloso outiots ot to tlo slo|| it
itvo|os
lt S LLLCP7S oxist s it tlo otvitottott ot st ottuu
|osl oto||os tlo jivot outi ots
l! CCA7 l C! A! D S 7AP 7UP cotti tuooì
!lot itt otoctivo |osl oisu|oys t lo utitoty oto
socotoot y ut otut sttitjs PS1 oto PS2 |osl
oxuo tos t lo to||ouitj oscouo soouotcos it tlo vo| uos
ot tloso sttitjs
o ot ASCll BLL clotoct ot oct o| ì
o tlo oot o it ‘‘!oo|ooy Mottl Doy’’ tot tot
o ot ASCll oscouo clotoct ot oct o| SSì
l tlo lost toto uu to t lo titst oot ì
tlo tu|| lost toto
t o tou|ito
t o cottiojo tot utt
s tlo toto ot tlo slo|| |osototo ot ì
t tlo ti to it 21lout MMSS tot tot
7 tlo ti to it 12lout MMSS tot tot
u tlo usot’s usottoto
v tlo vot siot ot |osl oj 2 2ì
tlo vot sio t oto uot cl|ovo| ot |osl oj 2 2 ì
u tlo cuttott uot |itj oitoctot y
! tlo |osototo ot tlo cuttott uot |itj oi toctot y
tlo list ot y tut|ot ot tlis cottoto
tlo cottoto tut|ot ot tlis cottoto
o it tlo ottoctivo UlD is otlotuiso o
tlo ti to it 12lout ot ut tot tot
o |oc|s|osl
ttt tlo clotoct ot cot t osuotoitj to octo| vo|uo ttt
st ott o soouotco ot totutitti tj clotoct ots
oto o soouotco ot to tuti ttitj clotoct ots
7lo list ot y tut|ot is t lo tut|ot ot tlo cottoto it
tlo list ot y | ist ulicl toy itc|uoo cottotos tostot oo
ttot tlo list ot y t i|o 7lo cottoto tut|ot is t lo
tut|ot ot tlis cottoto st ot t itj ttot tlo tit st
cottoto tut |y tlo cuttott itvocoti ot ot tlo slo||
7lo ootou| t vo|uo ot PS1 is ‘ ’’
PP CM P7 l!
1
ovotts
ulicl cotsist ot ot ovott oosijtotot ulicl utovious | ito
to st ot t ui tlì o uot o oosijtotot ulicl uot o t t ot tlot
|ito to uso stot t itj ui tl ot oì oto oto ot tot o
outioto| tooitiots ulicl uotts ot tlo uot os to usoì
Co|ots so uotot o tlo tltoo uott s o| tloujl tlo co|ot
|otuoot tlo ovott oosijtotot oto uot o oosijtotot
toy |o oti ttoo ulot tlo uot o oosijtotot |ojits ui tl
ˆ ot Locl tooiti ot is so uotot oo t tot tlo toxt
oto uitl o co|ot 7lo li stclot s voti o||o suociti os tlo
st ottotlist ot y oto ouic| su|stituti o t clotoct ots oto
o| so tlo cottott clotoct ot t lot itoicot os t lot tlo tost
ot o |ito is o cottott 7lo utovious cottoto is t lo
ootou| t ovott i t to o vott oosijtotot is suuu|io o
7lo ovott oosijtotot s oto
st ott o listot y su|sti tutiot
t cottoto | ito t
t cuttott | ito titus t t utoviousì
tlo utovious cottoto
stt tost tocott cottoto |ito st ot t itj ui tl
stt
stt tost tocott cottoto |ito cott oititj stt
tlo otti to cottoto |ito tyuo o so tot
ˆo|oˆtouˆ ouic| su|st itutiot touoot | ost cottoto
clotjitj o|o to tou
7lo uot o oosijtotot s oto
tlo ot o’tl uot o cottoto totoì
t uot o t
ˆ tlo titst ot jutott io uoto oto
tlo | ost ot jutott
tlo uot o tot cloo |y tlo tost tocott
stt soot cl
x y uotos x tlt oujl y is slott tot
uot os 1 t ltoujl t lo |ost |i|o ì
t uotos t tlt oujl t lo |ost |i|o t ì
t uotos t tlt oujl t lo toxt to |ost
7lo tooitiot s oto
o t otovo o|| |ut tlo suttix ot o t i|ototo
j to| o clotjos j|o|o||y uso ui tl s
tooitiot |o|ou
l t otovo tlo |ost uott ot o t i|ototo
|oovitj tlo ‘‘looo’
u utitt tlo cottoto |ut oo tot oxocut o it
o ouot o t lo jotot ot oo t oxt
t t otovo tlo |ost suttix ot o t i|ototo
s o|o tou su|sti tuto tou tot o|o it tlo toxt Aty
oo|iti tot toy |o usoo At it tlo
t ou|ocotott toots t lo vo| uo ot o|o !i tl
otuty o|o uso |ost o|o ot tlo tost tocott
stt soot cl it tloto uos to utovious o|o
t t otovo o|| |ut tlo |ost uott o t o t i|ototo
|oovitj tlo ‘‘t oi|’
x ouot o t lo jototot oo t oxt |ut |t oo| itto
uot os ot ||ot|s oto tou|ito
t ouoot t lo |ost su|st i tuti ot
lS7 CP S UBS 7 l7 U7 lC!
c
c ouoto sitj|o clotoct ot c
o|o sty|o cottoto su|sti tuti ot
t oxt t toot oo os o sitj|o otjutott oou||o
ouotos t otovoo vot io||o cottoto o to
ot itltot ic su|sti tuti ots uottot too
uso t o ouoto oto
|i|o |ut | oco| o tt ots| ot io t oo to
t oxt t toot oo os o sitj|o otjutott sitj|o
ouotos t otovoo toxt |otuoot ouotos
|ot t o|oto cottot itc| uoo
t oxt t toot oo os o sitj|o otjutott oto
sitj|o ouot os t otovoo to su|sti tuti o ts
uottot too A!Sl C oto o ooi tioto|
oscouo soouotcos ut ocossoo
o o|ott |o||ì v vot ti co| t o|
| |oc|suoco ooo oct o| vo| uo ooo
t tott tooo xlll lox vo|uo lll
t tou|ito |oc|s| osl
t cottiojo tot utt o oscouo tot it A!Sl C
t lot i ott o| to|
UC7 l!
o| ios toto vo|uo
A|iosos oto oxuo tooo ulot o cottoto is t ooo tot
ulot oxocut oo A| ios totos cot cottoit oty to t
suocio| clotoct ot to t ¡ ust o| ulotutot ics oxcout tot
A| ios oxuo tsio t is ooto ot tlo tit st uoto ot o cottoto
lt tlo |ost clotoct ot ot t lo tou|ocotott toxt is o ||ot|
tlot tlo toxt uot o it tlo cottoto |ito is cloc|oo tot
o| ios oxuo tsiot A| iosos cot ovot |o usoo to t oootito
slo|| |oyuotos |ut tot i t PCSl tooo
AL lAS l!
Btoco oxuotsiot is siti|ot to csl’s A uot o tust
cott oit ot | oost o to utouo t oo | ot t |toco oto cotto to
|o oxuo tooo |osl oxuo tos t lo cottosouotot oo
i tots it otoot tlo t osu| t is tot sot t oo Bt oco
oxuo tsiots toy |o tost oo Iot oxotu|o
t|oi t ust jtu| oco| stc |it| i |
BPACL L P A! S lC!
˜ su|sti tuto CML
˜usot su|sti tuto usot’s loto oitoctot y
˜ su|sti tuto P !D
su|sti tuto CLDP!D
˜t su|sti tuto Dl PS7AC t A | oooitj
ot is o| |ouoo tojotivo vo|uos coutt
ttot tlo oto ot tlo stoc|
7i| oo su|sti tutio t louuots ottot o| ios oxuo tsiot lt is
ooto tot uot os tlot |ojit ui tl ˜ oto tot votio||o
ossijttott
lt votio||o ossijttotts it is o| so ooto o ttot o it tlo
vo|uo 7i|oo su|sti tuti o t is ooto os uott ot uot o
oxuo tsiot 7lis toots tot toto ou uoto uoto ui|| |o
cloc|oo tot t i|oo su|sti tuti ot |ut ot|y it tlo ouotot iot
t oouitos tlo vo| uo ot tlo tijltloto sioo
7lL DL SU BS 7 l7 U7 lC!

toto tot ototco t o slo|| votio||o toto
toto us o |tocos to oo| iti t slo|| voti o||o toto
toto uoto
uso votio||o toto it sot o|so uso uoto
toto uoto
os o|ovo |ut o| so sot toto to uoto
toto uoto
uso toto it sot otlot uiso utitt uoto oto
oxi t itt otoct ivo slo| |s oo tot oxi tì
toto uoto
uso uoto it toto is sot otlot uiso uso
totlitj
toto t o|otott t it ottoy toto
toto |otjtl ot slo|| votio||o toto
toto tut|ot ot o| otott s it ottoy toto
toto tut|ot ot o| otott s it ottoy toto
toto uot t otovo slottost | oooitj su|sttitj
ot toto tlot tot clos uot
toto uot t otovo |otjost |oooitj su|sttitj
ot toto tlot tot clos uot
toto uot t otovo slottost ttoi|itj su|sttitj
ot toto tlot tot clos uot
toto uot
t otovo |otjost ttoi|itj su|sttitj
ot toto tlot tot clos uot
totostott
totostott|otjtl
|otjtl clotoct ots ot toto stottitj ot
stott couttitj ttot ì uso tost ot
vo|uo it to |otjtl !ojotivo stott
coutts t tot tlo oto lt toto is ot
ot ot ot t oy itooxoo |y ot stott
oto |otjtl itoicot o t lo ottoy itoox oto
coutt ot o|otott s stott oto |otjtl cot
|o otitltot ic oxutossio ts
toto uottott sttitj
vo|uo ot toto ui tl titst tot cl ot uottott
tou|ocoo ui tl sttitj
toto uottott
vo|uo ot toto ui tl titst tot cl ot uottott
oo|ot oo
toto uottott sttitj
vo|uo ot toto ui tl ovoty tot cl ot
uottott tou|ocoo ui tl sttitj
toto uottott sttitj
vo|uo ot toto ui tl tot cl ot uottott
tou|ocoo ui tl sttitj tot cl tust occut
ot |ojittitj
toto uottott sttitj
vo|uo ot toto ui tl tot cl ot uottott
tou|ocoo ui tl sttitj tot cl occut s ot oto
!ot o tot oto usitj toto itst ooo ot toto
t ost s ulotlot toto is sot oto tot!ULL usitj toto
t ost s ot|y ulotlot toto is sot
Iot oto ulot toto is ot
ot ot ot t oy itooxoo |y ot tlo su|sttitj ot
su|sti tutiot ouotot io t is ouu|ioo t o oocl o|otott
A P lAB LLSU BS 7 l7 U7 lC!

Atitltot ic ovo|uoti o t is ooto uitl tlo | ot |ui|tit
cottoto tlo ìì cottoto o to tlo ìì
oxuo tsio t tot ut ooucitj tlo tosu| t ot ot oxutossiot
A|| ot i tltot ic usos | o tj itt ojot s Uso t o jot
itt ojot vot io||os l tt ojot cotst ott s |oo| | i|o |oso t
uloto |oso is o oocito| tut|ot |otuoot tuo oto 1
oto t is it tlot |oso 7lo oiji ts oto o A oto
A |oooitj ot x ootot o oct o| ot loxooocito|
7lo to| |ouitj ouotot ot s |osoo ot C uitl tlo soto
ut ocoootco o to o ssociot ivi ty ot o o voi| o||o
utot y u|us oto titus
˜ |ojico| oto |ituiso tojotiot
oxuotottiot io t tot it Cì
tu| tiu|y oivioo toou|us
o ooi tiot su|ttoctiot
|ott slitt tijlt slit t
cotuoti sots
oouo| s tot oouo|s
|i tuiso A!D
ˆ |i tuiso CP
|i tuiso CP
|ojico| A!D slott ci tcuit
|ojico| CP slott citcuit
it|ito cotoi tioto|
ossijttott ouototot s
l tsioo | ot ìì oto ìì votio||o totos oo tot tooo
o t o jot t loit vo|uos
AP l7 M L7 lC L ALUA7 l C!
cottotoì tou tott
cottoto o|o tott
Put cottoto su|sti tut o t lo tosu| ts os otjutott s
7t oi|itj tou| itos oto totovoo Clotoct ots it l IS
souotot o uotos soo Field Splitting). The new for m is
pref erred f or si mpl er quot i ng rules.
$((oxutossiotìì ot itltot ic su|sti tuti ot
7lo oxutossiot is ovo| uot oo oto t lo t osu| t is usoo os ot
ot jutott to t lo cut t ott cottoto
CCMM A! DSUBS 7 l7 U7 lC!
cto |ist1ì |ist2ì
Puts |ist1 oto |ist2 osytc lt otous | y ui tl st oi t oto
st oout tosuoct ivo|y cottoct oo vio uiuos usitj t itos ot
t i|os it oov t o 7loso t i|o totos |ocoto otjutotts to
cto ulicl oxuocts to t ooo its t itst ot jutott oto utito
i ts socoto 7lis ot|y uot |s it you lovo oov t o ot t i t os
PP CCL SS S UB S7 l7 U7 lC!
uotoo t oxt |ocotos oto uot o Ctlotuiso
occuttotcos ot oty clotoct ot it l IS souotot o uot os
Mu| tiu|o ulitosuoco clotoct ots t lot oto it l IS oo tot
oo|iti t otuty uot os uli|o tu| tiu|o totulitosuoco
clotoct ots oo !lot l IS is tot t lo ootou| t vo| uo
soouotcos ot | oooitj oto ttoi|itj l IS uli tosuoco
clotoct ots ot o t otovoo oto utitt o||o clotoct ots it
l IS suttoutooo |y oo¡ ocott l IS uli tosuoco
clotoct ots oo| itit tio| os lt l IS is !ULL |osl ooos
tot oo tio|o s u| ittitj
I lLLDSPL l77l !

clots tot cl oty ot clots
uoit souotot oo |y o tot clos o t otjoì
clots tot cl oty oxcout clots
ˆclots tot cl oty oxcout clots
lt tlo oxtj| o| outiot to s lout is sot tlo to||ouitj
oxt otooo tot clitj toci|itios toy |o usoo
uot|istì outioto||y tot cl oty ot tlo uottot ts
uot|istì tot cl ot tot o ot oty ot tlo uottot ts
uot|istì tot cl 1 ot tot o ot oty ot tlo uottot ts
uot|istì tot cl oxoct| y 1 ot oty ot tlo uottot ts
uot|istì tot cl otytlitj |ut oty ot tlo uottot ts
uot|ist is o |ist ot oto ot tot o uot t ot ts souotot oo |y
7lo PCSl c oto c totot iots t ot sotouoijlt
clotoct ot s oto co| |ot itj o| otott s ot o occout oo 7lo
totot iot c|oss ootitos clotoct ot c|ossos
o| tut o|ulotutotic | ouot | ouot coso
o| ulo o|ulo |otic ut itt uti tto||o
|| ot| suo co ot to| uutct uutct uotiot
cttt | cottto| suoco uli tosuoco
oijit oocito| uuuot uuuotcoso
jt o ul totsuocos xoijit loxooocito|
7ltoo s lout outiots ottoct uottott tot clitj
ootj| o| itc|uoo t i|os uloso totos |ojit ui tl
tocosoj| o| ijtot o coso ulot tot clitj
tu| | j| o| t otovo uottotts tlot oot’ t tot cl
!lot oxuo toitj t i|ototos oto oto ijtot oo
t i|ototos totclitj tlo uottot ts it LCBl !CPL oto
o| so ijtot oo oto o |oooitj tust |o s uuu|ioo it tlo
uottot t t o tot cl t i|ototos tlot |ojit ui tl
ouovot sottitj LCBl !CPL oto||os tlo ootj| o|
outiot ltc|uoo it LCBl !CPL t o jot t lo ootou|t
|oloviot
PA 77LP!S
otio||o totos oto to oo uu ot | ot t ots oijits oto
utootscot os 7loy toy tot st ot t ui tl o oiji t 7loto is
to |iti t o t tlo |otjtl ot o votio||o toto oto tlo coso
ot | ot t ots is sijtiti cott
A P lAB L L !AMLS
Assijttotts to itt ojot vot io||os utoot jo ot itltot ic
ovo|uotiot ot i o|| o ossijttott s lovo oto ot tlo
to||ouitj tot ts
toto uoto sot toto to uoto
toto itoox uoto
sot o| otott itoox ot ottoy toto to uoto
toto uoto ì
sot itooxoo ottoy toto to uot os
toto tut uoto ì
sot jivot itoicos ot ottoy toto to uot os
A P lAB LLAS S l !ML!7

t uso uosi tioto| uot otot ot t t
t uso uosi tioto| uot otot ot t
o|| uosi tio to| uot otot ots
o|| uosi tio to| uot otot ots
o ouivo|ott to 1 2
o ouivo|ott to 1 2
tut|ot ot uosi tio to| uot ototots
outiots t o slo|| ot |y sot
vo|uo tot uttoo |y |ost cottoto
ut ocoss tut|ot ot cuttott slo||
ut ocoss tut|ot ot | ost |oc|jt outo
cto
toto ot utojtot it otvitottott ot
st ottuu o| uo ot | ost uosi tioto|
otjutott it |ost cottoto !oto ot
clotjoo toi| t i|o it MAl LPA7
outo tosuto oto||os uso ot si tj|ouot o
cottotos t o tot cl s touuoo ¡ o|s tot
tot ojt outoitj !itl o vo|uo ot oxoct
tlo uot o tust oxoct| y tot cl tlo
cottoto usoo to st ot t tlo ¡o| !i tl
o vo|uo ot su|sttitj tlo tyuo o uoto
cot |o o su|sttitj ot tlo cottoto
|i|o sttitj
BAS tu|| t i|o toto usoo to itvo|o |osl
BAS L! it tot to| to titt otoct ivo slo||s ot| y
vo|uo is voti o||o cottoto o to
ot itltot ic su|stitutoo tot uotl ot
st ottuu t i|o Soo I nvocation And
Star tup)
$BASH_VERSI ON t he ver sion of bash
$BASH_VERSI NFO0] t he major ver si on number
(release)
$BASH_VERSI NFO1] t he minor version number
(ver sion)
$BASH_VERSI NFO2] t he pat chlevel
$BASH_VERSI NFO3] t he bui ld ver sion
$BASH_VERSI NFO4] t he r el ease st at us
$BASH_VERSI NFO5] same as $MACHTYPE
$CDPATH sear ch pat h f or cd command
$DI RSTACK[* ] ar r ay vari abl e cont aining t he pushd
and popd di rector y st ack
$ENV i n int eract i ve POSI X mode shel ls, or
when invoked as sh, value is vari able,
command and a ri thmeti c subst i tut ed
for pat h of st ar t up fil e
$EUI D t he effecti ve user i d (readonly)
$FCEDI T defaul t edi tor f or t he f c command ( no
defaul t value)
$FI GNORE col on-separat ed list of suffixes givi ng
t he set of fil enames t o ignore when
doing f ilename complet ion using
readl i ne
$GLOBI GNORE col on-separat ed l i st of pat t er ns giving
t he set of fil enames t o ignore when
doing pat t ern mat ching
$GROUPS[* ] r eadonl y ar r ay vari able wi th t he list
of gr oups t he user belongs t o
$hi st char s charact ers t hat cont rol csh-st yle
hist or y (defaul t: ! ˆ#). See Histor y
Substitution
PR E-DE FINE D VAR IAB LES
10
$HI STCMD hi st or y number o t he current
command
$HI STCONTROL wi th a value of i gnor espace, do not
ent er l i nes t hat begin wi th spaces
int o t he hist or y f ile. Wi th a value of
i gnor edups, do not ent er a line t hat
mat ches t he previous l ine. Use
i gnor ebot h t o combine bot h opti ons
$HI STFI LE where command hi st ory is st or ed
$HI STFI LESI ZE maximum number o l i nes t o keep in
$HI STFI LE
$HI STI GNORE colon-separat ed list of pat t erns; if t he
current l i ne mat ches any of t hem, the
line is not ent ered in t he hist or y f ile.
& r epr esent s t he last hist or y l ine.
Pat ter ns must mat ch t he whol e line
$HI STSI ZE number of previous commands t o
keep avai lable whi le bash i s r unni ng
$HOME home di rector y for cd command and
value used for t ilde expansion
$HOSTFI LE f ile in for mat of / etc/ host s t o use for
host name complet ion
$HOSTNAME name of the current host
$HOSTTYPE st ring descri bing t he current host
$I FS fi eld separat or s (space, t ab, newl i ne)
$I GNOREEOF for i nt eract ive shell s t he number of
consecuti ve EOFs t hat must be
ent er ed before bash act ually exi ts
$I NPUTRC name of readl i ne st art up f ile,
overrides ˜/.i nputr c
$L ANG name of current l ocale
$LC_ALL current l ocal e; overr ides $L ANG and
ot her $L C_vari ables
$L C_COLLATE current l ocale for charact er collat ion,
includes sort ing r esul ts of fi lename
expansi on
$L C_CTYPE current l ocale for charact er cl ass
funct ions (see Patter ns)
$L C_MESSAGES current local e for t r ansl at ing $" ..."
st rings
$L I NENO line number of l i ne being execut ed in
scri pt or f unct ion
$MACHTYPE a st ring i n GNU cuucotuotysyst ot
tottot oosct i|itj tlo toclito
tuttitj |osl
MAl L toto ot o toi| t i|o it oty
MAl LC LC cloc| tot toi| ovoty t socotos
ootou| tì
MAl LPA7 t i|ototos to cloc| tot tou toi| usos
souototot ti|ototo toy |o to||ouoo
|y tossojo it tossojo is
tot cloo toi| t i|o toto Cvo ttioos
MAl L
CLDP!D utovious uot |itj oitoctot y
CP7AP vo|uo ot |ost otjutott ut ocossoo |y
jotouts
CP7LPP it sot to 1 oisu|oy ot t ot tossojos
ttot jotouts ootou| t 1ì
CP7l !D itoox ot |ost ot jutott ut ocossoo |y
jotouts
PP L DL I l!L D AP lAB LLS c ot tit uooì
11
CS7 PL sttitj ooscti|itj tlo
ouotot itj systot tuttitj
|osl
PA7 cottoto soot cl uot l
Pl PLS7A7US ot t oy votio||o cott oititj oxit
st ot us vo|uos t tot ut ocossos
it tlo tost tocott| y oxocutoo
tot ojt outo uiuo| ito
PPl D ut ocoss io ot slo||’s uot ott
P PCMP7 CCMMA!D cottoto to tut |otot o oocl
uti toty ut otut
PS1 uti tot y ut otut stt itj
ì
PS2 socotoot y ut otut sttitj ì
P SS so| oct cottoto utotut
sttitj ì
PS1 ttocitj ut otut sttitj ì
P !D cuttott uot |itj oitoctot y
PA!DCM sot oocl t ito it’s t ot ot otcoo
PLPL sot |y tlo so| oct oto tooo
cottotos
S LCC!DS tut|ot ot socotos sitco slo| |
itvocoti ot
S LLL toto ot tlis slo| |
S LLLCP7S co|otsouot ot oo |ist ot tlo
oto|| oo slo|| outiots t ot sot
S L L itct otott oo |y oto tot oocl
s u||osl
7l MLICP MA7 tot tot stt itj tot out uut ot
ti to |oyuot o Suocio|
cotsttuct s itttooucoo |y
u | P o|ousoo socs
u | U usot CPU socs
u | S systot CPU socs
P CPU uot cott ojo
|itoto|
Cutioto| u jivos t lo utocisiot
tlo tut|ot ot oi ji t s ot t ot t lo
oocito| uoitt i t tust |o
|otuoot oto S Cuti oto| |
ut ooucos o |otjot tot tot it
tlo tott MMtSSIIs
7MCU7 tut|ot ot socotos to uoit
outitj ut otut |ototo
t ot titoti tj
Ul D tlo too| usot io toooot|yì
PP L DL I l!L D AP lAB LLS (continued)
Funct ions r un i n t he same pr ocess as t he calling scri pt ,
and share t he open f iles and current di rect or y. They
access their par amet ers l ike a scri pt , via $1, $2 and so
on. $0 does not change. r et ur n may be used insi de a
funct ion or . scri pt . Funct i ons share tr aps wi th t he
parent scr ipt , except f or DEBUG. Funct ions may be
r ecur sive, and may have local vari ables, declar ed using
decl ar e, l ocal , or t ypeset . Funct ions may be export ed
i nt o t he envi ronment wi th .
FUN CTI ONS
12
uoto soto st oout oto st oot t to uoto
uoto soto st oout oto st oot t to uoto
t ti|o uso ti|o tot ituut
t ti|o uso ti|o tot outuut
t ti|o |i|o |ut ovottioos toc| o||ot
t ti|o |i|o |ut ouuoto to ti|o it it oxists
t ti|o ouot ti|o tot t ooo utito ootou| t t o ì
t t ouu|icot o ituut ti|o ooscti utot t t ot t
t t ouu|icot o outuut t i | o oosct i utot t t ot t
t c|oso ituut t i|o oosctiutot
t c|oso outuut ti|o ooscti utot
t uoto
ituut cotos ttot tlo slo|| sctiut ttoot o | ito ui tl
uoto os LCI o t ituut lt oty ot uoto is ouotoo to
o ooi tioto| ut ocossitj is ooto ot ituut |y tlo slo||
Ctlotuiso
• o o votio||o cottoto otitltotic su|st i tutio ts
• ijtot o osco uoo tou| itos
• uso t o ouoto oto tit st clotoct ot ot uoto
t uoto os o|ovo |ut uitl |oooitj t o|s ijtotoo
Ct oto tlo titst is utot ottoo lt i s ooui vo| ott t o
uoto 2 1
l!PU 7 CU 7P U7
A|| su|sti tuti ots oto l C tooitoctiots oto uott ot too
|otot o o cottoto is octuo||y oxocut oo
|osl toitt oits ot itt ot to| losl t o||o tot coclitj
oxt ot to| cottotos lti tio||y tlis t o||o is otuty As
cottotos ot o t outo |y soot clitj tlo oi toctot ios | istoo
it PA7 tloy ot o o oooo to t lo losl t o||o
7lo cottoto soot cl otoot is slo|| tutctiots t itst |ui| t
it cottotos socoto oto oxt ot to| cottotos titst it
tlo itt ot to| losl to||o oto tlot vio PA7 ì tli to
L LCU 7l C! CP DLP
Si jto| loto|itj is ooto uitl tlo ttou |ui|tit cottoto
7lo uoto otjutott ooscti|itj cooo t o oxocuto uuot
t ocoiut ot t lo sijto| is scottoo tuico |y |osl otco
ulot tlo ttou cottoto is oxocut oo oto ojoit ulot
tlo sijto| is coujlt 7lotot oto i t i s |ost t o uso si tj| o
ouotos tot t lo ttou cottoto 7tous ot o oxocut oo it
ot oot ot sijto| tut|ot ou cottot clotjo tlo st ot us
ot o sijto| tlot uos ijtot oo ulot tlo slo|| stot t oo uu
7tous ot DLBU louuot ottot cottotos ot o oxocut oo
Boc|jt outooo cottotos tloso to||ouo o |y ì ui||
ijtot o t lo Sl l !7 oto Sl Ul 7 sijto| s it tlo toti tot
outio t is t uttoo ott Ctlotuiso tloy itlot i t tlo vo|uos
ot tlo uotott |osl
S l !A LS A! D 7PAPS
Attoys it |osl lovo to |itits ot tlo tut|ot ot
o| ototts Attoy itoicos st ot t ot Attoy su|sctiuts
cot |o otitltot ic oxutossiots Attoy o| otott s tooo
tot |o cotti juous |osl ooos tot lovo ossociot ivo
ot t oys
APPA S
1S
uiuo|ito
oxocuto uiuo|ito lt oxi t stot us uos to t ot o oxit
ot o lt oxi t st ot us uos ot o oxi t 1
coso uoto i t uot 1uot 2 ì |ist osoc
oxocuto |ist ossociot oo ui tl uot tlot tot clos uoto
Iio| o s u| ittitj is tot ooto tot uoto uot is o |osl
uottot t soo Patter ns). | is used t o i ndi cat e an OR
condi ti on. Use leading ( if case is inside $( )
f or toto i t uot os oo |ist oo to
soouottio||y ossijt oocl uoto to toto oto oxocuto
|ist lt i t uot os is tissitj uso tlo uosi tioto|
uototot ots
t utcti ot tutc ì |ist
ootito tutct iot tutc |ooy is |ist soo Functions)
i f |ist1 tlot |ist2 o| i t |istS tlot |ist1 o| so |istc t i
it oxocuti tj |ist1 tot utts succosstu| oxi t st ot us
oxocuto |ist2 o| so
so| oct toto i t uot os oo |ist oo to
utitt o totu ot uot os utotut ui tl PSS oto t ooo o
|ito ttot st oi t sovitj it it PLPL lt tlo |ito is
tlo tut|ot ot oto ot t lo uot os sot toto to i t
otlot uiso sot toto to !ULL Lx ocuto |ist lt i t
uot os is tissitj uso tlo uosi tio to| uot otot ots
|osl outotot ico||y toutitts tlo totu ot tlo oto ot
tlo |oou
ti to uiuo|ito
oxocuto uiuo|ito uti tt o| ousoo systot oto usot
ti tos ot stoot t
utitt titos it PCSl tot tot
7lo 7l MLICP MA7 votio||o cottto|s t lo tot tot ot
tlo outuut it is tot us oo |osl usos tlo vo|uo
’tt oo| t S| P tusot t S| U tsys t S| S’ it tloto is
to vo|uo tot 7l MLICP MA7
utti | |ist 1 oo |ist 2 oo to
|i|o uli | o |ut tojot ot lo tot titotio t tost
uli | o |ist 1 oo |ist 2 oo to
oxocuto |ist 1 lt |ost cottoto it |ist 1 loo o
succosstu| oxi t st ot us oxocut o |ist 2 to||ouo o |y
|ist 1 Pouoot utti| | ost cottoto it |ist 1 tot utts ot
utsuccosstu| oxi t st ot us
ìì
ot i tltot ic ovo| uotiot | i|o | ot
oxutossiot
ovo| uoto oxutossiot tot utt succosstu| oxi t st ot us it
ttuo utsuccosstu| it to|so soo Conditional
Expressions for det ails)
( |ist ì
oxocuto |ist it o s u|slo| |
|ist
oxocuto |ist it tlo cuttott slo| |
CC !7P CL CCMMA!DS
11
Us oo ui tl tlo cotuouto cottoto ulicl ooos
tot oo uottot t oxuo tsiot ot uot o su|ittitj
sttitj ttuo it sttitj is tot !ULL
ti|o ttuo it ti|o oxist s is utot ottooì
ti|o ttuo it ti|o is o || oc| oovico
ti|o ttuo it ti|o is o clotoct ot oovico
ti|o ttuo it ti|o is o oitoctot y
ti|o ttuo it ti|o oxists
ti|o ttuo it ti|o is o t oju|ot t i | o
ti|o ttuo it ti|o los sot jio |i t sot
ti|o ttuo it ti|o jt ouu is ottoctivo jio
ti|o ttuo it ti|o is o syt|o| ic |it|
ti|o ttuo it ti|o los stic|y |i t sot
ti|o ttuo it ti|o is o syt|o| ic |it|
sttitj ttuo it sttitj los tot ot o |otjtl
ti|o ttuo it ti|o oxist s oto uos tooiti oo sitco
|ost tooo
outiot ttuo it outiot is ot
ti|o ttuo it ti|o outot i s ottoctivo uio
ti|o ttuo it ti|o is o t ito totoo uiuoì
ti|o ttuo it ti|o is t oooo||o
ti|o ttuo it ti|o los tot ot o si o
ti|o ttuo it ti|o is o soc|ot
ti|ooos ttuo it ti|ooos is o t ot tito|
ti|o ttuo it ti|o los sot uio |i t sot
ti|o ttuo it ti|o is utito||o
ti|o ttuo it ti|o is oxocut o||o
sttitj ttuo it sttitj los ot o |otjtl
ti|o1 ti|o2 ttuo it ti|o1 is touot t lot ti|o2 ot ti|o2
ooos tot oxist
ti|o1 ti|o2 ttuo it ti|o1 is o|oot tlot ti|o2 ot ti|o2
ooos tot oxist
ti|o1 ti|o2 ttuo it ti|o1 oto ti|o2 ot o t lo soto ti| o
sttitj uottott
ttuo it sttitj tot clos uottott
sttitj uottott
ttuo it sttitj ooos tot totcl uottott
sttitj1 sttitj2
ttuo it sttitj1 is |ototo sttitj2
sttitj1 sttitj2
ttuo it sttitj1 is ottot sttitj2
oxu1 oxu2 ttuo it oxu1 oouo|s oxu2
oxu1 oxu2 ttuo it oxu1 ooos tot oouo| oxu2
oxu1 oxu2 ttuo it oxu1 is | oss tlot oxu2
oxu1 oxu2 ttuo it oxu1 is jt oot ot t lot oxu2
oxu1 oxu2 ttuo it oxu1 is | oss tlot ot oouo| to oxu2
oxu1 oxu2 ttuo it oxu1 is jtootot t lot ot
oouo| to oxu2
oxutossiotì ttuo it oxutossiot is tt uo tot jt ouuitj
oxutossiot ttuo it oxutossiot is t o| so
oxu1 oxu2 ttuo it oxu1 A!D oxu2 oto tt uo
oxu1 oxu2 ttuo it oxu1 CP oxu2 is ttuo
lt ti|o is oov t o t tlot it tloto is to oov t o oi toctot y
t i|o ooscti utot t is cloc|oo Ctlotuiso tlo too|
oov t o t t i|o is cloc|oo Li tux ItooBSD BSD CS oto
toy|o otlotsì tot ut t itto tot tlo itoicot oo t i|o
oosctiutot itst ooo ot tlo octuo| oov t o oovico t i|o
Botl oto ot o slot t ci tcui t Cuot otos ot
cotuotisot ouototot s utoot jo ot i tltot ic ovo|uotio t
Iot oto ouo t o oty uott ot uottott to tt oot i t os o
sttitj
CC !D l7l C!A L L PPLSS lC!S
1c
7loso cottotos ot o oxocut oo oitoct| y |y tlo slo||
A|tost o|| occout to tot | t lo oto ot outiots
ti|o
sout co ti|o
t ooo oto oxocut o cottotos t tot ti|o lt
ot jutott s sovo oto t ostot o uosi tio to| uot ots
Soot cl PA7 it tot litj touto | oo| it tlo cuttott
oi toctot y
tu|| cottoto t ot ut ts oxi t stot us
soo t ost
o| ios toto vo|uo
ct ooto ot o| ios !i tl to otjutotts utitt o| |
o| iosos !i tl toto utitt o|ios vo|uo tot toto
utitt o| ios |otot o oocl o|ios
|j ¡o|io
uut ¡o|io it tlo |oc|jt outo
|ito tou
|ito tou tutc |oysoo tutc
|ito tou ti|o
|ito tou |oysootutc
oisu|oy oto ot tooit y tooo| ito tutctiot oto |oy
|itoitjs 7lo sytt ox is soto os t ot ˜i tuutt c
ti|o t ooo tou |itoitjs t tot ti|o
|ist t lo totos ot o| | tooo| i to tutct io ts
tou uso tlo |oytou tou
| ist tooo| ito tutct iots oto |itoitjs
tot totoooitj
| ist tooo| ito tutct iots oto |itoitjs
tutc slou ulicl |oys itvo|o tutc
|oysoo t otovo |itoitjs tot |oysoo
| ist tooo| ito |oy soouotcos oto toct os
tot totoooitj
| ist tooo| ito |oy soouotcos oto toct os
tutc t otovo |oy |itoitjs tot tutc
| ist tooo| ito voti o||o totos oto vo|uos
tot totoooitj
| ist tooo| ito voti o||o totos oto vo|uos
|t oo| t
oxi t ttot otc|ositj t ot uli | o utti | ot so| oct |oou
lt t is suuu|ioo oxi t ttot t’ tl otc|ositj | oou
|ui | ti t slo|||ui|tit otjs
oxocuto slo|||ui|tit uitl jivot otjs oto tot utt
st ot us Usotu| tot t lo |ooy ot o s lo|| tutct iot tlot
t oootitos o |ui|tit oj co
co oit
clotjo cuttott oitoctot y to oit CML ootou| tì
Do oitoctot y uotl soot cl usitj vo|uo ot CDPA7
uso |ojico| uotl tot co P!D ootou| tì
us o ulysico| uotl tot co P !D
lt |otl o t o jivot tlo |ost oto ot tlo cottoto |ito
uits
co
clotjo cuttott oitoctot y to CLDP!D
cottoto toto otj
uitlout ot oxocuto toto uitl otjutotts otj
uso o ootou| t soot cl uot l tot PA7
utitt o oto uot o oosct iutiot ot toto
utitt o vot |oso oosct iutiot ot toto
cotti tuo t
oo toxt i totot iot ot otc|ositj t ot uli | o utti | ot
so| oct |oou lt t is suuu|ioo it ototo t’ tl otc|ositj
| oou
BU lL7 l! CCMMA!DS
1
toto vo|uo
tyuosot ot Ii t x toto vo|uo
sot ottti|utos oto vo| uos ot voti o||os ltsioo
tutct iots ct oot o tou couios ot tlo votio||os Usitj
itst ooo ot tutts ottti|ut os ott !i tl to totos
ot ot t t i|ut os utitt ovoty votio||o’s toto oto
ottt i|ut os
toto is ot ottoy
oocl toto is o tutct iot
oot’t slou tutct io t ootiti tiots |ooiosì
toto is ot itt ojot ot itltot ic
ovo| uotio t is ooto uuot ossijttott
tot| totos toooot| y
tot| totos tot oxuot t
oit s t t
oisu|oy tlo oi toctot y st oc|
t slou t’ tl ottty ttot | ot t t
t slou t’ tl ottty ttot ti jlt t
c|oot tlo oi toctot y st oc|
utitt o |otjot t ot tot |istitj
uti tt tlo stoc| oto ottty uot | ito
utitt tlo stoc| oto ottty uot | ito ui tl
itoox tut|ots
oi sout ¡o|
uitl to outi ots totovo totoo ¡o|s ttot tlo t o||o
ot octivo ¡ o|s
t otovo ot tot | ui tl ì o|| ¡o|s
tot| oocl ¡o| t o tot t ocoivo o Sl UP
ulot |osl t ot titot os
uso ui tl to tot | ¡ust tuttitj ¡o|s
oclo uot os
oclo uot os is tot suocio|
oxuo to oscouos soo oclo1ìì
to vot oxuo to oscouos
oot’ t outuut ttoi|itj tou| ito
ut ittt is tot o uot t o||o
oto|| o ti|o toto
oto||o oto oiso||o slo|| |ui|tits ot |oo o o to
ut|ooo tou |ui|tits ttot slot oo |i|tot y t i|os
Diso||itj o |ui| tit o|| ous uso ot o ois| t i|o uitl tlo
soto toto os o |ui| tit
utitt o|| |ui|t its uitl tloit st ot us
oo|ot o o |ui|tit |oooo o ui tl
ti|o |ooo o tou |ui| tit toto ttot ti|o
oiso||o toto ot utitt oiso||o o |ui|tits
uitl to totos
utitt oto|| o o |ui|tits
uti tt ot|y PCSl suocio| |ui|tits
ovo| uot os
ovo| uoto uot os oto oxocut o tosu|t
oxoc toto uot os
oxocuto uot os it u|oco ot tlo slo|| lt tooi toctio ts
ot|y clotjo tlo slo| |’s ouot t i|os
uso toto tot ot jv
c|oot tlo otvi tottott titst
u| oco o ot ot jv |i|o |ojit1ìì
lt tlo oxoc t oi| s to titt otoctivo slo||s oxi t ut| oss
tlo s lout outiot oxoct oi| is sot
oxit t
oxi t uitl tot utt vo |uo t Uso it to t
BU lL7 l! CCMMA!DS (continued)
17
expor t [ ] [toto vo|uo
uitl to otjutotts uti tt totos oto vo|uos ot
oxuott oo votio|| os Ctlotuiso oxuot t totos to t lo
otvi tottott ot cottotos
totos tot ot to t utcti ots
stou oxuottitj oocl toto
utitt oxuot t |otot o oocl votio||o
t c ooitot titst |ost
utitt o totjo ot cottotos t tot titst to |ost ttot |ost
l S7Sl L cottotos
tut ooitot it s uuu| ioo it tot uso t itst ot
ICLDl 7 LDl 7CP ot vi ot
cottotos oxocut o tosu| t sì
|ist ot st otoo t o out uut itst ooo ot ooi titj
oot’t uti tt | ito tut|ots
t ovot so ot oot ot cottotos
o|o tou cottoto
su|sti tuto tou tot o|o it cottoto ot | ost cottoto
it to cottotoì oto o x o cut o t lo t osu|t
t j ¡o|io
uut ¡o|io it tlo tot ojt outo
jotouts outsttitj toto otj
uot so uot otot ot s oto out iots soo |osl1ìì
losl ti|o toto
ui tl to otjutotts utitt tlo losl t o|| o cott ott s
jivitj li t coutt oto t i|o toto
ti|o ott ot ti|o tot toto it tlo losl t o||o
c|oot tlo itt ot to| losl t o||o
Assijttott to PA7 o| so c| oots tlo losl t o||o
lo| u uottott
utitt lo|u !i tl uottott utitt lo|u o |out o|| tlo
cottotos t lot totcl uottott
li stot y t
ti|o
li stot y
otj
otj
ui tl to outiots utitt t lo cottoto listot y At
ot jutott ot t utitt s ot|y t |itos lt s uuu|ioo uso
ti|o itst ooo ot l S7Il LL
ouuoto tou list oty |itos t o listot y t i|o
c|oot tlo list ot y | ist
t ooo tou list ot y |itos it tlo t i|o itto t lo
itt ot to| listot y |ist
uottot t list ot y su|sti tuti o t oto uti tt
tlo tosu| ts
t ou|oco itt ot to| list ot y ui tl cott ott s ot
list ot y ti| o
u|oco tlo otjs itto tlo list ot y |ist
tot | otot uso
utito t lo itt ot to| list ot y to t lo ti| o
¡ o|s ¡o|io
cottoto otjs
|ist ittot tot io t o |out ¡ o|s
o|so |ist ut ocoss io
ot|y |ist st ouuoo ot oxi too ¡o|s
ot|y | ist ut ocoss jt ouus
ot|y | ist t uttitj ¡o|s
ot|y | ist st ouuoo ¡o|s
tou| oco oty ¡o|io it tlo cottoto |ito
uitl tlo cottosuotoitj ut ocoss jt ouu l D
oto oxocuto t lo cottoto
BU lL7 l! CCMMA!DS (continued)
18
ki l l [ sij ¡o|io
|i | | sijtoto sijtut ¡o|io
soto Sl 7LPM ot jivot sijto| to totoo ¡o|ios
Si jto| s ot o totos | ist oo it ust itc| uoo si jto| l
uitl o t ui tlout tlo utot i x ‘‘Sl ’’ Stouuoo ¡o|s jot
o Sl CC!7 titst it sij is oitlot Sl 7LPM ot
Sl UP
sijs
|ist sijto| totos oto ot tut|ot s lt sij is o
tutot ico| oxi t st ot us ut itt tlo sijto| tlot |i||oo tlo
ut ocoss
| ot otj
ovo|uoto oocl otj os ot otitltot ic oxutossiot oxi t
it tlo |ost oxut ossio t uos to t ot o 1 otlot uiso
soo Arithmetic Evaluation)
l ocal [toto vo|uo
ct oot o vot io||os ui tl tlo jivot vo|uos |oco| to o
tutct iot !itl to ouot otos utitt o | ist ot | oco|
votio||os Must |o usoo itsioo o tutctiot
| ojout
oxi t o |ojit slo| |
uouo t t
t otovo otttios ttot tlo oitoctot y st oc| !itl to
ot jutotts totovo tlo tou ott t y oto co tloto
t t otovo t’ tl ottty ttot | ot t t
t t otovo t’ tl ottty ttot ti jlt t
oot’ t clotjo oitoctot y
ut ittt tottot otj
utitt out uut | i|o A!Sl C ut i ttt ui tl oxt otsio ts
| oxuo to oscouo soouotcos it sttitjs
o uti tt ouot oost t itj tlot cot |o t otooo
Iottot cotvot siots ot o t ousoo os tooooo
uuslo oit
uuslo t t
o oo o t ottty to tlo oi toctot y st oc| !i tl to
otjutotts oxclotjo tlo tou t uo otttios
t t ot ot o t lo st oc| so t lot t lo t’ tl
ottty ttot | ott is ot tlo t ou t
t t ot ot o t lo st oc| so t lot t lo t’ tl
ottty ttot ti jlt is ot tlo t ou t
oot’ t clotjo oitoctot y
oit uusl oit o t tlo stoc| oto co tloto
uuo
utitt uot |itj oitoctot y toto
utitt | ojico| uotl ootou| tì
utitt ulysico| uotl
lt |otl o t o jivot tlo |ost oto ot tlo cottoto |ito
uits
toto utotut totos
tooo st oi t oto ossijt to totos l IS su|it s ituut
PLPL is sot it to toto jivot Lxit ut| oss oto
ot ti|o otcoutt otoo
t ooo uot os itto itooxoo ottoy toto
uso tooo| i to it toooitj ttot o t ot tito|
uti tt utotut it toooitj ttot o t ot tito|
|otot o toooitj
ot oto ot | ito ooos tot oo | ito
cottituot iot
BU lL7 l! CCMMA!DS (continued)
19
readonl y [ ] [toto vo|uo
tot| totos toooot|y utitt | ist it to totos
oocl toto tust |o ot ottoy
oocl toto tust |o o tutct iot
utitt toooot| y |otot o oocl votio||o
t otut t t
oxi t tutctiot ot sctiut uitl tot utt vo|uo t !itl to
t tot utt s t ot us ot | ost cottoto lt tot it tutctiot
ot sctiut utitt ot ot t ot tossojo
sot outiots outiot uot os
sot t| ojs oto outiots soo Options To set). uot os sot
uosi tio to| uot ototots
sot outiots o outiot uot os
utsot t |ojs oto outi o ts
slit t t
t ototo uosi tio to| uot otot ots t 1 1
t ootou| ts t o 1
s lout outiot
utitt ot clotjo vo|uos ot slo|| outiots !i tl to
otjutotts uti tt slo|| outio t ittot totiot
ot|y clotjo outio ts
utitt sot t itjs t ot t otoooitj
ouiot tooo oxi t st ot us itoicot os
outio t st ot us
sot oto|| oì jivot outiot ui tl to
outiots utitt tloso tlot ot o sot
utsot oiso||oì jivot outiot ui tl to
outiots utitt tloso tlot ot o utsot
Soo Options To shopt)
suspend [ ]
suspend t he shell unti l SI GCONT i s r eceived
for ce suspension, even for login shel l
t est
evaluat e condi tional expressions (see Options To
t est and Conditional Expressions)
ti mes
pri nt accumulat ed process ti mes
t rap [ ] [uoto sijs
oxocuto uoto it sijto| it sijs t ocoivoo sijs oto
tut|ot s ot sijto| totos uitl ot uitlout ‘‘Sl ’’
!i tl to uoto ot sijs utitt ttous !itl to uoto
t osot sijs to ott t y ootou| ts lt uoto sijs
to ott t y ootou| ts lt uoto is t lo tu|| sttitj ijtoto
sijs lt sijs is ot L l 7 oxocuto uoto ot oxi t ttot
slo|| lt sijs is DLBU tut uoto ottot ovoty
cottoto
utitt o | ist ot si jto| totos oto tut|ots
utitt ttous ui tl ouot itj
tyuo toto
ooscti|o lou tlo slo|| itt ot utots toto
utitt o|| uossi|| o itt ot utot ot io ts
ot toto
utitt tlo toto ot tlo t i|o t o oxocut o it
toto is ot oxt ot to| ut ojtot
utitt o |oyuot o oosct i|itj toto
BU lL7 l! CCMMA!DS (continued)
20

Sign up to vote on this title
UsefulNot useful