title: Iterate over array in shell whose name is stored in a variable
body: <p>Let us say, i have an array: 
  <code>versions=(1 2 3 4)</code>
  I can iterate over it by :
  <code>for i in ${versions[@]}</code>
  How to do this if the name of the array is decided on the basis of some other variable, hence stored in a variable
  Example:</p>
  
  <pre><code>array_name=${some_var}_arr
  
  declare -a ${array_name}
  </code></pre>
  
  <p>How do I iterate over elements of array whose name is stored in array_name.
  I tried </p>
  
  <pre><code>for i in ${${array_name}[@]}
  </code></pre>
  
  <p>Got bad substitution error</p>