I have a skeleton text file with placeholder strings:
blah blah blah
blah $PLACEHOLDER_1$
blah
$PLACEHOLDER_2$
and so on. Specific \"form\" of
I just stumbled upon this question because I was just looking for the exact same, and I found envsubst(1)
.
You can use envsubst if you don't mind using environment variables:
PLACEHOLDER_1='string 1' PLACEHOLDER_2='multiline
string
2' envsubst < output.template
If you have a lot of variables you can store them in a file and just source
it (remember to use export
at the end of the sourced file!)