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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Alternative to WAITFOR ?

Status
Not open for further replies.

jeditom

IS-IT--Management
Dec 3, 2003
23
0
0
US
Is there a way to scan a screen of output for a particular string, then fire off the next line of the script? (As opposed to Waiting for the string to appear.)

When Telnetting into my Adtran device I need to issue a WaitQuiet command, but experience a delay because the prompt I waiting for is already present on the terminal.

connectmanual telnet "89.1.16.105"
waitquiet 1
waitfor "SELECT UNITS"
waitfor "ENTER SELECTION : ^[[24;32H"
transmit "1"
waitquiet 1
transmit "^M"
 
You can place a target command at the beginning of your script that will fire whenever it appears on the screen.

When target 0 "SELECT UNITS" Call XXXX
When target 1 "ENTER SELECTION :" Call XXXX

You also have the option of pause after you connect

connectmanual telnet "89.1.16.105"
pause 10

After the pause you can use a waitfor forever:

waitfor "SELECT UNITS" forever

The script will literally wait forever and will not continue if that doesn't appear on the screen so you might want to waitfor for 30 or 60 seconds.

waitfor "SELECT UNITS" 30
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top