Created
August 26, 2016 18:58
-
-
Save mike10004/7830097bda3b20d7905a12b5fddc7136 to your computer and use it in GitHub Desktop.
Bash snippet that does one thing or another if it's a weekday or weekend day
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
echo "the shell is $SHELL"; | |
DAY=$(date "+%a"); | |
case $DAY in | |
Sat|Sun) | |
echo "$DAY is on the weekend"; | |
# do something here | |
;; | |
*) | |
echo "$DAY is not on the weekend"; | |
# do something else here | |
;; | |
esac |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment