I m running bash
. I have this:
$ A="This is something"
$ B='$A'
$ echo "$B"
'$A'
So far so good. But then:
$ echo "$(eval $B)"
This: command not found
Which is not what I expected:
This is something
How do I evaluate the string, without executing the result of the evaluation? I only want to perform variable substitution.
EDIT
This works, but is ugly:
A="This is something" ; B='$A' ; eval "echo $B"