Skip to content

Instantly share code, notes, and snippets.

@thibaultcha
Created April 8, 2015 02:25
Show Gist options
  • Save thibaultcha/96d7349dfa858f540fcb to your computer and use it in GitHub Desktop.
Save thibaultcha/96d7349dfa858f540fcb to your computer and use it in GitHub Desktop.
Prints a random fortune in a random cow template
# Add this to your .profile
# $ fortunecow
function fortunecow() {
files=`cowsay -l | cut -d \: -f 2 | xargs echo`
arr=("${(s/ /)files}")
file=$arr[$RANDOM%$#arr+1]
fortune | cowsay -f $file
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment