Re: Help with executing a command on remote machine using Net::Telnet
A small correction-> I am able to run it but not desired results. thanks. Satish >From: "Satish Vadlamani" <[EMAIL PROTECTED]> >To: [EMAIL PROTECTED], [EMAIL PROTECTED] >Subject: Re: Help with executing a command on remote machine using >Net::Telnet >Date: Sun, 01 Jul 2001 14:35:28 > >Hi Andy: > >I am not able to run the program. Actually, in order to eliminate >variables, the host I am telnetting to is the local machine. The program >is >running but no results. I included the relevant part of the program here. >Thanks in advance. > >Satish > >use Cwd; >use File::Basename; >use Env; >use Cwd; >use File::Copy ; >use File::Path ; >use strict; >use Data::Dumper; >use Time::Local; >use Win32; >use Date::Calc; >use Net::Telnet; > >$\ = "\n"; > >my $t; >#$t = Net::Telnet->new (Timeout => 10,Host => 'MatrixProd',Prompt => >'/c:.*>/i'); >$t = Net::Telnet->new (Timeout => 10,Prompt => '/c:.*?>/i'); >$t->open("MatrixProd"); > >my $user_name = "administrator"; >my $password = ""; >$t->login($user_name,$password); > >my $fh = $t->input_log; >$fh = $t->input_log($fh); > >my $change_dir = $t->cmd("cd c:\\MatrixProd\\DF\\controls\\scripts"); >$t->cmd("c:\\MatrixProd\\DF\\controls\\scripts\\run_primary_aa.pl"); > > >my $ok = >$t->print("c:\\MatrixProd\\DF\\controls\\scripts\\run_primary_aa.pl"); > >exit; > > >>From: "Andy Jennings" <[EMAIL PROTECTED]> >>Reply-To: "Andy Jennings" <[EMAIL PROTECTED]> >>To: "Satish Vadlamani" <[EMAIL PROTECTED]>, "Perl Win32" >><[EMAIL PROTECTED]> >>Subject: Re: Help with executing a command on remote machine using >>Net::Telnet >>Date: Sun, 1 Jul 2001 04:54:52 -0500 >> >>As specified in the Net::Telnet docs, your prompt should be a match >>string. >>Try something like:- >> >>prompt =>'/c:.*?>/' #untested on a full session but does not throw an >>error >>when called as below >> >>Andy >> >>- Original Message - >>From: "Satish Vadlamani" <[EMAIL PROTECTED]> >>To: <[EMAIL PROTECTED]> >>Sent: Sunday, July 01, 2001 4:52 AM >>Subject: Help with executing a command on remote machine using Net::Telnet >> >> >> > Hi: >> > I am having trouble sending a command to the remote machine (both >>machines >> > win2000). I don't want any interaction. I just want to send a command >>to >>be >> > executed on the remote machine. I am getting the following error: >> > >> > bad match operator: opening delimiter missing: c:.*\\> at >> > C:\MATRIX~1\DF\controls\scripts\RUN_PR~3.PL line 17 >> > >> > Here is the relevant part of my program. Thanks a lot if you can be of >> > help. >> > >> > use Cwd; >> > use File::Basename; >> > use Env; >> > use Cwd; >> > use File::Copy ; >> > use File::Path ; >> > use strict; >> > use Data::Dumper; >> > use Time::Local; >> > use Win32; >> > use Date::Calc; >> > use Net::Telnet; >> > >> > $\ = "\n"; >> > >> > my $t; >> > $t = Net::Telnet->new (Timeout => 10, >> > Host => 'MatrixDev', >> > Prompt => 'c:.*\\\>' >> > ); >> > my $user_name = "administrator"; >> > my $password = ""; >> > >> > $t->login($user_name,$password); >> > #my $change_dir = $t->cmd("cd >>c:/MatrixDev/DF/controls/scripts"); >> > #my $result = $->cmd("run_prod_secondary_aa.pl"); >> > _ >> > Get your FREE download of MSN Explorer at http://explorer.msn.com >> > >> > ___ >> > Perl-Win32-Users mailing list >> > [EMAIL PROTECTED] >> > http://listserv.ActiveState.com/mailman/listinfo/perl-win32-users >> > >> >>___ >>Perl-Win32-Users mailing list >>[EMAIL PROTECTED] >>http://listserv.ActiveState.com/mailman/listinfo/perl-win32-users > >_ >Get your FREE download of MSN Explorer at http://explorer.msn.com > >___ >Perl-Win32-Users mailing list >[EMAIL PROTECTED] >http://listserv.ActiveState.com/mailman/listinfo/perl-win32-users _ Get your FREE download of MSN Explorer at http://explorer.msn.com ___ Perl-Win32-Users mailing list [EMAIL PROTECTED] http://listserv.ActiveState.com/mailman/listinfo/perl-win32-users
Re: Help with executing a command on remote machine using Net::Telnet
Hi Andy: I am not able to run the program. Actually, in order to eliminate variables, the host I am telnetting to is the local machine. The program is running but no results. I included the relevant part of the program here. Thanks in advance. Satish use Cwd; use File::Basename; use Env; use Cwd; use File::Copy ; use File::Path ; use strict; use Data::Dumper; use Time::Local; use Win32; use Date::Calc; use Net::Telnet; $\ = "\n"; my $t; #$t = Net::Telnet->new (Timeout => 10,Host => 'MatrixProd',Prompt => '/c:.*>/i'); $t = Net::Telnet->new (Timeout => 10,Prompt => '/c:.*?>/i'); $t->open("MatrixProd"); my $user_name = "administrator"; my $password = ""; $t->login($user_name,$password); my $fh = $t->input_log; $fh = $t->input_log($fh); my $change_dir = $t->cmd("cd c:\\MatrixProd\\DF\\controls\\scripts"); $t->cmd("c:\\MatrixProd\\DF\\controls\\scripts\\run_primary_aa.pl"); my $ok = $t->print("c:\\MatrixProd\\DF\\controls\\scripts\\run_primary_aa.pl"); exit; >From: "Andy Jennings" <[EMAIL PROTECTED]> >Reply-To: "Andy Jennings" <[EMAIL PROTECTED]> >To: "Satish Vadlamani" <[EMAIL PROTECTED]>, "Perl Win32" ><[EMAIL PROTECTED]> >Subject: Re: Help with executing a command on remote machine using >Net::Telnet >Date: Sun, 1 Jul 2001 04:54:52 -0500 > >As specified in the Net::Telnet docs, your prompt should be a match string. >Try something like:- > >prompt =>'/c:.*?>/' #untested on a full session but does not throw an error >when called as below > >Andy > >- Original Message - >From: "Satish Vadlamani" <[EMAIL PROTECTED]> >To: <[EMAIL PROTECTED]> >Sent: Sunday, July 01, 2001 4:52 AM >Subject: Help with executing a command on remote machine using Net::Telnet > > > > Hi: > > I am having trouble sending a command to the remote machine (both >machines > > win2000). I don't want any interaction. I just want to send a command >to >be > > executed on the remote machine. I am getting the following error: > > > > bad match operator: opening delimiter missing: c:.*\\> at > > C:\MATRIX~1\DF\controls\scripts\RUN_PR~3.PL line 17 > > > > Here is the relevant part of my program. Thanks a lot if you can be of > > help. > > > > use Cwd; > > use File::Basename; > > use Env; > > use Cwd; > > use File::Copy ; > > use File::Path ; > > use strict; > > use Data::Dumper; > > use Time::Local; > > use Win32; > > use Date::Calc; > > use Net::Telnet; > > > > $\ = "\n"; > > > > my $t; > > $t = Net::Telnet->new (Timeout => 10, > > Host => 'MatrixDev', > > Prompt => 'c:.*\\\>' > > ); > > my $user_name = "administrator"; > > my $password = ""; > > > > $t->login($user_name,$password); > > #my $change_dir = $t->cmd("cd >c:/MatrixDev/DF/controls/scripts"); > > #my $result = $->cmd("run_prod_secondary_aa.pl"); > > _ > > Get your FREE download of MSN Explorer at http://explorer.msn.com > > > > ___ > > Perl-Win32-Users mailing list > > [EMAIL PROTECTED] > > http://listserv.ActiveState.com/mailman/listinfo/perl-win32-users > > > >___ >Perl-Win32-Users mailing list >[EMAIL PROTECTED] >http://listserv.ActiveState.com/mailman/listinfo/perl-win32-users _ Get your FREE download of MSN Explorer at http://explorer.msn.com ___ Perl-Win32-Users mailing list [EMAIL PROTECTED] http://listserv.ActiveState.com/mailman/listinfo/perl-win32-users
Re: Help with executing a command on remote machine using Net::Telnet
As specified in the Net::Telnet docs, your prompt should be a match string. Try something like:- prompt =>'/c:.*?>/' #untested on a full session but does not throw an error when called as below Andy - Original Message - From: "Satish Vadlamani" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Sunday, July 01, 2001 4:52 AM Subject: Help with executing a command on remote machine using Net::Telnet > Hi: > I am having trouble sending a command to the remote machine (both machines > win2000). I don't want any interaction. I just want to send a command to be > executed on the remote machine. I am getting the following error: > > bad match operator: opening delimiter missing: c:.*\\> at > C:\MATRIX~1\DF\controls\scripts\RUN_PR~3.PL line 17 > > Here is the relevant part of my program. Thanks a lot if you can be of > help. > > use Cwd; > use File::Basename; > use Env; > use Cwd; > use File::Copy ; > use File::Path ; > use strict; > use Data::Dumper; > use Time::Local; > use Win32; > use Date::Calc; > use Net::Telnet; > > $\ = "\n"; > > my $t; > $t = Net::Telnet->new (Timeout => 10, > Host => 'MatrixDev', > Prompt => 'c:.*\\\>' > ); > my $user_name = "administrator"; > my $password = ""; > > $t->login($user_name,$password); > #my $change_dir = $t->cmd("cd c:/MatrixDev/DF/controls/scripts"); > #my $result = $->cmd("run_prod_secondary_aa.pl"); > _ > Get your FREE download of MSN Explorer at http://explorer.msn.com > > ___ > Perl-Win32-Users mailing list > [EMAIL PROTECTED] > http://listserv.ActiveState.com/mailman/listinfo/perl-win32-users > ___ Perl-Win32-Users mailing list [EMAIL PROTECTED] http://listserv.ActiveState.com/mailman/listinfo/perl-win32-users
Help with executing a command on remote machine using Net::Telnet
Hi: I am having trouble sending a command to the remote machine (both machines win2000). I don't want any interaction. I just want to send a command to be executed on the remote machine. I am getting the following error: bad match operator: opening delimiter missing: c:.*\\> at C:\MATRIX~1\DF\controls\scripts\RUN_PR~3.PL line 17 Here is the relevant part of my program. Thanks a lot if you can be of help. use Cwd; use File::Basename; use Env; use Cwd; use File::Copy ; use File::Path ; use strict; use Data::Dumper; use Time::Local; use Win32; use Date::Calc; use Net::Telnet; $\ = "\n"; my $t; $t = Net::Telnet->new (Timeout => 10, Host => 'MatrixDev', Prompt => 'c:.*\\\>' ); my $user_name = "administrator"; my $password = ""; $t->login($user_name,$password); #my $change_dir = $t->cmd("cd c:/MatrixDev/DF/controls/scripts"); #my $result = $->cmd("run_prod_secondary_aa.pl"); _ Get your FREE download of MSN Explorer at http://explorer.msn.com ___ Perl-Win32-Users mailing list [EMAIL PROTECTED] http://listserv.ActiveState.com/mailman/listinfo/perl-win32-users