title: How could I pipe both stderr and stdout to the same file, coloring stderr red but not stdout?
body: <ul>
  <li>I need to capture the output and errors of script.sh in
  a single log file, retaining the order in which the output and errors
  were written</li>
  <li>I need the errors to be colored red, so that they stand out.</li>
  <li>This needs to be done without modifying the contents of script.sh.</li>
  </ul>
  
  <p>If script.sh executes the following:</p>
  
  <pre><code>echo "This is STDOUT line 1"
  echo "This is STDERR line 2" &gt;&amp;2
  echo "This is STDOUT line 3"
  </code></pre>
  
  <p>The log should look like</p>
  
  <pre><code>This is STDOUT line 1
  [RED]This is STDERR line 2
  This is STDOUT line 3
  </code></pre>
  
  <p>I know how to colorize text, so you may emit that explanation from your answer if you wish.</p>
  
  <p>Thanks.</p>