cannot press enter when expect is running?
script such as
-sharp!/usr/bin/expect
set timeout 30
spawn bash centos7_client.sh
expect
{
"sharon@192.168.27.156"s password:" {send "pwd\r" ; exp_continue } }
expect "sftp>"
send "put -r /home/xu/Documents/scripts/centos7 /home/sharon/Docuemnts/scripts \r"
interact
there was a prompt to confirm whether to overwrite at the earliest time in the operation. As a result, I immediately typed in
put-r / home/xu/Documents/scripts/centos7 / home/sharon/Docuemnts/scripts
put-r / home/xu/Documents/scripts/centos7 / home/sharon/Docuemnts/scripts .
I look completely confused about this operation.