Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Shaun E on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

list of processus with perl 1

Status
Not open for further replies.

eve25

Programmer
Feb 9, 2004
32
US
Hi folks!
I am just starting using Perl and I am wondering how I could get the list of the processus running at one time (present) on the computer. (to detect the ftp one).
also, is it possible to have a bash shell script in a perl script (which could be another way to obtain this list)?

Thanks a lot,
Have a good nite or day... or whatever!
Eve
 
Use the ps command in backticks and capture the result in a list, e.g
Code:
@processes = `ps -f`; #use your favorite options
This will give you the same listing you'd normally see at the shell prompt in the list @processes.

Make sure you use backticks (on the same key as the ~, on my keyboard, at least), not single quotes (a common mistake, leading to complaints of "backticks don't work").
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top