this task can be accomplished with a perl one-liner:
perl -ne"/error|warning/i && print" rc.logbut if you'd like to make it a script, with full error checking, i might do something like:
#!/opt/perl5/bin/perl5.005 -w use strict; use warnings; $|++; ## process each file passed on command line for my $file ( @ARGV ) { ## open the file for reading open( RC => "<", $file ) or die "Can't open $file"; ## print the program name and current file to be processed print "$0: $file\n"; ## print errors and warnings while(<RC>) { print if /error|warning/i } close RC; }
~Particle *accelerates*
In reply to Re: log search
by particle
in thread log search
by Lhamo_rin
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |