cowsay-3.03+dfsg2/000755 001750 001750 00000000000 11432042322 015024 5ustar00melaniemelanie000000 000000 cowsay-3.03+dfsg2/cows/dragon.cow000644 001750 001750 00000001750 06755214044 020004 0ustar00melaniemelanie000000 000000 ## ## The Whitespace Dragon ## $the_cow = < \\ _ -~ `. ^-` ^-_ ///-._ _ _ _ _ _ _}^ - - - - ~ ~-- ,.-~ /.-~ EOC cowsay-3.03+dfsg2/cows/cheese.cow000644 001750 001750 00000000740 06755214044 017764 0ustar00melaniemelanie000000 000000 ## ## The cheese from milk & cheese ## $the_cow = <> 5.4 ## $the_cow = < 'oo', 'f' => 'default.cow', 'n' => 0, 'T' => ' ', 'W' => 40, ); getopts('bde:f:ghlLnNpstT:wW:y', \%opts); &display_usage if $opts{'h'}; &list_cowfiles if $opts{'l'}; $borg = $opts{'b'}; $dead = $opts{'d'}; $greedy = $opts{'g'}; $paranoid = $opts{'p'}; $stoned = $opts{'s'}; $tired = $opts{'t'}; $wired = $opts{'w'}; $young = $opts{'y'}; $eyes = substr($opts{'e'}, 0, 2); $tongue = substr($opts{'T'}, 0, 2); $the_cow = ""; &slurp_input; $Text::Wrap::columns = $opts{'W'}; @message = ($opts{'n'} ? expand(@message) : split("\n", fill("", "", @message))); &construct_balloon; &construct_face; &get_cow; print @balloon_lines; print $the_cow; sub list_cowfiles { my $basedir; my @dirfiles; chop($basedir = cwd); for my $d (split(/$pathsep/, $cowpath)) { print "Cow files in $d:\n"; opendir(COWDIR, $d) || die "$0: Cannot open $d\n"; for my $file (readdir COWDIR) { if ($file =~ s/\.cow$//) { push(@dirfiles, $file); } } closedir(COWDIR); print wrap("", "", sort @dirfiles), "\n"; @dirfiles = (); chdir($basedir); } exit(0); } sub slurp_input { unless ($ARGV[0]) { chomp(@message = ); } else { &display_usage if $opts{'n'}; @message = join(' ', @ARGV); } } sub maxlength { my ($l, $m); $m = -1; for my $i (@_) { $l = length $i; $m = $l if ($l > $m); } return $m; } sub construct_balloon { my $max = &maxlength(@message); my $max2 = $max + 2; ## border space fudge. my $format = "%s %-${max}s %s\n"; my @border; ## up-left, up-right, down-left, down-right, left, right if ($0 =~ /think/i) { $thoughts = 'o'; @border = qw[ ( ) ( ) ( ) ]; } elsif (@message < 2) { $thoughts = '\\'; @border = qw[ < > ]; } else { $thoughts = '\\'; if ($V and $V gt v5.6.0) { # Thanks, perldelta. @border = qw[ / \\ \\ / | | ]; } else { @border = qw[ / \ \ / | | ]; } } push(@balloon_lines, " " . ("_" x $max2) . " \n" , sprintf($format, $border[0], $message[0], $border[1]), (@message < 2 ? "" : map { sprintf($format, $border[4], $_, $border[5]) } @message[1 .. $#message - 1]), (@message < 2 ? "" : sprintf($format, $border[2], $message[$#message], $border[3])), " " . ("-" x $max2) . " \n" ); } sub construct_face { if ($borg) { $eyes = "=="; } if ($dead) { $eyes = "xx"; $tongue = "U "; } if ($greedy) { $eyes = "\$\$"; } if ($paranoid) { $eyes = "@@"; } if ($stoned) { $eyes = "**"; $tongue = "U "; } if ($tired) { $eyes = "--"; } if ($wired) { $eyes = "OO"; } if ($young) { $eyes = ".."; } } sub get_cow { ## ## Get a cow from the specified cowfile; otherwise use the default cow ## which was defined above in $the_cow. ## my $f = $opts{'f'}; my $full = ""; if ($opts{'f'} =~ m,/,) { $full = $opts{'f'}; } else { for my $d (split(/:/, $cowpath)) { if (-f "$d/$f") { $full = "$d/$f"; last; } elsif (-f "$d/$f.cow") { $full = "$d/$f.cow"; last; } } if ($full eq "") { die "$progname: Could not find $f cowfile!\n"; } } do $full; die "$progname: $@\n" if $@; } sub display_usage { die < ---___ XXX__/ XXXXXX \\__ / \\- --__/ ___/\\ XXXXXX / ___--/= \\-\\ ___/ XXXXXX '--- XXXXXX \\-\\/XXX\\ XXXXXX /XXXXX \\XXXXXXXXX \\ /XXXXX/ \\XXXXXX > _/XXXXX/ \\XXXXX--__/ __-- XXXX/ -XXXXXXXX--------------- XXXXXX- \\XXXXXXXXXXXXXXXXXXXXXXXXXX/ ""VXXXXXXXXXXXXXXXXXXV"" EOC cowsay-3.03+dfsg2/cows/000755 001750 001750 00000000000 13022471255 016007 5ustar00melaniemelanie000000 000000 cowsay-3.03+dfsg2/cows/flaming-sheep.cow000644 001750 001750 00000000752 06755214044 021252 0ustar00melaniemelanie000000 000000 ## ## The flaming sheep, contributed by Geordan Rosario (geordan@csua.berkeley.edu) ## $the_cow = < EOC cowsay-3.03+dfsg2/install.sh000755 001750 001750 00000004343 07007372711 017050 0ustar00melaniemelanie000000 000000 #!/bin/sh ## ## install.sh ## ## Installation script for cowsay. ## ## $Id: install.sh,v 1.5 1999/11/01 20:19:21 tony Exp $ ## ## This file is part of cowsay. (c) 1999 Tony Monroe. ## rcs_id='$Id: install.sh,v 1.5 1999/11/01 20:19:21 tony Exp $' filelist='cows' cat </dev/null 2>&1; then echo Found a good perl in $perl goodperls="$goodperls $perl" fi done echo The following perl executables will run cowsay: echo $goodperls echo I recommend the latest stable perl you can find. set $goodperls if [ -z "$1" ]; then echo Ack! You do not have Perl 5 installed correctly! echo Get thee to CPAN! exit 1 fi usethisperl=$1 echo I will be using $1 because I know it will work. echo Now I need an installation prefix. I will use /usr/local unless printf "you give me a better idea here: " if [ -n "$backdoor" ]; then prefix=$backdoor printf "%s (specified on command line)\n" $prefix else read prefix fi PREFIX=${prefix:-/usr/local} echo Okay, time to install this puppy. echo s,%BANGPERL%,!$usethisperl,\; > install.pl echo s,%PREFIX%,$PREFIX,\; >> install.pl set -x mkdir -p $PREFIX/bin || (mkdir $PREFIX; mkdir $PREFIX/bin) $usethisperl -p install.pl cowsay > $PREFIX/bin/cowsay chmod a+x $PREFIX/bin/cowsay ln -s cowsay $PREFIX/bin/cowthink mkdir -p $PREFIX/man/man1 || ($mkdir $PREFIX; mkdir $PREFIX/man; mkdir $PREFIX/man/man1) $usethisperl -p install.pl cowsay.1 > $PREFIX/man/man1/cowsay.1 chmod a+r $PREFIX/man/man1/cowsay.1 ln -s cowsay.1 $PREFIX/man/man1/cowthink.1 mkdir -p $PREFIX/share/cows || (mkdir $PREFIX; mkdir $PREFIX/share; mkdir $PREFIX/share/cows) tar -cf - $filelist | (cd $PREFIX/share && tar -xvf -) set +x echo Okay, let us see if the install actually worked. if [ ! -f $PREFIX/share/cows/default.cow ]; then echo The default cow file did not make it across! echo Ooops, it failed...sorry! exit 1 fi echo Installation complete! Enjoy the cows! cowsay-3.03+dfsg2/cowsay.1000644 001750 001750 00000011122 07010361620 016412 0ustar00melaniemelanie000000 000000 .\" .\" cowsay.1 .\" .\" $Id: cowsay.1,v 1.4 1999/11/04 19:50:40 tony Exp $ .\" .\" This file is part of cowsay. (c) 1999 Tony Monroe. .\" .ds Nm Cowsay .ds nm cowsay .ds Vn 3.02 .TH \*(nm 1 "$Date: 1999/11/04 19:50:40 $" .SH NAME \*(nm/cowthink \- configurable speaking/thinking cow (and a bit more) .SH SYNOPSIS cowsay .RB [ \-e .IR eye_string ] .RB [ \-f .IR cowfile ] .RB [ \-h ] .RB [ \-l ] .RB [ \-n ] .RB [ \-T .IR tongue_string ] .RB [ \-W .IR column ] .RB [ \-bdgpstwy ] .SH DESCRIPTION .I Cowsay generates an ASCII picture of a cow saying something provided by the user. If run with no arguments, it accepts standard input, word-wraps the message given at about 40 columns, and prints the cow saying the given message on standard output. .PP To aid in the use of arbitrary messages with arbitrary whitespace, use the .B \-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 .B \-n is specified, there must not be any command-line arguments left after all the switches have been processed. .PP The .B \-W specifies roughly (where the message should be wrapped. The default is equivalent to .B \-W 40 i.e. wrap words at or before the 40th column. .PP If any command-line arguments are left over after all switches have been processed, they become the cow's message. The program will not accept standard input for a message in this case. .PP There are several provided modes which change the appearance of the cow depending on its particular emotional/physical state. The .B \-b option initiates Borg mode; .B \-d causes the cow to appear dead; .B \-g invokes greedy mode; .B \-p causes a state of paranoia to come over the cow; .B \-s makes the cow appear thoroughly stoned; .B \-t yields a tired cow; .B \-w is somewhat the opposite of .BR \-t , and initiates wired mode; .B \-y brings on the cow's youthful appearance. .PP The user may specify the .B \-e option to select the appearance of the cow's eyes, in which case the first two characters of the argument string .I eye_string will be used. The default eyes are 'oo'. The tongue is similarly configurable through .B \-T and .IR tongue_string ; it must be two characters and does not appear by default. However, it does appear in the 'dead' and 'stoned' modes. Any configuration done by .B \-e and .B \-T will be lost if one of the provided modes is used. .PP The .B \-f option specifies a particular cow picture file (``cowfile'') to use. If the cowfile spec contains '/' then it will be interpreted as a path relative to the current directory. Otherwise, cowsay will search the path specified in the .B COWPATH environment variable. To list all cowfiles on the current .BR COWPATH , invoke .B \*(nm with the .B \-l switch. .PP If the program is invoked as .B cowthink then the cow will think its message instead of saying it. .PP .SH COWFILE FORMAT A cowfile is made up of a simple block of .BR perl (1) code, which assigns a picture of a cow to the variable .BR $the_cow . Should you wish to customize the eyes or the tongue of the cow, then the variables .B $eyes and .B $tongue may be used. The trail leading up to the cow's message balloon is composed of the character(s) in the .B $thoughts variable. Any backslashes must be reduplicated to prevent interpolation. The name of a cowfile should end with .BR .cow , otherwise it is assumed not to be a cowfile. Also, at-signs (``@'') must be backslashed because that is what Perl 5 expects. .PP .SH COMPATIBILITY WITH OLDER VERSIONS .PP What older versions? :-) .PP Version 3.x is fully backward-compatible with 2.x versions. If you're still using a 1.x version, consider upgrading. And tell me where you got the older versions, since I didn't exactly put them up for world-wide access. .PP Oh, just so you know, this manual page documents version \*(Vn of cowsay. .SH ENVIRONMENT The COWPATH environment variable, if present, will be used to search for cowfiles. It contains a colon-separated list of directories, much like .B PATH or .BR MANPATH . It should always contain the .B /usr/local/share/cows directory, or at least a directory with a file called .B default.cow in it. .SH FILES .B %PREFIX%/share/cows holds a sample set of cowfiles. If your .B COWPATH is not explicitly set, it automatically contains this directory. .SH BUGS If there are any, please notify the author at the address below. .SH AUTHOR Tony Monroe (tony@nog.net), with suggestions from Shannon Appel (appel@CSUA.Berkeley.EDU) and contributions from Anthony Polito (aspolito@CSUA.Berkeley.EDU). .SH SEE ALSO perl(1), wall(1), nwrite(1), figlet(6) cowsay-3.03+dfsg2/cows/beavis.zen.cow000644 001750 001750 00000001110 06755214044 020564 0ustar00melaniemelanie000000 000000 ## ## Beavis, with Zen philosophy removed. ## $the_cow = <____) >___ ^\\_\\_\\_\\_\\_\\_\\) ^^^//\\\\_^^//\\\\_^ ^(\\_\\_\\_\\) ^^^ ^^ ^^^ ^ EOC cowsay-3.03+dfsg2/cows/stegosaurus.cow000644 001750 001750 00000001526 06755214046 021121 0ustar00melaniemelanie000000 000000 ## ## A stegosaur with a top hat? ## $the_cow = < < > .---. $thoughts | \\ \\ - ~ ~ - / / | _____ ..-~ ~-..-~ | | \\~~~\\.' `./~~~/ --------- \\__/ \\__/ .' O \\ / / \\ " (_____, `._.' | } \\/~~~/ `----. / } | / \\__/ `-. | / | / `. ,~~| ~-.__| /_ - ~ ^| /- _ `..-' | / | / ~-. `-. _ _ _ |_____| |_____| ~ - . _ _ _ _ _> EOC cowsay-3.03+dfsg2/cows/cower.cow000644 001750 001750 00000000346 06755214044 017651 0ustar00melaniemelanie000000 000000 ## ## A cowering cow ## $the_cow = <