您的位置:首页 > 其它

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.
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: