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 biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

PID and job name

Status
Not open for further replies.

jmanj

Programmer
May 20, 2003
298
US
Using ksh I was able to list the PID of jobs that start with
Scan*...ex..

for i in `ps -ef|grep Scan*|grep -v grep|tr -s ' ' |cut -d ' ' -f 3`;do

echo " $i Active"

done

Now I want the list to include the job name and its
parameters...

Will appreciate any help...

jmanj

 
If on Solaris [or maybe others]..... how 'bout:

ps -ef -o pid,args | nawk '$2 ~ /Scan/'

vlad
+----------------------------+
| #include<disclaimer.h> |
+----------------------------+
 
Thank you GUYS!! I finally used:

for i in `ps -ef|grep Scan*|grep -v grep|tr -s ' ' |cut -d ' ' -f3,10,12`;do

echo &quot; $i Active&quot;

done

Above will list both PID, the procedure and the first argument.

jmanj
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top