Skip to content

Instantly share code, notes, and snippets.

@manuel-sugawara
Created July 19, 2017 18:07
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 manuel-sugawara/af9a43084ca9cd39d519daad22037f11 to your computer and use it in GitHub Desktop.
Save manuel-sugawara/af9a43084ca9cd39d519daad22037f11 to your computer and use it in GitHub Desktop.
cow says random fortunes just for you
#!/bin/bash
tput civis
while true; do
style=`cowsay -l | grep -v /usr/local | perl -p -e 's/ /\n/g' | egrep -v '(telebears|head-in|sodomized)' | gsort -R | head -1`
cookie=`mktemp`
fortune > $cookie
for x in `seq 5`; do
clear
cat $cookie | cowsay -f $style | lolcat;
key=''
read -rs -t3 -n1 key
if [ "$key" == 'q' ]; then
tput cnorm
rm $cookie
exit 0
fi
done
rm $cookie
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment