your terminal sings

echo {1..199}" bottles of beer on the wall, cold bottle of beer, take one down, pass it around, one less bottle of beer on the wall,, " | espeak -v english -s 140
you know the song... sing along
Sample Output
one bottle of beer on the wall, cold bottle of beer...!

21
By: op4
2010-02-04 04:38:52

What Others Think

My version: (g=echo;s=s;n="o more";o="bottle";e="of beer";a="Take one down and pass it around";w="on the wall";for ((i=99;i>0;i--));do [ $i == 1 ]&&unset s;$g -n "$i $o$s $e $w, $i $o$s $e. $a, `[ $[i-1] != 0 ]&&$g $[i-1]||$g "n$n"` $o`[ $i != 2 ]&&$g s` $e $w. ";done;$g -ne "N$n ${o}s $e $w, n$n ${o}s $e. Go to the store and buy some more, 99 ${o}s $e $w.")|espeak -v english -s 140
eightmillion · 458 weeks and 5 days ago
Para los hispanoparlantes: echo {1..199}" elefantes se balanceaban sobre la tela de una ara?a, como ve?an que no se ca?an, fueron a llamar a otro elefante,, " | espeak -v spanish -s 140
kutus · 458 weeks and 4 days ago
You're supposed to count down in hex...
SuperFly · 458 weeks and 4 days ago
For OSX, substitute espeak with say: (g=echo;s=s;n="o more";o="bottle";e="of beer";a="Take one down and pass it around";w="on the wall";for ((i=99;i>0;i--));do [ $i == 1 ]&&unset s;$g -n "$i $o$s $e $w, $i $o$s $e. $a, `[ $[i-1] != 0 ]&&$g $[i-1]||$g "n$n"` $o`[ $i != 2 ]&&$g s` $e $w. ";done;$g -ne "N$n ${o}s $e $w, n$n ${o}s $e. Go to the store and buy some more, 99 ${o}s $e $w.")| say
antic · 458 weeks and 4 days ago
... you just made my day really average.... remind me to post this on MLIA :)
GinoMan2440 · 458 weeks and 4 days ago
echo "salue, amice, ut uales?" | espeak -v latin -s 140
bubo · 458 weeks and 3 days ago
Sing it in Hexadecimal: s=s;n="o more";o="bottle";e="of beer";a="Take one down and pass it around";w="on the wall";for ((i=255;i>0;i--)); do [ $i == 1 ] && unset s; ihex=$(echo "obase=16; $i" | bc); echo "$ihex $o$s $e $w, $ihex $o$s $e. $a, `[ $[i-1] != 0 ] && echo $(echo "obase=16; $[i-1]" | bc) || echo "n$n"` $o`[ $i != 2 ] && echo s` $e $w. ";done;echo -e "N$n ${o}s $e $w, n$n ${o}s $e. Go to the store and buy some more, FF ${o}s $e $w."
SuperFly · 458 weeks and 3 days ago
This works better, but can we do it in less that 255 characters? s=s;n="o more";o="bottle";e="of beer";a="Take one down and pass it around";w="on the wall";for ((i=255;i>0;i--));do [ $i == 1 ] && unset s;ihex=$(echo "obase=16; $i" | bc);echo "$ihex $o$s $e $w, $ihex $o$s $e. $a, `[ $[i-1] != 0 ] && echo $(echo "obase=16; $[i-1]" | bc) || echo "n$n"` $o`[ $i != 2 ] && echo s` $e $w. ";done;echo -e "N$n ${o}s $e $w, n$n ${o}s $e. Go to the store and buy some more, FF ${o}s $e $w."
SuperFly · 458 weeks and 3 days ago
echo {99..1}" bottles...
dennisw · 458 weeks and 2 days ago
As Antic said, on the mac substitute "espeak" with "say", but add the Cellos voice: echo {1..199}" bottles of beer on the wall, cold bottle of beer, take one down, pass it around, one less bottle of beer on the wall.. " | say -v Cellos Here a list of other voices you can play with on a mac: Female Voices say -v Agnes "hello world" say -v Kathy "hello world" say -v Princess "hello world" say -v Vicki "hello world" say -v Victoria "hello world" Male Voices say -v Bruce "hello world" say -v Fred "hello world" say -v Junior "hello world" say -v Ralph "hello world" Novelty Voices say -v Albert "hello world" say -v "Bad News" "hello world" say -v Bahh "hello world" say -v Bells "hello world" say -v Boing "hello world" say -v Bubbles "hello world" say -v Cellos "hello world" say -v Deranged "hello world" say -v "Good News" "hello world" say -v Hysterical "hello world" say -v "Pipe Organ" "hello world" say -v Trinoids "hello world" say -v Whisper "hello world" say -v Zarvox "hello world"
netsaint · 458 weeks ago
Is there something like the voice "Cellos" but in Spanish?
gloaiza · 114 weeks and 5 days ago

What do you think?

Any thoughts on this command? Does it work on your machine? Can you do the same thing with only 14 characters?

You must be signed in to comment.

What's this?

commandlinefu.com is the place to record those command-line gems that you return to again and again. That way others can gain from your CLI wisdom and you from theirs too. All commands can be commented on, discussed and voted up or down.

Share Your Commands



Stay in the loop…

Follow the Tweets.

Every new command is wrapped in a tweet and posted to Twitter. Following the stream is a great way of staying abreast of the latest commands. For the more discerning, there are Twitter accounts for commands that get a minimum of 3 and 10 votes - that way only the great commands get tweeted.

» http://twitter.com/commandlinefu
» http://twitter.com/commandlinefu3
» http://twitter.com/commandlinefu10

Subscribe to the feeds.

Use your favourite RSS aggregator to stay in touch with the latest commands. There are feeds mirroring the 3 Twitter streams as well as for virtually every other subset (users, tags, functions,…):

Subscribe to the feed for: