I wrote a small script that goes on to various machines greps for certain
events and logs them (I am using plain shell scripting for this). I need to
know what machine these events occur so I did an
echo $host >> myfile
then echo grep results >> myfile.
Now I want to call a perl script that will take this info pretty it up and
create a report. My first problem seems to be the following:
I now have a file (myfile) that has info like the following:
machine1
machine2
machine3
some log stuff that occured on machine3
machine4
I want to get rid of machine1, machine2, and machine4 as there were no
matching logs for these events.
I tried as a test perl -p -i -e 's//nmachine//g' myfile and get the
following error:
Illegal division by zero at -e line 1, <> line 1. (and all data is lost in
myfile).
Any ideas on how I can do this? I can't seem to find anything in Mastering
Regular Expressions (but I may be missing it =)
Thanks in advance
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]