Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
set newarg [join $argmnts " "] set msg [exec $fname arguments]
注意:argmnts 不是命令行参数,它来自 value_dialog_box
newarg是参数列表(参数的数量可能会有所不同newarg), fname是一些文件名。我想将这些参数(newarg)传递给[exec $fname arguments]
newarg
fname
[exec $fname arguments]
我怎样才能做到这一点 ?
您正在寻找参数扩展:
set msg [exec $fname {*}$argmnts]
它将列表中的元素$argmnts视为exec.
$argmnts
exec