Hi,
I am trying to launch a host command to windows, the command is something like
"rsh myaixmachine -l myuser “export PATH=/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 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érôme Hauss
PS. One of my simple tries
def rsh(myaixmachine, command)
@t = nil
s = "rsh " + myaixmachine + " -l myuser “#{ command }”"
puts s
@pipe = IO.popen(s)
@t = @pipe.read
@pipe.close
@t
end
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
Jerome Hauss wrote:
···
Hi,
I am trying to launch a host command to windows, the command is
something like
“rsh myaixmachine -l myuser "export PATH=/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 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érôme Hauss
PS. One of my simple tries
def rsh(myaixmachine, command)
@t = nil
s = “rsh " + myaixmachine + " -l myuser "#{ command }"”
puts s
@pipe = IO.popen(s)
@t = @pipe.read
@pipe.close
@t
end
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” rodrigo.bermejo@ps.ge.com
To: “ruby-talk ML” ruby-talk@ruby-lang.org
Sent: Tuesday, January 13, 2004 7:27 PM
Subject: Re: Host command with rsh ?
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
Jerome Hauss wrote:
Hi,
I am trying to launch a host command to windows, the command is
something like
“rsh myaixmachine -l myuser "export PATH=/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 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érôme Hauss
PS. One of my simple tries
def rsh(myaixmachine, command)
@t = nil
s = “rsh " + myaixmachine + " -l myuser "#{ command }"”
puts s
@pipe = IO.popen(s)
@t = @pipe.read
@pipe.close
@t
end