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.
为什么我不能在 TCL 中这样做:
set path "|C:/Program Files/Example/My Program/prgrm.exe"
字符串路径将获得值:
"C:/Program".
但是,如果我删除空格,它将获得完整的路径……有人知道吗?
这是因为使用管道运行子进程的代码在字符后采用了一个Tcl 列表。|像这样构建并运行它:
|
set path "C:/Program Files/Example/My Program/prgrm.exe" set pipe [open |[list $path]]
(该列表中后面的项目是传递给的参数prgrm.exe。)
prgrm.exe