[mythtv-users] MySQL script for mythfilldatabase

George Nassas gnassas at mac.com
Sat Feb 26 17:16:07 UTC 2011


On 2011-02-26, at 10:59 AM, Josu Lazkano wrote:

> I want to get on the "source" variable just the number of the
> sourceid, I get this output:
> 
> $ sh mysql.sh
> sourceid 1
> 
> How can I get it?

Mysql is putting out the column name and then the matching rows which in this case amounts to only one and then all that echoing is merging the two output lines into one. That's why you're getting "sourceid 1". Use the --silent flag or --skip-column-names to suppress the column name. mysql --help gives useful info.

Also, mysql has a -e option where you can pass it sql directly on the command line instead of echo and piping for a cleaner look.

- George



More information about the mythtv-users mailing list