Regarding GNU Grep's handling of filenames, especially including interactions
between grep and different command shells:
David Wheeler has recently written an essay that covers quite a bit of the
ground that's being discussed here. The essay covers surveys the problems
that "exotic" characters (e.g. newlines) in filenames can cause, and
discusses strategies at various levels for mitigating these problems.
The essay can be found at:
http://www.dwheeler.com/essays/fixing-unix-linux-filenames.html
cheers,
behoffski