Skip to content

Instantly share code, notes, and snippets.

@ynonp
Created June 7, 2022 18:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ynonp/40bf49749071c880688ffff416a8a9f8 to your computer and use it in GitHub Desktop.
Save ynonp/40bf49749071c880688ffff416a8a9f8 to your computer and use it in GitHub Desktop.
evenings_ok=(
"Pesach I"
"Pesach VII"
"Shavuot I"
"Tish'a B'Av"
"Rosh Hashana II"
"Yom Kippur"
"Sukkot I"
"Shmini Atzeret"
)
no_emails=(
"Rosh Hashana"
)
for send_in_evening in "${evenings_ok[@]}"
do
# echo "^[0-9/]+ ${send_in_evening}"
if hebcal $(date +"%m %d %Y") | egrep -v "CH''M" | egrep "^[0-9/]+ ${send_in_evening}" >& /dev/null
then
if (( $(date +%"_H") < 20 ))
then
exit 1
fi
fi
done
for holiday in "${no_emails[@]}"
do
if hebcal $(date +"%m %d %Y") | egrep "^[0-9/]+ ${holiday}" >& /dev/null
then
exit 1
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment