[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Indirect expansion and arrays
From: |
Bernd Eggink |
Subject: |
Indirect expansion and arrays |
Date: |
Thu, 29 Jul 2010 22:55:51 +0200 |
User-agent: |
Mozilla/5.0 (X11; U; Linux i686; de; rv:1.9.2.7) Gecko/20100713 Thunderbird/3.1.1 |
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
- Indirect expansion and arrays,
Bernd Eggink <=