awk累加

 

{a+=substr($14,1,1)}END{a=(a=="")?0:a;print a}'

对a进行累加,如果最后a=0的话,结果为0,否则为a,最后输出a

posted on 2013-06-21 10:03  语辰  阅读(353)  评论(0编辑  收藏  举报