Created
February 28, 2024 10:15
-
-
Save neoascetic/aa7da7c2349eb98921693c16ed1e91e2 to your computer and use it in GitHub Desktop.
Neat way to define multiline variables in bash
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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