title: Simple tee example
body: <p>Can someone please explain why tee works here:</p>
  
  <pre><code>echo "testtext" | tee file1 &gt; file2
  </code></pre>
  
  <p>My understanding was that tee duplicates the input and prints 1 to screen.</p>
  
  <p>The above example allows the output from echo to be sent to 2 files, the first redirecting to the second.</p>
  
  <p>I would expect 'testtext' to be printed to screen and passed through file1 and landing in file2. Similar as to how the text in the following example would only end up in file2.</p>
  
  <pre><code>echo "testtext" &gt; file1 &gt; file2
  </code></pre>
  
  <p>Can anyone explain what i am missing in my understanding?</p>
  
  <p>Edit</p>
  
  <p>Is it because its writing to file and then to stdout which gets redirected?</p>