title: mv a file that contains spaces from a shell script
body: <p>I am trying to <code>mv</code> a file (rename it to replace spaces with dashes). If I pass the source and dest arguments without quotes, the source is broken up because <code>mv</code> thinks it is the end of the argument. </p>
  
  <p>If I surround source and dest with arguments, mv reports that the source can't be found.  Currently, $1 and $2 have hardcoded quotes at the beginning and end. $onam and $dnam are the equivalents without the hardcoded quotes.  </p>
  
  <p>This command from a prompt works perfectly because source and dest are surrounded by quotes:</p>
  
  <pre><code>mv "/home/bryan/renametest/TestFolder/test file" "/home/bryan/renametest/TestFolder/test---file"
  </code></pre>
  
  <p>Here is what I've tried so far (inputs and results)</p>
  
  <pre><code>mv $1 $2
  mv: cannot stat `"/home/bryan/renametest/TestFolder/test   file"'
     No such file or directory
  
  mv $onam $dnam
  mv: cannot move `/home/bryan/renametest/TestFolder' to a subdirectory of itself, 
    `/home/bryan/renametest/TestFolder/test---file'
  
  mv $1 $dnam
  mv: cannot stat `"/home/bryan/renametest/TestFolder/test   file"': 
    No such file or directory
  
  mv $onam $2
  mv: cannot move `/home/bryan/renametest/TestFolder' to `"/home/bryan/renametest/TestFolder/test---file"': 
    No such file or directory
  </code></pre>
  
  <p>How can I move those files with the spaces?</p>