Skip to content
koalaman edited this page Nov 1, 2014 · 15 revisions

Shebang (#!) missing. Assuming Bash.

Problematic code:

echo "Hello World"

Correct code:

#!/bin/sh
echo "Hello World"

Rationale:

ShellCheck warns about different things for different shells. It uses the shebang to determine which shell to warn for. For the command line client, this can be overridden with -s, e.g. shellcheck -s sh file.

If you don't specify the shell type in any way, ShellCheck assumes a default and gives this message.

Contraindications

None. Just specify the shell type, either in a shebang or as a cli flag.

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