hi monks
i need to know whether IPC::Run can be used to spawn a telnet session and send some commands to it and display their output
i came across Net::Telnet and used it. it works.
but i need to know whether thi implentation is possible through IPC::Run
below is my code
so while executing its waiting indefinitely, pl help me out in this regard. tell ur valuable guidelines.... thanks#!/usr/bin/perl use IPC::Run qw(start pump finish timeout) ; my $server_address ='192.168.166.100'; my @cat = qw(cmd.exe); my $user_name = 'anitha'; #my @cat = qw(cmd /k telnet $server_address); my $h =start(\@cat, \$in , \$out); #pump $h while $out=~/.*>/i; $in .="telnet 192.168.166.100"."\n"; pump $h until $out=~/login:/i; $in .=$user_name."\n"; pump $h while $out=~/password .* /i; "before passwd\n"; $in .="9888888"."\n"; pump $h while $out=~/[.*]$/; $in .="help"."\n"; pump $h while $out=~/[.*]$/; print "$out\n";
In reply to ipc :: run & telnet by perlseeker19
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |