Re: [Nolug] grepping multiple strings

From: Scott Harney <scotth_at_scottharney.com>
Date: Mon, 03 Mar 2003 12:38:35 -0600
Message-ID: <8765r0cn2s.fsf@zenarcade.local.lan>

"Andrew S. Johnson" <andy@asjohnson.com> writes:

>> Thanks. I wonder why egrep doesn't have an "and" operator also. That
>> seems like a big oversight.
>
> Actually, you could include a wildcard ".*" in your search string, which means
> any number of any characters match. Try this: egrep "this.*that" filenames.
> Isn't this AND?

Not exactly. The words must be in the given order. In other words,
you'll catch "this and that" but not "that and this" in our example.
I figure he wants a true 'and' where both terms are captured
regardless of the order. But don't believe me; try it!

-- 
Scott Harney<scotth@scottharney.com>
"...and one script to rule them all."
___________________
Nolug mailing list
nolug@nolug.org
Received on 03/03/03

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