Today, I had to remove 650 instances of a line matching a certain pattern scattered across 145 different XML files. Not a pleasant task. (If you’re wondering, I’m deprecating a field in the XML DTD and wished to remove all current instances).
Just to save you all the searching and debugging, here is the final form and my notes.
egrep -rl '^<pattern>$' * | xargs sed -i .bak '/^<pattern>$/d' |
Recent Comments