in reply to Write a file if grep finds a pattern?
You want something like$ perl -MDDS -le" Dump($_); print grep /stuff/, 1,2,3,stuff; Dump($_)" $VAR1 = undef; stuff $VAR1 = undef; $ perl -MDDS -le" Dump($_); warn print grep /stuff/, 1,2,3,stuff; Dump +($_)" $VAR1 = undef; stuff 1 at -e line 1. $VAR1 = undef;
my $returncode; while(<IN>){ if( /error/i ){ print; $returncode++; } } if ( $returncode ){ BoogieWoogie(); }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Write a file if grep finds a pattern?
by matze77 (Friar) on Nov 19, 2010 at 09:37 UTC |