mailwatch script wanted

Chris Torek chris at umcp-cs.UUCP
Wed Jul 31 08:43:15 AEST 1985


I might note that our systems (and 4.3BSD) print

	You have mail.

or

	You have new mail.

when you log in, if you have mail or new mail.  We put this in login.c
long ago.  The code is basically something like this:

	struct stat st;
	...
	sprintf(buf, "%s/%s", MAILDIR, pwd->pw_name);
	if (stat(buf, &st) == 0)
		printf("You have %smail.\n",
		    st.st_mtime > st.st_atime ? "new " : "");
-- 
In-Real-Life: Chris Torek, Univ of MD Comp Sci Dept (+1 301 454 4251)
UUCP:	seismo!umcp-cs!chris
CSNet:	chris at umcp-cs		ARPA:	chris at maryland



More information about the Comp.unix.wizards mailing list