码迷,mamicode.com
首页 > 系统相关 > 详细

shell脚本,awk实现每个数字加1.

时间:2016-09-08 00:40:24      阅读:285      评论:0      收藏:0      [点我收藏+]

标签:

[root@localhost add]# cat file 
1 3 4 5
7 8 9
[root@localhost add]# cat file|awk {for(i=1;i<=NF;i++){$i+=1}}1
2 4 5 6
8 9 10
[root@localhost add]# cat file|awk {for(i=1;i<=NF;i++){$i+=1}}1{print $0}
2 4 5 6
8 9 10
[root@localhost add]# cat file|awk {for(i=1;i<=NF;i++){$i+=1}}{print $0}
2 4 5 6
8 9 10
[root@localhost add]# 

 

shell脚本,awk实现每个数字加1.

标签:

原文地址:http://www.cnblogs.com/wangyuebo/p/5851535.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!