SK

Bash code snippets

Date written Jul 5 2020
Filed underTechnology :: Software Engineering

Contents
  • Multiline strings

Multiline strings

Always forgetting this very important utility.

strvar=$(cat << EOF
# all content goes here, bash variables work.
EOF
)

To directly put the output into a file

cat << EOF > /path/to/file
# all content goes here, bash variables work.
EOF
)