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
if you use macOS and can't use readarray, you can simply do this-
MY_STRING="string1 string2 string3" array=($MY_STRING)
To iterate over the elements:
for element in "${array[@]}" do echo $element done