Geeks Talk

Prepare for your Next Interview


Welcome to the Geeks Talk forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact contact us.

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 dd ...

Go Back   Geeks Talk > Operating Systems > Unix/Linux
Register Blogs FAQ Tag Cloud 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

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On
Trackbacks are On
Pingbacks are On
Refbacks are Off


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 12:18 AM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.3.1
Copyright © 2009 GeekInterview.com. All Rights Reserved