[mythtv-users] How to check if a tuner is in use

Hika van den Hoven hikavdh at gmail.com
Wed Oct 15 20:56:41 UTC 2014


Hoi Bill,

Wednesday, October 15, 2014, 10:53:13 PM, you wrote:


> yourScriptName ...............

> RC=$?

> if [ $RC -eq 0 ]; then
>      echo "Tuner is idle....."
>      ...
> else
>      ...
>> Can I return the state? Like:
>>      state = element.findtext('State')
>>      sys.exit(state)
>> or even:
>>      sys.exit(element.findtext('State'))

> I never tried returning a string. I thought it was always a
> number 0-255.  Where 0 = true and non 0 = false.

Yes I know how to handle them in bash, that's why I asked. If it is
printed I have to get it by quoting it with `` to get the output.

Yeh, as I suggested you always get 1, unless probably when the string
is empty. So I tried by adding the int() function! In bash by the way
the returncode can be much bigger, I think a full signed integer.
Handy to return values from functions.

Tot mails,
  Hika                            mailto:hikavdh at gmail.com

"Zonder hoop kun je niet leven
Zonder leven is er geen hoop
Het eeuwige dilemma
Zeker als je hoop moet vernietigen om te kunnen overleven!"

De lerende Mens



More information about the mythtv-users mailing list