J
Jean-eric Godard
Hello ,
I use the NET::SSH gem, and I have some trouble using it, I can't send
successive command.
Per example when I type the commands :
"ls" followed by "cd desktop" and then "ls" again.
the second time I send "ls", return me the exact same list as the first
"ls" send the "cd desktop" command is ignored.
net::ssh act like if it open a new terminal for each command send.
Here the code I use:
require 'rubygems'
require 'net/ssh'
HOST = '192.168.0.3'
USER = 'utilisateur'
PASS = 'motdepasse'
Net::SSH.start( HOST, USER, assword => PASS ) do|ssh|
ssh.exec('ls')
ssh.exec('cd Desktop')
ssh.exec('ls')
end
I use NET::SSH version (2.0.23) on ruby 1.9.2p0.
Can someone please send me the code allowing me to send these two
simples commands in series to the terminal.
As it seems the above code send these commands in parallels.
Thanks very much.
I use the NET::SSH gem, and I have some trouble using it, I can't send
successive command.
Per example when I type the commands :
"ls" followed by "cd desktop" and then "ls" again.
the second time I send "ls", return me the exact same list as the first
"ls" send the "cd desktop" command is ignored.
net::ssh act like if it open a new terminal for each command send.
Here the code I use:
require 'rubygems'
require 'net/ssh'
HOST = '192.168.0.3'
USER = 'utilisateur'
PASS = 'motdepasse'
Net::SSH.start( HOST, USER, assword => PASS ) do|ssh|
ssh.exec('ls')
ssh.exec('cd Desktop')
ssh.exec('ls')
end
I use NET::SSH version (2.0.23) on ruby 1.9.2p0.
Can someone please send me the code allowing me to send these two
simples commands in series to the terminal.
As it seems the above code send these commands in parallels.
Thanks very much.