[mythtv-users] MySQL script for mythfilldatabase

Josu Lazkano josu.lazkano at gmail.com
Sat Feb 26 15:59:11 UTC 2011


Hello all, I am trying to configure a bash script to execute
mythtfilldatabase. I want to get the sourceid from mysql and use on
the script. I have this piece of script:

#!/bin/bash
. ~/.mythtv/mysql.txt
source=`echo "select sourceid from videosource where name='sat'" |
mysql --database=${DBName} --user=${DBUserName}
--password=${DBPassword}`
echo $source

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?

Thanks for all your help and best regards.

-- 
Josu Lazkano


More information about the mythtv-users mailing list