Skip to content

Instantly share code, notes, and snippets.

@jordic
Created November 19, 2015 06:46
Show Gist options
  • Save jordic/6f1c7df570e7c8526908 to your computer and use it in GitHub Desktop.
Save jordic/6f1c7df570e7c8526908 to your computer and use it in GitHub Desktop.
Bash template variable
# 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