Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/5/84; site kitty.UUCP Path: utzoo!watmath!sunybcs!kitty!larry From: larry@kitty.UUCP (Larry Lippman) Newsgroups: net.unix-wizards Subject: Re: Re: mailwatch script wanted Message-ID: <160@kitty.UUCP> Date: Fri, 26-Jul-85 17:09:14 EDT Article-I.D.: kitty.160 Posted: Fri Jul 26 17:09:14 1985 Date-Received: Sat, 27-Jul-85 03:42:48 EDT References: <411@sdcc12.UUCP> <319@tektools.UUCP> Organization: Recognition Research Corp., Clarence, NY Lines: 31 > In article <411@sdcc12.UUCP> wa371@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?"