- 论坛徽章:
- 16
|
The command exp_continue allows expect itself to continue execut-
ing rather than returning as it normally would. By default
exp_continue resets the timeout timer. The -continue_timer flag
prevents timer from being restarted. (See expect for more infor-
mation.)
和其他语言的类似,好吧结合你的例子,sudo passwd 给用户改密码,会2次输入密码的情况,第一次匹配上了,发送密码,此时没有continue,会按照继续向下执行,遇到eof结束。
有了continue,会allows expect itself to continue execut-
ing rather than returning as it normally would
会执行这部分 "assword" {
42 send "$passwd\n"
刚好符合改密码的情况,2次输入。。。。
这东西和c的类似,揣摩一下不难理解,楼主应该加强学习能力啊 |
|