[comp.sys.ibm.pc.rt] Mail reception notification in 'csh'.

francis@hslrswi.UUCP (Francis Demierre) (01/05/89)

I'm having a little problem with notification of new mail
arrival (Aix 2.2 is used).

I have two userid's on the machine for different tasks, one is 'fd1'
and the other is 'fd2'. The different login described here are for
'fd1'.

At the first few days, I was using the 'Bourne shell' as my login shell
and had the following setup in my '.profile' script: 

MAILMSG="[New mail has arrived]^G"
MAIL=/usr/mail/$LOGNAME 		# mailbox location
MAILPATH=$MAIL'%[^GNEW MAIL FOR fd1^G]:/usr/mail/fd2%[^GNEW MAIL FOR fd2^G]'
MAILCHECK=60
export MAILMSG MAIL MAILPATH MAILCHECK 

This worked perfectly and I was notified when new mail arrived for me.

Then, I changed my login shell to be '/bin/csh' and included the
following in my '.login' script:

setenv MAILMSG "[New mail has arrived]^G"
setenv MAIL /usr/mail/$LOGNAME 		# mailbox location
setenv MAILPATH $MAIL'%[^GNEW MAIL FOR fd1^G]:/usr/mail/fd2%[^GNEW MAIL FOR fd2^G]'
setenv MAILCHECK 60

Since that time, I never get notified when new mail arrives for me.

Is the 'mail check' only supported by the '/bin/sh' program ? Am I missing
something in my '.login' script ? Are there different environment varibles
for this in 'csh' ?

Any help will be appreciated. Thanks.

+- - - - - - - - - - - - - - - - - - - - - - - - - - - +
+  Francis Demierre,  M400: demierre@sba.kom.hasler    +
+  Bitnet: francis%hslrswi.UUCP@cernvax.BITNET         +
+  UUcp: {uunet,ukc,mcvax...}!cernvax!hslrswi!francis  +
+- - - - - - - - - - - - - - - - - - - - - - - - - - - +

roe@unibase.UUCP (Roe Peterson) (01/12/89)

From article <873@hslrswi.UUCP>, by francis@hslrswi.UUCP (Francis Demierre):
> I'm having a little problem with notification of new mail
> arrival (Aix 2.2 is used).
> 
> At the first few days, I was using the 'Bourne shell' as my login shell
> and had the following setup in my '.profile' script: 
[ script for sh deleted ]
[ this in .login/.profile ]
> 
> setenv MAILMSG "[New mail has arrived]^G"
> setenv MAIL /usr/mail/$LOGNAME 		# mailbox location
> setenv MAILPATH $MAIL'%[^GNEW MAIL FOR fd1^G]:/usr/mail/fd2%[^GNEW MAIL FOR fd2^G]'
> setenv MAILCHECK 60
> 
> Since that time, I never get notified when new mail arrives for me.

Not surprising - the csh isn't paying any attention to those environment
variables.  Get rid of all the MAIL environment (setenv) variables (unless
you regularly fork a sh from csh) and try:

	set mail=(60 /usr/mail/fd1 /usr/mail/fd2)

in your .cshrc file.

BTW, most csh's don't support customized messages for mail annunciation.
They just say 'You have new mail.'

Remember that the csh DOES NOT use environment variables to control
internal functions; it uses 'local' variables.

-- 

                                  Roe Peterson
                                  uunet!attcan!utgpu!tmsoft!mcl!unibase!roe