Reputation: 181
I am not sure if I am asking the question correctly.
This is what I working with:
a=foo
b=bar
cat 1.txt > new1.txt
Contents of 1.txt:
$a
$b
When run this, my new1.txt looks like this:
$a
$b
What I want:
foo
bar
Upvotes: 2
Views: 34
Reputation: 88583
With envsubst
:
export a="foo"
export b="bar"
envsubst < 1.txt > new1.txt
Output to new1.txt:
foo bar
Upvotes: 3