Skip to content
Vidar Holen edited this page Oct 4, 2015 · 6 revisions

Scripts are case sensitive. Use 'if', not 'If'.

Problematic code:

If true
Then
  echo "hello"
Fi

Correct code:

if true
then
  echo "hello"
fi

Rationale:

Shells are case sensitive and do not accept If or IF in place of lowercase if.

Exceptions

If you're aware of this and insist on naming a function WHILE, you can quote the name to prevent shellcheck from thinking you meant while.

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