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.

Regards,
Bernd

--
Bernd Eggink
http://sudrala.de

Reply via email to