Conditional structures: Difference between revisions

→‎Else and elif: there really is no need to use semicolons if we plan on writing several lines anyway
imported>Tromp
(Conditional structures in BLC)
(→‎Else and elif: there really is no need to use semicolons if we plan on writing several lines anyway)
Line 8,030:
There are optional <code>elif</code> (else if) and <code>else</code> clauses.
 
<syntaxhighlight lang="sh">if test 4 -ge 6; then
then echo '4 is greater than or equal to 6'
elif test 4 -lt 6; then
then echo '4 is less than 6'
else echo '4 compares not to 6'
else
echo '4 compares not to 6'
fi</syntaxhighlight>
 
1,934

edits