title: Unix : How to modify and redirect stdout of all running processes
body: <p>I want to modify and redirect the output of all running process. I know that if i know the name of the process i can do something like this</p>
  
  <pre><code>process 2&gt;&amp;1 &gt;/dev/null 
  </code></pre>
  
  <p>which will redirect stderr and stdout to dev/null. First, how would i modify the stdout before sending it to dev/null or anywhere else? One possible solution is </p>
  
  <pre><code>process 2&gt;&amp;1 | awk '{print "$SOME_ENV_VAR|" $0;}' &gt; dev/null
  </code></pre>
  
  <p>is this the correct way? Does it endure that both stdout and stderr are redirected? </p>
  
  <ol>
  <li><p>What if instead of redirecting to dev/null, i want to print to console?</p></li>
  <li><p>The bigger problem is, how to do this for each running process? I need to do this in a linux box where i dont know the names of  the processes running. Is that feasible?</p></li>
  </ol>
  
  <p>I am fairly new to shell scripting so please forgive me is these questions are trivial.</p>