I want to read variable name from txt file in bash script.
For example
I run var="thanks" in terminal
I create file.txt and txt file contains $var
I create variable var2 in terminal. var2=""
Then I run var2=$(<file.txt) command in terminal.
The Problem is
$ echo $var2
"$var"
I want the output of the echo $var command to be "thanks"
$ echo $var2
"thanks"
So what should I do?