如何解决如何中断作为grep C1输出的行
-----我的输入文件[文件名-测试]
centos is my bro
red hat is my course
ubuntu is my OS
fqdn is stupid
tom outsmart jerry
red hat is 3
red hat is friend
red hat is my boy
jerry is small
----我的代码
#! /bin/bash
grep -C1 --color=always "red hat" test
-预期输出
centos is my bro
red hat is my course
ubuntu is my OS
--
tom outsmart jerry
red hat is 3
red hat is friend
--
red hat is 3
red hat is friend
red hat is my boy
--
red hat is friend
red hat is my boy
jerry is small
----即将输出
centos is my bro
red hat is my course
ubuntu is my OS
--
tom outsmart jerry
red hat is 3
red hat is friend
red hat is my boy
jerry is small
----请为grep命令提供必要的选项,以获取预期的输出
-----如果还有其他方法可以实现此输出
-----请在代码中提供参考和注释
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。