title: A bit curious about `mysql -e` output format with & without redirect
body: <p>Say when I run <code>mysql -u user -p -e 'select id from db.users limit 1'</code>, I got:</p>
  
  <pre><code>+------+
  | id   |
  +------+
  | 8434 |
  +------+
  </code></pre>
  
  <p>When I redirect the output/stdout to some file, like <code>mysql -u user -p -e 'select id from db.users limit 1' &gt; /tmp/a.txt</code>, then I <code>cat /tmp/a.txt</code>, I got:</p>
  
  <pre><code>id
  8434
  </code></pre>
  
  <p>So where do those little format strings go? Does it mean that <code>mysql</code> knows when it is redirected, so it returns a different format? I always thought a redirect(<code>&gt;</code>) doesn't concern the previous command, that it doesn't have to know if or where its output is redirected. Or is it another explanation?</p>