Skip to content

Latest commit

 

History

History
31 lines (20 loc) · 685 Bytes

SC1122.md

File metadata and controls

31 lines (20 loc) · 685 Bytes

Pattern: Text after the terminating token in shell script

Issue: -

Description

You have a here-document, and appear to have added text after the terminating token.

This is not allowed. If it was meant to continue the command, put it on the line with the <<.

If it helps, look at << "END" as if it was < file, and make sure the resulting command is valid. This is what the shell does. You can then append here-document data after the command.

Example of incorrect code:

cat << EOF
Hello
EOF | nl

Example of correct code:

cat << EOF | nl
Hello
EOF

Further Reading