SC1052 – ShellCheck Wiki

See this page on GitHub

Sitemap


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

Problematic code:

if true; then; echo "Hi"; fi

Correct code:

if true; then echo "Hi"; fi

Rationale:

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


ShellCheck is a static analysis tool for shell scripts. This page is part of its documentation.