0
#!/bin/bash
# Bash commands go here

/usr/bin/expect - << EndMark
This is the expect script
expect commands go here
and here
until:
EndMark

# More bash commands go here.

exit 0

这样的事情将允许我从 bash 中启动一个期望脚本。但是,当它到达更多 bash 命令部分时,它将停止期望进程(以及它产生的进程)是否有可能回到相同的期望脚本?

eg - Start expect script
   - At a certain point leave the expect to bash operations
   - return to the same expect script?
4

1 回答 1

0

不必为了发出 shell 命令而离开期望进程 - 您可以system在期望脚本中使用该命令。

于 2013-09-05T06:20:54.970 回答