i have perl script connects telnet server , runs basic commands on it. script using , works fine.
my $host = '192.186.0.2'; print ("\nconnecting server ".$host); $telnet->open($host); $telnet->waitfor('/login: $/i'); $telnet->print('admin'); $telnet->waitfor('/password: $/i'); $telnet->print('password'); $telnet->waitfor('/\$ $/i'); @output = $telnet->cmd('ls --color=none'); print ("@output\n");
but prompt on server looks this.
prompt>
so modified code read.
$telnet->waitfor('/prompt> $/i');
but pattern match timeout error. how can solve this?
Comments
Post a Comment