Command substitution in quotes cannot be used to call the variable
4
votes
4
answers
1281
views
Say:
variable="Something that it holds"
then
echo "$variable"
will output: Something that it holds
But say I also do:
var2="variable";
echo "\$$(echo $var2)"
will just output: $variable
And not: Something that it holds
Can anyone tell me about what feature of Unix is in play, here?
Asked by Swaroop Joshi
(149 rep)
Jul 22, 2020, 06:43 PM
Last activity: Jul 23, 2020, 05:18 PM
Last activity: Jul 23, 2020, 05:18 PM