Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Ruby > Host command with rsh ?

Reply
Thread Tools

Host command with rsh ?

 
 
Jerome Hauss
Guest
Posts: n/a
 
      01-13-2004
------=_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--

 
Reply With Quote
 
 
 
 
Bermejo, Rodrigo
Guest
Posts: n/a
 
      01-13-2004
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 <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é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
>
>
>





 
Reply With Quote
 
 
 
 
Jerome Hauss
Guest
Posts: n/a
 
      01-14-2004
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" <(E-Mail Removed)>
To: "ruby-talk ML" <(E-Mail Removed)>
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 <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é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
> >
> >
> >

>




 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to call rsh from Applet to remote host ashutosh.juneja@gmail.com Java 16 06-02-2007 04:04 PM
RSH over IPSEC VPN ramuesq.cisco@gmail.com Cisco 2 03-14-2006 04:32 PM
Search java rsh Api or Sample program pcouas@infodev.fr Java 1 04-08-2005 04:04 PM
disconnecting rsh session sc0ri0n Perl 1 02-16-2005 12:46 AM
rsh to router B Wert Cisco 1 08-20-2004 09:10 PM



Advertisments