3 SC1053
Joachim Ansorg edited this page 2021-11-12 10:38:29 +01:00

Semicolons directly after else are not allowed. Just remove it.

Problematic code:

if mycommand; then echo "True"; else; echo "False"; fi

Correct code:

if mycommand; then echo "True"; else echo "False"; fi

Rationale:

else keywords should not be followed by semicolons. It's not valid shell syntax.

You can follow them directly with a line break or another command.

Exceptions:

None