title: Iterate over a list of files with spaces
body: <p>I want to iterate over a list of files. This list is the result of a <code>find</code> command, so I came up with:</p>
  
  <pre><code>getlist() {
    for f in $(find . -iname "foo*")
    do
      echo "File found: $f"
      # do something useful
    done
  }
  </code></pre>
  
  <p>It's fine except if a file has spaces in its name:</p>
  
  <pre><code>$ ls
  foo_bar_baz.txt
  foo bar baz.txt
  
  $ getlist
  File found: foo_bar_baz.txt
  File found: foo
  File found: bar
  File found: baz.txt
  </code></pre>
  
  <p>What can I do to avoid the split on spaces?</p>