[PD-ot] using "-send" and shell-variables

IOhannes m zmoelnig zmoelnig at iem.at
Tue Mar 14 16:53:48 CET 2006


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?

> 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...


mfg.asdr.
IOhannes




More information about the PD-ot mailing list