Skip to content

Instantly share code, notes, and snippets.

@stinethebean3
Created August 12, 2014 05:01
Show Gist options
  • Select an option

  • Save stinethebean3/e643e4032d3b3d0dce75 to your computer and use it in GitHub Desktop.

Select an option

Save stinethebean3/e643e4032d3b3d0dce75 to your computer and use it in GitHub Desktop.
Writes the lyrics to the Bottles of Beer on the Wall song
#!/bin/bash
i=99 s=s
while [ $i -gt 0 ]; do
p="bottle"
p2="of beer"
p3="on the wall"
echo $i $p$s $p2 $p3
echo $i $p$s $p2
i=`expr $i - 1`
[ $i -eq 1 ] && s= || s=s
echo "Take one down, pass it around"
if [ $i -eq 0 ]; then
echo "No more bottles of beer on the wall"
else
echo $i $p$s $p2 $p3
fi
echo " "
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment