I have a proc which receives script name and parameters, then exec it
with the parameters. Very simple but for some reason exec sees all
list of parameters as one object. I tried using join, which works for
internal use but the problem remains. Here's an example
proc Exec vars {
set script [lindex $vars 0]
# remove script name from list:
set args [lreplace $args 0 0]
exec /scripts/$script [join $args " "]
when I print argc from the external script it says 1
Anyone got a clue how to overcome this sh**?
Thanks
If you're using 8.5 or greater, does this work?
exec /scripts/$script {*}$args
If you're using 8.4 or lower, how about
eval exec [list /scripts/$script] $args
God bless you