keep mysql frame when piping to file?
bash, mysql
Solution
Use the `-t` option to explicitly output a table:
mysql -u**** -p*** -h*** -P*** -t -e "SELECT ..." > text.txt
Problem
I had a question for mySQL/bash. here's my basic situation ``` ****> mysql -u**** -p*** -h*** -P*** -e "SELECT user,host,password FROM mysql.user WHERE password='*0F7947B374392A8F5638B396E0E4BB198D1D16D8'" +--------------+------+-------------------------------------------+ | user | host | password | +--------------+------+-------------------------------------------+ | ********* | % | *0F7947B374392A8F5638B396E0E4BB198D1D16D8 | | ************ | % | *0F7947B374392A8F5638B396E0E4BB198D1D16D8 | | ******* | % | *0F7947B374392A8F5638B396E0E4BB198D1D16D8 | +--------------+------+-------------------------------------------+ ****> mysql -u**** -p*** -h*** -P*** -e "SELECT user,host,password FROM mysql.user WHERE password='*0F7947B374392A8F5638B396E0E4BB198D1D16D8'" >test.tmp; more test.tmp user host password ********* % *0F7947B374392A8F5638B396E0E4BB198D1D16D8 ************ % *0F7947B374392A8F5638B396E0E4BB198D1D16D8 ******* % *0F7947B374392A8F5638B396E0E4BB198D1D16D8 ``` When I output to console, I get a nice, even frame, What can I do to have this frame carry over to when I write it to a file? This is going to be part of a much larger script. I know it would be possible to re-create the frame with awk, but I'm hoping there's a simple was to have it carry over. Thanks in advance!