Hi ALL,
I have been testing this script to run for every last Sunday of the month,looks like month which have 5 sunday (july 2016 )is not passing this and failing every time.
Here is what I am using,
current_date=31
echo " CURRENT DAY -> $current_date"
if [ $current_date -le 7 ]
then
week=A
else
if [ $current_date -gt 7 ] && [ $current_date -le 14 ];
then
week=B
else
if [ $current_date -gt 14 ] && [ $current_date -le 21 ];
then
week=C
else
if [ $current_date -gt 21 ] && [ $current_date -le 28 ] ;
then
week=D
else
week=E
fi
fi
fi
fi
echo "CURRENT WEEK --> $week"
echo ""
WEEK is a variable which I am passing with the script.
ksh test_script.sh D
Any clue will be highly appreciated.Thanks again for your time.