SC1118 – ShellCheck Wiki

See this page on GitHub

Sitemap


Delete whitespace after the here-doc end token.

Problematic code:

"▭" below indicates an otherwise invisible space:

cat << "eof"
Hello
eof▭   

Correct code:

cat << "eof"
Hello
eof

Rationale:

The end token of your here document has trailing whitespace. This is invisible to the naked eye, but shells do not accept it.

Remove the trailing whitespace.

Exceptions:

None.


ShellCheck is a static analysis tool for shell scripts. This page is part of its documentation.