Skip to content

Instantly share code, notes, and snippets.

@saxbophone
Last active August 31, 2016 17:05
Show Gist options
  • Save saxbophone/d69091b1067bd75605e4 to your computer and use it in GitHub Desktop.
Save saxbophone/d69091b1067bd75605e4 to your computer and use it in GitHub Desktop.
A very annoying shell function - Prints out a stupid message from fortune via cowsay, to all terminals, then waits a number of seconds in the fibonacci scale before spawning itself into the background
function meme() {
if [ "$1" -eq "1" ] && [ "$2" -eq "1" ]
then
wall <<< `cowsay "Hello! I am Cow, and I like to SAY things"`
else
wall <<< `fortune | cowsay`
fi
a=$1
b=$2
temp=$((a + b))
sleep $temp
meme $2 $temp&
}
# call meme
meme 1 1;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment