I wonder if there is a way to unlist a list ...
I am very new to Tcl, but this is the case:
I have a proc with `args' as the last arg, and I want that list to be executed
by exec. Exec however wants the arguments to the program as arguments to exec,
so:
set output [exec $args]
won't work if args is (for example) "ls -l" :(
Is there a way to expand the "ls -l" to a "ls" "-l" ??
Thanx,
Gert
--
_______________________________________________________________________________
~ Gert, Gs2, The Blue Mage - whatever you prefer
'v' E-Mail : G...@dds.nl
// \\ Computer : nowmoo.demon.nl
/( )\ Project : gMOO, a MOO (and MUD) client for the unises
^`~'^ HomePage : http://www.nowmoo.demon.nl
> Hi,
>
> I wonder if there is a way to unlist a list ...
> I am very new to Tcl, but this is the case:
>
> I have a proc with `args' as the last arg, and I want that list to be executed
> by exec. Exec however wants the arguments to the program as arguments to exec,
> so:
> set output [exec $args]
> won't work if args is (for example) "ls -l" :(
>
> Is there a way to expand the "ls -l" to a "ls" "-l" ??
Check out the eval command
--
+--------------------------------+---------------------------------------+
| Gerald W. Lester | "The man who fights for his ideals is |
| gerald...@mtolive-lcms.org | the man who is alive." -- Cervantes |
| Webmaster for http://www.mtolive-lcms.org |
+--------------------------------+---------------------------------------+
Cameron Laird http://starbase.neosoft.com/~claird/home.html
cla...@NeoSoft.com +1 281 996 8546 FAX
>I have a proc with `args' as the last arg, and I want that list to
>be executed by exec. Exec however wants the arguments to the
>program as arguments to exec, so:
> set output [exec $args]
>won't work if args is (for example) "ls -l" :(
Try set output [eval exec $args]