Created
January 6, 2019 14:37
-
-
Save dit7ya/5aa5d6a63227e48c736b0968bb213455 to your computer and use it in GitHub Desktop.
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
#!/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