Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!seismo!rutgers!ames!ucbcad!ucbvax!hplabs!sdcrdcf!ism780c!tim From: tim@ism780c.UUCP (Tim Smith) Newsgroups: comp.unix.wizards Subject: Re: impossible problem for find(1)? Message-ID: <6218@ism780c.UUCP> Date: Fri, 8-May-87 20:08:35 EDT Article-I.D.: ism780c.6218 Posted: Fri May 8 20:08:35 1987 Date-Received: Sun, 10-May-87 02:08:45 EDT Reply-To: tim@ism780c.UUCP (Tim Smith) Organization: Interactive Systems Corp., Santa Monica CA Lines: 44 If you are not going to do something a lot, it is sometimes faster to just write a shell script rather than try to figure out exactly which tools are right for the job. In this example, the following would work: $ find . -type d | dodir where dodir is the following shell script: #!/bin/sh BASE=`pwd` while read DIR do cd $BASE cd $DIR if [ -r INDEX ] then mkdir TEMP.$$ ln *xrefs TEMP.$$ ln INDEX TEMP.$$ cd TEMP.$$ if ls -lt | sed 2q | fgrep INDEX > /dev/null 2>&1 then # # Get here if INDEX is newer than # all the refs files # else # # Get here if some ref files are newer # than INDEX # fi cd .. rm -rf TEMP.$$ fi done Ok, I admit it is a kludge, but it works! -- Tim Smith "Froh wie seine Sonnen fliegen sdcrdcf!ism780c!tim Durch des Himmels praecht'gen Plan, Laufet, Brueder, eure Bahn, Freudig wie ein Held zum Siegen"