hi
I've 2 bash script, in the first i define an array and I'd like to pass it as argument to the second script.
For example:
first_bash:
k=(1 2 3 4)
.......
#in the end i call the 2 script
./second_bash $k
then in the second_bash:
.....
echo "${1[*]}" #this not work
but i'm not able to manage the array in the 2 bash.
Any ideas?
thanks
D.
--------------------------------------------
Hi
I've tried as follow:
k=(1 2 3 4)
.......
#in the end i call the 2 script
./second_bash "${k[*]}"
and in the second_bash i call it as
....
passed_arr=$1
echo "${passed_arr[*]}"
....
and it seems like to work. Anyway I'll check in deep. Thanks
D.