At 09:29 AM 6/13/97 +0300, era eriksson wrote:
[snip]
I almost wrote | fgrep foo | fgrep bar but unfortunately, it's not
quite that simple. (BOY do I feel stupid today. :-) If you can live
with an invocation of Perl for each message received, this should do:
:0:
* ? formail -k -XSubject: | \
perl -0777 -ne 'exit 1 unless (/foo/ and /bar/)'
folder
It can probably be coded with tr and sed or awk instead of Perl, but
don't ask me about that right now. Thank you.
FYI, here's an awk version:
:0:
* ? formail -k -XSubject: | \
awk '/foo/{foo=1} /bar/{bar=1} END{exit (foo+bar!=2)}'
folder
Cheers,
Stan