I have a text file containing this:
Hello \"${USER}\"!
Today you drank ${COFFEE_COUNT} coffees.
See you tomorrow!
Now I have a bash script running that has these strings assigned (and exported). But when that script echoes this file it doesn't replace the strings.
... code ...
export COFFEE_COUNT="$(some code)" #${USER} is set by default
... code ...
t=$(wc -l < ${scriptdir}/COFFEE);
for ((l=1;l<t;l++));
do
echo $(sed -n "${l}{p;q;}" < ${scriptdir}/COFFEE);
done;
... code ...
nor does cat work
cat "${scriptdir}/COFFEE";
Is there a way to make this work?
required output:
Hello "username"!
Today you drank 3 coffees.
See you tomorrow!
COFFEE_COUNTset?