Mailing List archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[vdr] Re: bash problem in runvdr



On Wed, Apr 09, 2003 at 02:01:34PM +0200, Zuliani Guido wrote:
> Hi,
>       I installed vdr and some plugins ... if I launch it from /usr/src/VDR
> everyting is right ... I use a command line this:
> 
> 	./vdr -Pdvd -P"mp3 -m /video/plugins/mount.sh" -P"mplayer - m
> /video/plugins/mount.sh -M /video/plugins/mplayer.sh"
> 
> and everything is OK.
> 	
> I want to use the same command in runvdr, but (as aspected) " cause problem
> ... I tried a lot of combination .... but I could not find a correct syntax
> in place of (****)
> 
> ----------------------------------------------------- runvdr 
> VDRPRG="/usr/src/VDR/vdr" 
> VDRCMD="$VDRPRG -L /usr/src/VDR/PLUGINS/lib -Pdvd -P(****)  -w 60 -s
> /root/shutdown $*" 
> ......
> ......
> 
> while (true) 
> ----------------------------------------------------- runvdr 
> 
>  I tried somethings like:
> 
>  -P""mp3 -m /video/plugins/mount.sh"" -P""mplayer - m
> /video/plugins/mount.sh -M /video/plugins/mplayer.sh""
> or 
>  -P\"mp3 -m /video/plugins/mount.sh\" -P\"mplayer - m
> /video/plugins/mount.sh -M /video/plugins/mplayer.sh\"
> or 
>  -P'mp3 -m /video/plugins/mount.sh' -P'mplayer - m /video/plugins/mount.sh
> -M /video/plugins/mplayer.sh'
> etc. etc.
> 
> the response is 'invalid option -M" (for vdr)
> 
> this problem is driving me crazy ... can anyone help me?

... lets see:

sh-2.05b> set -x
sh-2.05b> echo -Pdvd -P"mp3 -m /video/plugins/mount.sh" -P"mplayer -m /video/plugins/mount.sh -M /video/plugins/mplayer.sh" > /dev/null
+ echo -Pdvd '-Pmp3 -m /video/plugins/mount.sh' '-Pmplayer -m /video/plugins/mount.sh -M /video/plugins/mplayer.sh'
sh-2.05b> set +x
+ set +x

... in other words we seek for a way to put space into words without expanding these spaces.
This could be done with the Internal Field Separator (IFS environment variable) of
the bourne shell.

First try:

sh-2.05b> VDRPRG="echo"
sh-2.05b> VDRCMD="$VDRPRG:-Pmp3 -m /video/plugins/mount.sh"
sh-2.05b> VDRCMD="$VDRCMD:-Pmplayer -m /video/plugins/mount.sh -M /video/plugins/mplayer.sh"
sh-2.05b> OIFS="$IFS"
sh-2.05b> IFS=:
sh-2.05b> set -x
sh-2.05b> $VDRCMD > /dev/null
+ echo '-Pmp3 -m /video/plugins/mount.sh' '-Pmplayer -m /video/plugins/mount.sh -M /video/plugins/mplayer.sh'
sh-2.05b> set +x
+ set +x

... seems to work.  Maybe a space between -P and the plugin is nice to have.
This will be done by

sh-2.05b> VDRPRG="echo"
sh-2.05b> VDRCMD="$VDRPRG:-P:mp3 -m /video/plugins/mount.sh"
sh-2.05b> VDRCMD="$VDRCMD:-P:mplayer -m /video/plugins/mount.sh -M /video/plugins/mplayer.sh"
sh-2.05b> OIFS="$IFS"
sh-2.05b> IFS=:
sh-2.05b> set -x
sh-2.05b> $VDRCMD > /dev/null
+ echo -P 'mp3 -m /video/plugins/mount.sh' -P 'mplayer -m /video/plugins/mount.sh -M /video/plugins/mplayer.sh'
sh-2.05b> set +x
+ set +x


... with `echo' it works on the bash prompt (called as sh for bourne shell compatiblity) as seen on the
terminal copy I have put here.  Maybe this will also work in the runvdr script.


        Werner


-- 
Info:
To unsubscribe send a mail to listar@linuxtv.org with "unsubscribe vdr" as subject.



Home | Main Index | Thread Index