It's a standard trick :-) Messages in these files are separated by "From " lines (notice the space). Why do you use less? You can supply the file name to grep:
egrep -c '^From ' /var/spool/mail/USERNAME I'm not familiar with pine. Have you checked it's docs? It sounds like a trivial question. Cheers, --Amos > -----Original Message----- > From: Ishai Parasol > [mailto:[EMAIL PROTECTED]] > Sent: Sunday, December 29, 2002 10:26 AM > To: [EMAIL PROTECTED] > Subject: counting emails and pine questions > > > Hi > > I'm looking for a way to know (using the command line) the > number of emails > that a /var/spool/mail/USERNAME file contains. Right now I'm > using "less > /var/spool/mail/USERNAME | grep -c Subject: ", but it's not > accurate enough > (cases of forwarded mails etc.). Any better ideas ? > > Another question. Is it possible to run pine with another > user email file > (/var/spool/mail/USER) ? for example, I'm logged as root and > want to read > USER2 emails (ofcourse, USER2 can't login, he's only a mail > account and not > a "full user"). If it's impossible with pine, is there a > client (not for X) > that can do it ? > > Thanks, > Ishai. > > > > ================================================================= > To unsubscribe, send mail to [EMAIL PROTECTED] with > the word "unsubscribe" in the message body, e.g., run the command > echo unsubscribe | mail [EMAIL PROTECTED] > > > > ---------- Your email is protected by Mailshell ---------- > As you requested, this email was forwarded to you by Mailshell. > Mailshell will forward your replies to this email and keep your > private email address safe. > > To unsubscribe safely and easily using Mailshell or to stop > forwarding: > http://www.mailshell.com/control.html?a=blshp8bbumg87yq1j9157q v2pz6_58z35eg0 FreshAddress.com http://rd.mailshell.com/ad482 Earn up to $3 for each of your friends who signs up with Mailshell! http://rd.mailshell.com/sp5 ================================================================= To unsubscribe, send mail to [EMAIL PROTECTED] with the word "unsubscribe" in the message body, e.g., run the command echo unsubscribe | mail [EMAIL PROTECTED]