Re: [Nolug] grepping multiple strings

From: Ron Johnson <ron.l.johnson_at_cox.net>
Date: 03 Mar 2003 14:13:12 -0600
Message-Id: <1046722391.11427.22.camel@haggis>

On Mon, 2003-03-03 at 13:53, Andrew S. Johnson wrote:
> On Monday 03 March 2003 01:14 pm, Scott Harney wrote:
> > "Andrew S. Johnson" <andy@asjohnson.com> writes:
> >
> > > How about egrep "this.*that|that.*this". Worked for me.
> >
> > Doesn't scale too well beyond two search terms though, does it?
>
> No, but maybe the example will be useful for someone.
>
> > Believe it or not, I deliberately ignored doing that example in my
> > reply for this reason. I very frequently do things like:
> >
> > $ grep pattern1 /var/log/logfile | grep -v ignorepattern1 \
> > | grep -v ignorepattern2 | less
>
> This is usually what I do, with the occaisional sed and/or awk
> thrown in for good measure.
>
> This is similar to the difference between a leatherman and
> a toolbox. While in theory the leatherman gives you all the
> implements in one single compact package, separate tools
> are actually easier to use. If I start hinting now for the

But using the same tool over and over again can get kinda old.

In this case, piping thru grep over and over gets kinda old, and
is way excess typing.

-- 
+-----------------------------------------------------------+
| Ron Johnson, Jr.     Home: ron.l.johnson@cox.net          |
| Jefferson, LA  USA   http://members.cox.net/ron.l.johnson |
|                                                           |
| The difference between Rock&Roll and Country Music?       |
| Old Rockers still on tour are pathetic, but old Country   |
| signers are still great.                                  |
+-----------------------------------------------------------+
___________________
Nolug mailing list
nolug@nolug.org
Received on 03/03/03

This archive was generated by hypermail 2.2.0 : 12/19/08 EST