COWSAY(1) | Cowsay Manual | COWSAY(1) |
NAME
cowsay, cowthink - configurable speaking/thinking cow (and a bit more)
SYNOPSIS
cowsay [-f cowfile] [-r [-C] ] [-e eye_string] [-T tongue_string] [-bdgpstwy] [-n] [-W column] [<message>]
cowsay -l
cowsay [-h | --help]
DESCRIPTION
cowsay generates an ASCII-art picture of a cow saying something provided by the user. If run with no non-option arguments, it reads from standard input, word-wraps the given message at about 40 columns, and prints the cow saying the given message on standard output.
To aid in the use of arbitrary messages with arbitrary whitespace, use the -n option. If it is specified, the given message will not be word-wrapped. This is possibly useful if you want to make the cow think or speak in figlet(6). If -n is specified, there must not be any command line arguments left after all the switches have been processed.
The -W specifies roughly where the message should be wrapped. The default is equivalent to -W 40 (i.e. wrap words at or before the 40th column).
If any command-line arguments are left over after all switches have been processed, they become the cow’s message, instead of using standard input. Standard input is ignored in this case.
If the program is invoked as cowthink, then the cow will think its message instead of saying it. (This is indicated by a "thought bubble" appearance in the displayed cow image. Cowsay does not take a philosophical position on whether actual cognition is occurring.)
(The resulting picture is technically not necessarily ASCII. It may be in other encodings, and contain non-ASCII characters, or even terminal-control character sequences, depending on your environment and the particular cow definition files used.)
OPTIONS
There are several provided modes which change the appearance of the cow depending on its particular emotional/physical state.
Cow modification
-b
-d
-g
-p
-s
-t
-w
-y
-e
-T
Cow selection
-f
-r
-C
Non-cow operations
-l
-h
COWFILE FORMAT
A cowfile is made up of a simple block of perl(1) code, which assigns a picture of a cow to the variable $the_cow. Should you wish to customize the eyes or the tongue of the cow, then the variables $eyes and $tongue may be used. The trail leading up to the cow’s message balloon is composed of the character(s) in the $thoughts variable. Other variables should not be set.
Any backslashes in the cowfile text (inside string literals or heredocs) must be doubled to prevent interpretation. Also, any "@", "$", and maybe "&" characters must be escaped with backslashes, because that is what Perl expects.
The name of a cowfile must end with .cow, otherwise it is not recognized as a cowfile.
ENVIRONMENT
The COWPATH environment variable, if present, will be used to search for cowfiles. It contains a colon-separated list of directories, much like PATH or MANPATH.
The default COWPATH is searched after entries in the user-specified COWPATH environment variable. To suppress this behavior (e.g. for development work), set the COWSAY_ONLY_COWPATH environment variable to 1. In this case, COWPATH should contain at least a directory with a file called default.cow in it.
FILES
%PREFIX%/share/cowsay/cows holds a sample herd of cowfiles. Your COWPATH automatically contains this directory, unless the COWSAY_ONLY_COWPATH environment variable is set to 1.
%PREFIX%/share/cowsay/site-cows is provided for administrators to install custom cows. Cows in share/cowsay/site-cows take precedence over cows with the same name in share/cowsay/cows. The site-cows directory will never be modified by cowsay installations, so custom cows defined there will persist across upgrades of cowsay. site-cows is also on the default COWPATH.
%PREFIX%/etc/cowsay/cowpath.d/ (or /etc/cowsay/cowpath.d/ when %PREFIX% is /usr) is a directory that contains files which list entries to be added to the default COWPATH. This mechanism allows third-party cow collections to register themselves with cowsay in a way that does not require per-user configuration. The path files under cowpath.d must have the file extension .path (or they will be ignored), and must contain a list of directory paths, one per line.
In the special case when cowsay is installed to the prefix /usr, then /etc instead of %PREFIX%/etc is used for the configuration files, including cowpath.d.
BUGS
If you find any, please report them on the cowsay GitHub page ( https://github.com/cowsay-org/cowsay/issues), or notify the author at the email address below.
AUTHOR
Cowsay is maintained by Andrew Janke ( <floss@apjanke.net>).
Cowsay was originally written by Tony Monroe ( <tony@nog.net>), with suggestions from Shannon Appel ( <appel@csua.berkeley.edu>) and contributions from Anthony Polito ( <aspolito@csua.berkeley.edu>).
RESOURCES
GitHub: https://github.com/cowsay-org/cowsay
Main web site: http://cowsay.diamonds
SEE ALSO
2024-11-30 | Cowsay |