Thursday, October 24, 2013

receive argument on expect shell script

I just wanted to scp easily. I just simply made a expect shell script which receive one argument.
I just excute one script like below file

and copy finished
#!/usr/bin/expect -f

set filename [lindex $argv 0];

spawn scp -v /temp/$filename root@
expect "Enter passphrase"
send "\r"

No comments:

Post a Comment