Re: Open3 and ssh

I think your problem is that the -T option explicitly prevents the far
end
opening a pty. It works for me if I change this to “ssh -tt localhost”
(having two -t options forces opening a pty even though the local end
doesn’t have one). Note that this is under Ubuntu Linux though, not OSX.

You should also add “STDOUT.sync = true” at the top of your program, or
else
remember to flush STDOUT after each print.

However, spawning the ssh client like this is pretty yucky, especially
if
you want to avoid interactive prompting for passwords/passphrases,
unknown
ssh host keys etc.

You could instead try using the Net::SSH library, written entirely in
Ruby.
Its native API is awkward, but there is a separate Net::SSH::Telnet shim
which makes it work like Net::Telnet. I find it very powerful for
scripted
access to devices.

http://net-ssh.rubyforge.org/
http://rubyforge.org/projects/net-ssh-telnet/

Regards,

Brian.