The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > OS Specific Forums > SUN Solaris
Google UNIX.COM


SUN Solaris The Solaris Operating System, usually known simply as Solaris, is a free Unix-based operating system introduced by Sun Microsystems .

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
while - comparision sharif Shell Programming and Scripting 2 11-01-2007 01:58 AM
alphanumeric comparision rakeshou Shell Programming and Scripting 3 09-27-2007 08:32 AM
date comparision kotasateesh UNIX for Dummies Questions & Answers 3 07-20-2007 08:25 AM
Number comparision in AWK vskr72 UNIX for Dummies Questions & Answers 1 11-22-2006 09:35 AM
SuSE comparision lungs Linux 8 02-11-2005 09:36 PM

Reply
 
Submit Tools LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 12-03-2006
Registered User
 

Join Date: Oct 2002
Location: India
Posts: 39
Stumble this Post!
date comparision

I am wriitng a shell script to compare a date in `date +%Y%m%d%H%M` to the output of `cat /var/adm/messages.0 | grep Temp |grep "CPU Fans" | cut -f1-4,19 -d' '` which looks like

Dec 2 11:30:57 79
Dec 2 11:37:58 79
Dec 2 11:44:58 79
Dec 2 11:50:59 79
Dec 2 11:58:00 79
Dec 2 12:05:01 79
Dec 2 12:11:01 79
Dec 2 12:18:02 79
Dec 2 12:21:02 80

How can I do this . My main issue is abbreviated month description .

Many thanks in advance
Reply With Quote
Forum Sponsor
  #2 (permalink)  
Old 10-26-2007
Registered User
 

Join Date: Sep 2007
Posts: 16
Stumble this Post!
Unhappy Compare two dates using shell scripting

a=2007-05-10 (YYYY-DD-MM Format)
b=2007-06-10

These are the two given dates and I need to compare.
(First It should split the dates into YYYY,dd,mm)

The script should first compare years(2007 here).If both are same or if "a" is lesser than "b"(ie.suppose year in "a" is 2006),it should print correct.If "a"(ie. suppose year in a is 2008) is greater than b,then it should print error.Similarly for the dates(05 and 06).

No need to check for the months(10).

Regards,
Dave Nithis.
Reply With Quote
Google The UNIX and Linux Forums
Reply

Thread Tools
Display Modes




All times are GMT -7. The time now is 05:27 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008 The CEP Blog All Rights Reserved -Ad Management by RedTyger Visit The Global Fact Book

Content Relevant URLs by vBSEO 3.2.0