From: oinkoink+unet@... (Bret Jolly) Date: 2004-05-18T08:08:49+09:00 Subject: PTY and expect tutorial and examples Is there a tutorial or other simple documentation in English on how to use PTY and expect? I'm having a heck of a time trying to figure them out. I also cannot get the example scripts to work. For example, expect_sample.rb comes with the ruby distribution (I'm using ruby 1.9.0 (2004-05-10) [i686-linux]) and supposedly uses ftp to ftp.ruby-lang.org to get the name of the latest stable distribution. Running this script tells me that the distribution is "nil" and I can't get it to work no matter how I hack it. Even trying the simplest PTY program I can think of: require 'pty' PTY.spawn("ls") { |r, w, pid| puts r.readlines } ....leads to failure with the exception PTY::ChildExited. The most infuriating thing is that, despite not knowing what I am doing, I once had a Ruby expect script which invoked a function in Pari/gp and took the string result back into Ruby for further processing. This script no longer works correctly (it gives answers, but wrong answers). I can't figure out what is wrong because I don't understand PTY and expect and I can't find functioning examples or useful documentation anywhere (the rdoc output is not useful documentation here). Any pointers to explanations and examples that actually work will be greatly appreciated. Thanks! Regards, Bret