在我的腳本中,我想返回不匹配的字符串。 我試圖puts $expect_out(buffer)
,但它沒有工作,給了我下面的錯誤如何在預期中返回不匹配的字符串
can't read "expect_out(buffer)": no such variable
while executing
"puts "out is $expect_out(buffer)" "
代碼
expect {
-nocase -re "$arg3" { exit 0 }
timeout { puts "Does not matched, output is $expect_out(buffer)" ; exit 2 }"
}
你的代碼和你的錯誤信息不太匹配;也可以在_exactly_上覆制事物,以便微妙之處不會導致問題。 – 2012-04-19 09:32:42