[Bradford] bash hell , removing " from a strings

Dick Thomas xpd259 at gmail.com
Mon Jun 29 16:11:38 UTC 2009


hiya thanks for your helps

mark's (didnt' make it to the list)
--separate-output for dialog

not thinking about the problem and getting some sleep did the trick

the answer was to alter the config

CITY="Bradford"
CITY_TAG="-city='$CITY'"

then alter the code in the script

      	"$CITY_TAG"  "blah blah city" off \

        echo $enable
now displays
-city='bradford'

RESULT!!


thanks for you help
Dick

2009/6/29 Mark Randall <markrandallwork at googlemail.com>:
> Hi - not sure what you're trying to do exactly - just remove the quotes, or
> return environment variables rather than quoted strings?
>
> If you use the --separate-output option, then that will remove the quotes.
>
> If you want environment variables rather than strings, then you might need
> to explain what values you want those variables to contain?
>
> The following should set the variables to "true":
>
> dialog --backtitle "backtitle" --no-cancel --title "main title"
> --separate-output --checklist "Hello, checklist" 25 61 15 city "city tag"
> off copyright ct off 2> dialog.ans
> for option in `cat dialog.ans`; do eval $option=true; echo $option;done
>
> Does that help?
>
> Cheers,
>
> Mark
>
> On Sun, Jun 28, 2009 at 11:33 PM, Dick Thomas <xpd259 at gmail.com> wrote:
>>
>> I'm writing a bash script and i'm stuck
>>
>> the out put of a dialog menu is
>>
>> echo $select
>> "foo" "bar" "lemon" cheese"
>>
>> while I need
>> $foo $bar $lemon $cheese
>>
>> to reuse them as strings later in the script
>> and very new to bash scripting and i've no idea how to do this
>> any help would be fantastic
>>
>> Dick
>>
>> <code>
>> dialog --backtitle "Enable / Disable Tags" \
>>                --no-cancel --title "CHECKLIST BOX" \
>>                --checklist "Hi, blah blah fill me in" 25 61 15 \
>>                "$CITY"  "$CITY_TAG" off \
>>                "$COPYRIGHT"    "$COPYRIGHT_TAG" off \
>>                "$Orange" "$orange_tag" off \
>>                "$Chicken"    "$chicken_tag" off \
>>                "$Cat"    "$CAT_TAG" off\
>>                "$Fish"   "$FISH_TAG" off \
>>                "$Lemon"  "$LEMON_TAG" on 2> $tempfile2
>>
>>        retval=$?
>>
>>        enable=`cat $tempfile2`
>>
>> echo $enable
>> </code>
>> "foo" "bar" "lemon" "poo-sticks"
>>
>> _______________________________________________
>> Bradford mailing list
>> Bradford at mailman.lug.org.uk
>> https://mailman.lug.org.uk/mailman/listinfo/bradford
>>
>
>
>



More information about the Bradford mailing list