No, that's not a misspelling in the title. I switched back to gentoo on my lappy, so while re-constructing my environment I found I forgot to install this swell little tool. I've been meaning to mention ack for a while. Ack is a nice little command line perl script, that describes itself "as a replacement for 99% of the uses of grep". If you find yourself typing anything similar to find . | xargs grep foo, you owe it to yourself to try ack, if you haven't already.
or if you want something a little more python-y, grin is virtually
identical. I don't actually know if there is any functional difference,
but it can be easy_installed, and that's always nice.
While I appreciate that this isn't really the point of your post, 'grep foo
-R .' does what your example does. Might be worth finding a more
expressive/interesting example (and showing how ack does it better),
because I haven't seen anything to make me check it out yet...
Alternatively, you could switch from bash to zsh. This has superior
filename expansion, including expanding through a directory tree. For
example:
There are plenty of examples on the ack home page at
http://petdance.com/ack/.