title: What does the "=~" operator do in shell scripts?
body: <p>It seems that it is sort of comparison operator, but what exactly it does in e.g. the following code (taken from <a href="https://github.com/lvv/git-prompt/blob/master/git-prompt.sh#L154">https://github.com/lvv/git-prompt/blob/master/git-prompt.sh#L154</a>)?</p>
  
  <pre><code>    if [[ $LC_CTYPE =~ "UTF" &amp;&amp; $TERM != "linux" ]];  then
              elipses_marker="…"
      else
              elipses_marker="..."
      fi
  </code></pre>
  
  <p>I'm currently trying to make <code>git-prompt</code> to work under MinGW, and the shell supplied with MinGW doesn't seem to support this operator:</p>
  
  <pre><code>conditional binary operator expected
  syntax error near `=~'
  `        if [[ $LC_CTYPE =~ "UTF" &amp;&amp; $TERM != "linux" ]];  then'
  </code></pre>
  
  <p>In this specific case I can just replace the entire block with <code>elipses_marker="…"</code> (as I know my terminal supports unicode), but what exactly this <code>=~</code> does?</p>