Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!seismo!ll-xn!cit-vax!trent From: trent@cit-vax.Caltech.Edu (Ray Trent) Newsgroups: comp.unix.wizards Subject: Re: impossible problem for find(1)? Message-ID: <2459@cit-vax.Caltech.Edu> Date: Fri, 24-Apr-87 15:43:16 EST Article-I.D.: cit-vax.2459 Posted: Fri Apr 24 15:43:16 1987 Date-Received: Sat, 25-Apr-87 20:58:47 EST References: <2645@phri.UUCP> Reply-To: trent@cit-vax.UUCP (Ray Trent) Organization: California Institute of Technology Lines: 36 In article <2645@phri.UUCP> roy@phri.UUCP (Roy Smith) writes: > > A user posed a problem which I can't solve. She wants to find all >the files named *refs which are newer than a file called INDEX in the same >directory. Thus she wants to know if any of ./x/foorefs, ./x/barrefs or Here's a cute solution: Place the following into the Makefile for each of the directories: ---start of new lines--- INDEX : *refs echo "`pwd`: "; ls $? ---end of new lines--- and execute: find . -name INDEX -exec make -s INDEX \; I just tried this and it does exactly what you requested. The -name INDEX part of the find command is so that make doesn't get executed in directories not containing an INDEX. The -s option on make causes the output command not to be echoed. The $? in the output command in the Makefile refers to all prerequitsites that are not up to date. This way of doing it has the advantage that you can format the output pretty much any way you want to by changing the command line in the Makefile. Remember, you too can use make for *anything*. -- ../ray\.. (trent@csvax.caltech.edu, rat@caltech.bitnet, ...seismo!cit-vax!trent)