koalaman / shellcheck Public
SC1051
Joachim Ansorg edited this page Nov 12, 2021
·
3 revisions
Semicolons directly after then are not allowed. Just remove it.
Problematic code:
if true; then; echo "Hi"; fiCorrect code:
if true; then echo "Hi"; fiRationale:
then 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