shell分割字符串

#!/bin/sh
ids="1,2,3,4,5";
var=`echo   "$ids"   |   awk  -F ', '   '{print   $0} '   |   sed   "s/,/   /g "`;
for   list   in   $var
do
 echo $list
done

相关推荐