Skip to content

Instantly share code, notes, and snippets.

@naftulikay
Last active August 29, 2015 14:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save naftulikay/3a831291167429704158 to your computer and use it in GitHub Desktop.
Save naftulikay/3a831291167429704158 to your computer and use it in GitHub Desktop.
Multiline Embedded Bash Variables
#!/bin/bash
# This is terribly annoying to remember, but here's how you do multiline
# variables in Bash.
read -d '' suchvariable <<EOF
usage: do this thing
preserves linebreak
wow such things
newlines galore
EOF
echo -e "$suchvariable"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment