For faster navigation, this Iframe is preloading the Wikiwand page for cowsay.

cowsay

cowsay
原作者Tony Monroe
当前版本
  • 3.04 (2016年6月25日)[1]
编辑维基数据链接
原始码库 编辑维基数据链接
编程语言Perl
操作系统跨平台
语言英语
许可协议Artistic License / GNU通用公共许可证
网站www.nog.net/~tony/warez/

cowsay是一个生成ASCII图片的程序,显示一头牛的消息。[2]它也可以使用预先制作的图像,以生成其他动物的图片,如Linux的吉祥物企鹅。由于它是用Perl编写的,它也适用于其他系统,如微软的Windows。还有一个相关的程序,名为cowthink,则为一头牛在思考,而不是说话。.cow文件能使cowsay产生不同样式的“牛”和“眼睛”等。[3]有时,IRC、桌面截图和软件文档中会使用它。它更像骇客文化中的玩笑,但一段时间后,它也较常被一般人使用。在2007年,它被选为Debian的今日软件包。[4]

Cowsay和Cowthink是用Perl语言写成的,正因为如此,它很容易用在Unix系统任务上,比如,告诉用户他们的主目录已满,或他们有新邮件等等。另外,它也可以适应通用网关接口[5]

范例

[编辑]

Unix命令fortune也可用管道重定向至cowsay命令:

$ fortune | cowsay
 ________________________________________
/ You have Egyptian flu: you're going to \
\ be a mummy.                            /
 ----------------------------------------
        \   ^__^
         \  (oo)\_______
            (__)\       )\/\
                ||----w |
                ||     ||

(你得了埃及流感:变成一具木乃伊。)

使用参数-f tux可以把牛换成Linux吉祥物,Tux

$ fortune | cowsay -f tux
 _________________________________________
/ You are only young once, but you can    \
\ stay immature indefinitely.             /
 -----------------------------------------
   \
    \
        .--.
       |o_o |
       |:_/ |
      //   \ \
     (|     | )
    /'\_   _/`\
    \___)=(___/

(年轻只有一次,但你可以永不成熟。)

参数

[编辑]
选项 目的
-n 禁用自动换行,允许牛说FIGlet,或显示其他嵌入ASCII艺术。列宽依最长的列,将会忽略-W'的值。
-W 指定说话气球的列宽,即等宽字体的字符数。默认值为40。
-b 博格模式”,使用==代替oo作为牛的眼睛。
-d “死掉”的牛,使用XX,再加上下降的U代表被挤压的舌头。
-g “财迷”的牛,使用$$
-p “多疑”的牛,使用@@
-s “喝醉”的牛,使用**代表眼红,再加上下降的U代表被挤压的舌头。
-t “疲劳”的牛,使用--
-w “吃惊”的牛,使用OO
-y “小牛”,使用..代表小眼睛。
-e eye_string 手动指定牛眼形状,例如cowsay -e ^^(参见颜文字)。[6]
-T tongue_string 手动指定牛舌形状,例如cowsay -T \(\)指定一对括号[6]
-f cowfile 指定一个.cow文件以加载另一种ASCII艺术。允许使用绝对路径或环境变量COWPATH的相对路径。
-l 列出COWPATH文件夹中可用的cow文件名称,而不是显示一条资讯。

参考

[编辑]
  1. ^ tnalpgge/rank-amateur-cowsay. [2018年9月3日] (英语). 
  2. ^ Orr, Mike. cowsay--ASCII Art for Your Screen. Linux Gazette. 2001-06 [2012-04-24]. (原始内容存档于2012-03-19). 
  3. ^ Newborough, Philip. A Virtual Richard Stallman for Cowsay Hack. 2007-10-05 [2013-03-22]. (原始内容存档于2011-07-25). 
  4. ^ Beshenov, Alexey. cowsay: a configurable talking and thinking cow. Debian Package of the Day. 2007-10-28 [2013-03-22]. (原始内容存档于2007-10-30). 
  5. ^ Schroder, Carla. Tip of the Trade: Linux Easter Egg Fun. ServerWatch.com. 2008-06-30 [2012-04-24]. (原始内容存档于2012-04-15). [与来源不符]
  6. ^ 6.0 6.1 在C0控制符及基本拉丁文(U+0021–U+007E)外的字符将不会正确显示,因为这些参数只接受输入值的前两个字节。使用一个预定义的牛面孔将会覆盖-e-T的任何值。

外部链接

[编辑]
{{bottomLinkPreText}} {{bottomLinkText}}
cowsay
Listen to this article

This browser is not supported by Wikiwand :(
Wikiwand requires a browser with modern capabilities in order to provide you with the best reading experience.
Please download and use one of the following browsers:

This article was just edited, click to reload
This article has been deleted on Wikipedia (Why?)

Back to homepage

Please click Add in the dialog above
Please click Allow in the top-left corner,
then click Install Now in the dialog
Please click Open in the download dialog,
then click Install
Please click the "Downloads" icon in the Safari toolbar, open the first download in the list,
then click Install
{{::$root.activation.text}}

Install Wikiwand

Install on Chrome Install on Firefox
Don't forget to rate us

Tell your friends about Wikiwand!

Gmail Facebook Twitter Link

Enjoying Wikiwand?

Tell your friends and spread the love:
Share on Gmail Share on Facebook Share on Twitter Share on Buffer

Our magic isn't perfect

You can help our automatic cover photo selection by reporting an unsuitable photo.

This photo is visually disturbing This photo is not a good choice

Thank you for helping!


Your input will affect cover photo selection, along with input from other users.

X

Get ready for Wikiwand 2.0 🎉! the new version arrives on September 1st! Don't want to wait?