[Klug-general] Bash scripting help

dan danattwood at googlemail.com
Sat May 2 09:33:50 UTC 2009


Karl Lattimer wrote:
> On Sat, 2009-05-02 at 09:53 +0100, dan wrote:
>   
>> Ok i;ve been toying with this for hours now and it's sending me nuts so 
>> here's hoping someone can help
>>
>> I have the following chunk of bash code;
>>
>>  Pref="--type='tv,radio,podcast,five,itv,ch4' --since=24"
>>  zenity --info --text "$Pref"
>>
>>
>> This works fine and the call to zenity outputs a text box with; 
>> --type='tv,radio,podcast,five,itv,ch4' --since=24; as expected
>>
>> However when I then feed $Pref into a function if comes out as; 
>> --type="tv,radio,podcast,five,itv,ch4' --since=24; note the double quote 
>> before tv instead of a single qoute
>>
>> does anyone have any pointers on whats going on and how to fix this?
>>     
>
> All I can say is that's just fucking weird!
>
> hmm
>
> so I'd suggest trying two things, try using $PREF out of quotes entirely
> and in caps so e.g.
>
> zenity --info --text $PREF
>
> see what happens, report back.. I'm intrigued :/
>
> BR,
>  K
>   
$Pref without the qoute fails completely. Thats expected though because 
of the space before --since.
Would putting pref in all caps make any difference - isn't it just the 
name of string?



More information about the Kent mailing list