Created
April 8, 2015 02:25
-
-
Save thibaultcha/96d7349dfa858f540fcb to your computer and use it in GitHub Desktop.
Prints a random fortune in a random cow template
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
# 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