Posted to tcl by c0rnel at Tue Feb 19 12:30:09 GMT 2013view raw

  1. expect {
  2. "assword:" {send $UPASS\r}
  3. timeout {puts "too slow!"; exit}
  4.  
  5. puts "logged in";
  6.  
  7. expect {
  8. " $UNAME:" {
  9. puts "got ' $UNAME:'"
  10. send "$UPASS\r"
  11. }
  12. timeout {
  13. puts "got timeout"
  14. exit 2
  15. }
  16. eof {
  17. puts "ssh has exited"
  18. }
  19. }
  20. }