string="Paris, France, Europe"
IFS=', ' read -r -a array <<< "$string"

# 0번째
echo "${array[0]}"

# iteration
for element in "${array[@]}"
do
    echo "$element"
done

# loop
for index in "${!array[@]}"
do
    echo "$index ${array[index]}"
done

 

https://stackoverflow.com/questions/10586153/how-to-split-a-string-into-an-array-in-bash

Posted by poterius
,