![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| comparing dates | ragha81 | Shell Programming and Scripting | 17 | 10-25-2006 05:38 PM |
| Comparing two dates | guptan | Shell Programming and Scripting | 5 | 11-25-2005 11:46 AM |
| Comparing last modified dates | dmilks | Shell Programming and Scripting | 1 | 08-16-2005 09:01 PM |
| comparing dates | svh | High Level Programming | 2 | 07-19-2005 10:04 AM |
| comparing 2 dates in Bourne shell | scmay | Shell Programming and Scripting | 1 | 04-28-2004 07:04 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread |
Rating:
|
Display Modes |
|
|
|
||||
|
hi ,
I have two variables both containg dates, x= `date` and y= `date' their format being -> Fri Nov 12 22:59:50 MST 2004 how do I compare which one is greater. ->Can dates be converted into integer and then compared? ( one lengthy way would be to compare the words one by one (i.e., first compare year then month then day....) ) But is their a simpler way of can any one help me please. Thanks Last edited by k_oops9; 11-13-2004 at 02:29 AM.. |
|
|||||
|
Unix is used loosely with both Unix and Linux the assumption goes with date +%s "unix"...
unless the original post specified otherwise. what you are claiming is a little irrelevant its off topic and doesn't help the opriginal poster solve their problem.. do you have a better answer.. ifact do you know what flavour of Unix the original poster is uisng.. since linux is basically unix. try gawk "substrings" to compare strings as you would in C just put the whole value of the time stamp in a variable and compare using the awk string comparison command..(awk is basically a language not a command so it will do the job just as you want) you will have to look it up in the man pages or try http://www.sourceforge.net to get the exact command since I am little rusty on awk.. moxxx68 |
![]() |
| Bookmarks |
| Tags |
| linux |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|