From mboxrd@z Thu Jan 1 00:00:00 1970 Received: by archone.tamu.edu id <22542>; Fri, 28 Jun 1991 15:19:27 -0500 From: Byron Rakitzis To: rc Subject: biff? Message-Id: <91Jun28.151927cdt.22542@archone.tamu.edu> Date: Fri, 28 Jun 1991 15:19:15 -0500 I got sick of xbiff; both the annoying beep, and the ugly icon, and I decided to replace it with the sweeter sound of a bell- chime that I have for my sparcstation. Here's the rc script that does the job: #!/bin/rc if (! ~ `{arch -k} sun4c) # Are we on a sparcstation? exit exec >[2] /dev/null # Throw away errors from ls mail=/usr/spool/mail/`whoami fn getsize { # Get the size of $mail in bytes size = `{ls -l $mail} size = $size(4) if (~ $#size 0) # No output from ls? size = 0 $1 = $size } fn ring { play -v 30 $h/lib/doorbell.au echo Mail received at `date > /dev/console } old = 0 while () { getsize new if (test $new -gt $old) { ring old = $new } else if (test $old -gt $new) { old = $new } sleep 10 } There's not much here that's rc specific, except that I don't have to call sed or awk in order to figure out the size of $mail. I thought it was cute...