Like heredoc syntax there is also herestring.
For a heredoc you'd do something like
cat >file <<EOF This is a file all this text will get written to the file This dir contains $(ls) EOFor, if expansion (command, parameter and arithmetic) isn't wanted, quote the word at the start:
cat >file <<"EOF".
Herestrings are a quicker way than using echo and piping to a command -- for instance to get torrent info I can do
ssh server deluge --ui=console <<<info rather than
echo info | ssh server deluge --ui=console.