Search

cowsay: a configurable talking and thinking cow

October 28th, 2007 by Alexey Beshenov

Article submitted by Alexey Beshenov. We are running out of articles! Please help DPOTD and submit good articles about software you like!

Cowsay is a useless but very fun text filter written in Perl. If you send some text into cowsay, you get an ASCII cow saying your text. For example, cowsay Hello, World! prints

 _______________
< Hello, World! >
 ---------------
        \   ^__^
         \  (oo)\_______
            (__)\       )\/\
                ||----w |
                ||     ||

To get a thinking cow, run cowthink:

$ cowthink Hello, World!
 _______________
( Hello, World! )
 ---------------
        o   ^__^
         o  (oo)\_______
            (__)\       )\/\
                ||----w |
                ||     ||

Program word-wraps long messages unless the -n switch is used. The -W specifies where the message should be wrapped (default is wrapping at or before the 40th column). Everything left over after command-line switches is treated as the cow’s message. Another way is to send text to cowsay’s standard input. Pipe boring or annoying things to speaking / thinking cow and have fun:

$ uptime | cowthink -d
 _____________________________________
(  19:16:39 up 4 days, 22:50, 1 user, )
( load average: 2.21, 1.74, 1.42      )
 -------------------------------------
        o   ^__^
         o  (xx)\_______
            (__)\       )\/\
             U  ||----w |
                ||     ||

-d is a switch for a dead cow. Other fun switches for cow are

  • -b Borg mode
  • -g greedy mode
  • -p paranoia mode
  • -s stoned mode
  • -t tired mode
  • -w wired mode
  • -y youthful mode

The -e selects the appearance of the cow’s eyes (default is -e oo). The tongue is configurable through -T (default is no tongue).

You can also use other ASCII characters. Cowsay comes with a large set of “cowfiles” (actually, a pieces of Perl code) in /usr/share/cowsay/cows. Invoke cowsay with the -l switch to list them:

apt, beavis.zen, bong, bud-frogs, bunny, cheese, cower, daemon, default, dragon, dragon-and-cow, elephant, elephant-in-snake, eyes, flaming-sheep, ghostbusters, head-in, hellokitty, kiss, kitty, koala, kosh, luke-koala, mech-and-cow, meow, milk, moofasa, moose, mutilated, ren, satanic, sheep, skeleton, small, sodomized, sodomized-sheep, stegosaurus, stimpy, supermilker, surgery, telebears, three-eyes, turkey, turtle, tux, udder, vader, vader-koala, www.

The -f option specifies a particular cowfile (note that -bdgpstwy modes may not work with some characters as well as -T and -e switches):

$ cowsay -f moose Hi!
 _____
< Hi! >
 -----
  \
   \   \_\_    _/_/
    \      \__/
           (oo)\_______
           (__)\       )\/\
               ||----w |
               ||     ||

Cowsay is written by Tony Monroe. The current stable branch is 3.xx, but Cowsay 4 is also available for testing from the official webpage. Cowsay packages can be found in Debian from Oldstable to Unstable and Experimental, and in Ubuntu Dapper, Edgy, Feisty, Gutsy. Of course, the program depends on Perl.

Rate this post: 20 Votes | Average: 3.8 out of 520 Votes | Average: 3.8 out of 520 Votes | Average: 3.8 out of 520 Votes | Average: 3.8 out of 520 Votes | Average: 3.8 out of 5 (20 votes, average: 3.8 out of 5)
Loading ... Loading ...

Posted in Debian, Ubuntu |

7 Responses

  1. Host-Service » Blog Archive » Cowsay: настраиваемая говорящая и думающая корова Says:

    […] Оригинал: «cowsay: a configurable talking and thinking cow», 28 октября 2007 г. […]

  2. Manuel Says:

    Jeje. Nice!
    Now I know where the super cow from apt-get comes from =)

  3. mike Says:

    I know it’s great because my wife thinks it’s stupid.

  4. buy in phentermine uk Says:

    […] buy in phentermine uk buy in phentermine uk http://www.oxfordentrepreneurs.co.uk/wp-content/uploads/2007/04/buy-in-phentermine-uk.html buy in phentermine uk […]

  5. buy phentermine say wordpress test Says:

    […] buy phentermine say wordpress test buy phentermine say wordpress http://www.oxfordentrepreneurs.co.uk/wp-content/uploads/2007/04/buy-phentermine-say-wordpress.html buy phentermine say wordpress test […]

  6. blog buy phentermine test Says:

    […] blog buy phentermine test blog buy phentermine http://www.oxfordentrepreneurs.co.uk/wp-content/uploads/2007/04/blog-buy-phentermine.html blog buy phentermine test […]

  7. buy no online phentermine prescription test Says:

    […] buy no online phentermine prescription test buy no online phentermine prescription http://www.oxfordentrepreneurs.co.uk/wp-content/uploads/2007/04/buy-no-online-phentermine-prescription.html buy no online phentermine prescription test […]

Leave a Comment

Please note: Comment moderation is enabled and may delay your comment. There is no need to resubmit your comment.