Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

exec file $NumberOfArgs ???

8 views
Skip to first unread message

Andre Schilling

unread,
May 28, 1996, 3:00:00 AM5/28/96
to

Here is the situation:
Performing a simple exec command in any tcl-script (tk-version 4.0, tcl 7.4
UNIX) does not allow to specify
multiple arguments for the file to be executed via variable substitution.
Neither a script like:

set args {-l -s}
exec ls $args

nor any other way of replacing the wanted arguments by the value of a variable
(for example reading out a list or defining the string args "xyz x1y1z1") does not do what it s supposed to.

Is there a way to make this thing work except of naming all arguments by hand???

andre

-----------------------

John Haxby

unread,
May 29, 1996, 3:00:00 AM5/29/96
to

Andre Schilling wrote:
[snip]

> set args {-l -s}
> exec ls $args
[snip]

> Is there a way to make this thing work except of naming all
> arguments by hand???

eval exec ls $args

See the man page for eval.

--
John Haxby
These are my opinions, not my employer's.

0 new messages