SK

Bash code snippets

Date written Jul 5, 2020
Date updated Last updated: Sep 8, 2020
Filed under Software Eng. in tech

Contents
  • Articles
  • Snippets

Articles

Snippets

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
)