If the output is under your control, you can have date emit
easily-comparable dates.  Something like:

                  date +%Y%M%D%h%m%s

should do the trick (man date).

No Perl this time, even though I was tempted :)

Regards,

-- Raju

>>>>> "sreangsu" == sreangsu acharyya <[EMAIL PROTECTED]> writes:

    sreangsu> Hi, is there anyway by which one can compare 2 date
    sreangsu> strings as returned by "date" in bash.

    sreangsu>   I can ofcourse parse it with something like

    sreangsu> "^(???) (???) ([1-9]*) (([1-9]*:)*)([1-9]*) .* [1-9]*$"
    sreangsu> Thu Dec 28 17:19:35 IST 2000

    sreangsu> and then compare the year month and day. But I am
    sreangsu> looking for a simpler solution ( i.e without parsing )

    sreangsu> thanks in advance sreangsu


    sreangsu> p.s.  No Perl please ;) --

-- 
Raju Mathur          [EMAIL PROTECTED]           http://kandalaya.org/

----------------------------------------------
The mailing list archives are available at
http://lists.linux-india.org/cgi-bin/wilma/LIH

Reply via email to