I'm looking for a script to recursively replace a formatted block of text across all files and directories, with the search and replace text coming from external files. For example:
find.txt
Lorem ipsum dolor sit amet, consectetur adipiscing elit,
do eiusmod tempor incididunt ut labore et
dolore magna aliqua. Ut enim ad minim veniam, quis nostrud
replace.txt
Excepteur sint occaecat cupidatat
non proident, sunt in
culpa qui officia
deserunt mollit anim id
est laborum
And then a simple command along the lines of:
replace find.txt replace.txt /some/dir/*
This one is close but not quite. But it looks like perl slurp might be part of the solution?
I don't care what language it's scripted in, as long as it's common and runs on Linux. Thanks a lot!
grep|sedReplace a String in Multiple Files in Linux. be carefull, you are going to work with too sharp objects