I'd like to know what your real purpose is, because this has all the hallmarks of an
XyProblem.
You want to evaluate a variable, so that you can use the value as the name of another variable. This can't generally be done directly. It can be done with
eval, as above, but
the use of eval is risky, not recommended, and probably not necessary.
Chances are that what you want to do can better be done with an array, or an indirect reference, or
something similar, but we'd need to hear the details first.
At the very least, the above example can be done reasonably more safely using
declare instead of
eval.
Code:
a=var
declare $a=value