rc-list - mailing list for the rc(1) shell
 help / color / mirror / Atom feed
* biff?
@ 1991-06-28 20:19 Byron Rakitzis
  1991-06-28 20:30 ` biff? Mark-Jason Dominus
  0 siblings, 1 reply; 2+ messages in thread
From: Byron Rakitzis @ 1991-06-28 20:19 UTC (permalink / raw)
  To: rc


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...


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~1991-06-28 20:39 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1991-06-28 20:19 biff? Byron Rakitzis
1991-06-28 20:30 ` biff? Mark-Jason Dominus

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).