 <pre><code>exec 3&gt;&amp;1 1&gt;&gt;${LOG_FILE} 2&gt;&amp;1 </code></pre> <p>would send stdout and stderr output into the log file, but would also leave you with fd 3 connected to the console, so you can do</p> <pre><code>echo "Some console message" 1&gt;&amp;3 </code></pre> <p>to write a message just to the console, or</p> <pre><code>echo "Some console and log file message" | tee /dev/fd/3 </code></pre> <p>to write a message to <em>both</em> the console <em>and</em> the log file - <code>tee</code> sends its output to both its own fd 1 (which here is the <code>LOG_FILE</code>) and the file you told it to write to (which here is fd 3, i.e. the console).</p> <p>Example:</p> <pre><code>exec 3&gt;&amp;1 1&gt;&gt;${LOG_FILE} 2&gt;&amp;1 echo "This is stdout" echo "This is stderr" 1&gt;&amp;2 echo "This is the console (fd 3)" 1&gt;&amp;3 echo "This is both the log and the console" | tee /dev/fd/3 </code></pre> <p>would print</p> <pre><code>This is the console (fd 3) This is both the log and the console </code></pre> <p>on the console and put</p> <pre><code>This is stdout This is stderr This is both the log and the console </code></pre> <p>into the log file.</p>