× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Hi John,

The stty errors are because Expect wants the stty program to be in the /usr/local/bin directory, whereas in PASE it's located in /qopensys/usr/bin. You can solve the problem by doing (from PASE):

ln -s /QOpenSys/QIBM/ProdData/OS400/PASE/bin/stty /usr/local/bin/stty

That'll set up /usr/local/bin/stty as an alias, so Expect can use it.

The pattern not matching isn't really a problem. When you tell Expect to show you diagnostics, it'll show you all of the lines that it processes that do not match your string. It says that "" (a blank line) doesn't match "password:" which is normal -- it shouldn't match. The line following the blank line might have "password:" or maybe the one after it. It's not a problem unless NOTHING matches...

Please fix the stty thing, and then maybe the log will make more sense...

John McKee wrote:
Following Scott' examples, I have been trying to get a script to connect to a
remote site for sftp. It isn't working right, but, at least, it is not locking
up the remote system either.

First, from working with scripting in the past, I assumed that the search
pattern does not have to be the entire string. In this case, the remote site
sends back a rather long user name, followed by 's password:. I have tried
running this with the entire user name as well as just password:.

I get the same error each time. My first thought is that something else is
missing.

Anyway, this is what I receive in stderr:

spawn: returns {494}

expect: does "" (spawn_id exp3) match glob pattern "password:"? no

expect: does "sh: /usr/local/bin/stty: not found.\r\n" (spawn_id ex

expect: does "sh: /usr/local/bin/stty: not found.\r\nConnecting to

expect: does "sh: /usr/local/bin/stty: not found.\r\nConnecting to

expect: does "sh: /usr/local/bin/stty: not found.\r\nConnecting to
expect: timed out

My questions:
1) I have logged in manually, and I can confirm that the trainilg part of the
password prompt is indeed password:. So what is the expect trying to tell me
when it tates that the pattern does not match?

2) Notice a little further down the not found related to /usr/local/bin/stty? I
have Cygwin on my desktop. Looking for stty, it is in /usr/bin. But, even
looking there on the i, I do not see it.

Any thoughts?

Thanks.

John McKee



As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.