string="hell|ttt|sss|2222" OLD_IFS="$IFS" IFS="|" array=($string) IFS="$OLD_IFS" for var in ${array[@]} do echo $var done