title: Why is 'cp' failing in this shell script?
body: <p>Here's a snippet of code from a shell script I have written:</p>
  
  <pre><code>for src in $(find . -type f -maxdepth 1 \! -name ${deploy} \! -name gvimrc)
  do
      src=$(basename ${src})
      dest="~/.${src}"
      copy="${src} -&gt; ${dest}"
      cp $src $dest &amp;&amp; echo -e "${ok} ${copy}" || echo -e "${fail} ${copy}"
  done
  </code></pre>
  
  <p>For some reason, <code>cp</code> fails to execute. For example, in the case in which <code>$src='bashrc'</code>, I get this error:</p>
  
  <pre><code>cp: ~/.bashrc: No such file or directory
  </code></pre>
  
  <p>I don't understand why this happens, though, because obviously, <code>~/.bashrc</code> is the <em>destination</em>, not the source, so <code>cp</code> shouldn't care whether it exists or not. What exactly is going wrong?</p>