awk 使用
2015-07-26 20:39
246 查看
cat english_w06.txt |awk '{print $3}' 打印上述文档第三列的所有单词
awk '{for(i=1;i<=NF;++i) if($i=="some") ++sum}END{print sum}' english_w06.txt 统计单词some和 will出现的次数,并输出统计结果到文件
awk '{for(i=1;i<=NF;++i) if($i=="will") ++sum}END{print sum}' english_w06.txt
ifconfig | awk '/eth/{inter=$1;getline;sub(/inet addr:/,"");print inter,$1}' 使用ifconfig,显示网卡ip地址
english_w06.txt
Some people are a little nervous when it comes to cooking for someone else,
but even if you haven’t done much cooking, there are some delicious meals
you can prepare that will impress your date. The best part about cooking for
someone else is that it gives you an opportunity to serve the person you are
with, and that alone will start things off on a good note. The following are some
easy but delicious things you can cook on a date with someone new.
awk '{for(i=1;i<=NF;++i) if($i=="some") ++sum}END{print sum}' english_w06.txt 统计单词some和 will出现的次数,并输出统计结果到文件
awk '{for(i=1;i<=NF;++i) if($i=="will") ++sum}END{print sum}' english_w06.txt
ifconfig | awk '/eth/{inter=$1;getline;sub(/inet addr:/,"");print inter,$1}' 使用ifconfig,显示网卡ip地址
english_w06.txt
Some people are a little nervous when it comes to cooking for someone else,
but even if you haven’t done much cooking, there are some delicious meals
you can prepare that will impress your date. The best part about cooking for
someone else is that it gives you an opportunity to serve the person you are
with, and that alone will start things off on a good note. The following are some
easy but delicious things you can cook on a date with someone new.
相关文章推荐
- 一个Web布局实例
- BZOJ 1179: [Apio2009]Atm( tarjan + 最短路 )
- 2015 HUAS Provincial Select Contest #1~D
- 人生的智慧 读书笔记
- NYOj 69 数的长度
- opendaylight中arphandler模块与routing模块的学习
- python中使用xmlrpc
- BUILD ROOT编译记录
- 【计蒜客系列】挑战难题20:跳跃游戏二
- web_custom_request
- UVA 400 Unix ls
- windows 下 redis 安装
- Uva 12436 Rip Van Winkle's Code
- 一个答案不唯一的数独问题
- UVa439(BFS最短路实现)
- HDU 3023 Dirt 踩黑白块
- mysql服务启动、停止、重启
- 八大排序总结
- UVa439(DFS实现)
- 【数据结构】1、串的模式匹配算法