title: How do I redirect a copy of all output of a shell script?
body: <p>I want to redirect a copy of all output of a shell script, there's some mount command and some echo in the script.</p>
  
  <p>If I use <code>&gt;&gt; 2&gt;&amp;1</code>, I can't see the output from the command line.<br>
  If I use <code>| tee -a the_log_file 2&gt;&amp;1</code>, I can get all output in command line, but in the_log_file, there's no mount error output such as <code>mount.nfs: /mnt/folder is busy or already mounted</code> which I also want in <code>the_log_file</code>  </p>
  
  <p>How can I fix this?</p>