Note that there are some explanatory texts on larger screens.

plurals
  1. POUnable to understand this strange MySql client behavior
    primarykey
    data
    text
    <p>I'm not sure what's going on here with the line art output by /usr/bin/mysql here. </p> <p><strong>The problem:</strong> I'm unable to redirect the line art (used in creating the table columns) to a file!</p> <p>First, I do this on my terminal.</p> <pre><code>[sd@host:~/tmp] $ mysql -usd sd -e 'select * from loan;' +---------+--------------+--------+ | loan_no | branch_name | amount | +---------+--------------+--------+ | L-11 | Round Hill | 900 | | L-14 | Downtown | 1500 | | L-15 | Perryridge | 1500 | | L-16 | Perryridge | 1300 | | L-17 | Downtown | 1000 | | L-23 | Redwood | 2000 | | L-93 | Mianus | 500 | +---------+--------------+--------+ </code></pre> <p>Now, I want this whole blessed thing printed above captured, so I redirect stdout and stderr to the file 'out', like so:</p> <pre><code>[sd@host:~/tmp] $ mysql -usd sd -e 'select * from loan;' &gt;out 2&gt;&amp;1 </code></pre> <p>As you can see below, the line art is completely missing! </p> <pre><code>[sd@host:~/tmp] $ cat out loan_no branch_name amount L-11 Round Hill 900 L-14 Downtown 1500 L-15 Perryridge 1500 L-16 Perryridge 1300 L-17 Downtown 1000 L-23 Redwood 2000 L-93 Mianus 500 </code></pre> <p>More proof that the line art is REALLY missing! (The -T option prints tabs, if any.)</p> <pre><code>[sd@host:~/tmp] $ cat -T out loan_no^Ibranch_name^Iamount L-11^IRound Hill^I900 L-14^IDowntown^I1500 L-15^IPerryridge^I1500 L-16^IPerryridge^I1300 L-17^IDowntown^I1000 L-23^IRedwood^I2000 L-93^IMianus^I500 </code></pre> <p>So, <strong>my question is</strong>, how the heck does mysql know <strong>who</strong> -- whether a terminal or a text file -- <strong>is sucking its output from 'its rear end'</strong> :-) ?</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload