Skip to content
koalaman edited this page Apr 8, 2017 · 1 revision

Remove leading spaces before the shebang.

Problematic code:

  #!/bin/sh
echo "Hello world"

Correct code:

#!/bin/sh
echo "Hello World"

Rationale:

The script has leading spaces before the shebang (#!). This is not allowed.

The #! should be the first two bytes in the file, as they're used as a file signature by the OS to determine whether a file is a script.

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