- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- ptree & rptree
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-04-2013 10:35 PM - last edited on 04-06-2013 06:20 PM by Cathy_xu
04-04-2013 10:35 PM - last edited on 04-06-2013 06:20 PM by Cathy_xu
Hi guys ,
i have two scripts with me for ptree and rptree.
I want an o/p same as of aix proctree "pid" which gives a tree of all assiciated child pid's only.
i do not want to reverse trace till init.
In forum i have got ptree , but it does not display tree process as expected.
For ex:
if i login through a user id test
and run sqlplus
and when i grep for "sqlplus" pid what i get is only the below o/p ;
28453 qryusr sqlplus
What i expect is , the user name with process name also to be appeared in this o/p.
For ex:
28453 /oracle/bin/sqlplus
3645536 /usr/sbin/sshd
3919904 sshd: pol
-----------------------------------------------------------------------------------------------------------------------------
P.S. This thread has been moved from HP-UX>Ignite-UX to HP-UX > languages - Forum Moderator
Solved! Go to Solution.
- Tags:
- ptree
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-04-2013 11:34 PM
04-04-2013 11:34 PM
Re: ptree & rptree
Did you want the tree displayed from the child first?
ptree(1) on 11.31 gives:
$ ptree $$
928 /opt/ssh/sbin/sshd
15283 sshd: foobar [priv]
15285 sshd: foobar@pts/0
15287 -ksh
15307 ptree 15287
I expect is the user name with process name
You would need to capture that from the ps(1) output. Or write a program to call pstat(2).
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-05-2013 01:08 AM
04-05-2013 01:08 AM
Re: ptree & rptree
Hi Dennis ,
Yes.
We have 11iv2 here.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-05-2013 02:34 AM
04-05-2013 02:34 AM
Re: ptree & rptree
>We have 11iv2 here.
>In forum I have got ptree but it does not display tree process as expected.
Can you please attach a copy of it so we don't have to start from scratch? :-)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-05-2013 03:11 AM
04-05-2013 03:11 AM
Re: ptree & rptree
Hi ,
PFA both scripts
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-05-2013 10:41 PM - edited 04-05-2013 10:42 PM
04-05-2013 10:41 PM - edited 04-05-2013 10:42 PM
Solution>both scripts
I'm still not sure what you want.
ptree.sh will start at the PID and go to all of its descendents.
rptree.sh will start at the PID and go to all of its ancestors.
$ ptree.sh $PPID
10459 foobar sshd:
10461 foobar -ksh
4852 foobar /bin/sh
4861 foobar ps
4862 foobar sed
4863 foobar sort
15017 foobar vi