[mythtv-users] Requeue All Shows Not Commflagged?

Drew Tomlinson drew at mykitchentable.net
Mon May 13 15:33:23 UTC 2013


After upgrading from 0.24 to 0.26, all my commflag jobs exited on error 
140.  After learning that it was because of the commflag command and 
fixing that in the general setup, I wanted to commflag all the 
recordings that had erred.  With some reading and fiddling, I came up 
with this:

mysql mythconverg -umythtv -pmythtv < ~/commflag.sql | sed '1d; s/-//g;s/://g' | awk '{print "/usr/bin/mythcommflag --queue --chanid", $1, "--starttime",$2$3}'

Commflag.sql contains:
SELECT chanid, starttime FROM `mythconverg`.`recorded`where commflagged 
<> 1;

Which prints this:

/usr/bin/mythcommflag --queue --chanid 2581 --starttime 20130513045900
/usr/bin/mythcommflag --queue --chanid 1278 --starttime 20130513045900
/usr/bin/mythcommflag --queue --chanid 3031 --starttime 20130509045900

So I added a 'for' loop with a 'do echo' to test:

for i in "`mysql mythconverg -umythtv -pmythtv < ~/commflag.sql | sed '1d; s/-//g;s/://g' | awk '{print "/usr/bin/mythcommflag --queue --chanid", $1, "--starttime",$2$3}'`"

do

         echo ${i}

done


But the output is just one long line:

/usr/bin/mythcommflag --queue --chanid 2581 --starttime 20130513045900 /usr/bin/mythcommflag --queue --chanid 1278 --starttime 20130513045900 /usr/bin/mythcommflag --queue --chanid 3031 --starttime 20130509045900

I've read up on 'awk' and tried adding '\n' but this doesn't seem to 
have any effect.  I've also read about $IFS and tried setting that to 
'\n' but still no help.

Thus I have these questions:

1. Is a 'for' loop the proper loop to use?  I fiddled with 'while' and 
'read' and 'read line' but couldn't get those to work either.

2. How do I get the newline added so I can make this a script?

3. Am I duplicating something that already exists in MythTV?

Thanks for your time.

Cheers,

Drew


-- 
Like card tricks?

Visit The Alchemist's Warehouse to
learn card magic secrets for free!

http://alchemistswarehouse.com




More information about the mythtv-users mailing list