Hello.
I have the following arrays:
Code:
ARRAY_ONE[0]="hello"
ARRAY_ONE[1]="world"
ARRAY_ONE[2]="!"
ARRAY_TWO[0]="hello"
ARRAY_TWO[1]="linuxquestions"
ARRAY_TWO[2]="!"
[*note: just an example :-) ]
I have a name of the array I need (i.e. "ARRAY_ONE" or "ARRAY_TWO") stored in $ARR_NAME, and the element I need in $ARR_ELEM.
I.e.: $ARR_NAME could be "ARRAY_TWO" and $ARR_ELEM "0".
I need to print the information in $ARRAY_ELEM of $ARR_NAME.
"echo ${$ARR_NAME[$ARR_ELEM]}" doesn't work.