find with spaces in filenames

Set bash’s internal field seperator to an enter instead of a space, so grep (or whatever) doesn’t freak out:

[code lang=”bash”]IFS=’
‘ ; for i in `find -name “*.php” ` ; do grep foo $i ; done[/code]

Leave a Reply