[mythtv-users] command line argument processing help
skreien at wcnet.org
Wed Mar 21 02:21:35 UTC 2018
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%"
In my script I'm parsing the commandline arguments, IE filename="$1",
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?
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the mythtv-users