技术改变生活

博客园 首页 新随笔 联系 订阅 管理

2020年10月24日 #

摘要: NR与FNR [root@x112 linshi]# awk '{print NR}' c.txt d.txt 1 2 3 4 5 6 7 8 [root@x112 linshi]# awk '{print FNR}' c.txt d.txt 1 2 3 4 1 2 3 4 [root@x112 l 阅读全文
posted @ 2020-10-24 20:17 小阿峰 阅读(120) 评论(0) 推荐(0) 编辑

摘要: 使用awk方式: [root@x112 linshi]# cat 10_for.sh #!/bin/bash #describtion awk print first line ten time Line=$(cat c.txt|wc -l) awk '{if(NR==1) {for(i=1;i<= 阅读全文
posted @ 2020-10-24 17:58 小阿峰 阅读(142) 评论(0) 推荐(0) 编辑