Thanks, that got me a little more information.  The output was this.

[snip]

Net ssh start completed.
session.open_channel completed, about to call loop
about to send 2\n
sent, the result was 2

[/snip]

Hugh Sasse wrote:
> On Wed, 5 Nov 2008, Nathan Halterman wrote:
> 
>> I'm trying to interact with a RF Terminal application.  But each time I
>> run this, it returns nothing from stdout, and just hangs irb.  I've been
>> banging my head on this one for a couple days, because it seems right,
>> but nothing comes back from the server.
>> 
>> Any ideas?  Thanks in advance.  :)
> 
> While you're waiting for someone who knows Net::ssh to reply, I'd add
> LOTS more diagnostics:
>> 
>> [code]
>>   def test_rf(run_this)
>> 
>>     Net::SSH.start('xx.xx.xx.xx', 'userid', :password => "password")  do
>> |session|
>> 
>>       session.open_channel do |channel|
>>         channel.request_pty(:term => 'xterm') do |ch, success|
>>           raise "could not request pty!" unless success
>  +          puts "about to send 2\\n"
>             # channel.send_data "2\n" # tell the shell to exit
>             x = channel.send_data "2\n" # tell the shell to exit
>             puts "sent, the result was #{x}"
>>         channel.send_data "2\n"
>>         channel.send_data "0\n"
>> 
>>         channel.on_data do |ch, data|
>>           puts "got data: #{data.inspect}"
>>         end
>>         channel.on_close do
>>           puts "shell terminated"
>>         end
>> 
>>       end
>         puts "session.open_channel completed, about to call loop"
>> 
>>       session.loop
>         puts "got past loop statement"
>> 
>>     end
>       puts "Net ssh start completed.

-- 
Posted via http://www.ruby-forum.com/.