Hi: Try this:
<variable_to_store> = `rsh -l <username> <hostname> 'command arg1 arg2 ..`; This works for me, I don't know if this is the best way or if it the more secure way to run a command in a remore machine, try to search CPAN for a module that can do something similar. Pablo. On 8/24/05, grover mitchell <[EMAIL PROTECTED]> wrote: > > Hi, > > I am trying to use system to run a command on a remote machine. > > system "ssh", $remote_host[0], "sudo", "-u", "nobody", > "/usr/bin/remote_command", "--arg1", $arg1, "--arg2", $arg2; > > The problem I run into is that perl will ssh into the remote host and > give me a shell there, instead of running the remote command on the > remote system. When I exit, perl will then try and run the remote > command on my local host. Is there an easy way to accomplish this task > using system? > > Thanks for any help. > > -- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > <http://learn.perl.org/> <http://learn.perl.org/first-response> > > > -- Did you try Net::SSH ?? Manav -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>