title: Writing outputs to log file and console
body: <p>In Unix shell, I have a env file (<em>env file defines the parameters required for running the user script like log file name and path, redirect outputs and errors to log file, database connection details, etc</em>) which redirects all the outputs (<em>echo messages</em>) and errors to the log file from the executed script using the following code:</p>
  
  <pre><code>exec 1&gt;&gt;${LOG_FILE}
  exec 2&gt;&gt;${LOG_FILE}
  </code></pre>
  
  <p>The env file is executed at the beginning of each script. Due to the above code in env file all the console outputs that might be user outputs or errors are directly output to the log file which is what I actually needed.</p>
  
  <p>But there are some selective user outputs which I want to be displayed in both the console and the log file. But because of the above code I am not able to do so.</p>
  
  <p>I know that if I remove the above code I can get the desired result for this case, but I will have to manually write all other outputs to the log file which is not an easy task.</p>
  
  <p>Is there a way to get the output in both the console and the log file without removing the above codes?</p>