I am trying to check if the day is Sunday or Friday, and if the time is later than hour 20.
If so, then I want to do something; if not, I want to do something else.
I am using /bin/sh.
This gives me below error:
Too many arguments.
Why ?
day_of_week=$(date -d $given_date +%u )
hour_of_day=${ST_job:0:2}
if [ [ $day_of_week -eq 7 ] || [ [ $day_of_week -eq 5 ] && [ $hour_of_day -gt 20 ] ] ] ; then
something
else
something else
fi
Thanks