I have a file contains a few lines, and in some lines there is a variable like this:
The-first-line
The-second-${VARIABLE}-line
The-third-line
In a bash scrip, I want to read the lines and resolve the variable wherever exists.
VARIABLE=Awesome
LINES=$(echo $(cat file.txt))
for i in $LINES
do :
echo "$i"
done
The output is same as the input file (unresolved variables) but I want something like this:
The-first-line
The-second-Awesome-line
The-third-line
Thanks in advance for any help!