Scripting 在tcl中重定向exec命令输出

Scripting 在tcl中重定向exec命令输出,scripting,tcl,Scripting,Tcl,在执行下面的命令后,您能告诉我如何避免控制台输出打印吗。无论如何,exec输出被放入buf,所以我不希望命令在控制台上打印 (bin) 49 % set buf "[exec cmd /c dir c:\\Program\ files\ (x86)\\WinPcap\\]" Volume in drive C has no label. Volume Serial Number is x8 Directory of c:\Program files (x86)\WinPcap 04/17/

在执行下面的命令后,您能告诉我如何避免控制台输出打印吗。无论如何,
exec
输出被放入
buf
,所以我不希望命令在控制台上打印

(bin) 49 % set buf "[exec cmd /c  dir c:\\Program\ files\ (x86)\\WinPcap\\]"
Volume in drive C has no label.
Volume Serial Number is x8

Directory of c:\Program files (x86)\WinPcap

04/17/2018  12:50 PM    <DIR>          .
04/17/2018  12:50 PM    <DIR>          ..
04/17/2018  12:50 PM               422 install.log
03/01/2013  07:18 AM           118,520 rpcapd.exe
04/17/2018  12:50 PM           121,106 Uninstall.exe
           3 File(s)        240,048 bytes
           2 Dir(s)  63,677,669,376 bytes free
(bin) 50 % 
(bin)49%设置buf“[exec cmd/c dir c:\\Program\files\(x86)\\WinPcap\\]”
驱动器C中的卷没有标签。
卷序列号是x8
c:\Program files(x86)\WinPcap目录
2018年4月17日下午12:50。
2018年4月17日下午12:50。。
2018年4月17日12:50 PM 422 install.log
2013年01月03日07:18 AM 118520 rpcapd.exe
2018年4月17日下午12:50 121106 Uninstall.exe
3个文件240048字节
2个目录(s)63677669376个可用字节
(bin)50%

正如彼得所写,检查前面的答案。要让你走:

% set x [exec ls]; list

正如Peter所写,请查看前面的答案。要让你走:

% set x [exec ls]; list