Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

2
  • IMHO pcregrep -M is more suitable than trying to force grep to do multiline matches using -z Commented Feb 18, 2017 at 23:27
  • This may be the case. I haven’t tested because pcregrep is not installed on my machine by default and I’m reluctant to install new software if I need it in just one tiny script. With vatsug’s help I’ve found a solution that fits my needs.@steeldriver Commented Feb 19, 2017 at 11:51