solaris8 viewer wrapper Scripting puzzle

Shing-Fat Fred Ma fma "at"
Fri, 11 Jan 2002 03:50:22 +0000


Here's a puzzle I've been ignoring for the last while.  I wrote a
trivial wrapper script "vncv":

     #!/bin/csh -f

     echo ${0}: \$0=_${0}_
     echo ${0}: \$1=_${1}_
     echo ${0}: \$2=_${2}_
     echo ${0}: \$3=_${3}_
     echo ${0}: \$4=_${4}_
     echo ${0}: \$5=_${5}_
     echo ${0}: \$6=_${6}_
     echo ${0}: \$7=_${7}_
     echo ${0}: \$8=_${8}_
     echo ${0}: \$9=_${9}_

     set echo

     vncviewer -owncmap -noshared $*
     vncviewer -owncmap -noshared "$*"
     `echo vncviewer -owncmap -noshared $*`
     `echo vncviewer -owncmap -noshared "$*"`

which I invoke using

     vncv -encodings \"tight copyrect\"

The first two invocations of vncviewer make it through to the vncviewer, which
interprets it as a syntax error.  The last two invocations confuse csh because
of ambiguous variable interprettation.  Could anyone comment on why, or
suggest a way to make it work?  On my system, it appears that the escaped
double quotes have been made to be a permanent part of the argument, though
one would expect them to be done away with after variable expansion.

I realize that all of this is easily avoidable using "alias vncv vncviewer
 -owncmap -noshared".  I'm posting this questions more to dispel
whatever misunderstanding causes the above.


Fred Ma
Department of Electronics
Carleton University, Mackenzie Building
1125 Colonel By Drive
Ottawa, Ontario
Canada     K1S 5B6
fma "at"
To unsubscribe, mail majordomo "at" with the line:
'unsubscribe vnc-list' in the message BODY
See also: