Add blank line after every result in grep

前端 未结 7 2011
北荒
北荒 2020-12-14 18:24

my grep command looks like this zgrep -B bb -A aa \"pattern\" *

I would lke to have output as:

file1:line1
file1:line2
file1:line3
file1:pattern
file         


        
7条回答
  •  孤街浪徒
    2020-12-14 19:07

    I can't test it with the -A and -B parameters so I can't say for sure but you could try using sed G as mentioned here on Unix StackEx. You'll loose coloring though if that's important.

提交回复
热议问题