title: Capture STDIN / STDERR / STDOUT of a process AFTER it's been started, using command line?
body: <p>Thanks! My usercase: I started a lengthy interactive 'configure' process (say under 'screen'), and then realised I need to always answer 'no' until I see a particular keyword. Seems a waste of time to do this by hand (not to say that I can easily miss the keyword..)</p>
  
  <p>Thus it seems I want to pipe (a copy of) STDERR / STDOUT to a filter, 
  and also be able to inject into the STDIN of a (console) process, 
  AFTER it's been started, using command line? Is there a ready-made solution? </p>
  
  <p>The following tools seem help. To capture output, use </p>
  
  <pre><code>strace -ewrite -p $PID
  </code></pre>
  
  <p>It's not that clean (shows lines like: write(#,) ), but works!
  But does it say handle UTF8 correctly? </p>
  
  <p>To redirect the output, do something like</p>
  
  <pre><code>printf '..input..' &gt;/dev/pts/33
  </code></pre>
  
  <p>But it is not clear how to find the right device.. </p>