Article View: mod.std.unix
Article #415Re: file times and shell commands
From: std-unix
Date: Thu, 04 Dec 1986 15:18
Date: Thu, 04 Dec 1986 15:18
31 lines
1660 bytes
1660 bytes
From: glc@akgua.UUCP (glc)
Date: 30 Nov 86 16:02:09 GMT
Organization: AT&T Technologies/Bell Labs, Atlanta
> > There doesn't appear to be any decent way to compare the last modified
> > times of files from the shell...
>
> Before everybody starts inventing their own names for this, it should be
> noted that V8 already has a program for this, newer(1).
The newer(1) program is a very good solution to the problem. For
those who (for whatever reason) do not wish to implement it, there
is an alternate method using the "make" command.
Make(1) has the "-q" option which causes it to return zero or
non-zero after checking the dependencies. Here is an example:
if echo "$DEPENDENT:$CONTROL;:" | make -f - -q
then # The dependent file is up-to-date
else # The control file is newer that the dependent file
fi
Cheers,
Lindsay
Lindsay Cleveland (akgua!glc) (404) 447-3909 Cornet 583-3909
AT&T Technologies/Bell Laboratories ... Atlanta, Ga
Volume-Number: Volume 8, Number 61
Technical Details
Message-ID:
<6495@ut-sally.UUCP>Path:
arc1-ca.pugleaf.net!utzoo!decvax!ucbvax!cartan!ucbcad!ames!lll-crg!seismo!ut-sally!std-unixReferences:
<6177@ut-sally.UUCP> <6196@ut-sally.UUCP>Show Full Headers
Complete Article Headers
Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: arc1-ca.pugleaf.net!utzoo!decvax!ucbvax!cartan!ucbcad!ames!lll-crg!seismo!ut-sally!std-unix From: std-unix@ut-sally.UUCP Newsgroups: mod.std.unix Subject: Re: file times and shell commands Message-ID: <6495@ut-sally.UUCP> Date: Thu, 4-Dec-86 10:18:16 EST Article-I.D.: ut-sally.6495 Posted: Thu Dec 4 10:18:16 1986 Date-Received: Fri, 5-Dec-86 00:15:42 EST References: <6177@ut-sally.UUCP> <6196@ut-sally.UUCP> Organization: IEEE P1003 Portable Operating System for Computer Environments Committee Lines: 31 Approved: jbc@sally.utexas.edu Summary: Another way to do it