Ask a Question related to PERL Beginners, Design and Development.
-
Steve Hemond #1
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 -> bsh
49672 -> /usr/dt/bin/dtterm
50170 -> /usr/dt/bin/dtlogin
50400 -> dtterm
50604 -> dispscript
50844 -> genie
51096 -> /prog/gena/8.1.1/bin/dispatch
51348 -> gmap
51676 -> reproject
51874 -> gxtrackd
52086 -> ps
52378 -> perl
52646 -> sh
53164 -> /usr/bin/ksh
53432 -> /bin/bsh
Like $cmd will stop at the end of the word, not the end of the rest of the line.
Steve Hemond
Programmeur Analyste / Analyst Programmer
Smurfit-Stone, Ressources Forestières
La Tuque, P.Q.
Tel.: (819) 676-8100 X2833
[email]shemond@smurfit.com[/email]
<http://learn.perl.org/> <http://learn.perl.org/first-response>> -----Original Message-----
> From: drieux [mailto:drieux@wetware.com]
> Sent: Wednesday, December 17, 2003 1:24 PM
> To: Perl Perl
> Subject: Re: RE : RE : RE : Regular expressions
>
>
>
> On Dec 17, 2003, at 10:16 AM, Hemond, Steve wrote:
>>> > I am issuing this command on an Aix box and running allright :-)
> interesting,
>
> let's do a quick piece of test code
>
> open(PS, "ps -efA|") or die "unable to open ps command\n:$!";
> while (<PS>) {
> ($uid,$pid,$ppid,$c,$stime,$tty,$time,$cmd) = split;
> print "$pid -> $cmd\n";
> }
> close(PS);
>
> that will at least get us to what is going on with
> the actual $cmd data itself.
>>> > Forgive my curiosity..
> Curiosity Killed The Cat you know...
> "But the cat came back, the very next day,
> thought he was a gonner but cat came back..."
> - old american folk song.
>>> > are you running Solaris on a x86 box?
> Solaris on Sparc and x86
> FreeBsd, some variations on linux,
> my desk top tho is OSX.
> Haven't been on an AIX box in a while.
> Loved Unicos. But real Men are not afraid
> to toggle it into a PDP-8.... or an AN/Ukky-20
> in battleship grey, or ...
>
>
> ciao
> drieux
>
> ---
>
>
> --
> To unsubscribe, e-mail: [email]beginners-unsubscribe@perl.org[/email]
> For additional commands, e-mail: [email]beginners-help@perl.org[/email]
Steve Hemond Guest
-
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.) ... -
[PHP] Q on Regular Expressions
* Thus wrote jsWalter (jsWalter@torres.ws): have you looked at strtotime()? http://php.net/strtotime The Date formats it can find are defined... -
[PHP-DEV] PHP regular expressions
Hello. In regex/utils.h there is a definition for DUPMAX: #ifdef _POSIX2_RE_DUP_MAX #define DUPMAX _POSIX2_RE_DUP_MAX #else #define DUPMAX 255... -
Help with regular expressions.
Apples and Oranges: I think your format string is wrong, try: {0:d} "Pablo Pecora" <pablo.pecora@itau.com.ar> wrote in message... -
help with regular expressions
Hello, just getting grips with Perl and RE, but need your help. I am trying to open a file, print its contents to a textbox, but extract... -
Steve Hemond #2
RE : RE : RE : RE : Regular expressions
No worries :-)
It works now, thanks a lot :-)
Best regards,
Steve Hemond
Programmeur Analyste / Analyst Programmer
Smurfit-Stone, Ressources Forestières
La Tuque, P.Q.
Tel.: (819) 676-8100 X2833
[email]shemond@smurfit.com[/email]
<http://learn.perl.org/> <http://learn.perl.org/first-response>> -----Original Message-----
> From: drieux [mailto:drieux@wetware.com]
> Sent: Wednesday, December 17, 2003 1:38 PM
> To: Perl Perl
> Subject: Re: RE : RE : RE : Regular expressions
>
>
>
> On Dec 17, 2003, at 10:24 AM, drieux wrote:
>>> >
> > open(PS, "ps -efA|") or die "unable to open ps command\n:$!";
> > while (<PS>) {
> > ($uid,$pid,$ppid,$c,$stime,$tty,$time,$cmd) = split;
> > print "$pid -> $cmd\n";
> > }
> > close(PS);
> Tell me not to make my coffee with last night's bong water!
> if split is splitting on the default blank space,
>
> root $1
> 1644 $2
> 1 $3
> 0 $4
> Nov10 $5
> ? $6
> 00:00:00 $7
> /usr/sbin/httpd2-prefork $8
>
> -f /etc/apache2/httpd.conf
>
> what we want is the saner process of
>
> ($uid,$pid,$ppid,$c,$stime,$tty,$time,$cmd) = split(/\s+/,$_,8);
>
> eg:
>
> 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) = split;
> ### # print "$pid -> $cmd\n";
> ### my ($uid,$pid,$ppid,$c,$stime,$tty,$time,$cmd) =
> split(/\s+/,$_,8);
> ### print "Better $pid -> $cmd\n";
> ### print "\t$uid,$pid,$ppid,$c,$stime,$tty,$time,$cmd\n ";
> ###
> ### }
>
> My Apology!
>
> ciao
> drieux
>
> ---
>
>
> --
> To unsubscribe, e-mail: [email]beginners-unsubscribe@perl.org[/email]
> For additional commands, e-mail: [email]beginners-help@perl.org[/email]
Steve Hemond Guest



Reply With Quote

