Skip to content

Instantly share code, notes, and snippets.

@stormbeta
Created January 28, 2014 18:17
Show Gist options
  • Save stormbeta/8673133 to your computer and use it in GitHub Desktop.
Save stormbeta/8673133 to your computer and use it in GitHub Desktop.
Shell template interpolator
function render-template {
local template=`cat "${1}"`
local command=$(echo -e "cat <<EOF\n${template}\nEOF\n")
cat << EOF
$(eval "${command}")
EOF
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment