piroufreek has asked for the wisdom of the Perl Monks concerning the following question:
What is the real answer? UPDATE: Co-worker helped shorten it:perl -ne '/pattern/?$test=1:{($test>=1)?$test++:next}&&($test>=2&&$tes +t<=11)?print:next' <filename>
Piroufreek.perl -ne '/pattern/?$t=1&&print:{($t)?$t++:""}&&($t&&$t<12)?print:""' +filename
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: grep -A10 oneliner?
by Roy Johnson (Monsignor) on Apr 14, 2005 at 19:53 UTC | |
by ikegami (Patriarch) on Apr 14, 2005 at 20:21 UTC | |
by Roy Johnson (Monsignor) on Apr 14, 2005 at 20:34 UTC | |
by gam3 (Curate) on Apr 14, 2005 at 21:54 UTC | |
|
Re: grep -A10 oneliner?
by Roy Johnson (Monsignor) on Apr 14, 2005 at 21:41 UTC | |
|
Re: grep -A10 oneliner?
by Fletch (Bishop) on Apr 14, 2005 at 19:46 UTC | |
|
Re: grep -A10 oneliner?
by ikegami (Patriarch) on Apr 14, 2005 at 19:44 UTC | |
|
Re: grep -A10 oneliner?
by dragonchild (Archbishop) on Apr 14, 2005 at 19:41 UTC | |
by ikegami (Patriarch) on Apr 14, 2005 at 19:47 UTC | |
|
Re: grep -A10 oneliner?
by tlm (Prior) on Apr 14, 2005 at 19:52 UTC | |
by ikegami (Patriarch) on Apr 14, 2005 at 20:17 UTC | |
|
Re: grep -A10 oneliner?
by ambrus (Abbot) on Apr 14, 2005 at 19:48 UTC | |
by Fletch (Bishop) on Apr 14, 2005 at 20:23 UTC | |
|
Re: grep -A10 oneliner?
by ysth (Canon) on Apr 14, 2005 at 22:21 UTC |