Language Bourne Shell
Date: | 04/20/05 |
Author: | Craig J. Copi |
URL: | n/a |
Comments: | 0 |
Info: | n/a |
Score: | (2.91 in 11 votes) |
#!/bin/sh # Bourne shell version of 99 Bottles # Craig J Copi - copi@oddjob.uchicago.edu # if [ $# -eq 1 ]; then beers=$1 else beers=99 fi s="s" while [ $beers -gt 0 ]; do echo "$beers bottle$s of beer on the wall," echo "$beers bottle$s of beer," echo "take one down, pass it around," beers=`expr $beers - 1` if [ $beers -ne 0 ]; then test $beers -eq 1 && s="" echo "$beers bottle$s of beer on the wall." else echo "no bottles of beer on the wall." fi echo done echo echo "Time to buy some more beer . . . ."
Download Source | Write Comment
Alternative Versions
Version | Author | Date | Comments | Rate |
---|---|---|---|---|
small pieces loosely joined | anonymous | 03/14/06 | 0 | |
Gramatically correct | Jeff Popp | 06/14/07 | 2 |
Download Source | Write Comment
Add Comment
Please provide a value for the fields Name,
Comment and Security Code.
This is a gravatar-friendly website.
E-mail addresses will never be shown.
Enter your e-mail address to use your gravatar.
Please don't post large portions of code here! Use the form to submit new examples or updates instead!
Comments