When I'm working on a project I don't know much about, I do this before I do the compiles, so that the file FILES only has the source code:
find . -type f -print > FILES
Then, on most Unix platforms, I can do something like this with FILES:
xargs egrep whatever < FILES
On the Mac, however, this often breaks because of spaces in file names. I know about the -print0 option in find, so I could have two files, FILES and perhaps FILES0, which I could produce with:
find . -type f -print0 > FILES0
I could then follow that with this:
xargs -0 egrep whatever < FILES0
But I just figured out another solution...
I can do this in one step like this:
tr '\n' '\0' < FILES | xargs -0 egrep whatever
And, this could be plopped into a script like:
#!/bin/sh
tr '\n' '\0' | xargs -0 "$@"
and maybe call it xargs0. Then I could do:
xargs0 egrep whatever < FILES
Mac OS X Hints
http://hints.macworld.com/article.php?story=20090710062214206