Advertisement
Guest User

Untitled

a guest
Jun 26th, 2019
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.51 KB | None | 0 0
  1. #!/usr/bin/expect
  2.  
  3. set FILEPATH1 $1
  4.  
  5. spawn sh "scp $FILEPATH1 $USER@$HOST:/destination/files"
  6. set pass "pass123"
  7. expect {
  8. password: {send "$passr"; exp_continue}
  9. }
  10.  
  11. FILEPATH1=$1
  12.  
  13. set FILEPATH1 $1
  14.  
  15. set FILEPATH1 [lindex $argv 0]
  16.  
  17. spawn scp $FILEPATH1 $USER@$HOST:/destination/files
  18.  
  19. spawn scp $FILEPATH1 $env(USER)@$env(HOST):/destination/files
  20.  
  21. set timeout -1
  22. expect {
  23. password: {send "$passr"; exp_continue}
  24. eof
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement