shell分割字符串

DBATips 2011-06-16

#!/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

相关推荐