recursive grep

Perry Hutchison perry at ccssrv.UUCP
Thu Aug 31 06:27:56 AEST 1989


In article <7774 at cbmvax.UUCP> grr at 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 <dir> -type f -exec <command> \;

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.



More information about the Comp.unix.wizards mailing list