I need a way to run grep on a list of files which may contain spaces in the file name. On a list of files with no spaces, it's pretty straight forward and easy. Also, i know how to deal with spaces in the file names for find & xargs. I'm just looking for a way to use grep with the -print0 command.
UPDATE: to clarify, i'm looking for text inside the file, not in the filename...
list all files
find * -print 0 | xargs -0 -i{} echo {}
but say i have to do a grep (or some other command) inbetween
lists files which contain "howdy doody" inside the file
find * | xargs grep -l "howdy doody" | xargs -i{} echo {}
This doesn't work, grep doesn't know how to recognize null terminated lines. maybe i missed something in grep's man page?
find * -print0 | xargs grep -l "howdy doody" | xargs -0 -i{} echo {}