Skip to content

Instantly share code, notes, and snippets.

@1stvamp
Last active October 16, 2019 16:17
Show Gist options
  • Save 1stvamp/7b8ebdd97f08a2a7b22cf9ec72d276ba to your computer and use it in GitHub Desktop.
Save 1stvamp/7b8ebdd97f08a2a7b22cf9ec72d276ba to your computer and use it in GitHub Desktop.
cowsay joke
#!/bin/bash
args=( '-e OO -T U' '-e ">o"' )
lines=( 'knock knock' "who\'s there?" 'moo' 'moo who?' "aww don\'t cry, it\'ll be alright" )
args_i=0
for line in "${lines[@]}"
do
eval cowsay "${args[$args_i]}" "$line"
if [ "$args_i" -eq 0 ]
then
args_i=1
else
args_i=0
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment