Skip to content

Files

Latest commit

 

History

History
32 lines (21 loc) · 733 Bytes

SC1121.md

File metadata and controls

32 lines (21 loc) · 733 Bytes

Pattern: Use of &, ;, &> or similar after a here-document

Issue: -

Description

You are using &, ;, &> or similar after a here-document. This is not allowed. This should instead be part of the line that initiated the here-document, i.e. the one 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:

sudo bash -s << "END"
  cmd1
  cmd2
END &

Example of correct code:

sudo bash -s << "END" &
  cmd1
  cmd2
END

Further Reading