title: Reading rsync source from file results in improper parsing of file names with white space
body: <p>I wrote a simple script that searches through a specific directory defined by the variable "SCOPE" producing a list of directories that were modified within the past 24 hours printing them to a temp file. The first line of the file is deleted (to exclude the root level of the directory). Finally, it loops over the contents of the temp file and rsync's each of the directories to the destination. </p>
  
  <p><strong>Problem</strong>
  Directories that contain white space in their name do not rsync. The space causes everything before the whitespace and after the whitespace to be passed as individual arguments, and thus invalid filenames. </p>
  
  <p><strong>Observation</strong>When I examine the contents of the temp file, each directory appears on a single line as expected. It appears that only when it is read into rsync from the file </p>
  
  <p>How can I prevent the whitespace in the directory names from preventing those directories from failing to rsync? </p>
  
  <pre><code>SCOPE="/base/directory"           
  DESTINATION="/volumes/destination/"       
  
  find "$SCOPE" -maxdepth 1 -type d -mtime 0 &gt; /tmp/jobs.txt;
  
  sed '1d' /tmp/jobs.txt &gt; /tmp/tmpjobs.txt;                      
  mv /tmp/tmpjobs.txt /tmp/jobs.txt;
  
  for JOB in `cat /tmp/jobs.txt`; do
      rsync -avvuh "$JOB" "$DESTINATION";          
  done
  </code></pre>