Make all the cows tell a fortune

echo 'Dir.foreach("/usr/local/Cellar/cowsay/3.03/share/cows") {|cow| puts cow; system "fortune | cowsay -f /usr/local/Cellar/cowsay/3.03/share/cows/#{cow}" }' | ruby
Shows a list of all installed cows saying a fortune. Also lists the cows names. Pic your favorite cow! Needs cowsay, fortune and ruby installed. The path only applies to OS X with cowsay installed using homebrew. On Linux it might be /usr/share/cowsay/cows/ or similar. Uses ruby just because.
Sample Output
/ One can't proceed from the informal to \
\ the formal by formal means.            /
       |o_o |
       |:_/ |
      //   \ \
     (|     | )
    /'\_   _/`\

/ Living in New York City gives people \
| real incentives to want things that  |
| nobody else wants.                   |
|                                      |
\ -- Andy Warhol                       /
   \    (__)
        o o\
       ('') \---------
          \           \
           |          |\
           ||---(  )_|| *
           ||    UU  ||
           ==        ==

By: orkoden
2013-04-15 12:27:38

What Others Think

This is one of the best ways to make all the cows tell a fortune. This is great content, and I will write one of my city cv reviews about this now. I hope it will turn out great, and people will appreciate it.
WalkerNolan · 35 weeks and 4 days ago
Thanks for sharing this kind of article. Economics Tuition
bolinchen · 22 weeks and 3 days ago
Great article posted by the blog admin. Economics Tuition
besteconstuition · 22 weeks and 2 days ago
Top-quality articles are posted here. Economics Tuition
bingwentan · 22 weeks and 2 days ago
Thanks for sharing these wonderful articles with us. Financial Statements
ykglobal · 7 weeks and 2 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? 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.


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: