Created
November 19, 2015 06:46
-
-
Save jordic/6f1c7df570e7c8526908 to your computer and use it in GitHub Desktop.
Bash template variable
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
# tpl is a variable only template parser for bash. | |
tpl() { | |
if [ -z "$1" ]; then | |
echo "Must provide a tpl name: tpl tplname" | |
exit; | |
fi | |
TPL=$(cat $1) | |
eval "echo \"$TPL\"" | |
} | |
tpl filename.yaml |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment