[svlug] extended grep reg exp

Ivan Sergio Borgonovo mail at webthatworks.it
Tue Aug 12 19:31:22 PDT 2003

On Tue, Aug 12, 2003 at 01:43:10PM -0700, Mark S Bilk wrote:

> I don't recall any regexp for a numerical span.  The square brackets

No, but with the right tool:

sed -ne '/regexp/,+Np' file
sed -ne '/regexp/,+N!p' file

depending if you want to extract or delete.

where N is the number of consecutive line you want to print once regexp has been found.

More information about the svlug mailing list