From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from pertsserver.cs.uiuc.edu ([128.174.247.69]) by hawkwind.utcs.utoronto.ca with SMTP id <24658>; Thu, 1 May 1997 21:19:02 -0400 Received: (from mkgardne@localhost) by pertsserver.cs.uiuc.edu (8.8.5/8.8.5) id QAA09988; Thu, 1 May 1997 16:13:39 -0500 (CDT) Date: Thu, 1 May 1997 17:13:39 -0400 Message-Id: <199705012113.QAA09988@pertsserver.cs.uiuc.edu> From: "Mark K. Gardner" To: rc@hawkwind.utcs.toronto.edu Subject: re: 99 bottles in an rc shell script. Reply-to: mkgardne@cs.uiuc.edu I had to join in the fun (even though I don't drink beer). This one not only drinks beer, it also eats CPU. (You get a test mode free of charge by typing "beer ". It may or may not use builtins exclusively... depending on your philosophy.) -- Mark K. Gardner (mkgardne@cs.uiuc.edu) University of Illinois at Urbana-Champaign Real-Time Systems Laboratory -- === File: beer === #!/bin/rc # rc shell version of 99 bottles of beer # by Tom Culliton (culliton@clark.net) # revised by Mark Gardner (mkgardne@cs.uiuc.edu) # Supply the path to this script... again = `{pwd}^/beer if (~ $#* 0) { count = 99 } else { count = $1 } bottles = bottles; one = one if (! ~ $count 0) { if (~ $count 1) {bottles = bottle; one = it} if (! ~ $count 99) { echo $count $bottles 'of beer on the wall.' echo } echo $count $bottles 'of beer on the wall,' echo $count $bottles 'of beer,' echo 'take' $one 'down and pass it around,' $again `{expr $count - 1} } else { echo 'no more bottles of beer on the wall!' }