#! /bin/bash
array_1=(1 3 5)
array_2=(7 9 3)
array_3=(0 -1 3)
for i in {1..3}; do
array=array_$i
echo "${array[@]}"
done
I'm printing "array_1", "array_2" and "array_3" instead of its value.
Store the full variable name plus [@] as a string, then get the elements with ${!var} indirect expansion. It's funky, but putting [@] in the string rather than in the expansion is the way to go.
#!/bin/bash
array_1=(1 3 5)
array_2=(7 9 3)
array_3=(0 -1 3)
for i in {1..3}; do
array="array_$i[@]"
echo "${!array}"
done