Geeks Talk

Prepare for your Next Interview




Shell Script

This is a discussion on Shell Script within the Unix/Linux forums, part of the Operating Systems category; 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 ...


Go Back   Geeks Talk > Operating Systems > Unix/Linux

Register FAQ Members List Calendar Mark Forums Read
  #1 (permalink)  
Old 05-24-2007
Junior Member
 
Join Date: Sep 2006
Posts: 13
Thanks: 1
Thanked 0 Times in 0 Posts
henri084 is on a distinguished road
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 12:07 PM.
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 05-31-2007
Junior Member
 
Join Date: May 2007
Location: India
Posts: 1
Thanks: 0
Thanked 1 Time in 1 Post
uniqueshekhar is on a distinguished road
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
Reply With Quote
The Following User Says Thank You to uniqueshekhar For This Useful Post:
Reply

  Geeks Talk > Operating Systems > Unix/Linux


Thread Tools
Display Modes


Similar Threads

Thread Thread Starter Forum Replies Last Post
shell script Barbie Unix/Linux 13 10-11-2008 12:32 PM
Shell Scripting questions Geek_Guest Unix/Linux 4 11-05-2007 02:05 AM
Popular Shell in Linux norman Unix/Linux 1 09-25-2007 08:25 AM
Desktop and Shell replacement JobHelper Geeks Lounge 0 03-01-2007 09:40 AM
Difference in UNIX Shell scott Unix/Linux 2 07-23-2006 12:40 PM


All times are GMT -4. The time now is 01:16 PM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Copyright © 2008 GeekInterview.com. All Rights Reserved