[bash] linux shell script: split string, put them in an array then loop through them