|
|
|
|
|
by WizardClickBoy
646 days ago
|
|
Thanks! Gippity did suggest the xargs approach as an alternative, but I found that find [...] - exec [...] {} + as opposed to find [...] - exec [...] {} \; worked fine and was performant enough for my use-case. An example command was find . -type f -name "*.html" -exec sed -i '' -e 's/\.\.\/\.\.\/\.\.\//\.\.\/\.\.\/\.\.\/source\//g' {} + which took about 20s to run |
|
If your sed is GNU, or otherwise sane, one can also `sed -Ee` and then use `s|\Q../../../|` getting rid of almost every escape character. I got you half way there because one need not escape the "." in the replacement pattern because "." isn't a meta character in the replacement space - what would that even mean?
1: https://en.wikipedia.org/wiki/Leaning_toothpick_syndrome