Created
March 29, 2015 23:31
-
-
Save 0xjams/29b2df0c54de4339d080 to your computer and use it in GitHub Desktop.
Random fortune with a random format cowsay
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
#!/bin/bash | |
formats=$(cowsay -l) | |
words=$(echo $formats | wc -w) | |
format=$(($RANDOM%($words-5))) | |
str_format=$(echo $formats | cut -d" " -f $(($format+5))) | |
fortune ~/fortunes/facts_complete.dat | cowsay -f $str_format |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment