English 中文(简体)
default timeout handler for expect script
原标题:
  • 时间:2009-11-20 23:02:49
  •  标签:
  • expect

I have a expect script that need to fail when certain any of the expect condition is not meet. For example:

expect "Hello World"

If the expect script does not find "Hello World" in certain amount of time, it should fail. According to expect manual, I can add a condition timeout in the expect, but I have many expect statements in the script and I don t want to add a timeout for all of them. Is there a better way to do it?

最佳回答
expect_after {
    timeout {
        puts "a default timeout clause for all subsequent expect commands"
    }
}

Subsequent expect commands can still provide their own timeout clauses that will take precedence over the above.

问题回答

暂无回答




相关问题
using python expect to run openvpn

i need a python script to run open vpn automaticaly but i use sudo for run the open vpn sudo openvpn --cd /etc/openvpn --config openvpn.conf & thats my terminal command. i have to give the ...

Regular Expression to find string in Expect buffer

I m trying to find a regex that works to match a string of escape characters (an Expect response, see this question) and a six digit number (with alpha-numeric first character). Here s the whole ...

Where can I find TTY and curses documentation for Unix?

I m working on automation tools for an ERP program running on SCO Unix. See my questions on Expect: (Tcl/Expect) clear screen after exit Expect - get variable from screen region based on row and ...

(Tcl/Expect) clear screen after exit

I want to clear the screen (on the local machine) after exiting from my (semi) interactive expect script. Can I do that from within the script? Here s what I tried, that failed. #!/usr/bin/expect -f ...

How can I flush the input buffer in an expect script?

I m writing an Expect script and am having trouble dealing with the shell prompt (on Linux). My Expect script spawns rlogin and the remote system is using ksh. The prompt on the remote system contains ...

default timeout handler for expect script

I have a expect script that need to fail when certain any of the expect condition is not meet. For example: expect "Hello World" If the expect script does not find "Hello World" in certain amount of ...

How can I debug a Perl CGI script?

I inherited a legacy Perl script from an old server which is being removed. The script needs to be implemented on a new server. I ve got it on the new server. The script is pretty simple; it ...

热门标签