Tell me more ×  Suppose I have some bash arrays:  A1=(apple
trees) A2=(building blocks) A3=(color television)  And index
J=2, how to get the array contents of A2?  share|improve this
question This is very cool. I consider myself a bash expert and
I was always under the assumption that bash cannot do array
indirection such as ${!ind[@]} but I never thought to introduce
a temp var to solve it. –  SiegeX Jan 3 '11 at 5:08 Interesting
question/answer! –  ring0 Jan 3 '11 at 5:44 You should post your
answer as an answer. You will be able to accept it when the time
limit expires. Here is an example of the usual way that arrays
are used with indirection: d=13; e=24; f=35; a=(d e f); echo
${!a[1]} which results in "24". –  Dennis Williamson Jan 3 '11
at 5:51 add comment  2 Answers  up vote 12 down vote accepted
I've already found a resolution, this can be done by:  $
Aref=A$J $ echo ${!Aref} $ Aref=A$J[1] $ echo ${!Aref} $
Aref=A$J[@] $ echo "${!Aref}" building blocks share|improve this
answer How can you assign to,