title: How can a process intercept stdout and stderr of another process on Linux?
body: <p>I have some scripts that ought to have stopped running but hang around forever.  Is there some way I can figure out what they're writing to STDOUT and STDERR in a readable way?</p>
  
  <p>I tried, for example, to do:</p>
  
  <pre><code>$ tail -f /proc/(pid)/fd/1
  </code></pre>
  
  <p>but that doesn't really work.  It was a long shot anyway.</p>
  
  <p>Any other ideas? </p>
  
  <p><code>strace</code> on its own is quite verbose and unreadable for seeing this.</p>
  
  <p>Note: I am <em>only</em> interested in their output, not in anything else.  I'm capable of figuring out the other things on my own; this question is only focused on getting access to stdout and stderr of the running process <em>after</em> starting it.</p>