I am trying to write a script that will check to see if one
directory is older than another, then do something. I have
NEW_PATCH=`ls -ld /apps/R_PATCHES |cut -c42-47`
OLD_PATCH=`ls -ld /apps/PATCHES |cut -c42-47`
if [ "$NEW_PATCH" -gt "$OLD_PATCH" ]
echo "$NEW_PATCH is greater than $OLD_PATCH"
This gives me the two dates, $NEW_PATCH = May 3 and $OLD_PATCH
= Mar 13, however the two dates in this form are
not "algebraically" different so nothing happens. I can not see
how using the dates as a string would help either. Is there a
function call that I can add to my script to change these dates
and if so what is the syntax, as I have not used functions? Is
there a better way to find out if one directory is older than
Any help that can be provided would be appreciated.
I thank you in advance.
Mark A. Lane
* Sent from RemarQ http://www.remarq.com The Internet's Discussion Network *
The fastest and easiest way to search and participate in Usenet - Free!