Since I’m always forgetting the specific syntax (which is another issue, as it’s quite straight-forward), I figured I’d write it down:
cat > /tmp/test << "EOF" this is a test it does nothing useful simply to demonstrate and document EOF
This is handy when you want to bung a configuration file in a shell script and easily write it out to the filesystem. An alternative (but much less succinct way) would be to do:
FILE=/tmp/test echo "this is a test" > $FILE echo "it does nothing useful" >> $FILE echo "simply to demonstrate and document" >> $FILE