Closed sc0ttj closed 5 years ago
Here's how to apply environment variables to template file (no backup need).
Create template with {{FOO}} for later replace. echo "Hello {{FOO}}" > foo.conf.tmpl
echo "Hello {{FOO}}" > foo.conf.tmpl
Replace {{FOO}} with FOO variable and output to new foo.conf file FOO="world" && sed -e "s/{{FOO}}/$FOO/g" foo.conf.tmpl > foo.conf
{{FOO}}
FOO
foo.conf
FOO="world" && sed -e "s/{{FOO}}/$FOO/g" foo.conf.tmpl > foo.conf
Working on both macOS 10.12.4 and Ubuntu 14.04.5
Here's how to apply environment variables to template file (no backup need).
Create template with {{FOO}} for later replace.
echo "Hello {{FOO}}" > foo.conf.tmpl
Replace
{{FOO}}
withFOO
variable and output to newfoo.conf
fileFOO="world" && sed -e "s/{{FOO}}/$FOO/g" foo.conf.tmpl > foo.conf
Working on both macOS 10.12.4 and Ubuntu 14.04.5