修复:#匹配不到

This commit is contained in:
yystopf 2024-05-14 15:19:59 +08:00
parent 1459a88322
commit fe12a2d5ea
2 changed files with 5 additions and 5 deletions

View File

@ -26,7 +26,7 @@ expect {
"yes/no" { send "yes\r"; exp_continue } "yes/no" { send "yes\r"; exp_continue }
"*$ " { "*$ " | "*# " {
# 从跳板机复制文件到目标主机 # 从跳板机复制文件到目标主机
send "scp -P $remote_port -r $temp_file $remote_user@$remote_host:$remote_file\r" send "scp -P $remote_port -r $temp_file $remote_user@$remote_host:$remote_file\r"
expect { expect {
@ -34,9 +34,9 @@ expect {
send "yes\r" send "yes\r"
exp_continue exp_continue
} }
"*$ " { "*$ " | "*# " {
send "rm $temp_file\r" send "rm $temp_file\r"
expect "*$ " {send "exit\r"} expect "*$ " | "*# " {send "exit\r"}
} }
} }
} }

View File

@ -15,13 +15,13 @@ expect {
"yes/no" { send "yes\r"; exp_continue } "yes/no" { send "yes\r"; exp_continue }
"*$ " { "*$ " | "*# " {
send "ssh -p $remote_port $remote_user@$remote_host $ssh_cmd\r" send "ssh -p $remote_port $remote_user@$remote_host $ssh_cmd\r"
expect { expect {
"yes/no" { send "yes\r"; exp_continue } "yes/no" { send "yes\r"; exp_continue }
"*$ " {send "exit\r"} "*$ " | "*# " {send "exit\r"}
} }
} }