LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   AIX (http://www.linuxquestions.org/questions/aix-43/)
-   -   date comparision (http://www.linuxquestions.org/questions/aix-43/date-comparision-4175447790/)

rajachan 01-29-2013 11:29 PM

date comparision
 
hi ..

i need to do ksh script to compare two dates.

one date is from file which have output like below
11-JAN-13
06-MAR-11

second date should be 15 days before the current date.
for ex: if currrent date is 30 jan... second date should be 15 jan


now i have to compare these two dates.

if 11-JAN-13 >second date then
echo "output is date is recent(less than 15 days)
else
echo "not recent)"

unSpawn 01-30-2013 12:45 PM

Half of this question was answered here already: http://www.linuxquestions.org/questi...te-4175447005/ and for the comparison part converting dates to epoch is probably the easiest. See 'man date'?


All times are GMT -5. The time now is 07:36 AM.