Ok, so now I have my /usr/bin/tv_grab_file set liek this:
#!/bin/bash
dflag=
vflag=
cflag=
if (( $# < 1 ))
then
cat /home/hts/zap2xml/xmltv.xml
exit 0
fi
for arg
do
delim=""
case "$arg" in
#translate --gnu-long-options to -g (short options)
--description) args="${args}-d ";;
--version) args="${args}-v ";;
--capabilities) args="${args}-c ";;
#pass through anything else
*) [[ "${arg:0:1}" == "-" ]] || delim="\""
args="${args}${delim}${arg}${delim} ";;
esac
done
#Reset the positional parameters to the short options
eval set -- $args
while getopts "dvc" option
do
case $option in
d) dflag=1;;
v) vflag=1;;
c) cflag=1;;
\?) printf "unknown option: -%s\n" $OPTARG
printf "Usage: %s: [--description] [--version] [--capabilities] \n" $(basename $0)
exit 2
;;
esac >&2
done
if [ "$dflag" ]
then
printf "tv_grab_file is a simple grabber that just read the /home/hts/zap2xml/xmltv.xml file\n"
fi
if [ "$vflag" ]
then
printf "0.1\n"
fi
Permissions on the xmltv.xml file: -rw-r--r-- 1 hts video 2155108 Aug 19 08:46 /home/hts/zap2xml/xmltv.xml
Now when I go to the system log, it oputputs:
2016-08-19 09:22:21.652 /home/hts/zap2xml/xmltv.xml: grab /home/hts/zap2xml/xmltv.xml
2016-08-19 09:22:21.653 spawn: Executing "/home/hts/zap2xml/xmltv.xml"
2016-08-19 09:22:21.655 /home/hts/zap2xml/xmltv.xml: no output detected
2016-08-19 09:22:21.655 /home/hts/zap2xml/xmltv.xml: grab returned no data
So wtf is the deal???