title: Write to terminal after redirecting stdout to a file without using stderr?
body: <p>I have two shell scripts, one that serves as the main "program" and another that serves as a "library." </p>
  
  <p>In several places in the "program," I'll do something like: <code>log "$thing" &gt;&gt; "$logfile"</code>, where <code>log</code> is a function defined in the "library."</p>
  
  <pre><code># program.sh
  
  logfile="log.txt"
  stuff="hahah heheh hoho"
  
  . library.sh 
  
  for thing in $stuff; do
    log "$thing" &gt;&gt; "$logfile"
  done
  </code></pre>
  
  <p>My question: Is there a way to redirect <em>some</em> of the output from the function back to the terminal <em>without</em> using <code>stderr</code>?</p>
  
  <pre><code># library.sh
  
  log () {
  
    # This gets written to the log
    echo "`date --rfc-3339=seconds`: $1"
  
    # How to write this to the terminal *without* using stderr?
    echo "Info: Message written to log." &gt;&amp;2
  
  }
  </code></pre>
  
  <p>I want to avoid the use of <code>stderr</code> because in my actual program, there's an option to redirect errors to a file, but the messages I want to send to the terminal are informational, not errors, and should always show up on the terminal.</p>