Re: [Nolug] grepping multiple strings

From: Ron Johnson <ron.l.johnson_at_cox.net>
Date: 03 Mar 2003 20:58:52 -0600
Message-Id: <1046746732.11427.28.camel@haggis>

On Mon, 2003-03-03 at 15:00, Andrew S. Johnson wrote:
> On Monday 03 March 2003 02:13 pm, Ron Johnson wrote:
> > 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.
>
> I suppose, but if you've ever replaced a transmission youself
> (vs. spending $k's for someone else to do it) you know that all the
> bolts holding the bell housing to the block are the same size.
> Ratcheting all those bolts is repetitive to be sure, but is sure is
> convenient that one tool will do them all, esp. when you're laying
> under the car.

I think that a more relevant analogy would be:
- the current "standard" method of "and"ing (via multiple greps") is
  like ratcheting each bolt on one at a time.
- a *better* tool would be one that ratchets *all* the bolts on at the
  same time, while still being simple to use.

> Can I be a gear head and a chip head at the same time?

-- 
+-----------------------------------------------------------+
| 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