0
spawn ssh -q user@xx.xx.xx.xx
Password:
Password:

Expect is expecting null before I sent the password.

Debug info

expect: does "" (spawn_id exp6) match glob pattern "yes/no"? no
"Password: "? no
Password:
expect: does "Password: " (spawn_id exp6) match glob pattern "yes/no"? no
"Password: "? yes
expect: set expect_out(0,string) "Password: "
expect: set expect_out(spawn_id) "exp6"
expect: set expect_out(buffer) "Password: "
send: sending "password \r" to { exp6 }

expect: does "" (spawn_id exp6) match glob pattern "*>"? no
Thomas
  • 4,155
  • 5
  • 21
  • 28
  • The debug output only shows it matching once. Why don't you show your expect script? – glenn jackman Jul 01 '17 at 22:36
  • This is my expect script. for i in xx.xx.xx.xx do expect << EOF spawn ssh -q user@$i sleep 2 match_max 600000 expect "yes/no" { send "yes\r" expect "Password: " { send "password@ \r } } "Password: " { send "password@ \r" } expect "*>" { send "sudo su - oracle \r" } expect "Password:" { send "password@\r" expect "*]" { send " ls -lhrt\r" } } "*]" { send " ls -lhrt\r" } expect "*]" { send "exit\r" } expect "*$" { send "exit\r" } EOF done – Nivedith Maknoor Jul 04 '17 at 11:20
  • Unreadable. Edit your question and add it there.\ – glenn jackman Jul 07 '17 at 12:53

0 Answers0