0
set newarg [join $argmnts " "] 
set msg [exec $fname arguments] 

Note : argmnts are not commandline arguments, it is from value_dialog_box

newarg is a list of arguments (no. of arguments may vary in newarg), fname is some file name. I want to pass these arguments (newarg) in [exec $fname arguments]

how can i do that ?

Bryan Oakley
  • 370,779
  • 53
  • 539
  • 685

1 Answers1

3

You're looking for argument expansion:

set msg [exec $fname {*}$argmnts]

which treats the elements of the list in $argmnts as individual arguments to exec.

Shawn
  • 47,241
  • 3
  • 26
  • 60