可以期望在没有显式设置一个巨大的常量值的情况下被告知不要超时吗?
can expect be told not to timeout without explicitly setting a huge constant value?
我已将超时设置为一个愚蠢的高数字。有没有更好的方法告诉脚本不要超时?
#!/usr/bin/expect
spawn telnet 10.10.10.10
set timeout 200000000
expect "login"
send "user\r"
expect "Password:"
send "password\r"
send "./run/this.sh\r"
将 timeout
值设置为 -1
set timeout -1
摘自 expect
、man page
If no timeout keyword is used, an implicit null action is executed upon timeout. The default timeout period is 10 seconds but may be set, for example to 30, by the command "set timeout 30". An infinite timeout may be designated by the value -1.
我已将超时设置为一个愚蠢的高数字。有没有更好的方法告诉脚本不要超时?
#!/usr/bin/expect
spawn telnet 10.10.10.10
set timeout 200000000
expect "login"
send "user\r"
expect "Password:"
send "password\r"
send "./run/this.sh\r"
将 timeout
值设置为 -1
set timeout -1
摘自 expect
、man page
If no timeout keyword is used, an implicit null action is executed upon timeout. The default timeout period is 10 seconds but may be set, for example to 30, by the command "set timeout 30". An infinite timeout may be designated by the value -1.