how'ld u write a shell script that would check if a date entered in yyyy mm dd format is a saturday. i kno how to write it in mm dd yy format
Printable View
how'ld u write a shell script that would check if a date entered in yyyy mm dd format is a saturday. i kno how to write it in mm dd yy format
echo "Enter Date :"
read ate
date --date=$ate > /tmp/date
aday=`cut -c 1-3 /tmp/date`
if [ $aday = 'Sat' ] ; then
echo "Saturday at $ate "
else
echo "Not saturday at $ate as $aday"
fi
Regards,
Shekhar