I have a set of > 100,000 files to which I want to apply a sed script. Reading the accepted answer to this question:
Applying sed with multiple files
I see the suggestion involves invoking sed
for every single one of the files one is interested in, e.g.:
find $root_path -type f -name "whatever" -exec sed -i "somecommands" {} \;
but while this works - it's a bit silly. After all, sed is willing to work on many files, e.g.:
sed -i "somecommads" input_file_1 input_file_2
So, I would tend to prefer:
sed -i "somecommads" $(find $root_path -type f -name "whatever")
and this does work.
... except when you have a lot of files. Then, bash tells you "argument list is too long".
Is there an alternative to these two approaches for applying the same sed script to tends, or hundreds, of thousands of files?