title: Redirecting standard output to a file containing the pid of the logging process
body: <p>I've searched for a while but i can't either find an answer or come up with a solution of my own, so I turn to you guys. First question I actually ask here :)</p>
  
  <p>I would like to run several instances of the same program, and redirect each of these programs' standard output to a file that contains that same process' pid, something like:</p>
  
  <pre><code>my_program &gt; &lt;pid of the instance of my_program that is called in this command&gt;.log
  </code></pre>
  
  <p>I'm aware that this is not even close of the way to go :P I have tinkered around with exec and $PPID but to no avail. My bash-fu is weak :| please help me, point me somewhere! Thanks!</p>