Suppose I have some bash arrays:
bash
A1=(apple trees) A2=(building blocks) A3=(color television)
And index J=2, how
J=2
I've already found a resolution, this can be done by:
$ Aref=A$J $ echo ${!Aref} building $ Aref=A$J[1] $ echo ${!Aref} blocks $ Aref=A$J[@] $ echo "${!Aref}" building blocks