rc-list - mailing list for the rc(1) shell
 help / color / mirror / Atom feed
From: rsc@research.att.com
To: rc@hawkwind.utcs.toronto.edu
Subject: beer bottles
Date: Wed, 30 Apr 1997 21:39:07 -0400	[thread overview]
Message-ID: <97May1.024702edt.24650@hawkwind.utcs.utoronto.ca> (raw)

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,'
	}
}


                 reply	other threads:[~1997-05-01  6:47 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=97May1.024702edt.24650@hawkwind.utcs.utoronto.ca \
    --to=rsc@research.att.com \
    --cc=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).