Last active
October 16, 2019 16:17
-
-
Save 1stvamp/7b8ebdd97f08a2a7b22cf9ec72d276ba to your computer and use it in GitHub Desktop.
cowsay joke
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 | |
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