Created
February 18, 2014 08:16
-
-
Save minejo/9066719 to your computer and use it in GitHub Desktop.
结合fortune,cowsay,cowthink图形显示名言名句。
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/bash | |
#author:jonathan | |
#version:1.0 | |
Cownumber=$(($RANDOM%4+1)) | |
case $Cownumber in | |
0) | |
cow="moose";; | |
1) | |
cow="tux";; | |
2) | |
cow="daemon";; | |
3) | |
cow="surgery";; | |
4) | |
cow="elephant";; | |
*) | |
cow="tux";; | |
esac | |
Cmnumber=$(($RANDOM%1+1)) | |
case $Cmnumber in | |
0) | |
command="cowsay";; | |
1) | |
command="cowthink";; | |
*) | |
command="cowsay";; | |
esac | |
/usr/bin/fortune /path/to/kindle-fortune | $command -f $cow |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment