>
> perl -ne'print if $.==2 || $& && !$x++; $.=0 if /^--+$/'
>
> The $.==2 tests if the current line number is 2. If $. is 2 then the
> current line is printed and the program goes on to the next statement.
> If $. is not 2 then $& is tested and if $& is false then the current
> line is printed an
thebarn...@gmail.com wrote:
Hi
Hello,
I run this command and pipe the output to a perl one liner. not quite
sure how it parses the data:
svmon -Pt3 | perl -e 'while(<>){print if($.==2 || $& && !$x++); $.=0 if
(/^--+$/)}'
That can be shortened to:
svmon -Pt3 | perl -ne'print if $.==2 || $&
On 1/30/2009 12:59 AM, thebarn...@gmail.com wrote:
Hi
I run this command and pipe the output to a perl one liner. not quite
sure how it parses the data:
svmon -Pt3 | perl -e 'while(<>){print if($.==2 || $& && !$x++); $.=0 if
(/^--+$/)}'
i understand that it resets the line count every time it
Hi
I run this command and pipe the output to a perl one liner. not quite
sure how it parses the data:
svmon -Pt3 | perl -e 'while(<>){print if($.==2 || $& && !$x++); $.=0 if
(/^--+$/)}'
which outputs:
---
Pid Command