title: Unix find with spaces in filenames
body: <p>I'm using the following shell script to loop through a text file, then delete anything that matches the filename there.</p>
  
  <p>However, it does not work if the filename has spaces in it. How can this be rectified? Ideally my script will find and delete filenames with and without spaces....</p>
  
  <p>Any other improvements to this most appreciated.</p>
  
  <p>This is in OSX</p>
  
  <p>Thanks for your ideas and suggestions in advance,</p>
  
  <p>Dan</p>
  
  <pre><code>$ cat delete-files.sh
  #!/bin/sh
  
  PATH=/bin:/usr/bin:/usr/sbin
  export PATH
  
  for i in `cat /opt/scripts/files-to-delete.dat` ;
  
  do find /Volumes/folder/subfolder -iname $i -print -delete ;
  
  done
  </code></pre>
  
  <p>And the text file:</p>
  
  <pre><code>$ cat files-to-delete.dat
  LloydsTSB_Customer_Identification.html
  Santander_Update_Process.html
  asdasdasd asdasdasd.txt
  </code></pre>