solaris8 viewer wrapper Scripting puzzle

Cameron Simpson cs "at"
Fri, 11 Jan 2002 04:17:53 +0000

On 22:47 10 Jan 2002, Shing-Fat Fred Ma <fma "at"> wrote:
| Here's a puzzle I've been ignoring for the last while.  I wrote a
| trivial wrapper script "vncv":
|      #!/bin/csh -f

Step 1: Use /bin/sh like any sane programmer :-(

| which I invoke using
|      vncv -encodings \"tight copyrect\"

This is very bogus. You are passing _FOUR_ arguments here:


What you really want is to say:

	vncv -encoding "tight encoding"

which passes three arguments:

	tight encoding

Then just have the script not screw up:

	exec vncviewer -owncmap -noshared ${1+"$@"}

| On my system, it appears that the escaped
| double quotes have been made to be a permanent part of the argument,

Of course they are. In fact, part of two arguments (see above).

| though one would expect them to be done away with after variable expansion.

Why? You escaped them: they're not quoting (punctuation) characters any
more, they're just [... dramatic pause ...] characters.
Cameron Simpson, DoD#743        cs "at"

Your eyes are weary from staring at the CRT.  You feel sleepy.  Notice how
restful it is to watch the cursor blink.  Close your eyes.  The opinions
stated above are yours.  You cannot imagine why you ever felt otherwise.
	- gabrielh "at"
To unsubscribe, mail majordomo "at" with the line:
'unsubscribe vnc-list' in the message BODY
See also: