Host command with rsh ?

J

Jerome Hauss

------=_NextPart_000_017A_01C3DA07.A93CB4A0
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

Hi,

I am trying to launch a host command to windows, the command is =
something like
"rsh myaixmachine -l myuser \"export PATH=3D/pvcsbindir:$PATH; vlog =
mypvcsarchive > tomyfile; echo\""

I would like to get the standard output for this command. But it does =
not work properly : I need to do <ENTER> in my Windows console window, =
and if I launch several such commands, it happens I am really stuck.

It works with simple commands to Windows. And it works also when I try =
some prepared command with `mycommand`

An idea to this problem ?

Regards,
J=E9r=F4me Hauss


PS. One of my simple tries

def rsh(myaixmachine, command)
@t =3D nil
s =3D "rsh " + myaixmachine + " -l myuser \"#{ command }\""
puts s
@pipe =3D IO.popen(s)
@t =3D @pipe.read
@pipe.close
@t
end
------=_NextPart_000_017A_01C3DA07.A93CB4A0--
 
B

Bermejo, Rodrigo

You can use net/telnet instead

require 'net/telnet'

c=%^export PATH=/pvcsbindir:$PATH; vlogmypvcsarchive > tomyfile; echo "^

s = Net::Telnet.new({"Host" => "myaixmachine")

s.login("myuser","password")

p s.command(c)


s.close
 
J

Jerome Hauss

Thank you Rodrigo,

I have discovered that my example with IO.popen works fine if I use the -n
option of Windows' rsh.
(this option redirects the input of RSH on NULL)

Regards,
Jérôme Hauss

----- Original Message -----
From: "Bermejo, Rodrigo" <[email protected]>
To: "ruby-talk ML" <[email protected]>
Sent: Tuesday, January 13, 2004 7:27 PM
Subject: Re: Host command with rsh ?
 

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

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top