How to check date variable according to the current date?

Hi folks,

I need to write a script that should activate a process according to the current hour.
The process should be activatet only if the hour is between midnight (00:00) and 07:00.
How should I create the condition?

Thanks in advance,
Nir

TIME=$(date '+%H%M%S')
if [ $TIME -ge 000001 ] && [ $TIME -le 070000 ];
then
echo "time between 00:01 and 07:00"
else
echo "other time"
fi

Hi Ikon,

Thanks a lot!!

Best regards,
Nir