title: Send tee command via ssh
body: <p>I send a <code>tee</code> command from host 1 to host 2:</p>
  
  <pre><code>ssh user@host2 '/path/run |&amp; tee myFile.txt'
  </code></pre>
  
  <p>I use <code>tee</code> so that I get the output of the binary to be added to <code>myFile.txt</code></p>
  
  <p>The problem I have then is after a bit of time, I want to regain control of my local host without having a lot of printout. So I do CTRL+C. This lets the process on host2 continue to run, which is what I want, but it stops the <code>tee</code> process itself, so the file is not populated.</p>
  
  <p>I tried to replace <code>|&amp; tee myFile.txt'</code> by <code>2&gt;&amp;1  myFile.txt' &amp;</code> but it did not help.</p>
  
  <p>How can I ensure that the file continues to be populated on host2, while regaining control to my session on host1?</p>