[svlug] extended grep reg exp

Rick Schultz bloodyvikings at sbcglobal.net
Tue Aug 12 13:48:39 PDT 2003


On Tue, Aug 12, 2003 at 01:21:03PM -0700, Robert Khachikyan wrote:

> you get the idea. I want to grep a portion of it out.
> Let's say from 3918403 -> 3928404 (10001 lines).

What you're trying to do is slightly more complex than a regular
expression match.  You're not looking for a particular pattern on any
line, you're looking for two patterns, and you want to remove the lines
in between.  This is easy in perl or awk.

$ perl -ne 'print unless (/3918403/ ... /3928404/);' < filename

HTH,
rick




More information about the svlug mailing list