UNIX Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsOperating SystemsUNIX Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old May 31st, 2005, 09:18 PM
stevefox stevefox is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2005
Posts: 12 stevefox User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 h 42 m 29 sec
Reputation Power: 0
Lightbulb Process ID

I am simultaneously running many processes with the same commands and I want to monitor each process. Using “top” or “ps –ef | grep command_name” to distinguish individual processes is difficult when there are many processes with the same commands. So I want to know what commands are needed for the process to display the PID it has been assigned when it gets executed.

Any help will be appreciated.
Steve

Reply With Quote
  #2  
Old June 2nd, 2005, 12:18 AM
stevefox stevefox is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2005
Posts: 12 stevefox User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 h 42 m 29 sec
Reputation Power: 0
The program I'm using is korn shell. I found out that I can display the PPID (Parent PID) by "echo $$" and I tried "echo $" but it didn't display the PID. I searched the net but can't find anyting yet.

Any help will be appreciated.
Steve

Reply With Quote
  #3  
Old July 27th, 2005, 12:55 PM
NPRao NPRao is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2004
Location: Pacific NW, USA
Posts: 26 NPRao User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 6 h 23 m 16 sec
Reputation Power: 0
Send a message via AIM to NPRao
Here is a code snippet from our version -

Code:
ksh
$BSE/bin/ba6.2 -- -nodebug -set TARG_COMP=$COMPANY -set EXCH_COMP=015 ttaad5203m
000 2>${BSE_LOG}/lmsjob_${BSH_JOB}.${ZDATE} &

BAPROCID=$!
echo $BAPROCID
wait $BAPROCID
echo "JOBID="$BSH_JOB "PROCESS ID = "$BAPROCID


$! - PID of last background process.

Reply With Quote
  #4  
Old August 22nd, 2005, 02:47 AM
guggach guggach is offline
Contributing User
Dev Shed Beginner (1000 - 1499 posts)
 
Join Date: Jul 2004
Location: Middle Europa
Posts: 1,098 guggach User rank is Corporal (100 - 500 Reputation Level)guggach User rank is Corporal (100 - 500 Reputation Level)guggach User rank is Corporal (100 - 500 Reputation Level)guggach User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 5 Days 9 h 5 m 46 sec
Reputation Power: 9
Quote:
Originally Posted by stevefox
I am simultaneously running many processes with the same commands and I want to monitor each process. Using “top” or “ps –ef | grep command_name” to distinguish individual processes is difficult when there are many processes with the same commands. So I want to know what commands are needed for the process to display the PID it has been assigned when it gets executed.

Any help will be appreciated.
Steve

ps –ef you are on a SVR4 sys, so read ps man pages
pay attention to the -o option, you can tell ps to make exactly
the output you need
__________________
working on Solaris[5-9], preferred languages french and C.

Reply With Quote
Reply

Viewing: Dev Shed ForumsOperating SystemsUNIX Help > Process ID


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 4 hosted by Hostway
Stay green...Green IT