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

Wait for output of previous command to stop before transmiting

Status
Not open for further replies.

bittergourd

Technical User
Aug 12, 2003
2
SG
Hi,
I am writing a simple transmit-waitfor script, where i transmit a command to a telecoms equipment, waitfor a prompt from the equipment (after the action of the previous command completes), transmit the next command, wait.... and so forth.
The problem is, the character used in the prompt of the equipment(that I Waitfor) can also be found in the output data from the equipment, hence prematurely transmitting my later commands.
Please suggest as a way round this?
Cheers!
 
Another way around this requires you know something about the response of the command you are waiting on the output to complete. Look for some unique string near the end of the output (spaces before or after characters can make it unique from other occurrences). Use the string near the end of the output for a waitfor command target string then follow up with a waitfor your prompt character and / or a waitquiet command. Don't forget to increase the default 30 second waitfor timeout if the output may take longer...

ie.
waitfor "comm " 99 ; unique from "comm" which would hit on "communication" also
waitfor &quot;<&quot; 5 ; both a waitfor and waitquiet usu. not needed after previous waitfor but it depends
waitquiet 3

It may be more code but sometimes that's what it takes to get reliability when the host dosen't always respond like clockwork with output...(some hosts have more important things to do)

DT
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top