Skip to content

Instantly share code, notes, and snippets.

@minejo
Created February 18, 2014 08:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save minejo/9066719 to your computer and use it in GitHub Desktop.
Save minejo/9066719 to your computer and use it in GitHub Desktop.
结合fortune,cowsay,cowthink图形显示名言名句。
#!/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