X-Git-Url: http://ftp.carnet.hr/carnet-debian/scm?a=blobdiff_plain;f=src%2Fos_regex%2Fexamples%2Fvalidate.pl;h=4bd67916d511000d7dc2e87ec596874f476fff8d;hb=3f728675941dc69d4e544d3a880a56240a6e394a;hp=3a925c633bfd2b47ce325a4cddb2f13663a84cbc;hpb=914feba5d54f979cd5d7e69c349c3d01f630042a;p=ossec-hids.git diff --git a/src/os_regex/examples/validate.pl b/src/os_regex/examples/validate.pl index 3a925c6..4bd6791 100755 --- a/src/os_regex/examples/validate.pl +++ b/src/os_regex/examples/validate.pl @@ -3,8 +3,7 @@ use strict; use warnings; -if(@ARGV < 2) -{ +if (@ARGV < 2) { die "$0 file error_msg\n"; } @@ -12,26 +11,20 @@ my ($prog, $file,$msg) = (@ARGV); open(FILE,$file) || die "Error opening file: $file\n"; -if(! -f $prog) -{ - die "File $prog not present\n"; +if (! -f $prog) { + die "File $prog not present\n"; } -while() -{ +while() { my $line = $_; print "running: $prog $line\n"; my $result = `$prog $line`; - if($result =~ /$msg/) - { + if ($result =~ /$msg/) { print $result; print "\t ** $line **\n"; ; - } - else - { + } else { print $result; } } -# EOF