Is there any way to expand variables inside commands? It's hard for me to explain what I want to achieve, so I'll demonstrate it:
Let's say I have this construct:
var1="\${var2} -eq 7"
if [ ${var1} ]; do....
And the desired output is:
if [ ${var2} -eq 7 ]; do....
Now obviously that doesn't work, but how would I make something like this work?