Open files and looking a word
- From: digolinopage@xxxxxxxxxxxx (Rodrigo Tavares)
- Date: Fri, 31 Aug 2007 10:09:54 -0300 (ART)
Hello,
I'm doing a script, it run a ping in many computers
and create a log file.
I need search in log file the word "Destination Host
Unreachable". So, I have to take below line. After
using regular expressions taking ferrari.lab and print
"The host is down !".
example:
PING ferrari.lab (192.168.1.152) 56(84) bytes of data.
From goal.lab (192.168.1.7) icmp_seq=2 DestinationHost Unreachable
How I do it ?
Begin of script, wih array with host names:
print "Testing the computers....\n";
for (my $i=0 ; $i < 5 ; $i++)
{
system "ping -c 4 $hosts[$i] >> hosts.txt";
}
Best regards,
Faria
Flickr agora em português. Você clica, todo mundo vê.
http://www.flickr.com.br/
.
- Follow-Ups:
- Re: Open files and looking a word
- From: Chas Owens
- Re: Open files and looking a word
- Prev by Date: finding methods and attributes in a name space
- Next by Date: Re: Open files and looking a word
- Previous by thread: finding methods and attributes in a name space
- Next by thread: Re: Open files and looking a word
- Index(es):
Relevant Pages
|
|