I'm trying to use scp, there is no key for the box I need to communicate w/. I tried this code and many variations of it from my searches online, for some reason it doesn't get entered in. If you can help me it would be great. Thanks in advance. BTW, I'm executing the bash script from testing on a mac.
#!/bin/bash
#$1- source file
#$2- destination
#$3- password
/usr/bin/expect << EOF
spawn scp -rp $1 $2
set pass $3
expect -re "password:"
send "password\r"
expect "\r"
send "\r\n"
EOF
result is ;
spawn scp -rp file1 user@x.com:/path/file2
me@whoknows.com's password:
return value was : 0