[PD-ot] using "-send" and shell-variables
Hans-Christoph Steiner
hans at eds.org
Sun Mar 19 00:32:38 CET 2006
On Mar 14, 2006, at 10:53 AM, IOhannes m zmoelnig wrote:
> Hans-Christoph Steiner wrote:
>>
>> Both above scripts work for me, I think the problem lies elsewhere.
>
> which shell are you using? bash? tcsh? something else??
> have you tested on linux or osX?
/bin/sh on OSX. But I think that its all the same, that code is so old.
>> quotes mean literal, so no expansion of variables is done. Quotes
>> inside of quotes are just characters, only the outer most count
>> (AFAIK).
>>
>> VAR=test
>>
>> echo '$VAR' prints: $VAR
>> echo "$VAR" prints: test
>> echo '"$VAR"' prints: "$VAR"
>> echo "'$VAR'" prints: 'test'
>>
>> If that helps at all. You might want to try sticking with only " and
>> escaping the ones inside:
>>
>> echo "\"$VAR\"" prints: "test"
>
> unfortunately (since it doesn't help me here), i know all this.
> the problem -as i see it- is, that my quotes somehow destroy the
> atomic
> structure of the enquoted stuff.
>
> e.g. i do:
> <snip>
> pd -send "pd quit"
> </snip>
> pd now gets 2 args '-send' and 'pd quit'.
> the '-send' tells pd that the next arg will be a message to shout. the
> message 'pd quit' is then sent (and received by 'pd')
>
> however, when i do
> <snip>
> OPTIONS="-send \"pd quit\""
> pd ${OPTIONS}
> </snip>
>
> here it seems that pd gets 3(!) args '-send', '"pd' and 'quit"'.
> pd therefore shouts and empty message to the receiver '"pd' and then
> tries to open (since it is a non-flagged argument) the patch 'quit"'.
> of course there is no receiver '"pd' and no patch 'quit"'.
>
> i'm still stupified...
can you post the actual script? Its hard to tell what's happening
based on the snippets.
.hc
________________________________________________________________________
____
¡El pueblo unido jamás será vencido!
More information about the PD-ot
mailing list