|
From: Ethan M. <merritt@u.washington.edu> - 2004-10-25 18:47:13
|
On Monday 25 October 2004 11:19 am, Juergen Wieferink wrote:
> >
> > With the new syntax, you would do
> > gawkcall = sprintf( '` gawk -f getname %i %s `', ...)
> > show var
> > gawkcall = ` gawk -f getname ... `
> > name = @"gawkcall"
> >
>
> Which does essentially the same as
>
> gawkcall = sprintf('"` gawk -f getname %i %s `"', ...)
> name = @gawkcall
>
> right? I haven't thought of this before seeing your @"var" syntax.
Yes, it seems so. I didn't think of it either.
So the @"foo" variant is not needed after all.
It is amazing how complicated this stuff becomes, starting with
something rather simple.
> But I like the syntax of command("foo") much more. It seems cleaner
> to me because there is no detour through the parser. There are
> no problems if the input or output contains quotes. And it's easier
> to understand.
Yes. I thought it was a very nice idea. But I had second thoughts while
I was in the middle of implementing it. I was reminded of the discussion
a month or so back sparked by someone who wanted a "secure" version
or wrapper for gnuplot. The idea was to allow use by untrusted, possibly
malicious users. One the one hand I don't think we should cripple gnuplot
just because someone could use it to issue arbitrary shell commands.
But on the other hand I do think we should think twice before adding a
feature that could encourage poor scripting via over-use of shell
intervention. But I could be convinced by a real-world example where shell
intervention for every point plotted was required.
Anyway, this is really a separate issue and can be pursued later.
The command("foo") syntax by itself does not address the problem of
storing the result in a string. For that you need these other tricks.
--
Ethan A Merritt merritt@u.washington.edu
Biomolecular Structure Center
Mailstop 357742
University of Washington, Seattle, WA 98195
|