mailwatch script wanted

Larry Lippman larry at kitty.UUCP
Sat Jul 27 07:09:14 AEST 1985


> In article <411 at sdcc12.UUCP> wa371 at sdcc12.UUCP (Bernd) writes:
> > Does anyone have a suggestion for a shell script for my .login
> > file, which will announce immediately upon login whether I have mail
> > or not, without putting me into the mail program if I don't want 
> > to be.
> > It should run under the 4.2 c-shell.
> 
> Try this single line:
> 
> 	if (! -z /usr/spool/mail/wa371) echo You have mail.
> 
> Instead of hardcoding your login name (wa371), you could use $user instead.

Here is an alternative to the above which does not require knowing the mail
spool path and file names:

	if (mail -e) echo 'You have mail.'

The -e option should also be good for 'mailx' if that is what is on your
machine.

	Larry Lippman
	Recognition Research Corp.
	Clarence, New York
	UUCP	{decvax,dual,rocksanne,rocksvax,watmath}!sunybcs!kitty!larry
		{rice,shell}!baylor!kitty!larry
		syr!buf!kitty!larry
	VOICE	716/741-9185
	TELEX	{via WUI} 69-71461 answerback: ELGECOMCLR

	"Have you hugged your cat today?"



More information about the Comp.unix.wizards mailing list