Iterate over a list of files with spaces

You could replace the word-based iteration with a line-based one:

find . -iname "foo*" | while read f
do
    # ... loop body
done

Leave a Comment