I needed to append some text to a bunch of files in a directory, so I thought I'd be clever and try something like this:
find . -name "*.txt" -exec cat source >> {} \;
Which did not work, of course, because the redirect gets picked up by the shell calling find, and not by the exec.
I ended up using BBEdit and a multi-file find/replace to do it, but I am sure there's some way to make find do this from the command line, but what?
Well, OK, I can think of one solution, but I don't like it: have exec spawn a shell for each result. That might work.