#!/usr/bin/expect
spawn ssh derrick@$abc123.net
expect "password"
send "helloworld\n"
send "cd /tmp\n"
send "sh rename.sh\n" # this shell script will get a list of files and rename each file
send "exit\n"
expect eof
问题是在'rename.sh'
启动后不到 3 秒内,'expect'
脚本在'rename.sh'
尚未执行完毕的情况下退出。
我的问题是如何让我的期望脚本等待“rename.sh”执行完成?