Show if I have new mail in .profile ?

Is there any way to script it to tell me if I have new mail when I log-in? I'm using the bash shell.

It's showing up now already but I want to put a clear in my .profile to clear the screen of the disclaimer I've seen 1000 times, I have a few echo's and a command to list the number of users currently on the system.

If I knew where the file was that showed that disclaimer i could copy the code to display if I have new e-mails or not.

I'm mainly doing this to learn, I know there's an easy way out and just not put a clear in my .profile, but I'd rather learn more about scripting. :smiley:

Ok, what I came up with is

grep -c "Message-Id" /usr/mail/[myusername]

To get the count of message-id's, that doesn't mean 'new' but it will give me a 'list' of the e-mails in my inbox.

mailx -e 

does nothing if there is no new mail.

Doesn't do anything for me, new mail or not. I'll look into the command though, thank you.