Evaluating a nexted variable

Doug McNeil mcneild at mcneild.Software.Mitel.COM
Sun Nov 11 05:44:17 AEST 1990


Hello,

A friend needed to get the value of a variable which was contained in
a variable:

$a=b
$c=a

Determing the value of "a" given "c".

I came up with:

$eval z="$`echo $c`"
$echo $z

Not being a shell guru, I expect there are lots of better ways to do
this. Any comments?

--
----------------------------------------------------------------------------->
"Smokin" Doug McNeil			| ...!uunet!mitel!spock!mcneild
Mitel Corporation, Kanata, Ontario	| (613)592-2122
"I know a lot of fancy dancers.." - Cat Stevens	|



More information about the Comp.unix.shell mailing list