Prepare for your Next Interview
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 ...
|
|||
|
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. |
| Sponsored Links |
|
|||
|
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 |
| The Following User Says Thank You to uniqueshekhar For This Useful Post: | ||
![]() |
|
| Thread Tools | |
| Display Modes | |
|
|
|
||||
| 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 |