Do not merge the context of contiguous matches with grep
问题 If I run grep -C 1 match over the following file: a b match1 c d e match2 f match3 g I get the following output: b match1 c -- e match2 f match3 g As you can see, since the context around the contiguous matches "match2" and "match3" overlap, they are merged. However, I would prefer to get one context description for each match, possibly duplicating lines from the input in the context reporting. In this case, what I would like is: b match1 c -- e match2 f -- f match3 g What would be the best