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

How to respond conditionally to prompts from host? 1

Status
Not open for further replies.

sargasso

Programmer
Sep 8, 2006
4
US
Normally, to script a download from a site one would write a succession of fixed waitfor commands interspersed with fixed transmit commands. But what do you do if there could be more than one response from the host, each requiring its own response from the procomm user?

In our case we're trying to download files from an health insurance contractor. If there are no files to download, it prompts for one thing, but if there ARE files to download, it prompts for something else entirely. How does one do that with waitfor commands?
 
I have a script I received from anothe ASPECT user ages ago that does this well. It looks for up to three different prompts using a when target command for each string then updates a global variable which you can check to see which of the three (if any) was received in the specificed timeout value.

If you go to the link below, click on the samples page, and search for "Josh" you'll find the script and the discussion about it. There is also some documentation at the bottom of the .was file.

 
Thanks very much! I checked out Josh's code. That should do it.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top