str=\"a,b,c,d\"array=(${str//,/ })for var in ${array[@]}doecho $vardonefor i in \"${!array[@]}\"doecho \"${array[$i]\"done
shell 字符串分割
未经允许不得转载:爱站程序员基地 » shell 字符串分割
str=\"a,b,c,d\"array=(${str//,/ })for var in ${array[@]}doecho $vardonefor i in \"${!array[@]}\"doecho \"${array[$i]\"done