Hi,
In a bash script, I would like to put the following code that assigns values to each element of several arrays into a function
for (( i=0 ; i < ${#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
i.e. something like
function set_values()
{
for (( i=0 ; i < ${#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
}
How to do it? Especially when these arrays are not seen as global inside the function.
Thanks and regards!