rc-list - mailing list for the rc(1) shell
 help / color / mirror / Atom feed
From: Byron Rakitzis <byron>
To: rc
Subject: biff?
Date: Fri, 28 Jun 1991 15:19:15 -0500	[thread overview]
Message-ID: <91Jun28.151927cdt.22542@archone.tamu.edu> (raw)


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


             reply	other threads:[~1991-06-28 20:19 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1991-06-28 20:19 Byron Rakitzis [this message]
1991-06-28 20:30 ` biff? Mark-Jason Dominus

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=91Jun28.151927cdt.22542@archone.tamu.edu \
    --to=rc@hawkwind.utcs.toronto.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).