Transcription of Systems Programming & Scripting - Heriot
{{id}} {{{paragraph}}}
Syst Prog & Scripting - Heriot Watt University1 Systems Programming & ScriptingLecture 14 - Shell Scripting : Control Structures, Functions Syst Prog & Scripting - Heriot Watt University2 Control 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 University3 The 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 University4 The 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 University5 The 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
Domain:
Source:
Link to this page:
Please notify us if you found a problem with this document:
{{id}} {{{paragraph}}}