Last active
May 14, 2019 23:21
-
-
Save VADemon/9e346773b83f7ccdc8976ba697b672ff to your computer and use it in GitHub Desktop.
Bash/Cron: check last day of month / new or next month
This file contains hidden or 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
#!/bin/bash | |
# for more info, escape chars in cron etc: | |
# https://unix.stackexchange.com/questions/89188/cron-allowed-special-character-l-for-last-day-of-the-month-on-debian | |
[ "$(date -d 'tomorrow' +%d)" == "01" ] && echo "next month" || echo "same month" | |
# UPD: found same solution https://stackoverflow.com/a/6139310/1599009 | |
# exit code? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment