[prev] [index] [next]

If Command

The if-then-else construct allows conditional execution:

if testList1
then
   commandList1
elif testList2
then
   commandList2
...
else
   commandListn
fi

Keywords if, else etc, are only recognised at the start of a command (after newline or semicolon).