title: Reopen STDOUT and STDERR after closing them?
body: <p>In bash consider I did this stupid thing:</p>
  
  <pre><code>$ exec 1&gt;&amp;-
  $ exec 2&gt;&amp;-
  </code></pre>
  
  <p>I am sure I have not yet lost the game (oops actually I lost <a href="https://en.wikipedia.org/wiki/The_Game_(mind_game)" rel="noreferrer">The Game</a>) and I can reconnect to stdout. The think is I don't know how. </p>
  
  <p>First thing I tried is create a fifo and using another shell to monitor stdout of the first shell. It did not work, I don't know why: </p>
  
  <h3>tty1</h3>
  
  <pre><code>$ mkfifo stdout
  $ exec 1&gt;stdout
  $ echo "Hello stdout"
  </code></pre>
  
  <h3>tty2</h3>
  
  <pre><code>$ tail -f stdout
  $ # nothing here
  </code></pre>
  
  <blockquote>
    <p>How can I reconnect my closed <code>STDOUT</code> and <code>STDERR</code> after all?</p>
  </blockquote>
  
  <p>I know that a solution would be to save STDOUT before playing with it: </p>
  
  <pre><code>$ exec 3&gt;&amp;1
  $ exec 1&gt;&amp;-
  $ echo "Nothing will see this"
  $ exec 1&lt;&amp;3 # Restoring stdout
  </code></pre>