[mythtv-users] command line argument processing help

Scot Kreienkamp skreien at wcnet.org
Wed Mar 21 02:21:35 UTC 2018


 Hi everyone,

Having a bit of an issue with command line argument processing for my
custom transcode script.  The transcode command I have set in mythtv is:

/mythtv/bin/transcoderep.sh "%FILE%" "%DESCRIPTION%" "%EPISODE%" "%SEASON%"
"%TITLE%" "%SUBTITLE%" "%ORIGINALAIRDATE%" "%STARTTIME%" "%ENDTIME%"
"%STARTTIMEUTC%" "%JOBID%"

In my script I'm parsing the commandline arguments, IE filename="$1",
description="$2", etc.

Here's the problem:  I've run into a problem with a few shows where the
description has contained a double quote, causing the obvious problem of it
thinking the field has ended and bumping all the rest of the arguments down
the line. I thought about changing the IFS, setting a multi character
string between each statement and processing it as one long string using
awk printf against $@, etc.  I'm rather curious how others have handled
this though as all my ideas have seemed sub-optimal.  Seems like there
should be a better way and I'm just not aware of it.  Or are those ideas
how it's supposed to be handled?


Thanks!

Scot
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mythtv.org/pipermail/mythtv-users/attachments/20180320/2226a221/attachment.html>


More information about the mythtv-users mailing list