13,420
edits
Changes
→Additional Logic Statements
Example:
<span style="font-family:courier;">num1=5<br>num2=10<br>if test $num1 –lt $num2<br>then<br> echo “Less Than”<br>else<br>echo “Greater Than or Equal to”<br>fi</span><br><br> [[Image:if-else.png|thumb|right|300px|Example of how an '''if-else''' statement works.]]'''if-elif-else Statements�''' If the test condition returns a TRUE value, then the Linux Commands between then and else statements are executed. �If the test returns a FALSE value, then a new condition is tested, and action is taken if the result is TRUE . Eventually, an action will be taken when the final test condition is FALSE� Example:�� <span style="font-family:courier;">num1=5<br>num2=10<br>if test $num1 –lt $num2<br>then echo “Less Than”<br>elif test $num1 –gt $num2<br>then<br> echo “Greater Than”<br>else echo “Equal to”<br>fi</span><br><br>
===Additional Loop Statements===