Mailing List archive

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

[vdr] Re: runvdr question - or better a bash question



-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Karsten Müller wrote:
> You could also use single quotes ' ...
>
> PLUGINS="-Pmp3 -Pmplayer '-Posdteletext -r'"
>
> (But be aware that between single quotes no variables would be expanded)
>
> On Wednesday 03 September 2003 11:21, Roland Behme wrote:
>
>>>PLUGINS="-Pmp3 -Pmplayer "-Posdteletext -r""
>>>VDRCMD="$VDRPRG -w 60 -l 3 -c $VIDEOCONF -v $VIDEODIR -E
>>>/vdrconf/epg.data -L $VDRDIR/PLUGINS/lib $PLUGINS $*"
>>>
>>>As you can see, I would need embedded quotations (for the osdteletext
>>>plugin) within the PLUGINS variable. Whatever way I tried (quoting it
>>>with backslashes, putting double quotation marks), bash always removes
>>>the quotation marks before it issues the command.
>>>
>>>Has someone found a way to overcome this?
>>
>>Try this one:
>>PLUGINS="-Pmp3 -Pmplayer \"-Posdteletext -r\""
>>
>>For details try "man bash" and search for "quoting"
>>

I use a little bit other approch: storing each "plugin"-option of vdr in
a Array-Varable. As I do not have currently access to my vdr machine at
home, I'll try to code it from scratch:

========================================================
#!/bin/bash
VDR="/home/vdr/bin/vdr"
VDR_FLAGS="-w 30 -c /home/vdr/vdrconfig/epg.data"

VDR_PLUGIN[0]="-Posdteletext -r"
VDR_PLUGIN[1]="-Pmp3"
VDR_PLUGIN[2]="-Pmplayer"

Now I can call vdr like this:

"$VDR" $VDR_FLAGS "${PLUGINS[@]}"
========================================================

which results in this command (I seperate each "word" with a newline to
point out the differnce to a space contained in a argument):

/home/vdr/bin/vdr
- -w
30
- -c
/home/vdr/vdrconfig/epg.data
- -Posdteletext -r
- -Pmp3
- -Pmplayer

Note, that the VDR_FLAGS variable is given NOT in quotes to allow the
shell to seperate the contained words into seperate arguments to vdr.
The construct "${PLUGINS[@]}" is further described in the bash manual!

This approatch makes my plugin config easier to read, esspecially the
reordering is simpler.

Hope this helps,
- --
Patrick Cernko | mailto:errror@errror.de | http://www.errror.de
Quote of the Week: "Is net scheen, das Bild, awwer einmalisch!"
                   (Markus Sand)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.2 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQE/VbvRB6g1EUxThvcRAkTuAJ0cOvafHsjxzFr+PT/LKZnkruBVZACggTNR
q79ab2Pjxo9Eqm9E3jwtwKM=
=48aW
-----END PGP SIGNATURE-----



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



Home | Main Index | Thread Index