Skip to content

Instantly share code, notes, and snippets.

@neoascetic
Created February 28, 2024 10:15
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 neoascetic/aa7da7c2349eb98921693c16ed1e91e2 to your computer and use it in GitHub Desktop.
Save neoascetic/aa7da7c2349eb98921693c16ed1e91e2 to your computer and use it in GitHub Desktop.
Neat way to define multiline variables in bash
#!/bin/bash
multiline() {
read -r -d '' "$@"
}
multiline text << 'END'
Hello, world!
Multiline docstrings seems to work today...
END
echo "$text"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment