Summary: Compare file dates

From: Gillon, Ian <Ian.Gillon_at_TelesensKSCL.com>
Date: Mon, 27 May 2002 14:54:00 +0100

Thanks to Peter Gergen, Stan Robinson, Bob Vickers, Harm Ensing, Oisin
McGuiness, alan_at_nabeth.cxo.cpqcorp.net & Jerome M Berkman for their
suggestions

The solution I went with was the simplest:

file1_date=`ls -al file1_full_path |awk '{print $7" "$6" "$8}'`
file2_date=`ls -al file2_full_path |awk '{print $7" "$6" "$8}'`
if [ $file1_date = $file_date2 ]
then
  echo "file dates are the same"
else
  echo "file dates are not the same"
fi

but I was provided with other solutions in perl & C that uses the stat
system call.

thanks again

> Ian

-----Original Message-----
From: Gillon, Ian [mailto:Ian.Gillon_at_TelesensKSCL.com]
Sent: 24/05/2002 09:41
To: Tru64 Unix (E-mail)
Subject: Compare file dates


Hi there,

Does anyone know how I would compare the date/timestamp of two files to see
whether they matched or not?

thanks in advance

> Ian
> Ian Gillon
> Technical Services Group
> T e l e s e n s K S C L
> S h a p i n g t h e f u t u r e o f b i l l i n g
>
>
>



**********************************************************************
Legal Disclaimer : This e-mail is for the intended recipient only.
If an addressing or transmission error has misdirected this e-mail,
please notify the sender by replying to this e-mail. If you are not
the intended recipient you must not use, disclose, distribute, copy,
print or rely on this e-mail. The opinions expressed in this message
are those of the sender and not those of TelesensKSCL.

This footnote also confirms that this e-mail has been swept by
MIMEsweeper for the presence of computer viruses.

Please note that TelesensKSCL monitors both incoming and
outgoing emails in accordance with our email policy.
**********************************************************************
Received on Mon May 27 2002 - 13:54:26 NZST

This archive was generated by hypermail 2.4.0 : Wed Nov 08 2023 - 11:53:43 NZDT