mailwatch script wanted

Jerry Peek jerryp at tektools.UUCP
Sat Jul 20 01:09:58 AEST 1985


[Doesn't this sort of thing belong in net.unix?]

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.

--Jerry Peek, UNIX Training Instructor, Tektronix, Inc.
US Mail:    MS 74-222, P.O. Box 500, Beaverton, OR 97077
uucp:       {allegra,decvax,hplabs,ihnp4,ucbvax}!tektronix!tektools!jerryp
CS,ARPAnet: jerryp%tektools at tektronix.csnet
Phone:      503/627-1603



More information about the Comp.unix.wizards mailing list