title: Duplicate IO with file descriptors
body: <p>I would like to route a file descriptor to <strong>multiple</strong> places at the same time.  For instance I would like every command in my script to print stdout to /dev/ps/9 and ./myscript.stdout  at the same time.</p>
  <p>I'm looking to achieve similar results as piping every command in a script (or a section of a script) into <code>tee</code>, perhaps with file descriptors.  I also want the ability to restore default output behavior later in the script.</p>
  <p>This code doesn't work, but it's an attempt at expressing my intent.  To restore stdout as FD 1 later, I copy it into FD 4.</p>
  <pre><code>exec 3&gt;(tee /dev/ps/9 ./myscript.stdout)
  exec 4&gt;&amp;1
  exec 1&gt;&amp;3
  </code></pre>
  <p>Restore normal output behavior, deleting FDs 3 and 4.</p>
  <pre><code>exec 1&gt;&amp;4
  exec 4&gt;&amp;-
  exec 3&gt;&amp;-
  </code></pre>