嗨,我是新的bash编程。我想要一种方法来搜索给定的文本。为了我使用grep功能:
grep -i "my_regex"@H_301_2@这样可行。但是给出这样的数据:
This is the test data This is the error data as follows . . . . . . . . . . . . . . . . . . . . . . Error data ends@H_301_2@一旦我找到单词错误(使用grep -i错误数据),我希望找到跟随单词error的10行。所以我的输出应该是:
. . . . . . . . . . . . . . . . . . . . . . Error data ends@H_301_2@有什么办法吗?