I don't know if this works for ksh (don't have that on my system -- yet),Quote:> Hi all,
> part of one of my scripts (AIX 4.1.5) has a structure like this:
> #!/bin/ksh
> dog=123
> cat=456
> for item in dog cat
> do
> echo "The value of $item is ${${item}}"
> done
> I want the output to look like:
> The value of dog is 123
> The value of cat is 456
> but I get back:
> adam[7]: "The value of $item is ${${item}}": 0403-011 The specified
> substitution is not valid for this command.
> I know the "${${item}}" is wrong, but I can't find a way to tell it I
> want to get the value of item, which is dog, then the value of dog, which
> is 123. I've tried many,many combinations, but nothing has worked.
but I think bash is similar enough:
bash$ FOO=PATH
bash$ eval echo $`echo $FOO`
/usr/local/bin:/bin:/usr/bin:/usr/X11R6/bin
-Lars
--
A *real* smart bomb would call in sick, perhaps move to another country,
changing its name in the process, open a beach bar maybe and live out its
days in safe anonymity. -- Barry O'Neill in rhod