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!

Script hangs on (of course!) last line 1

Status
Not open for further replies.

bubarooni

Technical User
May 13, 2001
506
US
Hi,

I am trying to download files from a dial-in server using zmoden. For some reason the very last line of the script hangs where I am inputting login info and other choices and never enters the last option. Here is a how the screen output shows:

Code:
Accepted

D)ownload    U)pload   G)oodbye
[D ]

Payer or Submitter/Provider: (P/S)
[S]

Transaction type:
[MCDS]

X)Modem   O)Xmodem 1K  Y)Modem  G)YmodemG   Z)Modem   K)ermit
[ ]

it is that very last line with the different modem choices where i can't get my choice input into the screen. Here is the code putting in my input:

Code:
   WAITFOR	"D)ownload U)pload G)oodbye:[]"
   TRANSMIT	"D^M"
   WAITFOR	"Payer or Submitter/Provider: (P/S)[]"
   TRANSMIT	"S^M"
   WAITFOR	"Transaction Type: []"
   TRANSMIT	"MCDS^M"
   WAITFOR	"X)Modem O)XModem 1K Y)Modem G)YmodemG Z)Modem K)ermit"
   TRANSMIT	"Z^M"

Am I just missing something here? The actual script is much longer than this and the waitfor and transmit sequences work everywhere else. When it hangs I can actually physically enter the 'Z' and hit enter and it continues.

Thanks in Advance for any ideas.
 
This one line is different from the others:

WAITFOR "X)Modem O)XModem 1K Y)Modem G)YmodemG Z)Modem K)ermit"

I noticed you did not include the "[]" Could it be that you are firing off the "Z^M" before the "[]" prompt?
 
Hi Kodr,

I had also tried:

Code:
WAITFOR    "X)Modem O)XModem 1K Y)Modem G)YmodemG Z)Modem K)ermit"
WAITFOR    "[]"
TRANSMIT   "Z^M"

to no avail. It is the only place in the whole script where there are two WAITFOR's in a row. Does that make a difference when they are consecutive?
 
My guess is it would depending on how fast the data is being sent to your terminal.

If '[]' only is sent as a prompt, then just use that in your waitfor line (don't include all the rest of the data, leaves room for typo's.)
Code:
waitfor "[]" forever
 
Also, are there spaces between the brakets? That could mess you up too.

maybe

Code:
waitfor "]" forever
transmit "Z^M"
 
One other thing to keep in mind is that what you see visually may not be what is actually sent. Instead of spaces, those could be tabs. There could also be some escape sequences stuck in the string as well to provide positioning or highlight/bold characters. It's alway best to use the shortest unique string with a waitfor command so you don't have to worry about this potential problem.

 
I am struggling...

I tried "]" thinking that might be the shortest string possible. Could there be something after that right bracket that is not showing up though? If so, how can I find it?

Thanks
 
I wouldn't use just ], since that is used in a lot of VT emulations. You can use Procomm's monitor window to see the full data stream, here is some information on how to use it:

Procomm's Monitor Window can be used to view the incoming and outgoing data, in both hex and ASCII format. To activate this window, select the Data | Monitor Window menu item. Resize the Monitor Window so that you can view the entire width of the window, then click back in the Procomm Plus window so that the Monitor Window does not have focus. Incoming text is displayed in red, while text you send is colored blue. The Monitor Window can be handy for viewing incoming escape sequences (to determine if Procomm Plus is responding properly to them) or to verify that the program is sending the data you think it should be.

 
Yikers! Can't figure out how to read that...
 
Just look for the text of the different prompts on the right side of the dialog (you may need to resize it to see everything), then look to see if there are any extra characters that are not visible in the Procomm screen.

 
there are all kinds of crazy looking ascii characters like music notes, boxes, left arrows and what looks like time stamps (?). i also see 4 left brackets, then a right bracket and finally 2 more left brackets.

i tried the 4 left brackets in the script with no result. when the '[ ]' shows up on the screen my 'transmit "Z^M"' doesn't do anything, at least the 'z' never appears in the brackets like the other lines do.

is there someplace that explains that output? i can't find it in the procomm help files.
 
If you search in Procomm's help file for ASCII, there is an entry labeled something like ASCII table or something close to that which can help you determine what some of the characters are. However, it would probably be easiest to post a screenshot of that dialog. If you can place such a screenshot on a website, you can reference it in a post here by using code like the below:

frog.gif


You'll need to make sure the Process TGML checkbox at the bottom of the posting area is checked.

 
the ascii table helped but i'm still not sure i understand it. it looks like the music note might be a carriage return...

anyway, take a look at this:

66.128.114.3/procommerror.htm

that should be a page with the screen shot.

thanks for all your help thus far.
 
OK, the problem is that there is more than one space between the different file transfer protocols (you can see by the multiple red 20s on the left side). It also doesn't look like the the number of spaces is consistent either - there are two between Xmodem and Xmodem1K, but three between YModemG and Zmodem. I think if you change the last waitfor in your original posting to look for just "K)ermit" you should be OK.

 
Hi,

WAITFOR "K)ermit"
TRANSMIT "Z^M"

results in no input box showing up on the screen

WAITFOR "K)ermit []"
TRANSMIT "Z^M"

results in an input box but the 'z' never goes in.

in both cases, after about 20 seconds it proceeds into a 'getfile zmodem' sequence without inputting the 'z' and the procedure then fails.

is there a command i can stick between the 'transmit' and 'getfile' to make it wait until the z shows up?

thanks

 
When you say input box, do you mean the [ ] that appears after the different file transfer protocols?

Try sticking a pause 1 between the waitfor and transmit commands and see if that helps out.

 
Hi Knob,

The pause, I increased it to '2', seems to have done the trick. Thanks for all your help and patience!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top