#
# mailwatcher (c) s. manoharan edinburgh u
#             sam@lfcs.edinburgh.ac.uk
# 

onintr - ;
set username = `whoami`;
set oldmailsize = 0;
set alert = "";

while ( 1 )
   set newmailsize = `wc -c < /usr/spool/mail/$username`;

   if ( $newmailsize > $oldmailsize ) then
      echo $alert;
      echo "You have new mail";
      from;
   endif 
   set oldmailsize = $newmailsize;
   sleep 60;
end

