My situation :
Textfile : test.txt
Variable test declared in the terminal
Now when I cat the file, output is :
My question how can I cat the file with the declared output from the variable?
cat itself does not evaluate any variables. To do it, the command line must be evaluated by bash twice. This is done by the eval command. Thus the result should be
eval echo $(cat test.tex)
Answered By – guthondr