The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
.
google unix.com



UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Some Info. ad4m88 UNIX for Dummies Questions & Answers 8 03-29-2008 07:01 PM
Need Info msgobinathan Shell Programming and Scripting 1 11-03-2007 05:17 PM
How get more LUN info itsupplies Red Hat 0 10-26-2006 05:22 AM
exe info sumsin High Level Programming 6 11-17-2005 05:15 AM
SU info afflack UNIX for Dummies Questions & Answers 4 01-20-2005 09:35 PM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 08-18-2006
mlucas mlucas is offline
Registered User
  
 

Join Date: Aug 2005
Posts: 10
Question PID info

Is it possible to find out what my PID is for the telnet session I am currentley using ?

  #2 (permalink)  
Old 08-18-2006
blowtorch's Avatar
blowtorch blowtorch is offline Forum Advisor  
Supporter
  
 

Join Date: Dec 2004
Location: Singapore
Posts: 2,350
What OS are you using? On Sun, you can use ptree <pid of current shell>.
  #3 (permalink)  
Old 08-18-2006
mlucas mlucas is offline
Registered User
  
 

Join Date: Aug 2005
Posts: 10
We are Using HP Tru64 Unix
  #4 (permalink)  
Old 08-18-2006
blowtorch's Avatar
blowtorch blowtorch is offline Forum Advisor  
Supporter
  
 

Join Date: Dec 2004
Location: Singapore
Posts: 2,350
Try this script:
Code:
#!/bin/ksh

if [ $# -ne 1 ]; then
        echo "usage: proc_tree.sh <pid>"
        exit -1
fi
pid=$1
while [ $pid -ne 1 ]; do
        ps -ef | nawk -v awkpid=$pid '{if($2==awkpid) print }'
        pid=$(ps -ef | nawk -v awkpid=$pid '{if($2==awkpid) print $3}')
done
This will print parent processes all the way to init.
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 12:08 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0