1 / 8

Lab 9

Lab 9. Shell Script. Reference: Linux Shell Scripting Tutorial v1.05r3 A Beginner's handbook http://www.freeos.com/guides/lsst/index.html. Special shell variables $0…$9. Positional parameters or command line arguments. myscript $0 foo $1 Bar $2.

nuwa
Télécharger la présentation

Lab 9

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Lab 9 Shell Script Reference: Linux Shell Scripting Tutorial v1.05r3A Beginner's handbook http://www.freeos.com/guides/lsst/index.html

  2. Special shell variables $0…$9 Positional parameters or command line arguments myscript $0 foo $1 Bar$2 $#tells you how many parameter your script was given

  3. if …else…fi Syntax: if condition Then if condition then ..... .. do this else .... .. do this fi else ... ..... do this fi

  4. Nested if-else-fi

  5. Multilevel if-then-else Syntax: if condition then condition is zero (true - 0) execute all commands up to elif statement elif condition1 then condition1 is zero (true - 0) execute all commands up to elif statement elif condition2 then condition2 is zero (true - 0) execute all commands up to elif statement else None of the above condtion,condtion1,condtion2 are true (i.e. all of the above nonzero or false) execute all commands up to fi fi

  6. for Loop Syntax: for { variable name } in { list } Do execute one for each item in the list until the list is not finished (And repeat all statement between do and done) done

  7. for Loop

More Related