Im trying double loop using array values like array names for loop
array1="name1 name2"
name1="one two"
name2="red blue"
for name in $array1
do
for value in $name
do
echo "$name - $value"
done
done
I need to use 'name' to '$name' for use in 2nd loop, but this don't work for me.
How could I use value of array1 like the name of array inside 2nd loop?