title: Bash No such file or directory error
body: <p>When I do</p>
  
  <pre><code>for files in ~/Desktop/mydir/*.text; 
  do
             mycommand  "$files" &gt; "out.txt"
  done
  </code></pre>
  
  <p>It works fine. But when I do the same thing with</p>
  
  <pre><code>mycommand "$files" &gt; "~/Desktop/out.txt"
  </code></pre>
  
  <p>I get <code>~/Desktop/out.txt: No such file or directory.</code>
  Why?</p>