From: Andreas Leitgeb <avl@lo...> - 2013-07-18 19:13:42
Jeff Rogers <dvrsn@...> wrote:
> I wrote up a brief draft of an alternate proposal to improving exec,
> My draft is available at http://paste.tclers.tk/2824?v=raw
Not bad, but how "cross-plattform" is that implementable?
A long while ago, I also made an attempt at fixing just the wart
about being unable to pass arbitrary arguments to commands.
Essentially, you'd specify an option (to activate it) and
then prepend a certain protection character in front of every
argument that could possibly (but unintendedly) look like
redirection stuff (or already start with exactly that char).
set arg1 <Hello>; set arg2 'World'; # arbitrary arguments
exec -quote prog1 '$arg1 '| '$arg2 | sed '$script > $file
# equiv in sh: $ prog1 "<Hello>" \| \'World\' | sed "$script" > $file
It didn't yet raise much excitement the last times I presented
it, but I still hope, someone reading it this time will think
of maybe a small change to it (catchier name of option, different
protection character) that would make it look less alien.
Or maybe someone just manages to describe it in better words.
The advantage of this approach would be simplicity of implementation.
I once implemented it for Tcl8.5, and I guess I could redo it for
When only the "cannot pass arbitrary args"-wart is removed, then
exec itself could become the building block of whatever higher
level interface anyone wanted to come up with.
PS: I'm not terribly fond of the TIP at hand, because that
visually small detail of a leading pipe-char changes treatment
of arguments so fundamentally.
Get latest updates about Open Source Projects, Conferences and News.