J
justme
hi
i have a question regarding the usage of Net::Telnet cmd.
here is some of my code
use Net::Telnet;
$key = <STDIN>;
$dir = '/home';
chomp($key);
my $telnet = Net::Telnet-> new
( Timeout => 30,
Prompt=>'server#'
);
$telnet->open("$telnetserver");
$telnet->
login($login,$pass);
my @listing = $telnet-> cmd("cd $dir;/usr/bin/grep '$key' *");
$telnet->close;
print "@listing\n";
here is my situation. in $dir, there are many text files, as much as
8000 files.
and i need to grep for $key in every file. sometimes i can get the
results
if the grep results is small. Otherwise, no results will be output if
the grep is big.
Anyway i can work around this or is there something i miss in the
code?. Is it better print to screen as the cmd executes using a while
loop? any suggestions is greatly appreciated thanks..
i have a question regarding the usage of Net::Telnet cmd.
here is some of my code
use Net::Telnet;
$key = <STDIN>;
$dir = '/home';
chomp($key);
my $telnet = Net::Telnet-> new
( Timeout => 30,
Prompt=>'server#'
);
$telnet->open("$telnetserver");
$telnet->
login($login,$pass);
my @listing = $telnet-> cmd("cd $dir;/usr/bin/grep '$key' *");
$telnet->close;
print "@listing\n";
here is my situation. in $dir, there are many text files, as much as
8000 files.
and i need to grep for $key in every file. sometimes i can get the
results
if the grep results is small. Otherwise, no results will be output if
the grep is big.
Anyway i can work around this or is there something i miss in the
code?. Is it better print to screen as the cmd executes using a while
loop? any suggestions is greatly appreciated thanks..