Getting data from Expect

G

greg

Hi All,

Can anyone tell me how I can get all the data produced by the command
"less":
PTY.spawn("cd some_directory") do |reader, writer, pid|
......
wireter.puts "less some_text_file"
# How do I get the content of the whole file?

Also, what is the command to find whether a ruby script has
successfully ssh-ed to a machine:
PTY.spawn("ssh user@machine") do |reader, writer, pid|
# How to find out that the login is successful?

I would really really appreciate your help!

Thanks,
Greg
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,266
Messages
2,571,318
Members
48,002
Latest member
EttaPfeffe

Latest Threads

Top