title: eval commands with STDERR/STDOUT redirection causing problems
body: <p>I'm trying to write a bash script where every command is passed through a function that evaluates the command using this line:</p>
  
  <pre><code>eval $1 2&gt;&amp;1 &gt;&gt;~/max.log | tee --append ~/max.log
  </code></pre>
  
  <p>An example of a case where it does not work is when trying to evaluate a cd command:</p>
  
  <pre><code>eval cd /usr/local/src 2&gt;&amp;1 &gt;&gt;~/max.log | tee --append ~/max.log
  </code></pre>
  
  <p>The part the causes the issue is the | tee --append ~/max.log part. Any idea why I'm experiencing issues?</p>