I use asyncrun.vim to async run a shell script when I save file, the shell script scp my file to remote server. but when I :w, it print "backgroud jobs is still running". and then i should print enter to return to vim. Actually the file is sent to remote server successfully. But every time the problem makes me really upset. My shell script call an expect script to fill password automatically. I am on MacOS 11.1 use vim8.2
my shell script call expect:
expect /Users/shiyaoliang/Develop/c/sendtoremote/sendfile.exp $PORT $USER $IP $PASSWORD $LOCALFILES $REMOTEFILES
echo "scopy files to remote is over!"
exit 0
my except script:
!/usr/local/bin/expect
set timeout 10
set port [lindex $argv 0]
set username [lindex $argv 1]
set hostip [lindex $argv 2]
set password [lindex $argv 3]
set localfiles [lindex $argv 4]
set remotefiles [lindex $argv 5]
I use asyncrun.vim to async run a shell script when I save file, the shell script scp my file to remote server. but when I :w, it print "backgroud jobs is still running". and then i should print enter to return to vim. Actually the file is sent to remote server successfully. But every time the problem makes me really upset. My shell script call an expect script to fill password automatically. I am on MacOS 11.1 use vim8.2
my shell script call expect:
expect /Users/shiyaoliang/Develop/c/sendtoremote/sendfile.exp $PORT $USER $IP $PASSWORD $LOCALFILES $REMOTEFILES echo "scopy files to remote is over!" exit 0
my except script:
!/usr/local/bin/expect
set timeout 10
set port [lindex $argv 0] set username [lindex $argv 1] set hostip [lindex $argv 2] set password [lindex $argv 3] set localfiles [lindex $argv 4] set remotefiles [lindex $argv 5]
spawn scp -r -P $port $localfiles $username@$hostip:$remotefiles expect { "yes/no" {send "yes\r";exp_continue} "password:" {send "$password\r"} } expect eof exit
Appreciate your work! Thank you!