> exec "egrep -c $lookFor @{$LOGS[$_ - 1]} >out" ...
>
> Unless you need to protect against malicious entries in
> @LOGS, this'll get
> you going.
okay, a bit more info...
$lookFor="Test App Finished|Fault
2-0|ORA-|Bind|SystemError|SystemException|Communication|ORBA|Get Q Error";
foreach (@allFiles) {
if( ($count % 3) == 0 ) {
push(@logFiles1,"../logs/set1/" . $_);
} else {
if ( ($count % 2 ) == 0 ) {
push(@logFiles2,"../logs/set1/" . $_);
} else {
push(@logFiles3,"../logs/set1/" . $_);
}
}
$count++;
}
exec "egrep -c $lookFor @{$LOGS[$_ - 1]} >out" unless $pid=fork; # fork new
process for cmd
results in:
sh: Fault: not found
egrep: can't open App
egrep: can't open Finished
sh: Bind: not found
sh: SystemError: not found
sh: ORA-: not found
sh: SystemException: not found
sh: ORA-: not found
egrep: can't open App
egrep: can't open Finished
shsh: Bind: : Faultnot found
: not found
sh: SystemError: not found
sh: SystemException: not found
sh: Communication: not found
sh: ORBA: not found
sh: Get: not found