SC1050 – ShellCheck Wiki

See this page on GitHub

Sitemap


Expected then.

Problematic code:

if true
  echo "True"
fi

Correct code:

if true
then
  echo "True"
fi

Rationale:

ShellCheck has found an if statement that appears to be missing a then.

Make sure the then exists, and that it is the first word of the line (or immediately preceded by a semicolon).

Exceptions:

None


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