I\'m trying to write a Ruby script that will ssh over to a server, run a given command, and fetch the output from it. Here\'s what I\'ve got so far, mostly adapted from the Prog
Check out http://www.42klines.com/2010/08/14/what-to-expect-from-the-ruby-expect-library.html - it has some nice examples of using PTY with and without Ruby's expect.
I often find it easier to only use PTY, as I can look at my "buffer" and work out what's happening.