One of many sillier, however nonetheless enjoyable, instruments out there on Linux is named “cowsay”. It is used to show a phrase together with an ASCII artwork picture of a cow.
The cowsay command lets you create messages which can be much less more likely to be neglected and would possibly come throughout as just a bit friendlier than the opposite thousand or so messages most of us get day-after-day. For instance:
$ cowsay That is cowsay! _________________ < That is cowsay! > ----------------- ^__^ (oo)_______ (__) )/ ||----w | || ||
As soon as cowsay is put in in your system, you possibly can create cute little messages – and you are not restricted to displaying a cow! In reality, for those who wander over to the cowsay‘s listing – /usr/share/cowsay/cows – you may see that there is a pretty massive assortment of information out there. Every features a completely different picture. You possibly can select from pictures as various as a snowman and a stegosaurus. If you wish to greet your Australian pals utilizing cowsay, you would possibly attempt utilizing the koala.
Word that it is advisable to specify the cowsay file that you just wish to use if you’d like one thing apart from the usual cow (on this case, koala.cow). You do not have to incorporate the .cow file extension in your command.
$ cowsay -f koala Hey, how are you? ___________________ < Hey, how are you? > ------------------- ___ ~._.~ ( Y ) ()~*~() (_)-(_)
If you wish to be intimidating, however, you would possibly attempt a dragon!
$ cowsay -f dragon I dare you to come back just a little nearer ____________________________________ < I dare you to come back just a little nearer > ------------------------------------ / // |___/| / // /0 0 __ / // | / / /_/ // | @_^_@'/ /_ // | //_^_/ /_ // | ( //) | /// | ( / /) _|_ / ) // | _ ( // /) '/,_ _ _/ ( ; -. | _ _.-~ .-~~~^-. (( / / )) ,-.-~-. .~ `. (( // / )) '/ / ~-. _ .-~ .-~^-. (( /// )) `. / (( / )) .----~-. -' .~ `. ^-. ///.----..> _ -~ `. ^-` ^-_ ///-._ _ _ _ _ _ _^ - - - - ~ ~-- ,.-~
Personalizing cowsay
You too can create your personal cowsay pictures, and it isn’t that arduous to do. Within the the rest of this put up, I’ll present you ways. You have to to have root entry so as to add your new file(s) to the /usr/share/cowsay/cows listing.
Step 1: The artwork
There are a pair methods to create your ascii artwork. You possibly can, as I’ve finished on this put up, create it just by typing keyboard characters right into a file. Alternately, you should use a software comparable to jp2a that turns jpg information into ASCII artwork, however the resultant file is prefer to be a bit overwhelming. Cowsay artwork should not be so difficult that your recipients fail to spot the message! So, I began with two pictures that I created – a Christmas tree after which a menorah – in honor of the December holidays. My Christmas tree seemed like this:
* / / / o / * / o / * / o /_ * _ / * / o /__ * __ / o * / * o / o /__ o * __ / * o / * o * / o * o /_____________________ | | _________| |_________
I referred to as the picture xmas_tree.cow. The extension is required in order that cowsay can discover and use it.
Step 2: The cowsay setup
To get my picture prepared for cowsay, I additionally wanted some extra strains. Referencing one of many current cowsay information, I discovered it straightforward to seize those I wanted. The feedback will not be required, however the two strains following them are wanted.
# a snowman # 2020 Sandra_H-S <bugfarm@gmail.com> $the_cow = <<EOF $ideas
Because the final line within the file, I additionally added EOF. This marks the top of the picture and matches the EOF proven within the third line proven above. These delimiting strains are required for cowsay.
I shortly got here to grasp that the backslashes in my artwork wanted to be “escaped” (i.e., was two backslashes every), so I modified my cowsay file, additionally including the backslashes proven within the higher left that act as the road connecting the message to the character or picture supposed to be seen as delivering it. The whole file then seemed like this:
# a Christmas tree # 2020 Sandra_H-S <bugfarm@gmail.com> $the_cow = <<EOF $ideas * / / / o / * / o / * / o /_ * _ / * / o /__ * __ / o * / * o / o /__ o * __ / * o / * o * / o * o /_____________________ | | _________| |_________
EOF
Now typing “cowsay -f xmas_tree Merry Christmas!” exhibits my message as I supposed.
$ cowsay -f xmas_tree Merry Christmas! __________________ < Merry Christmas! > ------------------ * / / / o / * / o / * / o /_ * _ / * / o /__ * __ / o * / * o / o /__ o * __ / * o / * o * / o * o /_____________________ | | _________| |_________
Drawing a menorah with my keyboard was just a little extra bother, however I got here up with this:
$ cowsay -f menorah.cow Completely satisfied Hannukah! _________________ < Completely satisfied Hannukah! > ----------------- () || () () () () || () () () () || || || || || || || || || || || || || || || || || || || || || || || || || || || || || || || || || || || || + ++ ++ ++ ++ ++ ++ ++ +/ || || || || || || || // || || || || || || ||// || || || || || || ||/ || || || || || // _||__||__||__||__||_// ____________________/ || || || / /____
To arrange my picture, I as soon as once more needed to double up on the backslashes, however vi instructions comparable to :s///g22 helped with that. Discover I needed to double up my backslashes once more to inform vi to show each backslash into two backslashes. Even vi wants escapes for some characters. The cowsay file then seemed like this:
# a menorah # 2020 bugfarm <bufarm@gmail.com> $the_cow = <<EOF $ideas () || () () () () || () () () () || || || || || || || || || || || || || || || || || || || || || || || || || || || || || || || || || || || || + ++ ++ ++ ++ ++ ++ ++ +/ || || || || || || || // || || || || || || ||// || || || || || || ||/ || || || || || // _||__||__||__||__||_// ____________________/ || || || / /____ EOF
Discover that my menorah has the entire candles already lit. You would, nonetheless, make a gaggle of cowsay information if you wish to mild them separately.
Copyright © 2020 IDG Communications, Inc.
Leave a Reply