can we use egrep?
egrep "subject1|subject2"
SoloCDM wrote:
>
> Mike McNally wrote:
> >
> > grep 'subject1.*subject2'
>
> With this lineup, one must know the exact order of the subjects.
> Having more than two subjects and lining them correctly will get
> tedious, time consuming, and make script construction more involved.
>
> > -----Original Message-----
> > From: SoloCDM
> >
> > While using grep, what is the best way to search for two subjects
> > within the same line instead of the following?
> >
> > cat <filename> | grep <subject_one> | grep <subject_two>
> >
> > This is not an "or" search with "-e", but an "and" search.
>
> The problem I'm up against is contingent on another issue --
> insensitive casing. Sed does a great job of finding things (without
> any set order), but is heavily reliant on casing. Grep has the "-i"
> option that rules out all case contingencies.
>
> I know I could pipe input through tr '[:upper:]' '[:lower:]' for
> sed, but one more command makes it lengthy and it also distorts the
> output -- making it unreliable.
>
> Note: Detailed Document(s) and Sample(s) are more than welcome!
> When you reply to this message, please include
> the mailing list and my address.
>
> *************************************************************************
> Signed,
> SoloCDM
>
> --
> To unsubscribe: mail [EMAIL PROTECTED] with "unsubscribe"
> as the Subject.
--
To unsubscribe: mail [EMAIL PROTECTED] with "unsubscribe"
as the Subject.