首页 > 其他 > 详细

去掉所有包含this或is的行

时间:2021-03-16 22:25:14      阅读:32      评论:0      收藏:0      [点我收藏+]
题目描述
写一个 bash脚本以实现一个需求,去掉输入中含有this的语句,把不含this的语句输出
示例:
假设输入如下:
that is your bag
is this your bag?
to the degree or extent indicated.
there was a court case resulting from this incident
welcome to nowcoder


你的脚本获取以上输入应当输出:
to the degree or extent indicated.
welcome to nowcoder

说明:
你可以不用在意输出的格式,包括空格和换行
grep -v -E "this|is" nowcoder.txt
awk -F: ‘$0!~/this|is/ {print $0}‘ nowcoder.txt
sed ‘/this\|is/d‘ nowcoder.txt

去掉所有包含this或is的行

原文:https://www.cnblogs.com/chenjo/p/14545555.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!