Trying to do the equivalent to this shell fragment
set -A MyArray1 q w e r t y
set -A MyArray2 a s d f g h
x=1
eval print \${MyArray${x}[*]}
If you're familiar with unix, the first parse (eval) expands ${x} to 1, and removes the
The second parse expands to ${MyArray1[*]} and prints q w e r t y
I know how to create and populate the arrays, but can't figure out the eval bit.
Thanks in advance.
set -A MyArray1 q w e r t y
set -A MyArray2 a s d f g h
x=1
eval print \${MyArray${x}[*]}
If you're familiar with unix, the first parse (eval) expands ${x} to 1, and removes the
The second parse expands to ${MyArray1[*]} and prints q w e r t y
I know how to create and populate the arrays, but can't figure out the eval bit.
Thanks in advance.