On 28-Jul-00 Bret Hughes wrote:
> I hate asking questions about what I thought was going to be
> a simple operation but I cannot find an easy way to compare
> timestamps of two files. I felt certain that I sould be
> able to do this without awking the ls -l outputs but maybe
> not? What I want to do is after wget runs, if a particular
> file's timestamp is newer that the old one I eed to notify
> someone via mail. The mail part I can do. It is timestamp
> stuff that is escaping me.
>
> It may be that lack of sleep is impairing my already
> questionable judgement (6 week old new baby) so if this a
> really simple one please don't hestate to give me a hard
> time :)
given 2 files "file_name_1" and "file_name_2":
x=`find file_name_1 -newer file_name_2 | wc -l`
if [ $x = 1 ] ; then echo true ; else echo false; fi
The above echos "true" if file_name_1 is newer than file_name_2,
false otherwise.
The above template should be enough to help you do what you want...
-Greg
----------------------------------
E-Mail: Gregory Hosler <[EMAIL PROTECTED]>
Date: 31-Jul-00
Time: 09:51:42
If Bill Gates had a dime for every time a Windows box crashed...
...Oh, wait a minute, he already does.
----------------------------------
--
To unsubscribe: mail [EMAIL PROTECTED] with "unsubscribe"
as the Subject.