Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How do I execute command on different server thru CGI?

Status
Not open for further replies.

makarandmk

Programmer
Jan 25, 2003
10
US
Hi,

In my cgi script, I want to do telnet or rsh to some different host and run the commands on that host. How do I do that?

e.g. In my CGI script, there is one function called removeCase -

sub removeCase
{
01 I_WANT_TO_GO_TO_ONE_HOST;(want to do telnet/rsh)
02 WANT_TO_EXECUTE_SET_OF_COMMANDS_ON_THAT_HOSTMACHINE;
}

system("rsh $host")
or print `rsh $host`
is not working for me... Pl advise.

 
to telnet to some other server and run commands on it (interactively?), i guess you would need to spawn these using ther Perl's Expect module.. see here
Code:
  my $exp = new Expect;
  $exp->spawn("telnet somehost; echo hi; ");
---
cheers!
san
pipe.gif


"The universe has been expanding, and Perl's kind of been expanding along with the universe" - Larry Wall
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top