Linux SCP Expect Scriptusage: expect_scp.exp myfile.7z
file: expect_scp.exp #!/usr/bin/expect -f set filename [lindex $argv 0] set timeout -1 spawn scp $filename myusername@192.168.1.123:/home/myusername/ set pass "mypassword" expect { password: {send "$pass\r" ; exp_continue} eof exit } 192.168.1.123 - change to the ip address of destination server myusername - change to user account of destination server mypassword - change to password of user account of destination server | Related Articles |