Create rendertemplate.sh
:
#!/usr/bin/env bash
eval "echo \"$(cat $1)\""
And template.tmpl
:
Hello, ${WORLD}
Goodbye, ${CHEESE}
Render the template:
$ export WORLD=Foo
$ CHEESE=Bar ./rendertemplate.sh template.tmpl
Hello, Foo
Goodbye, Bar