Skip to content
koalaman edited this page Jul 8, 2017 · 2 revisions

No comments allowed after here-doc token. Comment the next line instead.

Problematic code:

cat << eof  # --- Start greeting --
Hello
eof         # --- End greeting ---

Correct code:

cat << eof  # --- Start greeting --
Hello
eof
            # --- End greeting ---

Rationale:

The terminator token for a here document must be on an entirely separate line. No comments are allowed on this line.

Place the comment somewhere else, such as on the following line.

Exceptions:

None

ShellCheck

Each individual ShellCheck warning has its own wiki page like SC1000. Use GitHub Wiki's "Pages" feature guerraart8 to find a specific , or see Checks.

Clone this wiki locally