wenzi
wenzi

Reputation: 113

else string matching in expect

I want to use expect for telnet after sending a command it may return different results let me say, like the following 3 possibilities

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!
}

Upvotes: 4

Views: 2663

Answers (1)

glenn jackman
glenn jackman

Reputation: 247240

The keyword you're looking for is default.

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

Upvotes: 3

Related Questions