title: How to redirect output to STDERR?
body: <p>Suppose that I passed in 2 parameters to my function. How can I redirect a message to stderr?</p>
  
  <pre><code>#!/bin/bash
  if [ $# = 0 ]; then
      dir="."
  elif [ $# = 1 ]; then
      dir=$1
  elif [ $# -ge 2 ]; then
      echo "Too many operands." 2&gt;&gt; err.txt //???
      exit 1
  fi
  </code></pre>