By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,898 Members | 1,198 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,898 IT Pros & Developers. It's quick & easy.

pexpect and OpenVMS

P: n/a
I have a collection of tcl expect scripts which I am converting to python
using the excellent pexpect module (http://pexpect.sourceforge.net/). So
far I've had great success in getting all my scripts to work with various
flavours of UNIX. However, OpenVMS is causing me problems.

The tcl scripts work perfectly across UNIX and VMS. I'm converting them
from tcl to python simply because python is more scalable and allows for
better code reuse. And it's a nicer language to code in IMHO.

When running a pexpect script against a VMS system, the script only sends
the first character of the command and then gets a timeout. For example,
if I do "sendline('sho proc')" and then drop to interactive mode, only the
's' from 'sho' has been sent to the 'shell' prompt. Running a session in
'interactive' mode seems to work fine.

By experimenting with an interactive python session, I have determined that
VMS systems appear to use a different os.linesep - '\r' instead of '\n' for
UNIX. So, I modified my script to set os.linesep = '\r' for VMS systems
but I still get lots of timeouts.

The login files to the VMS systems tend to display a lot of information,
sometimes in colour meaning lots of escape characters are sent to the
terminal. I'm wondering if this is confusing pexpect? However, the tcl
scripts were not bothered by this at all.

One workaround I'm using at the moment is to send a series of 10 or 20
return charcters seperated by a 1 second sleep. This generally works but
makes dealing with VMS systems very slow... Under tcl, there is a way to
slow down the rate at which characters are sent to the client. Is the same
available in pexpect?

Any ideas on how to make pexpect work with VMS systems?

Regards.
Adrian Casey.
Jul 18 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a

"Adrian Casey" <ne**@outbacklinux.com> wrote in message news:40******@duster.adelaide.on.net...
Any ideas on how to make pexpect work with VMS systems?


I'm surprised you even got pexpect to run under VMS. The
fiddly terminal stuff doesn't look easy to port. Have you got some
build details?
Jul 18 '05 #2

P: n/a
In article <c8*********@newton.cc.rl.ac.uk>,
Richard Brodie <R.******@rl.ac.uk> wrote:

"Adrian Casey" <ne**@outbacklinux.com> wrote in message
news:40******@duster.adelaide.on.net...
Any ideas on how to make pexpect work with VMS systems?


I'm surprised you even got pexpect to run under VMS. The
fiddly terminal stuff doesn't look easy to port. Have you got some
build details?


That's what I thought the first time I read it. I think
when you re-read the description you'll see that Mr. Casey
unequivocally explains that he's *driving* an OpenVMS
process from a conventionally-hosted pexpect.
--

Cameron Laird <cl****@phaseit.net>
Business: http://www.Phaseit.net
Jul 18 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.