I've got a function in bash that takes an array as argument
in my case the array is made of "false" values
I define this array in a main script and then i call the function
my_function my_array[@]
where my_function is defined this way
function my_function(){
arg_array=("${!1}")
arg_array[2]="true"
}
but if i print the array in the main script i see that the array hasn't been modified. Actually the function modifies the "copy" of the argument array and not the array itself. How can I let the function to modify the source array ( in other programming languages is related to "global" variables..)?
thanks