Re: [vdr] VDR plugin options

2010-01-30 Thread Udo Richter
Am 30.01.2010 19:23, schrieb VDR User:
> On Sat, Jan 30, 2010 at 3:07 AM, Udo Richter  wrote:
>> The correct way to place every array element as one parameter, without
>> doing any additional whitespace separation, is this:
>>
>> "$vdrbin" -L "$vdrlib" "${vdrpl...@]}"
>>
>> In contrast, "${vdrplug[*]}" merges all to one parameter, ${vdrpl...@]}
>> does another whitespace separation run.
> 
> What makes that "correct"?  Just sounds like a different (and more
> complicated, ..I guess) way to accomplish the same end result, but no
> more "correct" then using double/single quotes.

Correct in the sense of using arrays to build up a command line, not in
a sense of The One And Only Solution (tm).

> I'm no bash expert but STRING="$STRING -P'asdf arg'" works equally as
> well as ARRAY=( "${arr...@]}"  ) in my experience.  What am
> I missing?

Well, not much, except that I would do it this way:

PLUGINS[${#PLUGINS[*]}]="-Psoftdevice -vo xv:full -ao
alsa:mixer:pcm=default"


For a more complex (and a bit constructed) case:

PLUGINS="$PLUGINS -P\"hello --aaa=\\\"A B C\\\"\""
or
PLUGINS="$PLUGINS -P'hello --aaa=\"A B C\"'"
or
PLUGINS[${#PLUGINS[*]}]="-Phello --aaa=\"A B C\""
or
PLUGINS[${#PLUGINS[*]}]="-Phello --aaa='A B C'"

Arrays have the advantage that they spare one level of quoting, don't
need eval, and are a bit more 'ordered', but on the other hand are
bash-only, and cannot be exported to sub-shells.

(runvdr extreme has a quoting function, so you do it with even less
quoting like this: AddPlugin hello --aaa="A B C")


Cheers,

Udo

___
vdr mailing list
vdr@linuxtv.org
http://www.linuxtv.org/cgi-bin/mailman/listinfo/vdr


Re: [vdr] VDR plugin options

2010-01-30 Thread VDR User
On Sat, Jan 30, 2010 at 3:07 AM, Udo Richter  wrote:
> The correct way to place every array element as one parameter, without
> doing any additional whitespace separation, is this:
>
> "$vdrbin" -L "$vdrlib" "${vdrpl...@]}"
>
> In contrast, "${vdrplug[*]}" merges all to one parameter, ${vdrpl...@]}
> does another whitespace separation run.
>
>
> runvdr extreme also uses a bash array for building the command line.

What makes that "correct"?  Just sounds like a different (and more
complicated, ..I guess) way to accomplish the same end result, but no
more "correct" then using double/single quotes.

I'm no bash expert but STRING="$STRING -P'asdf arg'" works equally as
well as ARRAY=( "${arr...@]}"  ) in my experience.  What am
I missing?

___
vdr mailing list
vdr@linuxtv.org
http://www.linuxtv.org/cgi-bin/mailman/listinfo/vdr


Re: [vdr] VDR plugin options

2010-01-30 Thread Udo Richter
Am 25.01.2010 00:19, schrieb Adrian C.:
> Now I want a variable or array at the top of the script so I could
> easily add, remove and comment plugins... rewriting the above example:
> 
> vdrplug=(-Pfemon
>  -P"softdevice -vo xv:full -ao alsa:mixer:pcm=default"
> )
> $vdrbin -L $vdrlib ${vdrpl...@]}

The correct way to place every array element as one parameter, without
doing any additional whitespace separation, is this:

"$vdrbin" -L "$vdrlib" "${vdrpl...@]}"

In contrast, "${vdrplug[*]}" merges all to one parameter, ${vdrpl...@]}
does another whitespace separation run.


runvdr extreme also uses a bash array for building the command line.


Cheers,

Udo

___
vdr mailing list
vdr@linuxtv.org
http://www.linuxtv.org/cgi-bin/mailman/listinfo/vdr


Re: [vdr] VDR plugin options

2010-01-24 Thread Adrian C.

On Sun, 24 Jan 2010, VDR User wrote:

Use double-quotes to surround your plugins and single-quotes for 
plugin options.


Excellent! Thank you.


--
Adrian C. (anrxc) | anrxc..sysphere.org | PGP ID: D20A0618
PGP FP: 02A5 628A D8EE 2A93 996E  929F D5CB 31B7 D20A 0618


___
vdr mailing list
vdr@linuxtv.org
http://www.linuxtv.org/cgi-bin/mailman/listinfo/vdr


Re: [vdr] VDR plugin options

2010-01-24 Thread VDR User
Use double-quotes to surround your plugins and single-quotes for
plugin options.  For example:

VDR="$vdrbin -L $vdrlib"
PLUGINS="-Pfemon -P'softdevice -vo xv:full -ao alsa:mixer:pcm=default'"
eval "$VDR $PLUGINS" &

___
vdr mailing list
vdr@linuxtv.org
http://www.linuxtv.org/cgi-bin/mailman/listinfo/vdr


[vdr] VDR plugin options

2010-01-24 Thread Adrian C.
Hello, 
in this example of starting VDR in a script some options are passed to 
the softdevice plugin:


$vdrbin -L $vdrlib -Pfemon -P"softdevice -vo xv:full -ao alsa:mixer:pcm=default"

Now I want a variable or array at the top of the script so I could 
easily add, remove and comment plugins... rewriting the above example:


vdrplug=(-Pfemon
 -P"softdevice -vo xv:full -ao alsa:mixer:pcm=default"
)
$vdrbin -L $vdrlib ${vdrpl...@]}

I have tried numerous ways of quoting and escaping the softdevice line 
but I always get one of:


1. VDR tries to start a plugin called: "softdevice
2. VDR interprets -v in -vo as VDR video directory option and fails
   because there is no directory "o"


Can anyone help me with writing this? I use vdr 1.6.0, thanks,

--
Adrian C. (anrxc) | anrxc..sysphere.org | PGP ID: D20A0618
PGP FP: 02A5 628A D8EE 2A93 996E  929F D5CB 31B7 D20A 0618


___
vdr mailing list
vdr@linuxtv.org
http://www.linuxtv.org/cgi-bin/mailman/listinfo/vdr