[Tutor] Matching problem....

Deirdre Saoirse deirdre@deirdre.net
Thu, 7 Oct 1999 16:29:45 -0700 (PDT)


I'm working on a silly project -- an APOP server -- <cough> and I'm having
a problem coming up with an equivalent to the following command line. I'd
rather not just have this as a commands.getstatusoutput() (which I could
do and is in fact what I'm doing now...)

cat /var/spool/mail/deirdre | grep ^From\  | wc

or, for you egrep fans:

egrep '^From\ ' /var/spool/mail/deirdre | wc

What I want is ONLY the count of the matches. I don't, at this point, care
a hoot about the matches themselves. That comes later. :)

I'm *also* interested in the following:

egrep '^From\ ' /var/spool/mail/deirdre -b

...but at a different point in time. :)

-- 
_Deirdre   *   http://www.linuxcabal.net   *   http://www.deirdre.net
"Mars has been a tough target" -- Peter G. Neumann, Risks Digest Moderator
"That's because the Martians keep shooting things down." -- Harlan Rosenthal
<Harlan.Rosenthal@Dialogic.com>, retorting in Risks Digest 20.60