Skip to content

Instantly share code, notes, and snippets.

@dit7ya
Created January 6, 2019 14:37
Show Gist options
  • Save dit7ya/5aa5d6a63227e48c736b0968bb213455 to your computer and use it in GitHub Desktop.
Save dit7ya/5aa5d6a63227e48c736b0968bb213455 to your computer and use it in GitHub Desktop.
#!/usr/bin/env bash
phrase=$(echo $1 | xargs echo -n)
if [[ ${#phrase} == 0 ]]
then
echo 'Fine. Be that way!'
elif [[ $phrase =~ \?$ ]]
then
if [[ ]]
if [[ $phrase =~ [a-z0-9\W] ]] #check if there is any lowercase letter
then
echo "Sure."
else
echo "Calm down, I know what I'm doing!"
fi
elif [[ $phrase =~ [a-z0-9\W] ]]
then
echo 'Whatever.'
else
echo 'Whoa, chill out!'
fi
exit 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment