Q:

Bash array values like variables inside loop

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?

A:

That's not how you define arrays in bash.
a="foo bar"

defines a string/scalar variable. And using it as $a (unquoted) performs the split+glob operator which only makes sense for strings representing a $IFS separated list of file patterns.
In bash, arrays are defined as:
a=(foo bar)

So here, you'd want:
array1=(name1 name2)
name1=(one two)
name2=(red blue)

for name in "${array1[@]}"
do
  typeset -n nameref="$name"
  for value in "${nameref[@]}"
  do
    printf '%s\n' "$name - $value"
  done
done

typeset -n is a relatively recent addition to bash and declares a nameref, that is a variable that contains the name of another variable and when expanded actually refers to the named variable.

