Skip to content

Instantly share code, notes, and snippets.

@ahpook
Created August 28, 2012 04:48
Show Gist options
  • Select an option

  • Save ahpook/3495041 to your computer and use it in GitHub Desktop.

Select an option

Save ahpook/3495041 to your computer and use it in GitHub Desktop.
working on shell scripts with gunnar
#!/bin/zsh
say "hi gunnar"
say "how are you today?"
echo -n "your answer? "
read feeling_answer
say "i am glad that you are $feeling_answer"
say "do you want food?"
echo -n "your answer? "
read food_answer
if [[ $food_answer =~ "^(y|yes|of course)" ]] ; then
say "well go get some food!"
elif [[ $food_answer =~ "^(n|no|negative)" ]] ; then
say "good, i don't have any food for you anyway!"
else
say "I don't understand. Sorry."
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment