home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 October / usenetsourcesnewsgroupsinfomagicoctober1994disk2.iso / misc / volume7 / mailwatcher / mailwatcher.csh < prev    next >
Encoding:
Text File  |  1989-07-21  |  402 b   |  23 lines

  1. #
  2. # mailwatcher (c) s. manoharan edinburgh u
  3. #             sam@lfcs.edinburgh.ac.uk
  4.  
  5. onintr - ;
  6. set username = `whoami`;
  7. set oldmailsize = 0;
  8. set alert = "";
  9.  
  10. while ( 1 )
  11.    set newmailsize = `wc -c < /usr/spool/mail/$username`;
  12.  
  13.    if ( $newmailsize > $oldmailsize ) then
  14.       echo $alert;
  15.       echo "You have new mail";
  16.       from;
  17.    endif 
  18.    set oldmailsize = $newmailsize;
  19.    sleep 60;
  20. end
  21.  
  22.