Last active
May 15, 2019 21:44
-
-
Save mikeslattery/8a355ddaa0bef42c3425e308fbacc540 to your computer and use it in GitHub Desktop.
Template engine for 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 | |
# Interpolates variables in a text file | |
# $1 = template filename | |
templatefile="$1" | |
shift | |
eval "$(echo -e "cat <<HEREX\n$(cat "$templatefile")\nHEREX\n")" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment