exp_internel 1 能看到所有的诊断信息
interpreter ( in code)--tcl debug
进入这种模式下,必须每个send都要自己发送,然后自己接收。与原来的脚本无关了
用return在回到原来的脚本,继续执行
在interpreter的地方
脚本自动运行到那里会停
expect 1.1>expect -------------注意不要加expect "*" or expect "" 就是expect
然后输入expect即等待执行
expect2.1>set timeout 3
expect3.1>send "abc\r"--------------send message
expect4.1>expect ".*"---------------match regexp
expect5.1>exec xterm &
expect 中set expect_out(buffer) 等于puts $
expect_out(buffer)存返回值
-----------------
匹配:
"*"
* is the same with shell .it is glob.
not regular expression ".*"
-re is regular expression
--
expect 有提示符号,一般匹配提示符。
没有匹配关键字。匹配的关键字不同,expect_out(buffer)中的内容不同。
如:setenv的 load aviable 、enter the generic