I have a script that runs once per month. It performs a certain task ONLY if the month is January, April, July, or October.
MONTH=`date +%m`
if [ $MONTH -eq 1 ] || [ $MONTH -eq 4 ] || [ $MONTH -eq 7 ] || [ $MONTH -eq 10 ]; then
do something
else
do a different thing
fi
Is there a neater way of doing it than my four separate "or" comparisons? That seems like a lot of words just to check if month = 1,4,7,10.
Just curious. This is HP-UX 11.31 if it matters.
Thanks