beetle30 has asked for the wisdom of the Perl Monks concerning the following question:

I need to rsh into a machine run a number of commands.grab the output,& exit the machine.But i am only able to get as far as the rsh,the command i need executed don't run.can someone tell me how this can be done.

Replies are listed 'Best First'.
Re: rsh from perl
by gaal (Parson) on Sep 19, 2004 at 08:48 UTC
    First of all, capture the status (and error message?) of what you are spawning. Does that give you a hint?

    Make sure you aren't being bit by whitespace or by quoting/escaping issues. On the command line, you may need to protect characters like ';' from the shell, but if you're using system with multiple args then that's not needed.

Re: rsh from perl
by ambrus (Abbot) on Sep 19, 2004 at 09:33 UTC

    You might want to give us the code you've tried and in what way it does not work (the error messages if there are some). Without that we can only guess what your problem is.

Re: rsh from perl
by jfroebe (Parson) on Sep 20, 2004 at 03:43 UTC

    Hi,

    First, I would have you take a look at the Net::Rsh module (it has a simple interface). Next, I would recommend using Net::SSH::Perl instead for security and compression of the data stream(s).

    While compression may not be a concern for you, it may be if your user(s) need to transfer a great deal of information back or if they are on a slow connection. In any case, I have a hard time seeing the use of rsh itself IMHO.

    hope this helps and isn't too preachy.

    Jason L. Froebe

    No one has seen what you have seen, and until that happens, we're all going to think that you're nuts. - Jack O'Neil, Stargate SG-1