Sweet, works like a charm. Just finishing off the pattern now...
Ok, one last glitch with the completed mashup.
I'm trying to use find to send filenames to that perl command - which *was* working - it worked the first time wonderfully. It modified exactly one file, the only file that contained the matching text.
But the issue was that I'm also getting a ton of output, basically dumping every file to stout.
Essentially I'm did
find . | xargs perl -0777 -pe -i ‘s!something!else!g’
When I tried sending output to /dev/null like this:
1> /dev/null
I then get a ton of errors that indicate it's breaking with the filenames containing spaces.
And now, I can't seem to get the find to work properly at all, even seemingly using the exact same structure I first tried. If I use the -name param for find I get the errors. If I use the same structure as I did initially I see a lot of files change their modified date and the one file that should have been changed, isn't.
The perl portion of the command is the same except for the -i param which can't be used when testing with a piped cat of the target file.
Further, I've seen strange behavior when I change the format of the params to perl.
Example: -pie versus -pe -i versus -p -i -e
Edited by hybrid8 (14/09/2011 16:42)