Checking for new mail (and killing bkgnd process on logout?)

Brad Morrison morrison at ficc.uu.net
Thu Aug 31 07:54:41 AEST 1989


In article <128 at isgtec.UUCP>, bmw at isgtec.UUCP (Bruce Walker) writes:
> You are supposed to start it like this (usually from .login):

> 	$ checkmail&

> My (slightly klugey) solution is to add a line to my .logout (csh):

> 	/bin/kill -9 `ps x | awk '$5=="checkmail" {print $1}'`&

> Anyone know a better way?

At the beginning of your program, use signal() (Read The Fine Manual)
to trap SIGHUP.

Also, you could fork() before the main control loop, so the program will
go into the background by itself.

Newsgroup comp.unix.wizards removed from distribution.
-- 
Brad Morrison                (713) 274-5449 | "If it doesn't come from you,
Ferranti International Controls Corporation |  shouldn't it come from Gerber?"
uunet!ficc!morrison    morrison at ficc.uu.net |  -- Bristol Meyers baby formula ad



More information about the Comp.unix.xenix mailing list