RE : RE : RE : RE : Regular expressions #2

No worries :-)

It works now, thanks a lot :-)

Best regards,

Steve Hemond
Programmeur Analyste / Analyst Programmer
Smurfit-Stone, Ressources Foresti=E8res
La Tuque, P.Q.
Tel.: (819) 676-8100 X2833
shemond@smurfit.com=20



 > -----Original Message-----
 > From: drieux [mailto:drieux@wetware.com]=20
 > Sent: Wednesday, December 17, 2003 1:38 PM
 > To: Perl Perl
 > Subject: Re: RE : RE : RE : Regular expressions
 >=20
 >=20
 >=20
 > On Dec 17, 2003, at 10:24 AM, drieux wrote:
 >=20
 > >
 > > 	open(PS, "ps -efA|") or die "unable to open ps command\n:$!";
 > >     while (<PS>) {
 > > 		($uid,$pid,$ppid,$c,$stime,$tty,$time,$cmd) =3D split;
 > > 		print "$pid -> $cmd\n";
 > > 	}
 > > 	close(PS);
 >=20
 > Tell me not to make my coffee with last night's bong water!
 > if split is splitting on the default blank space,
 >=20
 > 	root     $1
 > 	1644     $2
 > 	1  		$3
 > 	0 		$4
 > 	Nov10 	$5
 > 	?       $6
 > 	00:00:00  $7
 > 	/usr/sbin/httpd2-prefork  $8
 >=20
 > 	-f /etc/apache2/httpd.conf
 >=20
 > what we want is the saner process of
 >=20
 > 	($uid,$pid,$ppid,$c,$stime,$tty,$time,$cmd) =3D split(/\s+/,$_,8);
 >=20
 > eg:
 >=20
 > sed 's/^/### /' junk.plx
 > ### #!/usr/bin/perl -w
 > ### use strict;
 > ###
 > ### open(PS, "ps -efAww | grep http|");
 > ### while(<PS>)
 > ### {
 > ### #   my ($uid,$pid,$ppid,$c,$stime,$tty,$time,$cmd) =3D split;
 > ### #           print "$pid -> $cmd\n";
 > ### my  ($uid,$pid,$ppid,$c,$stime,$tty,$time,$cmd) =3D=20
 > split(/\s+/,$_,8);
 > ###     print "Better $pid -> $cmd\n";
 > ###     print "\t$uid,$pid,$ppid,$c,$stime,$tty,$time,$cmd\n";
 > ###
 > ### }
 >=20
 > My Apology!
 >=20
 > ciao
 > drieux
 >=20
 > ---
 >=20
 >=20
 > --=20
 > To unsubscribe, e-mail: beginners-unsubscribe@perl.org
 > For additional commands, e-mail: beginners-help@perl.org=20
<http://learn.perl.org/> <http://learn.perl.org/first-response>

0
SHEMOND
12/17/2003 6:43:09 PM
perl.beginners 29388 articles. 4 followers. Follow

0 Replies
1531 Views

Similar Articles

[PageSpeed] 3
Get it on Google Play
Get it on Apple App Store

Reply:

Similar Artilces:

RE : RE : RE : RE : Regular expressions
Here is a sample of what your piece of code returns on my Aix box. 44520 -> /prog/gena/8.1.1/bin/dispatch 44650 -> reproject 45176 -> aioserver 45432 -> aioserver 45724 -> -ksh 46002 -> /bin/bsh 46232 -> /usr/dt/bin/dtterm 46584 -> /usr/bin/ksh 46820 -> /usr/dt/bin/ttsession 47060 -> /bin/bsh 47304 -> /usr/dt/bin/dtlogin 47396 -> /usr/dt/bin/dtterm 47722 -> dtfile 47942 -> /usr/dt/bin/dtsession 48272 -> dtfile 48568 -> ora_cjq0_gist 48758 -> gxtrackd 49032 -> dtwm 49330 -> /usr/lib/lpd/pio/etc/piohpnpf 49592 -> b...

RE : RE : RE : Regular expressions #2
drieux is right about me being exploring Perl. In fact, that is a good = exercice to play with regular expressions and data types as I had to = build a hash of hashes to do the thing. However, I wouldn't let a script in that stat if I knew of a = better/quicker/shorter method. I will then have to improve my script soon. What would be the best way to put values returned by the ps command you = just mentionned in variables? Thanks again for your great help.=20 P.S : I look like the typical lazy guy who don`t even read and try by = himself. This is because I am at work, ...

RE : RE : RE : Regular expressions
I am issuing this command on an Aix box and running allright :-) Forgive my curiosity.. are you running Solaris on a x86 box?=20 Steve Hemond Programmeur Analyste / Analyst Programmer Smurfit-Stone, Ressources Foresti=E8res La Tuque, P.Q. Tel.: (819) 676-8100 X2833 shemond@smurfit.com=20 > -----Original Message----- > From: drieux [mailto:drieux@wetware.com]=20 > Sent: Wednesday, December 17, 2003 1:14 PM > To: Perl Perl > Subject: Re: RE : RE : Regular expressions >=20 >=20 >=20 > On Dec 17, 2003, at 8:47 AM, Hemond, Steve wrote: ...

Re: Re:
Sorry about that, my mistake, the patched method goes like this: procedure DeallocateHWnd(Wnd: HWND); var Instance: Pointer; begin Instance := Pointer(GetWindowLong(Wnd, GWL_WNDPROC)); if Instance <> @DefWindowProc then begin { make sure we restore the default windows procedure before freeing memory } SetWindowLong(Wnd, GWL_WNDPROC, Longint(@DefWindowProc)); FreeObjectInstance(Instance); end; DestroyWindow(Wnd); end; "Andreas Hausladen" <AndreasDOTHausladen@gObviousToBeRemovedmx.de> wrote in message news:99620@f...

RE: Spam:RE: Spam:Re: Using regular expressions
Erps... Just re-read where you said: > You imply above that you will read the file "a line at a time" however > using a for loop will read the whole file into a list in memory. You=20 > need to use a while loop to read a line at a time. .... And you're right... :) Regards, =20 Michael S. E. Kraus Software Developer Wild Technology Pty Ltd _______________________________ ABN 98 091 470 692 Level 4 Tiara, 306/9 Crystal Street, Waterloo NSW 2017, Australia Telephone 1300-13-9453 | Facsimile 1300-88-9453 http://www.wildtechnology.net =20 The in...

RE: Re: [wxperl-users] Re: Re: EVT_QUERY_END_SESSION
you putted the EVT_CLOSE to the wrong place... or do you have a reason why you need it to be there? $app ist not the window, but you could use EVT_CLOSE on $frame too. i changed your minimal sample that it works. hope it helps greeting Marco ---- use Wx; ########################### package MyApp; use strict; use vars qw(@ISA); @ISA=qw(Wx::App); sub OnInit { my( $this ) = @_; my( $frame ) = MyFrame->new( "Minimal wxPerl app", Wx::Point->new( 50, 50 ), Wx::Size->new( 450, 350 ) ); ...

RE : RE : Regular expressions
I think I begin to understand... I begin by fetching the results of the ps -efA command and split it into = many variables ($uid, $pid, etc.) open(PS, "ps -efA|");=20 while (<PS>) {=20 ($uid,$pid,$ppid,$c,$stime,$tty,$time,$cmd) =3D split; =20 if ($cmd =3D~ /dispatch genie/) { $infos{$pid}{'uid'} =3D $uid; $infos{$pid}{'ppid'} =3D $ppid; $infos{$pid}{'c'} =3D $c; $infos{$pid}{'stime'} =3D $stime; $infos{$pid}{'tty'} =3D $tty; $infos{$pid}{'time'} =3D $time;...

Re: Re: Re: Re: cross cluster read fails
--Boundary_(ID_HDBIpKP7HBB79jluGvYvuw) Content-type: text/plain; charset=iso-8859-1 Content-transfer-encoding: 8BIT Content-disposition: inline �Hi Alan One more thing before we go further :) I wrote a simple perl script that accepts a file name, prints it out, opens the file (dies if open unsuccessful or prints �open successful�) 1>I passed my local directory filename, it prints �open successful� 2> Now I just add �abcd::� in front of it, and the perl script fails with Remote node is unknown D...

Re: Re: Re: RE: capture a website and process its data
--Next_1077222091---0-202.54.124.153-17281 Content-type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Hi Rob,=0AI implemented your code and it gave perfectly desired answers. Bu= t I couldn't understand most of it. So, currently I went ahead with Dan's t= ips on my code only and would try to understand your code later after I mee= t a deadline for a small project of mine in college for tomorrow! So, no qu= estions as of now. =0A=0Acheers.=0AK(ay).=0A=0A=0AOn Thu, 19 Feb 2004 Rob D= ixon wrote :=0A>Scott E Robinso...

RE: Re: Re: Sub not working as it should
You don't need to be sorry - it's the right choice ;-) Philipp > -----Original Message----- > > I am sorry I am migrating over to perl (love the built > in debugger) > --- Saadat Saeed <saadat_saeed@yahoo.com> wrote: > > Thanks for the quick reponse - looks like I confuse > > my > > vbscript skills a bit... I am new to perl and am > > migrating over to vbscript! > > > > Regards > > > > > > --- Jeff 'japhy' Pinyan <japhy@perlmonk.org> wrote: > > > On Jan 21, Saadat S...

RE: RE: Re: Tri-grams?
------_=_NextPart_001_01C6380E.13FCCC91 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable -----Original Message----- From: amit hetawal [mailto:amit_h123@rediffmail.com] Sent: Wednesday, February 22, 2006 16:00 To: Wagner, David --- Senior Programmer Analyst --- WGO Subject: Re: RE: Re: Tri-grams? hi there the sequnce with alpha _ _ is valid but not _ _ _ I replaced the 4 four lines in your program with the following four line= s. =20 next if ( $char !~ /[a-z]/i ); my $char2 =3D substr $_, $ii+1, 1; ...

Re: Re-inventing the wheel [was RE: Why not gmp? [was Re: pdd14 -- bignums] ]
Simon Cozens <simon@netthink.c To: Shlomi Fish <shlomif@vipe.technion.ac.il> o.uk> cc: perl6-internals@perl.org ...

RE: RE: RE: RE: [wxperl-users] wxTreeCtrl, edit an treeItem
>>Found a fix ( I hope ); download the modified wx22_9.dll from >>http://wwwstud.dsi.unive.it/~mbarbon/wx/wx22_9.dll.gz >>uncompress it and put it in $PERL/site/lib/auto/Wx >>( make a backup of the original one, of course ). >>This fixes your problem with tree control, but may introduce >>new ones ( it is a fix backported from wxWIndows 2.3 ). >> >>Regards >>Mattia > >hey thanks man! >i had no time to work on my application but i checked the wxwindows >mailinglist archive. you asked for a code change as workaround......

Re: Re: Re: Re: counting tr thinks it's modifying
I was talking about the behavior of the operator, not how it is implemented =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D >De:Jarkko Hietaniemi <jhi@iki.fi> >Para:Daniel Ruoso <daniel@ruoso.com> >Assunto:Re: Re: Re: counting tr thinks it's modifying > >> so tr becomes a {if (r=3D=3Ds) {"COUNTING ONLY"} >else {"COUNTING AND REPLACEMENT"}} operator.=20 > >It's not like this is new behaviour: for example >5.004_05 has code >like this in doop.c: > > if (SvREADONLY(sv) && !(op->op_pri...

Web resources about - RE : RE : RE : RE : Regular expressions #2 - perl.beginners

Closed-form expression - Wikipedia, the free encyclopedia
In mathematics , an expression is said to be a closed-form expression if it can be expressed analytically in terms of a finite number of certain ...

Fighting abuse to protect freedom of expression
We believe that protection from abuse and harassment is a vital part of empowering people to freely express themselves on Twitter. Today, as ...

Apple acquires ‘Emotient’ facial expression & emotion detection technology
The Wall Street Journal reports Apple has confirmed it has made an acquisition of artificial intelligence startup Emotient . The cloud-based ...

Joe Rogan's Facial Expression After Ronda Rousey Got Knocked Out Was Priceless - Bleacher Report
Joe Rogan 's face spoke for us all Saturday night. After UFC superstar Ronda Rousey got knocked out by a lethal kick from Holly Holm, the commentator ...

Make your technology a force for musical expression with this digital guitar
Computers, tablets, even iPhones have grown into powerful tools for music making, but for many who play guitar the bridge from analog instrument ...

Disney's FaceDirector changes facial expressions in movies
The new tool out of Disney Research's labs could turn an ing&eacute;nue's semi-decent attempt into a finely nuanced performance. This software ...

Apple Buys A Startup That May Help It Read Your Facial Expressions
The Emotient software could be used to make Siri more aware of the moods of her human masters. Apple wants its devices to understand the emotional ...

Redbubble, A Profitable Channel For Artistic Expression
There is a growing movement of people who never want to follow a trend. Instead they embrace their own creative self-expression and are just ...

Expressions of Solidarity for France in Red, White and Blue
ABC News Expressions of Solidarity for France in Red, White and Blue ABC News This photograph made available on Saturday Nov. 14, 2015, shows ...

Black Activist Shows His Freedom Of Expression By Punching Christian Preacher In University Of Missouri’s ...
A black activist at the University of Missouri showed his “freedom of expression” towards a Christian pastor who was in the midst of protests. ...

Resources last updated: 1/9/2016 11:54:12 AM