From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from plan9.research.att.com ([135.205.33.187]) by hawkwind.utcs.utoronto.ca with SMTP id <24650>; Thu, 1 May 1997 02:47:02 -0400 From: rsc@research.att.com To: rc@hawkwind.utcs.toronto.edu Date: Wed, 30 Apr 1997 21:39:07 -0400 Subject: beer bottles Message-Id: <97May1.024702edt.24650@hawkwind.utcs.utoronto.ca> 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,' } }