Path: utzoo!censor!geac!jtsv16!uunet!zephyr.ens.tek.com!tektronix!sequent!ccssrv!perry From: perry@ccssrv.UUCP (Perry Hutchison) Newsgroups: comp.unix.wizards Subject: Re: recursive grep Message-ID: <593@ccssrv.UUCP> Date: 30 Aug 89 20:27:56 GMT References: <666@lakart.UUCP> <1641@cbnewsl.ATT.COM> <7774@cbmvax.UUCP> Reply-To: perry@ccssrv.UUCP (Perry Hutchison) Organization: Control-C Software, Inc., Beaverton, OR Lines: 18 In article <7774@cbmvax.UUCP> grr@cbmvax.UUCP (George Robbins) writes: >in which case the "find | filter | sh" can stil handle the problem. It may >not be as quick, since it does one command per filename, but it's certainly This discussion has now come full circle. The whole point of the original posting was how to run the command once per *directory* instead of once per *file*, so as to reduce overhead. It has been previously noted that once per file is readily accomplished without pipes or filters by find -type f -exec \; It seems that xargs, if available, reduces overhead satisfactorily although it will not produce "one execution per directory" as such. If xargs is not available or if exactly one execution per directory is needed, one may need a nearly-trivial script (original poster's solution) since "find" will not substitute a {} which appears *within* an argument. This limitation is arguably a (longstanding) flaw in find.