In a Bash script I would like to split a line into pieces and store them in an array.
The line:
Paris, France, Europe
I would like
Another way would be:
string="Paris, France, Europe" IFS=', ' arr=(${string})
Now your elements are stored in "arr" array. To iterate through the elements:
for i in ${arr[@]}; do echo $i; done