I wrote a function which returns an array:
create(){
my_list=("a" "b" "c")
echo "${my_list[@]}"
}
result=$(create)
for var in result
do
echo $var
done
Now, I'd like to extend it in order to return multiple arrays. For example, I'd like to write something like that:
create(){
my1=("1" "2")
my2=("3","4")
my3=("5","6")
echo "${my1[@]} ${my3[@]} ${my3[@]}"
}
and I'd like to get each of the returned arrays:
res1= ...
res2= ...
res3= ...
Anyone could suggest me a solution? Thanks