Pattern: Improperly terminated here-document
Issue: -
Your here-document isn't properly terminated.
Look at here-document and see which line was supposed to terminate it. Then ensure it matches the token exactly, and that it's on its own line with no text before or after.
Example of incorrect code:
cat <<-eof
Hello World
-eof
In the example code, the script uses <<-eof
, which is the operator <<-
followed by eof
. The script therefore looks for eof
and skips right past the intended terminator because it starts with a dash.
Example of correct code:
cat <<- eof
Hello World
eof