1:awk 取前n个字符
awk '{print $1,substr($2,1,3)}'
2:awk 赋值
dev=`echo $f|awk -F'_' '{print $1}'` #前后的符号不是单引号
3:遍历
echo '26040823T3,26030513b1,16001033SF'|awk -F ',' '{for (i = 1; i <= NF; i++) print $i}'
4:split(awk数组变量a不须要在BEGIN中定义,从1开始)
echo 'a,b,c'|awk '{split($0,a,",");print a[1]}'