Skip to content

Instantly share code, notes, and snippets.

@zjrosen1
Last active September 22, 2015 01:57
Show Gist options
  • Save zjrosen1/2e7db8abe8956ea40113 to your computer and use it in GitHub Desktop.
Save zjrosen1/2e7db8abe8956ea40113 to your computer and use it in GitHub Desktop.
Random Forturne
#!/bin/bash
function rnum {
echo $((RANDOM % $1))
}
COWS=("bong" "unipony" "sodomized" "head-in" "vader" "elephant" "tux")
VOICES=("Daniel" "Karen")
TIMER=10
audio=1
while :
do
clear
VOICE=${VOICES[$(rnum ${#VOICES[@]})]}
COW=${COWS[$(rnum ${#COWS[@]})]}
FORTUNE=`fortune -s -o`
if [[ $audio == 1 ]]; then
echo $FORTUNE | toilet --font future | lolcat
#echo $FORTUNE | cowsay -f $COW | lolcat
audio=0
else
echo $FORTUNE | cowsay -f $COW | lolcat
say -v $VOICE $FORTUNE
audio=1
fi
sleep $TIMER
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment