Posted to tcl by sbron at Tue Feb 19 13:38:29 GMT 2013view raw

  1. expect {
  2. "assword:" {
  3. send $UPASS\r
  4. exp_continue
  5. }
  6. " $UNAME:" {
  7. puts "got ' $UNAME:'"
  8. send "$UPASS\r"
  9. }
  10. timeout {
  11. puts "got timeout"
  12. exit 2
  13. }
  14. }
  15.  
  16. puts "logged in"
  17. set timeout -1
  18.  
  19. expect {
  20. eof {
  21. puts "ssh has exited"
  22. }
  23. }
  24. puts "expect block finished"
  25.