I have a perl script that I am working on. I would like for it to open the messages file and check for errors and warning. I want the check to be date specific though. I would also like for it to remove duplicate lines too. This is what I have so far.
This part works fine in that it opens mesages files and puts what I searching for in the message1 file. It is not date specific and it does not remove duplicate lines. I would appreciate any help.
Jesse
Code:
#!/usr/bin/perl -w
open(MESSAGES,"/var/adm/messages") || die "cannot open messages: $!";
open(OUT,">/export/home/siswjh/message1") || die "cannot create message: $!";
while (<MESSAGES>) {
if (/corrupt/i || /warning/i || /error/i) {
print OUT $_;
}
}
Jesse