root@naucse.UUCP (System Administrator) (02/09/89)
I've got a few questions for any/all uucp gurus out there. We've been having some problems with connecting to our only uucp neighbor, and I can't figure out what the problem is. I won't bore you with the spec- ifics (unless I really get stuck), but after having read the manuals on uucp many times (both man-pages and documents) I am left with a series of unanswered questions. Maybe you folks can help. Regarding entries in the L.sys file (expect/send sequences): 1. I read that the expect algorithm looks at the LAST PART of the incoming text, when comparing strings. But suppose the string I want to match has a new-line in it? How do I express this in my expect string? Example: fictitious incoming text: type your name:\n My sequence "name: myname" won't work, since the string "name:" is NOT the last thing received: there's a newline in there, too! Are carriage-returns and newlines ignored by the algorithm, or can I put something like "\n" in my expect string? What if it's also got a \r in there? What if it's after the newline, instead of before it? Will my sequence have to match the order of \r \n's ? 2. With keywords like PAUSE and - specially interpreted in my expect/ send sequences, how can I force these to be considered part of the text, if I needed to do so? Can I escape them? How? If I escape things with a backslash (\) like usual, is \\ considered a back- slash character? 3. How does the algorithm decide that the expected string has not come in? Does it have a timeout value of some sort? If so, how long? Does it "timeout" that long after no more text is received, or just after that time period is up (regardless of incoming text)? 4. While data is steadily coming in, does the expect algorithm look at snapshots of it, even though it's incomplete? Example: fictitious incoming text: Enter password: will the sequence "sswo myname" ever succeed because that was the last thing in the buffer at one point? Of course this would be VERY unreliable, but could it happen? 5. Is the text-to-send sent the instant the expect algorithm sees what it's been looking for, or is there a pause of one or more seconds? The manuals just leave me fuzzy on details. I really appreciate any assistance you all can give me on this subject. Thank you. -- paul -- Paul Balyoz, System Administrator ...!arizona!naucse!root Northern Arizona University --or-- Box 15600 ...!arizona!naucse!pab Flagstaff, AZ 86011
jbayer@ispi.UUCP (Jonathan Bayer) (02/09/89)
In article <1155@naucse.UUCP> root@naucse.UUCP (System Administrator) writes: >I've got a few questions for any/all uucp gurus out there. We've been >having some problems with connecting to our only uucp neighbor, and I The following answers are assuming HDB UUCP. There will be minor differences from the old UUCP. >Regarding entries in the L.sys file (expect/send sequences): > >1. I read that the expect algorithm looks at the LAST PART of the > incoming text, when comparing strings. But suppose the string I > want to match has a new-line in it? How do I express this in > my expect string? Example: > fictitious incoming text: type your name:\n > My sequence "name: myname" won't work, since the string "name:" > is NOT the last thing received: there's a newline in there, too! > Are carriage-returns and newlines ignored by the algorithm, or can > I put something like "\n" in my expect string? What if it's also ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ yes, but not needed. If your sys entry has name: as the text it is looking for, it will send the next sequence of text as soon as it sees the "name:" >2. With keywords like PAUSE and - specially interpreted in my expect/ > send sequences, how can I force these to be considered part of the > text, if I needed to do so? Can I escape them? How? If I escape > things with a backslash (\) like usual, is \\ considered a back- > slash character? It will depend on your uucp. The \\ is interpreted as \ One thing you can do is to make the first character of the word as an octal digit. For example, PAUSE could be put in as: \120AUSE >3. How does the algorithm decide that the expected string has not > come in? Does it have a timeout value of some sort? If so, how > long? Does it "timeout" that long after no more text is received, > or just after that time period is up (regardless of incoming text)? Yes, there is a timeout, typically about 30 seconds. >4. While data is steadily coming in, does the expect algorithm look > at snapshots of it, even though it's incomplete? Example: > > fictitious incoming text: Enter password: > > will the sequence "sswo myname" ever succeed because that was > the last thing in the buffer at one point? Of course this would > be VERY unreliable, but could it happen? According to the docs, yes. >5. Is the text-to-send sent the instant the expect algorithm sees > what it's been looking for, or is there a pause of one or more > seconds? It is sent almost immediately. If you want a pause you could put in a \d (delay for 2 seconds) in the script. > >The manuals just leave me fuzzy on details. I really appreciate any assistance you all can give me on this subject. Thank you. Do yourself a favor and pick up a copy of the Nutshell handbook: Managing UUCP and Usenet It answers all questions in a readable format. JB -- Jonathan Bayer Beware: The light at the end of the Intelligent Software Products, Inc. tunnel may be an oncoming dragon 19 Virginia Ave. ...uunet!ispi!jbayer Rockville Centre, NY 11570 (516) 766-2867 jbayer@ispi.UUCP