On Sun, 2 Jul 2000, Anthony E. Greene wrote:
> SoloCDM wrote:
> >
> > While using grep, what is the best way to search for two subjects
> > within the same line instead of the following?
> >
> > cat | grep | grep
> >
> > This is not an "or" search with "-e", but an "and" search.
>
> grep
SoloCDM wrote:
>
> While using grep, what is the best way to search for two subjects
> within the same line instead of the following?
>
> cat | grep | grep
>
> This is not an "or" search with "-e", but an "and" search.
grep "^Subject:.*subject1.*subject2" filename
--
Anthony E. Greene <[E
I'm not sure what you are trying to achieve exactly, but this is easily
done is a short perl script.
You cannot do what you are asking without invoking grep twice.
charles
On Mon, 3 Jul 2000, SoloCDM wrote:
>
> The problem I'm up against is contingent on another issue --
> insensitive casing.
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 scri
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
SoloCDM wrote:
> While using grep, what is the best way to search for two subjects
> within the same line instead of the following?
>
> cat | grep | grep
>
> This is not an "or" search with "-e", but an "and" search.
something like :
grep subject1.+subject2 filename
I belive this say grep al
While using grep, what is the best way to search for two subjects
within the same line instead of the following?
cat | grep | grep
This is not an "or" search with "-e", but an "and" search.
Note: Detailed Document(s) and Sample(s) are more than welcome.
When you reply to this message,