Article View: comp.unix.shell
Article #29Re: FILE TIMES - (Repeat)
From: Tom Christiansen
Date: Fri, 30 Oct 1992 17:47
Date: Fri, 30 Oct 1992 17:47
20 lines
1599 bytes
1599 bytes
From the keyboard of B.Kumar@cs.ucl.ac.uk:
: Is there a nice way of producing conditional expressions for
:use in shell scripts (csh/sh) which compare the creation and modification
:times of files? Test does not seem to do this.
Of course not. Creation is a myth.
Comparing modify, access, or inode change times is most easily
done using things like
if [ `ls -t file1 file2 | sed 1q` = file1 ]; then ...
if [ `ls -tu file1 file2 | sed 1q` = file1 ]; then ...
if [ `ls -tc file1 file2 | sed 1q` = file1 ]; then ...
--tom
--
Tom Christiansen tchrist@convex.com convex!tchrist
"The number of UNIX installations has grown to 10, with more expected."
- _The UNIX Programmer's Manual_, Second Edition, June, 1972.
Technical Details
Message-ID:
<1992Oct30.174715.1689@news.eng.convex.com>Path:
arc1-ca.pugleaf.net!sparky!uunet!charon.amdahl.com!pacbell.com!ames!saimiri.primate.wisc.edu!zaphod.mps.ohio-state.edu!cs.utexas.edu!convex!convex!tchristReferences:
<3158@ucl-cs.uucp>Show Full Headers
Complete Article Headers
Newsgroups: comp.unix.shell
Path: arc1-ca.pugleaf.net!sparky!uunet!charon.amdahl.com!pacbell.com!ames!saimiri.primate.wisc.edu!zaphod.mps.ohio-state.edu!cs.utexas.edu!convex!convex!tchrist
From: Tom Christiansen <tchrist@convex.COM>
Subject: Re: FILE TIMES - (Repeat)
Originator: tchrist@pixel.convex.com
Sender: usenet@news.eng.convex.com (news access account)
Message-ID: <1992Oct30.174715.1689@news.eng.convex.com>
Date: Fri, 30 Oct 1992 17:47:15 GMT
Reply-To: tchrist@convex.COM (Tom Christiansen)
References: <3158@ucl-cs.uucp>
Nntp-Posting-Host: pixel.convex.com
Organization: Convex Computer Corporation, Colorado Springs, CO
X-Disclaimer: This message was written by a user at CONVEX Computer
Corp. The opinions expressed are those of the user and
not necessarily those of CONVEX.
Lines: 20