Skip to content
Joachim Ansorg edited this page Nov 12, 2021 · 2 revisions

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

Each individual ShellCheck warning has its own wiki page like SC1000. Use GitHub Wiki's "Pages" feature above to find a specific one, or see Checks.

Clone this wiki locally