Jump to content

Here documents

From Squishu Wiki

General

  • a here document starts with the leader << followed by a special sequence of characters that are repeated at the end of the doc
  • use case: output large amounts of text from inside a script and avoiding using an echo statement for each line
cat << !BLAH!
hello
Bob
love mom
!BLAH!
  • This preserves the new lines