在expect中匹配其他字符串

时间:2012-12-20 23:49:38

标签: linux shell expect

我想对telnet使用expect 发送命令后 它可能会返回不同的结果 让我说,像以下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 个答案:

答案 0 :(得分:2)

您要查找的关键字是default

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