2012-11-15 30 views
1

我正在解析一个长期以前的同事留给我的一些tcl脚本,并试图让他们了解一下他们,而不必实际学习tcl(也许是其他时间)。我有一些脚本的经验,但不能与TCL,所以我觉得我得到的大部分,但我不知道是否有人能告诉我“-i”标志做什么,例如:Expect中的-i标志是做什么的?

expect { 
    -i $tbs -re "(.*)\n" { 

send -i $ftp "put /dev/acq/$data $data\r" 

这通常发现在期望{}块中,但我不知道这是否相关。

感谢您的帮助,

马里奥

回答

0

这是特定于预期,在genreal不TCL(所以这是你应该指的是期望手册页)。

对于expectsend命令-i标志都是类似的:它指定要使用的特定spawn_id(子进程),而不是默认值。

expect 

[...] 

By default, patterns are matched against output from the current 
process, however the -i flag declares the output from the named 
spawn_id list be matched against any following patterns (up to 
the next -i). 

send 

[...] 

The -i flag declares that the string be sent to the named 
spawn_id. 
+0

啊!这完全有道理。我注意到变量被设置为spawn ID,但我不确定实际发生的魔法转换到了哪里。谢谢! – mariogiov

相关问题