How to remove +-----+ from mysql query result

linux, mysql

Solution

use `-s` for what you want.

$ mysql   -s
mysql> SELECT NOW();
NOW()
2014-04-25 10:11:57

`-s` means `silent`

$ mysql --help
...
-s, --silent        Be more silent. Print results with a tab as separator,

Also you can skip column header with `-N`

$ mysql -s -N
mysql> SELECT NOW();
2014-04-25 10:14:49

Problem

Just wondering if there's a command line argument in mysql to remove the lines surrounding a mysql query result. For one of my recent queries, I got this back: ``` +----------+ | count(*) | +----------+ | 1016442 | +----------+ ``` Since I'd like to use this result in my shell script to do something else with it, I'd like it to just return the value, and not the +-----+ and | characters surrounding it. Is it possible to do this or do I have to find a way to parse around it? Thanks in advance for your help. EDIT: I was hoping there was a mysql command line option to easily return just the result. If not, then I'll use sed, awk, grep like someone mentioned in the comments =)

Original source