Unix Technical Forum

list all child process

This is a discussion on list all child process within the comp.unix.solaris forums, part of the Solaris Operating System category; --> Hi, how to list only childs of a process? i tried ptree command but o/p results the complete tree ...


Go Back   Unix Technical Forum > Unix Operating Systems > Solaris Operating System > comp.unix.solaris

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 01-12-2008, 05:55 AM
gdevah@gmail.com
 
Posts: n/a
Default list all child process

Hi,
how to list only childs of a process? i tried ptree command but o/p
results the complete tree but i am interested only in childs.
i tried workaround by using ptree and awk
CMD=`ptree $pid | $AWK 'BEGIN {i=0} /processName/ { i= 1; } { if
( i==1) print \$1 }'`
but ptree truncates the process name if the tree is large so my
combination of awk and ptree is failing.

Thanks and Regards,
Devah

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 01-12-2008, 05:55 AM
Chris Ridd
 
Posts: n/a
Default Re: list all child process

On 2007-08-01 19:40:44 +0100, gdevah@gmail.com said:

> Hi,
> how to list only childs of a process? i tried ptree command but o/p
> results the complete tree but i am interested only in childs.


How about "pgrep -P <ppidlist>"?

Cheers,

Chris

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 10:04 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0
www.UnixAdminTalk.com