I get 2 arrays using curl
I user readarray <<<$(curl http://etc)
So for example I got first array first line "Best friends" and second array first line "John Jim Piter"
How I can treat each line of the first array as new_array_name and fill it from the second array using bash? Each line of first array must be treat as separated array name and fill from each line of the second array.
Where are multiple line in each array
UPD. As @choroba mention also I need replace whitespace in variable name
I have 2 arrays:
declare -a my_array=([0]=$'BEST FRIENDS' [1]=$'Second line')
and 2nd array = declare -a my_array2=([0]=$'JOHN Jim Piter' [1]=$'This is the test')
I need treat each line from first array as variable name and each line from second array as value.
Like this - BEST FRIENDS=JOHN Jim Piter