I want to print out the element in a list:
lst_1=(A B C)
for j in ${lst_1[@]};do echo $j ;done
A
B
C
this worked. But when I use variable on list name, it failed.
lst_1=(A B C)
lst_2=(D E F)
for i in 1 2;do \
for j in ${lst_${i}[@]};do \
echo $j ;done;done
-bash: ${lst_${i}[@]}: bad substitution