Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Simple waitfor with timeout option

Status
Not open for further replies.

thokern

Technical User
Mar 19, 2003
21
0
0
DE
Does anybody know how to enhance the waitfor command with a timeout option:

Host requests for password
first password is transmitted
password fails (no response after 6 seconds)
second password is transmitted
password fails (no response after 6 seconds)
third password is transmitted
password fails again
script ends

(if any password succeeds the script continues with standard commands)
 
You can specify a timeout with the waitfor command by including the timeout value (in seconds) at the end of the command. For example:

waitfor "expected string" 6

where expected string is replaced by the string you would see if the login was successful.


aspect@aspectscripting.com
 
Thats correct, but what I´m searching for is a statement like:

waitfor <exp. string> 6
if timeout then
....
else
...
endif


Any idea?
 
If you use:

if failure
...
else
...
endif

after the waitfor command, then you can check to see if the string was received in the alloted timeout or not.


aspect@aspectscripting.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top