Forum: Ruby Ruby Expect Script

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!
Please log in before posting. Registration is free and takes only a minute.
Existing account

NEW: Do you have a Google/GoogleMail, Yahoo or Facebook account? No registration required!
Log in with Google account | Log in with Yahoo account | Log in with Facebook account
No account? Register here.