Posted to tcl by mjanssen at Fri Oct 23 14:09:39 GMT 2009view raw
- set prompt "#"
- expect {
- -re ".*Are.*.*yes.*no.*" {
- send "yes\r"
- exp_continue
- #look for the password prompt
- }
- $prompt {
- puts "Login succeeded"
- exit 0
- }
- "again." {
- puts stderr "Could not login"
- exit 7
- }
- "password:" {
- send -- "dummy"
- send -- "\r"
- exp_continue
- }
- }
Comments
Posted by krish at Fri Oct 23 14:13:29 GMT 2009 [text] [code]
"password:" { send -- "dummy" send -- "\r" exp_continue } "Permission denied" { exit 7 }