2012-12-20 62 views
2

我想用期待的telnet 发送命令 后,可能返回不同的结果 让我说,像下面的3种可能性其他字符串匹配指望

1 successful 
2 normal 
3 there are something wrong...blabla 
    you can refer to ....blabla 


expect{ 
    "successful" {} 
    "normal" {} 
    #here, for the third possibility, I want to use something like "else", so what should I put here? thanks! 
} 
+1

没有理由关闭这个有效的Expect问题。 –

回答

1

你要找的关键词是default

expect{ 
    "successful" {} 
    "normal" {} 
    default {} 
}