eof
is not on a separate line SH-1042Found eof
further down, but not on a separate line. Close matches include -eof
(!= eof
).
#
and !
in the shebang
SH-1115The script has spaces between the #
and !
in the shebang. This is not valid. Remove the spaces so the OS can correctly recognize the file as a script.
$[..]
used SH-2007The $[..]
syntax was deprecated in Bash 2.0 and replaced with the standard $((..))
syntax from Korn shell. It is therefore recommended to use $((..))
instead.
find
instead of ls
to better handle non-alphanumeric filenames SH-2012fi
statement here SH-1047Expected fi
matching previously mentioned if
statement.
!
in shebang SH-1113You appear to be specifying a shebang, but missing the bang (i.e. !
). The shebang should always be of the form #!/path/shell
.
Remove surrounding $()
to avoid executing output (or use eval
if this is intentional).
There's a syntax error at the highlighted location. This will cause the shell to crash with a syntax error as well.
Problematic code:
\<
to prevent it redirecting (or switch to [[ .. ]]
) SH-2073This error is typically seen when there are too many fi
s, done
s or esac
s , or when there's a do
or then
without a corresponding while
, for
or if
.
then
clause detected SH-1048$
used on the left side of an assignment SH-1066Unlike Perl or PHP, $
is not used when assigning to a variable.
For legacy reasons, $10
is interpreted as the variable $1
followed by the literal string 0
. Curly braces are needed to tell the shell that both digits are part of the parameter expansion.
$HOME
instead of tilde ~
to expand in quotes SH-2088Problematic code:
The end token of your here document has trailing whitespace. This is invisible to the naked eye, but shells do not accept it.
(
found SH-1036The checker expected an ordinary shell word but found an opening parenthesis instead. Determine what you intended the parenthesis to do and rewrite accordingly. Common issues include: * Wanting them to be literal, as in echo (FAIL) Some tests failed
. In this case, it requires quoting.
Parentheses are special characters in shell and must be used correctly. For commands that expect literal parentheses, such as grep
or find
, the parentheses need to be quoted or escaped so the shell does not interpret them, and instead passes them to the command.