首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >expect - expect_user和Expect的不同超时时间?

expect - expect_user和Expect的不同超时时间?
EN

Stack Overflow用户
提问于 2015-06-04 20:40:07
回答 1查看 1.4K关注 0票数 2

我希望expect_user有一个无限的(或非常大的)超时,expect的默认超时。有办法设置不同的超时吗?或者,在每次改变用法之前,我都要手动完成吗?

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2015-06-05 01:50:06

expectexpect_user都支持-timeout选项。通常,我会在timeout变量中设置默认的超时值,并为expect_user使用-timeout选项。例如:

代码语言:javascript
运行
复制
set timeout 30; # the default timeout value

# don't time out when waiting for user's input
expect_user -timeout 100000 -re "(.*)\n"; # use -1 for infinite timeout
set user_input "$expect_out(1,string)"
票数 6
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/30653734

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档