Systems Programming & Scripting - Heriot
Syst Prog & Scripting - Heriot Watt University1Systems Programming & ScriptingLecture 14 - Shell Scripting : Control Structures, Functions Syst Prog & Scripting - Heriot Watt University2Control Structures Shell Scripting supports creating more complex programs using control structures. Decision: if statement Iteration (looping): while/until statement for statement Syst Prog & Scripting - Heriot Watt University3The if statementif command then statementelsestatementfi Similar in behaviour to the if statement in other Programming languages with few differences: The command is executed which could be a script. Based on the return value, the statement after the then or else get executed. Syst Prog & Scripting - Heriot Watt University4The if statement (cont'd) Return value 0 is true and any other value is considered to be script1; then ls lelseecho script1 returned false fi Syst Prog & Scripting - Heriot Watt University5The test Command The if statement is used to run executable.
Systems Programming & Scripting Lecture 14 - Shell Scripting: ... Mendel Cooper “Advanced Bash Scripting Guide”, http://tldp.org/LDP/abs/html/index.html
Download Systems Programming & Scripting - Heriot
Information
Domain:
Source:
Link to this page:
Please notify us if you found a problem with this document: