How can I stop/abort a bash-script when:
- is last Sunday in March? OR
- is last Sunday in October?
Both should be checked here and if so the bash script should be stopped/aborted.
Thanks in advance.
EDIT: MAYBE THAT WAY
weekday=$(date +%a) day=$(date +%d) month=$(date +%m) if [[ ( $month == 03 || $month == 10 ) && $weekday = "Sun" && $day > 24 ]] then exit 1 fi