Hi,
I have an expect script where in i am trying to scp a folder but it is getting timed out. Any help will be appreciated. (I don't have the option for sharing keys)
expect -c 2> /dev/null " spawn scp -r -o NumberOfPasswordPrompts=1 -o StrictHostKeyChecking=no root@10.10.10.10:test_dir /usr/
expect {
"*?assword:*" { set timeout -1; send test\r\n; exp_continue }
}
expect eof
"
Also, how to check error code if timeout has occurred?