turn2me5 has asked for the wisdom of the Perl Monks concerning the following question:
Please let me know whether I can modify the same code or I need to use some totally different module than Net::Telnet..$username="imail1"; $passwd="imail1"; use Net::Telnet (); $t = new Net::Telnet (Timeout => 10); $t->open("172.16.14.74"); $t->print($username); $t->print($passwd); sleep(5); open(FHH, ">output.txt"); print FHH $t->cmd("cp opwv/config/config.db ./"); $flag=1; close(FHH); open(FH,"<output.txt"); while(<FH>) { if($_ =~ "ERROR"){ $flag = 0; } } if ($flag == 0) { print "Fail"; } else { print "Pass"; } close(FH); unlink("output.txt");
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Want to communicate status of the last command to Windows machine
by vladdrak (Monk) on Dec 19, 2006 at 07:20 UTC | |
by turn2me5 (Initiate) on Dec 19, 2006 at 07:37 UTC | |
by vladdrak (Monk) on Dec 19, 2006 at 08:59 UTC | |
by RedTussock (Acolyte) on Oct 07, 2012 at 17:20 UTC |