Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Shaun E on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Expect scripting with error reporting...

Status
Not open for further replies.

lhradowy

IS-IT--Management
Aug 2, 2002
6
CA
I am trying to harden my expect script, and so far I have the "usual prompts covered" (I can not really say they are prompt persay) but what happens if for some reason the host that the expect script is logging into changes its screens? How can I account for that?
Is there a way that if it does not receive any of the prompts listed below, it puts $FILE error, then continues on with the script?


expect {
"200? \\*\\*\\*\r\n>$"
{ change_pass }
"200? \\*\\*\\**\r\n>$"
{ change_pass }
"Invalid user name or password.\r\nEnter User Name\r\n>$" {
puts $PASS_ERROR "$LINE, Invalid user name or passwd, passwd was not changed."; continue
}
"User logged in on another device, please try again." {
puts $PASS_ERROR "$LINE, had user logged in, passwd was not changed."; continue
}
}
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top