Variable variables in ash


#1

I’m using variable variables in bash like that:

foo="value"
bar="foo"
echo ${!bar}

But how can I make same thing on my embedded system which uses ash shell?


#2

It is possible with eval command like this:

foo="value"
bar="foo"
eval result=\$$bar
echo $result