On Thursday, May 30, 2002, at 10:42 , Kipp, James wrote:
<>
very well. i see.
>
> while () {
> next if $_ =~ /USER/;
<<#
# why not clean the front first and not need a $null
#
s/^\s+//;
my($user,$cpu,$mem,$vmem,$cmd) = split(/\s+/);
print ":$user:$cp
Thanks for the explanation.
"Kipp, James" wrote:
>
> I think that is how he eliminates lines up to the NPROC line. so in other
> words, next if range from line 1 to /^NPROC/. and it does work.
Yes that is right, I also have to point out a potential problem here
This will not work if the first
> < ...
> so I fear his (1../^NPROC/) isn't doing quite what he was hoping that
> it would be doing >>
>
> yes, i noticed that, but was easily fixed with minor adjustments
I failed to notice this mail, was the adjustment what I had mentioned about
swapping the conditions in the if statement.
Sudarsan Raghavan wrote:
> Original Message
> Subject: Re: Help with parsing output
> Date: Fri, 31 May 2002 11:07:16 +0530
> From: Sudarsan Raghavan <[EMAIL PROTECTED]>
> Organization: HP ISO
> To: "John W. Krahn" <[EMAIL PROTECTED]>
>
Original Message
Subject: Re: Help with parsing output
Date: Fri, 31 May 2002 11:07:16 +0530
From: Sudarsan Raghavan <[EMAIL PROTECTED]>
Organization: HP ISO
To: "John W. Krahn" <[EMAIL PROTECTED]>
References: <[EMAIL PROTECTED]>
<[EMAIL PROTECT
"Kipp, James" wrote:
> >
> > # INPUTDATA is the filehandle through which you are getting the input
> > while () {
> > chomp;
> > s/^\s+//;
> > next if (m/^$/ || (1 .. /^NPROC/));
>
> >what does the range thing do?
> >wouldn't just ... || /^NPROC/ be enough?
>
> I think that is how h
On Thursday, May 30, 2002, at 02:53 PM, bob ackerman wrote:
>
> On Thursday, May 30, 2002, at 11:20 AM, David Gray wrote:
>
> while () {
> chomp;
> s/^\s+//;
> next if (m/^$/ || (1 .. /^NPROC/));
what does the range thing do?
wouldn't just ... || /^NP
On Thursday, May 30, 2002, at 11:20 AM, David Gray wrote:
while () {
chomp;
s/^\s+//;
next if (m/^$/ || (1 .. /^NPROC/));
>>>
>>> what does the range thing do?
>>> wouldn't just ... || /^NPROC/ be enough?
>>
>> ok. opposite sense: || ! /^NPROC/
>
> So that wo
On Thursday, May 30, 2002, at 10:42 , Kipp, James wrote:
as for why I do old dog flag tricks - to be honest -
they make me feel safer I know that i will not even
look at anything, and I get the 'freebie' of not needing
to deal with a RegEx resolution - which I think is more
expensive - and I
> >> while () {
> >> chomp;
> >> s/^\s+//;
> >> next if (m/^$/ || (1 .. /^NPROC/));
> >
> > what does the range thing do?
> > wouldn't just ... || /^NPROC/ be enough?
>
> ok. opposite sense: || ! /^NPROC/
So that would be:
next if (m/^$/ || ! /^NPROC/);
Which means skip proces
Sudarsan Raghavan wrote:
>
> "Kipp, James" wrote:
>
> > I am reading output from a pipe to a command called 'prstat' (like top).
> > just wanted to get some ideas on the best way to capture the data i am
> > looking for. below is an example of the output:
>
> # INPUTDATA is the filehandle throu
> thanks. question: why the counter in your code example?
<>
yes, i understand that, i guess the question should have been, why do we
need it?
why not just do a next unless /REGEX/ then
if /$find/
>
> hmm..guess i should have scoured the man page before posting the question.
> tur
On Thursday, May 30, 2002, at 09:44 AM, bob ackerman wrote:
>
> On Thursday, May 30, 2002, at 07:31 AM, Sudarsan Raghavan wrote:
>
>> "Kipp, James" wrote:
>>
>>> I am reading output from a pipe to a command called 'prstat' (like top)
>>> .
>>> just wanted to get some ideas on the best way to c
On Thursday, May 30, 2002, at 08:04 , Kipp, James wrote:
> thanks. question: why the counter in your code example?
I presume you mean the '$readIt++' - that is not really a counter,
more just a boolean flag We set it to zero and once we see that
the /$RightHeader/ we flip it on and get the
>
> # INPUTDATA is the filehandle through which you are getting the input
> while () {
> chomp;
> s/^\s+//;
> next if (m/^$/ || (1 .. /^NPROC/));
>what does the range thing do?
>wouldn't just ... || /^NPROC/ be enough?
I think that is how he eliminates lines up to the NPROC line. s
On Thursday, May 30, 2002, at 07:31 AM, Sudarsan Raghavan wrote:
> "Kipp, James" wrote:
>
>> I am reading output from a pipe to a command called 'prstat' (like top).
>> just wanted to get some ideas on the best way to capture the data i am
>> looking for. below is an example of the output:
>
>
: drieux [mailto:[EMAIL PROTECTED]]
Sent: Thursday, May 30, 2002 10:30 AM
To: Kipp, James
Cc: Perl
Subject: Re: Help with parsing output
On Thursday, May 30, 2002, at 06:55 , Kipp, James wrote:
> NPROC USERNAME SIZE RSS MEMORY TIME CPU
that is the trick throwing away everything before
Thanks. Clever slice with the split line.
-Original Message-
From: Sudarsan Raghavan [mailto:[EMAIL PROTECTED]]
Sent: Thursday, May 30, 2002 10:31 AM
To: Kipp, James
Cc: Perl
Subject: Re: Help with parsing output
"Kipp, James" wrote:
> I am reading output from a pipe
"Kipp, James" wrote:
> I am reading output from a pipe to a command called 'prstat' (like top).
> just wanted to get some ideas on the best way to capture the data i am
> looking for. below is an example of the output:
# INPUTDATA is the filehandle through which you are getting the input
while (
On Thursday, May 30, 2002, at 06:55 , Kipp, James wrote:
> NPROC USERNAME SIZE RSS MEMORY TIME CPU
that is the trick throwing away everything before this line,
and then doing a basic regEx on the stuff after it:
cf: http://www.wetware.com/drieux/pbl/Sys/Admin/prstatFilter.txt
persona
20 matches
Mail list logo