Pull out only first field of ps command ( in Perl ) PERL RUN COMMAND

T

tweetiebirds

Hi,

I want to filter out only the first column of the output of the ps -ae
command in Perl using
perl run-command.

I.e using perl -pi -e etc....

Anyone know how to do this ?

I do NOT want to use UNIX cut.

thanks
T
 
J

Jeff

Hi,

I want to filter out only the first column of the output of the ps -ae
command in Perl using
perl run-command.

I.e using perl -pi -e etc....

Anyone know how to do this ?

I do NOT want to use UNIX cut.

Did you try something? Can you post what you tried, so we can help you?

I'd suggest a reading of 'perldoc perlrun'. You'll probably want to use
a something like:

ps -ae | perl -lane '<insert code here>'

I'm going to leave the code itself as an exercise for you, and if you
have problems post what you tried and I'll be happy to help you
understand it better.

~Jeff
 
T

Tad McClellan

I want to filter out only the first column of the output of the ps -ae
command in Perl using
perl run-command.

I.e using perl -pi -e etc....

Anyone know how to do this ?


Yes.

What have you tried so far?

If you post your broken code we will help you fix it.

I do NOT want to use UNIX cut.


Errr, OK.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,014
Latest member
BiancaFix3

Latest Threads

Top