By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,417 Members | 1,825 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,417 IT Pros & Developers. It's quick & easy.

Execute script on remote computer.

shrek123
P: 23
Hi,

I am in a big mess.
I have to execute command on remote machine using perl script.
I have used INET Socket module to do this operation.
Following is the code snipet.
Expand|Select|Wrap|Line Numbers
  1.  
  2. use IO::Socket;
  3.  
  4. $socket = IO::Socket::INET->new (PeerAddr => "x:x:x:x",PeerPort => "ssh(zzz)",Proto => "tcp");
  5. if ($socket) 
  6.     {    print "f";
  7.     }
  8. else
  9. {print "g";}
  10.  
  11.  
I am able to connect to the remote machine, but i m not able to execute some other script on the remote machine.

Will appreciate , if anyone can throw light on it.

Regards,
Shrek.
Sep 26 '07 #1
Share this Question
Share on Google+
1 Reply


numberwhun
Expert Mod 2.5K+
P: 3,503
Hi,

I am in a big mess.
I have to execute command on remote machine using perl script.
I have used INET Socket module to do this operation.
Following is the code snipet.
Expand|Select|Wrap|Line Numbers
  1.  
  2. use IO::Socket;
  3.  
  4. $socket = IO::Socket::INET->new (PeerAddr => "x:x:x:x",PeerPort => "ssh(zzz)",Proto => "tcp");
  5. if ($socket) 
  6.     {    print "f";
  7.     }
  8. else
  9. {print "g";}
  10.  
  11.  
I am able to connect to the remote machine, but i m not able to execute some other script on the remote machine.

Will appreciate , if anyone can throw light on it.

Regards,
Shrek.
I have no experience with sockets, but I know that you would issue system level commands with either the syste() function or by enclosing the command(s) in back tics. I don't know if that would work via a socket, but its worth a shot.

Regards,

Jeff
Sep 26 '07 #2

Post your reply

Sign in to post your reply or Sign up for a free account.