10-06-04 12:50 PM
In article <b8a63f96.0410060003.56eda17d@posting.google.com>, doofer_spam@yahoo.de (Stefanie
) writes:
> Hi all,
>
> I am writing a Korn Shell script in which I need to read a line from a
> logfile, parse the date from it and check whether that date is older
> than five minutes.
>
> The date has this format: "Oct 6 07:51:55 2004"
>
> The problem now is, how can I format this date into unix timestamp
> format, so I can compare how old it is?
>
>
> Thanks,
>
> Stefanie
perl -le 'print time'
prints the date in Unix time format, i.e. seconds since 1970.
This is easy to calculate.
--
Michael Tosch
IT Specialist
HP Managed Services
Technology Solutions Group
Hewlett-Packard GmbH
Phone: +49 2407 575 313
Mail: michael.tosch:hp.com
[ Post a follow-up to this message ]
|