cowsay 牛說
1. 簡介:
cowsay 是我目前最喜歡的 Linux 套件(第二名是 conky),它唯一的功能就是如下圖所示:
________________________________________
/ Q: Why do WASPs play golf ? A: So they \
\ can dress like pimps. /
----------------------------------------
\ / \ //\
\ |\___/| / \// \\
/0 0 \__ / // | \ \
/ / \/_/ // | \ \
@_^_@'/ \/_ // | \ \
//_^_/ \/_ // | \ \
( //) | \/// | \ \
( / /) _|_ / ) // | \ _\
( // /) '/,_ _ _/ ( ; -. | _ _\.-~ .-~~~^-.
(( / / )) ,-{ _ `-.|.-~-. .~ `.
(( // / )) '/\ / ~-. _ .-~ .-~^-. \
(( /// )) `. { } / \ \
(( / )) .----~-.\ \-' .~ \ `. \^-.
///.----..> \ _ -~ `. ^-` ^-_
///-._ _ _ _ _ _ _}^ - - - - ~ ~-- ,.-~
/.-~
2. 安裝:
Ubuntu install cowsay:
$ sudo apt-get update $ sudo apt-get install cowsay fortune
Mac install cowsay:
$ brew install cowsay fortune
3. 用法:
(1) cowsay 加上你想讓它說的話
$ cowsay Hello world
_____________
< Hello world >
-------------
\ ^__^
\ (oo)\_______
(__)\ )\/\
||----w |
|| ||
(2) fortune pipe 到 cawsay
$ fortune | cowsay
_________________________________________
/ I do desire we may be better strangers. \
| |
| -- William Shakespeare, "As You Like |
\ It" /
-----------------------------------------
\ ^__^
\ (oo)\_______
(__)\ )\/\
||----w |
|| ||
4. 其它參數:
(1) 各種模式:
- -b: 瞇眼模式
- -d: 死亡模式
- -g: 視錢如命
- -p: 眼鏡模式
- -s: 吐舌頭模式
- -t: 疲勞模式
- -w: 吃驚模式
- -y: 小牛模式
$ fortune | cowsay -s
____________________________________
/ After your lover has gone you will \
\ still have PEANUT BUTTER! /
------------------------------------
\ ^__^
\ (**)\_______
(__)\ )\/\
U ||----w |
|| ||
(2) 指定眼睛(-e)和舌頭(-T):
$ fortune | cowsay -e RR -T\(\)
______________________________________
/ You will probably marry after a very \
\ brief courtship. /
--------------------------------------
\ ^__^
\ (RR)\_______
(__)\ )\/\
() ||----w |
|| ||
(3) 指定 cowfile:
cowfile 就是 cow 的模板,我們先來看看有哪些預設的模板可用
$ cowsay -l
Ubuntu 預設模板:
Cow files in /usr/share/cowsay/cows: apt beavis.zen bong bud-frogs bunny calvin cheese cock cower daemon default dragon dragon-and-cow duck elephant elephant-in-snake eyes flaming-sheep ghostbusters gnu head-in hellokitty kiss koala kosh luke-koala mech-and-cow milk moofasa moose mutilated pony pony-smaller ren sheep skeleton snowman sodomized-sheep stegosaurus stimpy suse three-eyes turkey turtle tux unipony unipony-smaller vader vader-koala www
$ fortune | cowsay -f dragon
________________________________________
/ Q: Why haven't you graduated yet? A: \
| Well, Dad, I could have finished years |
| ago, but I wanted |
| |
\ my dissertation to rhyme. /
----------------------------------------
\ / \ //\
\ |\___/| / \// \\
/0 0 \__ / // | \ \
/ / \/_/ // | \ \
@_^_@'/ \/_ // | \ \
//_^_/ \/_ // | \ \
( //) | \/// | \ \
( / /) _|_ / ) // | \ _\
( // /) '/,_ _ _/ ( ; -. | _ _\.-~ .-~~~^-.
(( / / )) ,-{ _ `-.|.-~-. .~ `.
(( // / )) '/\ / ~-. _ .-~ .-~^-. \
(( /// )) `. { } / \ \
(( / )) .----~-.\ \-' .~ \ `. \^-.
///.----..> \ _ -~ `. ^-` ^-_
///-._ _ _ _ _ _ _}^ - - - - ~ ~-- ,.-~
/.-~