Quote:
Originally Posted by
Don Cragun
Just to be clear, is it true that you want the output of the sed from the 1st find to be written to standard output (and not be included in the changes made to updated files) while all of the other finds run seds that will make updates to the files and not write anything to standard outputa?
Why not run all of the sed commands in the last 10 invocations of sed in a single invocation of find -execing sed?
And, why not use two -execs in a single invocation of find instead of invoking find eleven times?
Thanks for help.
All of the
sed is basically a large 'OR' boolean.
Any particular file, could have any
sed condition, 1..."#conditions", so the the
sed needs to search for a condition in the file before moving on to the next file.
Basically, the script has expanded over time and now it's getting to the point where I'd like to refactor it.
That is sort of the question, is it more efficient to let
find search a massive amount of files and let
sed chew on one condition at a time? Which it does now, which is basically unrolling the loops in your suggestion about concatening the sed to two exec commands?
or as you suggest,
find pauses its search while let
sed grind on one file searching all the conditions at once?
Say average files to search is ~ 100,000 files, average size ~40k/~100k
Thanks for the thoughts.