2016年9月28日

shell split函数的使用

摘要: #!/bin/awk -f BEGIN{FS=","} {split($1,name," "); for (i in name) print name[i] } 阅读全文

posted @ 2016-09-28 10:06 猫儿爹 阅读(2331) 评论(0) 推荐(0) 编辑

shell实现文件内容查询如输入姓名结果显示电话号码等信息

摘要: #!/bin/awk -f BEGIN{FS=","; if(ARGC>2){name=ARGV[1];delete ARGV[1]} else{ echo "please enter name";getline name<"-" } } $1~name {print $1,$3} 阅读全文

posted @ 2016-09-28 10:02 猫儿爹 阅读(290) 评论(0) 推荐(0) 编辑

使用sort&awk实现文件内容块排序

摘要: 源文件为: [root@luo5 wangxx]# cat -v luo.txt J LuoSoutth jfsaNanjing,china Y ZhangVictory UniversityNejflja,Australia D HouBeijing UniversityMelhouse,chin 阅读全文

posted @ 2016-09-28 09:57 猫儿爹 阅读(2980) 评论(0) 推荐(0) 编辑

导航