Pattern: Missing then
for if
or elif
Issue: -
Your code probably has a missing then
keyword for the if
or elif
.
Note that the then
needs a ;
or linefeed before it. if true then
is invalid, while if true; then
is correct.
Example of incorrect code:
if true
echo "foo"
elif true
echo "bar"
fi
Example of correct code:
if true
then
echo "foo"
elif true
then
echo "bar"
fi