Fun with Unix: Cowsay

Another in the “Fun with Unix” series (see the one other post so far on mesg), today’s episode covers a little trick that goes alongside messages.

Here it is:

 _______
< hello >
 -------
        \   ^__^
         \  (oo)\_______
            (__)\       )\/\
                ||----w |
                ||     ||

The code to output the above is:

echo "hello" | cowsay

You can tell cowsay to use a different picture, how about this one:

echo “hello” | cowsay -f elephant _______ < hello > ———- \ /\ ___ /\ \ // \/ \/ \\ (( O O )) \\ / \ // \/ | | \/ | | | | | | | | | o | | | | | |m| |m|

Or even:

echo “hello” | cowsay -f daemon _______
< hello > ———- \ , , \ /( )` \ \ \___ / | /- _ `-/ ‘ (/\/ \ \ /\ / / | ` \ O O ) / | `-^—’`< ‘ (_.) _ ) / `.___/` / `——-’ /
<——. __ / __ \
<——|====O)))==) \) /====
<——’ `—’ `.__,’ \ | | \ / ______( (_ / \______ ,’ ,——-’ | \ `—{__________) \/

My files are in /usr/share/cowsay/cows so have a look what you have.

Of course you can use these in conjunction with write that I mentioned last time, by using something like:

echo "hello there" | cowsay -f hellokitty | write kevin

Enjoy :)

Leave a Reply

Please use [code] and [/code] around any source code you wish to share.

This site uses Akismet to reduce spam. Learn how your comment data is processed.

To respond on your own website, enter the URL of your response which should contain a link to this post's permalink URL. Your response will then appear (possibly after moderation) on this page. Want to update or remove your response? Update or delete your post and re-enter your post's URL again. (Find out more about Webmentions.)