title: Socat: Allow reconnecting to a session
body: <p>I can setup an SSH connection with a local PTY link - and I want to be able to send some triggers to the remote end, then use screen or minicom to connect to the session ie:</p>
  
  <pre><code>socat PTY,link=/tmp/foo,raw,echo=0 EXEC:"ssh otherbox"
  </code></pre>
  
  <p>Then in another window (or background the socat)</p>
  
  <pre><code>echo "securepassword|sudo -S bash"
  screen /tmp/foo
  </code></pre>
  
  <p>The trouble is - after the echo, socat disconnects the EXEC - rather than keeping it open so that the PTY connection carries on.</p>
  
  <p>Any ideas? (I can sort of do this with expect or empty-expect, but its a faf with the former and buffering screws up the latter for the interactive part of the session.)</p>