Skip to content

Instantly share code, notes, and snippets.

@mike10004
Created August 26, 2016 18:58
Show Gist options
  • Save mike10004/7830097bda3b20d7905a12b5fddc7136 to your computer and use it in GitHub Desktop.
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
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