Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/expect
- set host [lindex $argv 0]
- set password [lindex $argv 1]
- spawn ssh $host
- ## expect_after eof { exit 0 }
- expect "yes/no" { send "yes\r" }
- expect "password:" { send "$password\r" }
- expect "#"
- send "echo \"hello\" > test.txt"
- send "exit\r"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement