http://steve-parker.org/sh/sh.

shtml

Shell Scripting Tutorial

Steve's Bourne / Bash Scripting Tutorial
http://steve-parker.org/sh/sh.shtml A Bourne Shell Programming/Scripting Tutorial for learning about using the Unix shell.

ersion !."a #p$f% &c' "((( - "(!! Steve Parker. )ail To: steve at steve-parker.org *riginal Available +rom: http://steve-parker.org/sh/sh.shtml ,ast Up$ate$: -(th .une "(!!

&See also the blog at http://nixshell./or$press.com/'

Shell Scripting Tutorial 0 "(((-"(!! Steve Parker

http://steve-parker.org/sh/sh.shtml

Page ! of 1(

...........................Part 33 ........................................................................................................inks To *ther >esources .............shtml Page " of 1( ....59 Simple 7xpect >eplacement ......................................................................................................................................................5 A +irst Script ....................... .............9: Airector4 Traversal..................................................................................................................................................................................................................99 7xercises...........................................................................................................................................1( Shell Scripting Tutorial 0 "(((-"(!! Steve Parker http://steve-parker.....!( 6il$car$s ..............................................................................................................1 ariables .....Part 3 ..........................................................................................................................................................................................................9.......................................... @c........................................................................................................................................Philosoph4 .oops ...................................................................................................................................................................<1 ?ints an$ Tips .......................................................................................................................!9 ...........................................................................................................................................................................................................................................................-: 7xit 8o$es...............................................................................................<....................................................................................................................................................................................... ariables ...... 7xit 8o$es &revisite$'.......97cho : -n vs...."....................................................................................................................................................................................."8ase ................................................................! 3ntro$uction ..........9! Trap ...............................................<9 =uick >eference ...shtml Shell Scripting Tutorial Table of Contents Steve2s Bourne / Bash Scripting Tutorial........................................................................................................................................................................................-< 7xternal Programs ..................................Part 333............................................................................................................................................................................................................................................................................................................................http://steve-parker..............org/sh/sh....................................................................................................................-9 +unctions .................!5 7scape 8haracters ...............95 3nteractive Shell .................................................................................org/sh/sh.......................................................................!: Test ....................................-! ariables ....................................................................................................9: A$$ressbook......

use of variablesB functionsB is useful backgroun$ kno/le$ge Un$erstan$ing of ho/ Unix comman$s are structure$B an$ competence in using some of the more common ones.org/sh/sh. )an4 other shells have been /rittenD this particular tutorial concentrates on the Bourne an$ the Bourne Again shells.org/sh/sh.org/sh/sh. Getting The Most Recent Version Of This Tutorial The most recent version of this tutorial is available from: http://steve-parker. A Brief istor! of sh Steve BourneB /rote the Bourne shell /hich appeare$ in the Seventh 7$ition Bell . Programmers of perlB p4thonB 8B PascalB or an4 programming language /ho can ma4be rea$ shell scriptsB but $on2t feel the4 un$erstan$ exactl4 ho/ the4 /ork. Al/a4s check there for the latest cop4.shtml Page .of 1( . As suchB it has been /ritten as a basis for one-on-one or group tutorials an$ exercisesB an$ as a reference for subseCuent use.faCs. Audience This tutorial assumes some prior experienceD namel4: • • • • Use of an interactive Unix shell )inimal programming kno/le$ge . )a4be a future version /ill cover kshD 3 $o not inten$ to /rite a tutorial for cshB as csh programming is consi$ere$ harmful!. *ther shells inclu$e the Eorn Shell &ksh'B the 8 Shell &csh'B an$ variations such as tcsh.org/faCs/unix-faC/shell/csh-/h4not/ Shell Scripting Tutorial 0 "(((-"(!! Steve Parker http://steve-parker.shtml.abs >esearch version of Unix.http://steve-parker. This tutorial $oes not cover those shells. ! http://///.shtml Shell Scripting Tutorial Introduction Purpose Of This Tutorial This tutorial is /ritten to help people un$erstan$ some of the basics of shell script programmingB an$ hopefull4 to intro$uce some of the possibilities of simple but po/erful programming available un$er the bourne shell.

8omman$-line entries /ill be prece$e$ b4 the Aollar sign &F'.http://steve-parker.org/sh/sh. 3f 4our prompt is $ifferentB enter the comman$: PS1="$ " .sh Hello orl! $ 7ntire scripts /ill be surroun$e$ b4 thick horiHontal rules an$ inclu$e a reference /here available to the plain text of the script: first.org/sh/sh.shtml Page < of 1( .sh " #!/bin/sh # $his is % comment! echo Hello orl! # $his is % comment& too! Iote that to make a file executableB 4ou must set the eJecutable bitB an$ for a shell scriptB the >ea$able bit must also be set: $ chmo! %'rx (irst.txt Shell Scripting Tutorial 0 "(((-"(!! Steve Parker http://steve-parker.sh $ echo 'echo Hello orl!' >> my-script. $ echo '#!/bin/sh' > my-script.sh " http://steve-parker. export PS1 Then 4our interactions shoul$ match the examples given &such as F . Script output &such as G?ello 6orl$G belo/' is $ispla4e$ at the start of the line.sh belo/'.sh $ ./m4-script./my-script.org/sh/eg/first.sh. 8o$e segments an$ script output /ill be $ispla4e$ as preformatte$ text.shtml T!pographical "onventions #sed in This Tutorial Shell Scripting Tutorial Significant /or$s /ill be /ritten in italics /hen mentione$ for the first time.sh $ chmo! "## my-script.

5": b4tes on m4 s4stemB attach it to the input of the pipeB an$ let it run. There are a number of factors /hich can go into goo$B cleanB CuickB shell scripts. Secon$l4B if nobo$4 else can un$erstan$ ho/ it /orksB 4ou /ill be lumbere$ /ith maintaining it 4ourself for the rest of 4our lifeN Something about shell scripts seems to make them particularl4 likel4 to be ba$l4 in$ente$B an$ since the main control structures are if/then/else an$ loopsB in$entation is critical for un$erstan$ing /hat a script $oes. *f courseB this kin$ of thing is /hat the *S is there forB an$ it2s normall4 prett4 efficient at $oing it. 3t is partl4 $ue to this that there is a certain machismo associate$ /ith creating good shell scripts. !. Since it is eas4 to /rite a simple batch-Kob t4pe shell scriptB there are a lot of poor Cualit4 shell scripts aroun$. A clear la4out makes the $ifference bet/een a shell script appearing as Gblack magicG an$ one /hich is easil4 maintaine$ an$ un$erstoo$. Secon$ is avoi$ing unnecessar4 comman$s. But if this comman$ /ere in a loop being run man4 times overB the saving of not locating an$ loa$ing the c%t executableB setting up an$ releasing the pipeB can make some $ifferenceB especiall4 inB sa4B a 8L3 environment /here there are enough other factors to slo/ things $o/n /ithout the script itself being Shell Scripting Tutorial 0 "(((-"(!! Steve Parker http://steve-parker. ".shtml Shell Scripting Tutorial Philosoph! Shell script programming has a bit of a ba$ press amongst some Unix s4stems a$ministrators.org/sh/sh. This is normall4 because of one of t/o things: • • The spee$ at /hich an interprete$ program /ill run as compare$ to a 8 programB or even an interprete$ Perl program. *ne of the maKor /eaknesses in man4 shell scripts is lines such as: c%t /tmp/my(ile ) *rep "mystrin*" /hich /oul$ run much faster as: *rep "mystrin*" /tmp/my(ile Iot muchB 4ou ma4 consi$erD the *S has to loa$ up the /bin/*rep executableB /hich is a reasonabl4 small 159(( b4tes on m4 s4stemB open a pipe in memor4 for the transferB loa$ an$ run the /bin/c%t executableB /hich is an even smaller . +irstB a simple script /illB more often than anticipate$B gro/ into a largeB complex one. Scripts /hich can be use$ as 8L3 programsB for exampleB /ithout losing out too much in spee$ to Perl &though both /oul$ lose to 8B in man4 casesB /ere spee$ the onl4 criterion'.org/sh/sh.http://steve-parker. Mou ma4 be forgiven for thinking that /ith a simple scriptB this is not too significant a problemB but t/o things here are /orth bearing in min$. !.shtml Page 5 of 1( . ". The most important criteria must be a clearB rea$able la4out.

org/cop4left/gpl.shtml Shell Scripting Tutorial too much of a hur$le.shell ne/sgroup from time to time.the reason behin$ this tutorial itselfB an$ /e can all learn from an$ contribute to open $iscussions about such issues. But ho/ever goo$ 4our flavour of Unix is at $oing thisB it2$ rather not have to $o it at all.html Shell Scripting Tutorial 0 "(((-"(!! Steve Parker http://steve-parker. Some Unices are more efficient than others at /hat the4 call Gbuil$ing up an$ tearing $o/n processesG . So 4ou might as /ell accept that it /ill be inspecte$ b4 an4one 4ou pass it toD use this to 4our a$vantage /ith the LP. 6hich lea$s me nicel4 on to something else: Aon2t ever feel too close to 4our o/n shell scriptsD b4 their natureB the source cannot be close$. 3f 4ou suppl4 a customer /ith a shell scriptB s/he can inspect it Cuite easil4. Speaking of /hichB 3 /oul$ like to reccommen$ the comp.+nix..http://steve-parker.org/sh/sh. Sharing experiences is the ke4 to all of this .shtml Page 9 of 1( . As a result of thisB 4ou ma4 hear mention of the Useless Use of 8at A/ar$ &UUo8'B also kno/n in some circles as The A$ard %or The Most Gratuitous #se Of The &ord "at In A Serious Shell Script being ban$ie$ about on the comp.http://///.+nix.gnu. There are still some real gurus /ho hang out there /ith goo$ a$vice for those of us /ho nee$ to kno/ more &an$ that2s all of usN'.os.org/sh/sh.shell ne/sgroup to 4ouB although its signal to noise ratio seems to have $ecrease$ in recent 4ears.encourage people to give 4ou fee$back an$ bugfixes for freeN .ieB loa$ing them upB executing themB an$ clearing them a/a4 again.. This is purel4 a /a4 of peers keeping each other in checkB an$ making sure that things are $one right.

/(irst.sh.org/sh/sh. 3t means that even if 4ou are using cshB kshB or an4thing else as 4our interactive shellB that /hat follo/s shoul$ be interprete$ b4 the Bourne shell. Iote that echo /ill automaticall4 put a single space bet/een its parameters. This marks the line as a commentB an$ it is ignore$ completel4 b4 the shell. The onl4 exception is /hen the very first line of the file starts /ith #! .sh Hello orl! $ < http://steve-parker.sh $ .org/sh/eg/first. Similarl4B a Perl script ma4 start /ith the line #!/+sr/bin/perl to tell 4our interactive shell that the program /hich follo/s shoul$ be execute$ b4 perl.the first is G?elloGD the secon$ is G6orl$G.txt Shell Scripting Tutorial 0 "(((-"(!! Steve Parker http://steve-parker. This is a special $irective /hich Unix treats speciall4.http://steve-parker./(irst. 6e /ill then tr4 to get more out of a ?ello 6orl$ program than an4 other tutorial 4ou2ve ever rea$ :-' 8reate a file &first.as ours $oes.shtml Page 1 of 1( . no/ run chmo! "## (irst.inuxB /bin/sh is normall4 a s4mbolic link to bash. 3f 4ou2re using LIU/.sh to make the text file executableB an$ run . +or Bourne shell programmingB /e shall stick to #!/bin/sh. This is the stan$ar$ location of the Bourne shell on Kust about ever4 Unix s4stem. The thir$ line runs a comman$: echoB /ith t/o parametersB or arguments . The secon$ line begins /ith a special s4mbol: #. The # s4mbol still marks a commentD the O an$ an4thing follo/ing it is ignore$ b4 the shell.org/sh/sh.sh.sh < #!/bin/sh # $his is % comment! echo Hello orl! # $his is % comment& too! The first line tells Unix that the file is to be execute$ b4 /bin/sh.sh' as follo/s: first.shtml Shell Scripting Tutorial A %irst Script +or our first shell scriptB /e2ll Kust /rite a script /hich sa4s G?ello 6orl$G. Mour screen shoul$ then look like this: $ chmo! "## (irst.

Put a fe/ spaces bet/een G?elloG an$ G6orl$G. Tr4 to pre$ict the outcome before 4ou run it: first". 3t prints this out exactl4.sh 5 #!/bin/sh # $his is % comment! echo "Hello orl!" echo "Hello orl!" echo "Hello .org/sh/sh. The output is exactl4 the sameN 6e are calling the echo program /ith t/o argumentsD it $oesn2t care an4 more than cp $oes about the gaps in bet/een them.the string G?ello 6orl$G. Io/ mo$if4 the co$e again: #!/bin/sh # $his is % comment! echo "Hello orl!" # $his is % comment& too! This time it /orks. As a final exampleB t4pe in the follo/ing script.txt # $his is % comment& too! Shell Scripting Tutorial 0 "(((-"(!! Steve Parker http://steve-parker. 6hat $o 4ou expect the output to beP 6hat about putting a TAB character bet/een themP As al/a4s /ith shell programmingB tr4 it an$ see.hello.shtml Mou /ill probabl4 have expecte$ thatN Mou coul$ even Kust run: $ echo Hello Hello orl! $ orl! Shell Scripting Tutorial Io/ let2s make a fe/ changes.shtml Page : of 1( .-" orl!" echo . /orl! echo 'hello' /orl! 5 http://steve-parker.org/sh/sh.http://steve-parker. The point to un$erstan$ here is that the shell parses the arguments B7+*>7 passing them on to the program being calle$. orl! echo Hello orl! echo "Hello" orl! echo Hello " " orl! echo "Hello -". +irstB note that echo puts *I7 space bet/een its parameters. orl!" echo Hello .org/sh/eg/first". Mou probabl4 expecte$ thatB tooB if 4ou have experience of other programming languages.sh. 3n this caseB it strips the Cuotes but passes the string as one argument. But the ke4 to un$erstan$ing /hat is going on /ith more complex comman$ an$ shell scriptB is to un$erstan$ an$ be able to explain: 6?MP echo has no/ been calle$ /ith Kust *I7 argument .

of 1( ..shtml Shell Scripting Tutorial 3s ever4thing as 4ou expecte$P 3f notB $on2t /orr4N These are Kust some of the things /e /ill be covering in this tutorial .shtml Page .. an$ 4esB /e /ill be using more po/erful comman$s than echoN Shell Scripting Tutorial 0 "(((-"(!! Steve Parker http://steve-parker.org/sh/sh.http://steve-parker.org/sh/sh.

shtml Shell Scripting Tutorial Varia'les ( Part I .txt Shell Scripting Tutorial 0 "(((-"(!! Steve Parker http://steve-parker. People use$ to Perl ma4 be Cuite happ4 /ith thisD if 4ou2ve gro/n up /ith 8B PascalB or /orse 4et A$aB this ma4 seem Cuite strange.Part 33 /hich looks into variables /hich are set for us b4 the environment. 3n the first caseB the shell sees the GQG s4mbol an$ treats the comman$ as a variable assignment.org/sh/sh.http://steve-parker. The bourne shell is no exceptionB an$ this section intro$uces i$ea.et2s look back at our first ?ello 6orl$ example. . 3n the secon$ caseB the shell assumes that A> must be the name of a comman$ an$ tries to execute it. This coul$ be $one using variables &though it2s such a simple example that it $oesn2t reall4 /arrant itN' Iote that there must be no spaces aroun$ the GQG sign: 012=3%l+e /orksD 012 = 3%l+e $oesn2t /ork. Iote that /e nee$ the Cuotes aroun$ the string ?ello 6orl$. This is taken further in ariables .ust about ever4 programming language in existence has the concept of variables . 9 http://steve-parker.sh. 3f 4ou think about itB this makes sense . *ther/iseB the shell /ill tr4 to execute the comman$ orl! after assigning 45647SS187=Hello The shell $oes not care about t4pes of variablesD the4 ma4 store stringsB integersB real numbers an4thing 4ou like.a s4mbolic name for a chunk of memor4 to /hich /e can assign valuesB rea$ an$ manipulate its contents.sh 9 #!/bin/sh 45647SS187="Hello echo $45647SS187 orl!" This assigns the string G?ello 6orl$G to the variable 45647SS187 then echoes out the value of the variable.org/sh/sh.shtml Page !( of 1( .sh: var. 6hereas /e coul$ get a/a4 /ith echo Hello orl! because echo /ill take an4 number of parametersB a variable can onl4 hol$ one valueB so a string /ith spaces must be Cuote$ to that the shell kno/s to treat it all as one.org/sh/eg/var.ho/ else coul$ 4ou tell it to run the comman$ A> /ith its first argument being GQG an$ its secon$ argument being GvalueGP 7nter the follo/ing co$e into var!.

147 echo "Hello $456. 3t is this kin$ of thing /hich can $rive a shell programmer craH4B so /atch out for themN This is using the shell-builtin comman$ re%! /hich rea$s a line from stan$ar$ input into the variable supplie$. 6e can interactivel4 set variable names using the re%! comman$D the follo/ing script asks 4ou for 4our name then greets 4ou personall4: var".expr $x ' 1.org/sh/eg/var".hope yo+'re /ell. 6hat happensB is that the re%! comman$ automaticall4 places Cuotes aroun$ its inputB so that spaces are treate$ correctl4. echo "$45647SS187"'.shtml Page !! of 1( .1@A" 4564>B7C=1A?%bc Iote though that special characters must be properl4 escape$ to avoi$ interpretation b4 the shell. expr9 non-n+meric %r*+ment $ Since the external program expr onl4 expects numbers.<4=72=1 456P>=?.org/sh/sh.txt Shell Scripting Tutorial 0 "(((-"(!! Steve Parker http://steve-parker. 3f 4ou assign a string to a variable then tr4 to a$$ ! to itB 4ou /ill not get a/a4 /ith it: $ x="hello" $ y=.147 .http://steve-parker.e.1@A 456:$H726P>="?. Iote that even if 4ou give it 4our full name an$ $on2t use $ouble Cuotes aroun$ the echo comman$B it still outputs correctl4.sh 1 #!/bin/sh echo h%t is yo+r n%meD re%! 456.shtml Shell Scripting Tutorial 3n truthB these are all store$ as stringsB but routines /hich expect a number can treat them as such. ?o/ is this $oneP 6ith the 45647SS187 variable earlier /e ha$ to put $ouble Cuotes aroun$ it to set it. This is $iscusse$ further in 7scape 8haracters.g. 1 http://steve-parker.org/sh/sh. But there is no s4ntactic $ifference bet/een: 45647SS187="Hello orl!" 456SH:2$647SS187=hi 456.sh." 3 ha$ originall4 misse$ out the $ouble-Cuotes in line -B /hich meant that the single-Cuote in the /or$ G4ou2reG /as unmatche$B causing an error. &Mou /ill nee$ to Cuote the outputB of course .

sh 45012 is9 45012 is9 hi there )M A> hasn2t been set to an4 valueB so it2s blank.http://steve-parker. Then /e give it a valueB an$ it has the expecte$ result.shtml Scope of Varia'les Shell Scripting Tutorial ariables in the bourne shell $o not have to be $eclare$B as the4 $o in languages like 8. This can cause some subtle bugs .org/sh/sh.shtml Page !" of 1( .sh 45012 is9 45012 is9 hi there : http://steve-parker. 8reate a small shell scriptB my3%rA. There is a comman$ calle$ export /hich has a fun$amental effect on the scope of variables. Io/ run: $ 45012=hello $ .org/sh/sh.sh : #!/bin/sh echo "45012 is9 $45012" 45012="hi there" echo "45012 is9 $45012" Io/ run the script: $ .sh. But if 4ou tr4 to rea$ an un$eclare$ varableB the result is the empt4 string./my3%rA.txt Shell Scripting Tutorial 0 "(((-"(!! Steve Parker http://steve-parker. Mou get no /arnings or errors.if 4ou assign 456:=E<SF1$7C6012>1=G7=Hello an$ then echo $456:SE<F1$7C6012>1=G7B 4ou /ill get nothing &as the secon$ *B+US8AT7A is mis-spelle$'. 3n or$er to reall4 kno/ /hat2s going on /ith 4our variablesB 4ou /ill nee$ to un$erstan$ something about ho/ this is use$.org/sh/eg/m4var".sh: m4var"./my3%rA.

pro(ile or .b%sh6pro(ile file /orksB for example./my3%rA. 3n or$er to receive environment changes back from the scriptB /e must source the script . Tr4 rea$ing the value of 45012: $ echo $45012 hello $ *nce the shell script exitsB its environment is $estro4e$.sh from 4our interactive shellB a ne/ shell is spa/ne$ to run the script.shtml Page !.sh 45012 is9 hello 45012 is9 hi there $ echo $45012 hi there The change has no/ ma$e it out into our shell againN This is ho/ 4our .of the script: this is changing the value of 45012. 6e nee$ to export the variable for it to be inherite$ b4 another program .inclu$ing a shell script./my3%rA.of 1( .shtml Shell Scripting Tutorial 3t2s still not been setN 6hat2s going onPN 6hen 4ou call my3%rA.org/sh/sh. But there is no /a4 that this /ill be passe$ back to 4our interactive shell. This is partl4 because of the #!/bin/sh line at the start of the scriptB /hich /e $iscusse$ earlier.http://steve-parker. Iote that in this caseB /e $on2t nee$ to export 45012. But 45012 keeps its value of hello /ithin 4our interactive shell. 6e can source a script via the G. Thanks to sway for pointing out that 32$ originall4 sai$ echo 45012 aboveB not echo $45012 as it shoul$ be.this effectivel4 runs the script /ithin our o/n interactive shellB instea$ of spa/ning another shell to run it. T4pe: $ export 45012 $ . .org/sh/sh.sh 45012 is9 hello 45012 is9 hi there Io/ look at line . Shell Scripting Tutorial 0 "(((-"(!! Steve Parker http://steve-parker.G comman$: $ 45012=hello $ echo $45012 hello $ .

org/sh/sh.shtml Shell Scripting Tutorial *ne other thing /orth mentioning at this point about variablesB is to consi$er the follo/ing shell script: #!/bin/sh echo " h%t is yo+r n%meD" re%! <S726. The shell $oes not kno/ /here the variable en$s an$ the rest starts.147 echo "Hello $<S726. . ?o/ can /e $efine thisP The ans/er isB that /e enclose the variable itself in curl4 brackets: user. http://steve-parker.147" echo "> /ill cre%te yo+ % (ile c%lle! $<S726.147 echo "Hello $<S726.1476(ile" to+ch $<S726.org/sh/sh.147I6(ile" .1476(ile Think about /hat result 4ou /oul$ expect.sh .that isB /e2$ effectivel4 be sa4ing to+ch Ste3e P%rJer6(ileB /hich is t/o files to be to+che$B not one. Also note the Cuotes aroun$ "$H<S726.1476(ile.org/sh/eg/user.shtml Page !< of 1( .http://steve-parker. +or exampleB if 4ou enter GsteveG as 4our US7>RIA)7B shoul$ the script create ste3e6(ileP Actuall4B no.147I6(ile" to+ch "$H<S726. The Cuotes avoi$ this.if the user entere$ GSteve ParkerG &note the space' then /ithout the CuotesB the arguments passe$ to to+ch /oul$ be Ste3e an$ P%rJer6(ile .sh. This can be the $o/nfall of man4 a ne/ shell script programmerB as the source of the problem can be $ifficult to track $o/n.147" echo "> /ill cre%te yo+ % (ile c%lle! $H<S726. This /ill cause an error unless there is a variable calle$ <S726.txt Shell Scripting Tutorial 0 "(((-"(!! Steve Parker http://steve-parker.147 an$ that /e /ant it suffixe$ /ith 6(ile. Thanks to 8hris for highlighting this. #!/bin/sh echo " h%t is yo+r n%meD" re%! <S726.147I6(ile" The shell no/ kno/s that /e are referring to the variable <S726.

http://steve-parker.er*org/sh/sh*sht)l for the full P-% docu)ent.shtml Page !5 of 1( .org/sh/sh. and for the full online tutorial* Shell Scripting Tutorial 0 "(((-"(!! Steve Parker http://steve-parker.org/sh/sh.shtml Shell Scripting Tutorial That's all for the sa)ple of the tutorial* Please visit http+//steve(par.

A/ar$sB etc http://///.org/sh/sh.s To Other Resources • • • • • http://steve-parker.a prett4 $efinitive $ocument on Cuoting an$ escape characters. >>P F<. Arra4s 8hapter !( Processes 8hapter !! 8hoosing an$ Using Shells Part II ( Recipes using S!ste) Tools 8hapter !" +ile 8ontrol 8hapter !.mpg.linux.org/sh/sh. Publishe$ b4 6rox an$ coming out /orl$/i$e in August "(!!B the book Shell Scripting: Expert Recipes for Linux.Text )anipulation 8hapter !< S4stems A$ministration Part III ( Recipes for S!ste)s Ad)inistration 8hapter !5 Shell +eatures 8hapter !9 S4stems A$ministration 8hapter !1 Presentation 8hapter !: Aata Storage an$ >etrieval 8hapter !.fi/era/unix/: ?istor4B Useless Use *f ..oops 8hapter 1 ariables 8ontinue$ 8hapter : +unctions an$ . Bash and more is available from all goo$ retailers.com/archive/fee$/-<95: T 6hat to /atch out for /hen /riting portable shell scripts http://bhami.. Part I ( /anguage and #sage 8hapter ! ?istor4 8hatper " Letting Starte$ 8hapter ariables 8hapter < 6il$car$ 7xpansion 8hapter 5 8on$itional 7xecution 8hapter 9 .ibraries 8hapter .. http://///.iki. http://///.html .shtml Shell Scripting Tutorial /in.com/rosetta. Iumbers an$ )ath 8hapter "( Process 8ontrol 8hapter "! 3nternationaliHation Shell Scripting Tutorial 0 "(((-"(!! Steve Parker http://steve-parker..mpi-sb.$e/Su/e/lehre/unixffb/Cuoting-gui$e. 3SBI !!!:("<<:9.org/sh/bourne. http://steve-parker.http://steve-parker..shtml Page !9 of 1( .org/book/ has the $etailsD from August "(!! the book /ill be available to bu4 online an$ in stores.the >osetta Stone for Unix The Printed Boo.Steve Bourne2s 3ntro$uction to the Unix Shell.html ..shtml.

Master your semester with Scribd & The New York Times

Special offer for students: Only $4.99/month.

Master your semester with Scribd & The New York Times

Cancel anytime.