On 29.07.2010 22:55, Bernd Eggink wrote:
It seems that indirect expansion doesn't work with arrays:

$ a=(x y z)
$ b=a
$ echo "${!b[0]} ${!b[1]} ${!b[2]}"
x

Is that intended? The documentation isn't explicit about it.

IMHO it would be very desirable to have a indirect expansion facility
for arrays. Otherwise there is only a choice between passing all
elements to a function, which is time-consuming, or using eval, which is
cumbersome and error-prone.



yes, that would be nice - as a feature.
but it somehow conflicts logically with ${!arr...@]}, which returns the indicies of an array (some ksh derivied feature I think).

Reply via email to