rc-list - mailing list for the rc(1) shell
 help / color / mirror / Atom feed
* beer bottles
@ 1997-05-01  1:39 rsc
  0 siblings, 0 replies; only message in thread
From: rsc @ 1997-05-01  1:39 UTC (permalink / raw)
  To: rc

a slightly better version

#!/bin/rc
# rc shell version of 99 bottles of beer
# by Tom Culliton (culliton@clark.net)
# revised by Russ Cox (rsc@research.att.com)

bottles = bottles; one = one
digits = (9 8 7 6 5 4 3 2 1)
for(i in $digits '') for(j in $digits 0) { 
	n = $i$j
	if(! ~ $n 0) {
		if(~ $n 1) { bottles = bottle; one = it }
		if(! ~ $n 99) {
			echo $n $bottles 'of beer on the wall.'
			echo
		}
		echo $n $bottles 'of beer on the wall,'
		echo $n $bottles 'of beer,'
		echo 'take' $one 'down and pass it around,'
	}
}


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~1997-05-01  6:47 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1997-05-01  1:39 beer bottles rsc

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