-
Junior Member
Shell Script
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
Last edited by henri084; 06-18-2007 at 11:07 AM.
-
Junior Member
Re: Shell Script
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
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules