separate string into array bash code example
Example 1: split string and create array bash
my_array=($(echo $string | tr "," "\n"))
Example 2: string to array bash
IFS='$SEP' read -r -a ARRAY <<< "$STRING"
my_array=($(echo $string | tr "," "\n"))
IFS='$SEP' read -r -a ARRAY <<< "$STRING"