title: set values to elements of an array in a function
body: <p>In a bash script, I would like to put the following code that assigns values to each element of several arrays into a function</p>
  
  <pre><code>for (( i=0 ; i &lt; ${#themes[@]} ; i+=1 )); do  
    c_bit_mins[i]=-5  
    c_bit_maxs[i]=15  
    gamma_bit_mins[i]=-15  
    gamma_bit_maxs[i]=3  
  done
  </code></pre>
  
  <p>i.e. something like</p>
  
  <pre><code>function set_values()
  {
  for (( i=0 ; i &lt; ${#themes[@]} ; i+=1 )); do  
    c_bit_mins[i]=-5  
    c_bit_maxs[i]=15  
    gamma_bit_mins[i]=-15  
    gamma_bit_maxs[i]=3  
  done
  }
  </code></pre>
  
  <p>How to do it? Especially when these arrays are not seen as global inside the function.</p>
  
  <p>Thanks and regards!</p>