Hi all,
 
 Is there a way to run a script that take standard input.
 My remote script is called 'restore'. When it is run , it
 require a "Yes or NO" answer before it can run"
 My  Perl program telnet find but cannot seems to pass
 the "Y" or "N" for the restore script to run.
 
 
 use Net::Telnet;
 
 $ip = "hulk";
 $user = "user102";
 $password = "";
 
 print "Running  ...\n";
 $t = new Net::Telnet(-Timeout=>36000,-Errmode=>"return");
       $t->open($ip);
       $t->waitfor(Match=>'/login/i');
       $t->print("$user");
       $t->waitfor(Match=>'/Pass/i');
       $t->print("$password");
      
       $t->waitfor(Match=>'/%/');
       
       $t->cmd('cd TOOLS'); 
       $t->print('restore');
       $t->waitfor(Match=>'/Are you sure/i');
       $t->print("y");
 
 
 
      


      
_______________________________________________
Perl-Unix-Users mailing list
Perl-Unix-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to