Linux Heredoc

Very handy tool, personally I like to use it to quickly make scripts, or populate files.

cat << EOF > /tmp/yourfilehere
These contents will be written to the file.
        This line is indented.
EOF

You can also use the tee command to the same effect.

tee /tmp/yourfilehere << EOF
These contents will be written to the file.
        This line is indented.
EOF
comments powered by Disqus