Hello!
I cannot find any documentation that would tell me whether and how it
is possible to do variable indiriction to arrays.
This works:
bash-2.05a$ a=xxx
bash-2.05a$ b=a
bash-2.05a$ echo $a
xxx
bash-2.05a$ echo ${!b}
xxx
But this doesn't:
bash-2.05a$ a=(xxx yyy zzz)
bash-2.05a$ b=a
bash-2.05a$ echo ${a[@]}
xxx yyy zzz
bash-2.05a$ echo ${!b[@]}
xxx
(because I would like to see "xxx yyy zzz" also on the last line!)
So, I would like to refer to the whole array $a with $b but that
way it doesn't work because [@] is expanded as part of expression
b[@], not as part of a[@] after substitution !b := a .
Any solutions ?
Yours,
Jorma Laaksonen
--
Jorma Laaksonen email: jorma.laaksonen@hut.fi
Dr. of Science in Technology, Docent http://www.cis.hut.fi/jorma/
Laboratory of Computer and Information Science tel. +358-9-4513269
Helsinki University of Technology fax. +358-9-4513277
P.O.Box 5400, Fin-02015 HUT, Finland mob. +358-50-3058719