Forum: Ruby Ruby Expect Script

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
740ef4a76261fea50e027a8e14fd3a8e?d=identicon&s=25 Tony De (ynot)
on 2014-07-25 02:07
I'm new to Ruby and need to write a script that uses the ruby equivalent
of linux expect to run interactive scripts or commands on remote boxes.

Basically I need to ssh into a box, potentially run a script on that box
that will need questions answered, such as user name, server name, or
other "configuration" items.

Hopefully I didn't make it sound confusing by the way I've presented the
problem.

Does anybody have any examples or know how to do this?

Thanks!
5c4e55b92169c16ce2ca8fd75318eded?d=identicon&s=25 David Unric (dunric)
on 2014-07-25 03:13
Expect library like behavior can be achieved with use of stock PTY
module
http://ruby-doc.org/stdlib/libdoc/pty/rdoc/PTY.html . Examples included.
740ef4a76261fea50e027a8e14fd3a8e?d=identicon&s=25 Tony De (ynot)
on 2014-07-28 19:43
David Unric wrote in post #1153441:
> Expect library like behavior can be achieved with use of stock PTY
> module
> http://ruby-doc.org/stdlib/libdoc/pty/rdoc/PTY.html . Examples included.

Thanks!
This topic is locked and can not be replied to.