Summary: Compare file dates

From: Gillon, Ian (Ian.Gillon@TelesensKSCL.com)
Date: Mon May 27 2002 - 09:54:00 EDT


Thanks to Peter Gergen, Stan Robinson, Bob Vickers, Harm Ensing, Oisin
McGuiness, alan@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@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.
**********************************************************************



This archive was generated by hypermail 2.1.7 : Sat Apr 12 2008 - 10:48:42 EDT