I have text file like this:
src_dir=source1
src_dir=source2
dst_dir=dest1
whatever_thing=thing1
whatever_thing=thing2
I want a script that will create arrays with names from the left part of a line and fill it with elements from the right part of a line. So basically it should do:
src_dir=(source1 source2)
dst_dir=(dest1)
whatever_thing=(thing1 thing2)
I've tried so far:
while read -r -a line
do
IFS='= ' read -r -a array <<< "$line"
"${array[0]}"+="${array[1]}"
done < file.txt