Guest User

expect

a guest
Oct 8th, 2012
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #!/usr/bin/expect -f
  2.  
  3.  
  4. # connect via scp
  5. spawn scp [lindex $argv 0] [lindex $argv 1]
  6. #######################
  7. expect {
  8. -re ".*es.*o.*" {
  9. exp_send "yes\r"
  10. exp_continue
  11. }
  12. -re ".*sword.*" {
  13. exp_send "mypassword\r"
  14. }
  15. }
  16. interact
Advertisement
Add Comment
Please, Sign In to add comment