title: shell script mv is throwing unhelpful error "No such file or directory" even though i see it
body: <p>I need to use a shell script to move all files in a directory into another directory.  I manually did this without a problem and now scripting it is giving me an error on the <code>mv</code> command.</p>
  
  <p>Inside the directory I want to move files out of are 2 directories, php and php.tmp.  The error I get is <code>cd: /path/to/working/directory/php: No such file or directory</code>.  I'm confused because it is there to begin with and listed when I ls the working directory.</p>
  
  <p>The error I get is here:</p>
  
  <pre><code>ls $PWD #ensure the files are there
  mv $PWD/* /company/home/directory
  ls /company/home/directory #ensure the files are moved
  </code></pre>
  
  <p>When I use <code>ls $PWD</code> I see the directories I want to move but the error afterward says it doesn't exist.  Then when I ssh to the machine this is running on I see the files were moved correctly.</p>
  
  <p>If it matters the directory I am moving files from is owned by a different user but the shell is executing as root.</p>
  
  <p>I don't understand why I would get this error so, any help would be great.</p>