2015-06-04 42 views

回答

5

expectexpect_user都支持-timeout選項。通常我會在timeout var中設置默認超時值,並在expect_user中使用-timeout選項。例如:

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)" 
相關問題