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 ${vdrplug[@]}
The correct way to place every array element as one parameter, without doing any additional whitespace separation, is this:
"$vdrbin" -L "$vdrlib" "${vdrplug[@]}"
In contrast, "${vdrplug[*]}" merges all to one parameter, ${vdrplug[@]} does another whitespace separation run.
runvdr extreme also uses a bash array for building the command line.
Cheers,
Udo