07-13-2008
Try this :
ps -p $$ -o %P | sed -n 's/^ *\([0-9][0-9]*\) *$/\1/p'
Where $$ --> Is the process name whose Process ID you want to get.
Hope that helps
Cheers,
Kunal
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
I need to write a script to monitor user processes that revert to parent process id = 1
I can do this with a grep " 1 " or awk and evaluation.
but
Is there a switch on the ps command or another command to specify parent id on proccesses?
I tried ps with the -p ppid=nnnnn but it... (6 Replies)
Discussion started by: MizzGail
6 Replies
2. Shell Programming and Scripting
how to find the chid process id from given parent process id.... (the chid process doesnot have sub processes inturn) (3 Replies)
Discussion started by: guhas
3 Replies
3. UNIX for Dummies Questions & Answers
Suppose we have the following process tree:
init-> ProcessA->processB->processC
then I kill processB
Who is the parent of the processC?
init or the processA (6 Replies)
Discussion started by: Puntino
6 Replies
4. UNIX for Dummies Questions & Answers
hello
i am not a unix programmer but i need to solve a particular problem using unix.
suppose i have a user XYZ logged on to a system called ABC. i want to get the parent process id for the user and kill it
i am using
ps -ef | grep XYZ | grep ABC
it returns me all the processes for... (2 Replies)
Discussion started by: ajit.yadav83
2 Replies
5. UNIX for Dummies Questions & Answers
I need to kill all the processes of user "release" on system "PROterm" or the parent process for the user
I did this
ps -ef | grep PROterm | grep release
i got
release 2900014 2961494 0 12:19:44 pts/3 0:00 PROterm
release 3264694 2900014 0 12:19:44 - 0:00 PROterm
if i... (7 Replies)
Discussion started by: ajit.yadav83
7 Replies
6. Shell Programming and Scripting
Hi All,
I have two ksh script. 1st script calls the 2nd script and the second script calls an 'C' program.
I want 1st script to wait until the 'C' program completes.
I cant able to get the process id for the 'C' program (child process) to make the 1st script to wait for the second... (7 Replies)
Discussion started by: sennidurai
7 Replies
7. Shell Programming and Scripting
Hey all, I need to launch a script from within 2 other scripts that can run independently of the two parent scripts... Im having a hard time doing this, if anyone knows how please let me know.
More detail.
ScriptA (bash), ScriptB (ksh), ScriptC (bash)
ScriptA, launches ScriptB
ScirptB,... (7 Replies)
Discussion started by: trey85stang
7 Replies
8. Emergency UNIX and Linux Support
Hello, everyone.
Here's a program:
pid_t pid = fork();
if (0 == pid) // child process
{
execvp ...;
}
I send a signal (such as SIGINT) to the parent process, the child process receive the signal as well as the parent process.
However I don't want to child process to receive the... (7 Replies)
Discussion started by: jackliang
7 Replies
9. Shell Programming and Scripting
Hi everyone
i am very new to linux , working on bash shell.
I am trying to solve the given problem
1. Create a process and then create children using fork
2. Check the Status of the application for successful running.
3. Kill all the process(threads) except parent and first child... (2 Replies)
Discussion started by: vizz_k
2 Replies
10. Programming
Hi:
I have a program written in FORTRAN running on AIX platform.
It is because missing of documentation and without root password, therefore we want to modify the program so that we can find out which script/program that call this FORTRAN program.
I have google for few days, all of them are... (3 Replies)
Discussion started by: cstsang
3 Replies
LEARN ABOUT OSF1
dxproctuner
dxproctuner(8) System Manager's Manual dxproctuner(8)
NAME
dxproctuner - Manages and monitors system processes
SYNOPSIS
/usr/bin/X11/dxproctuner
OPTIONS
Process Tuner accepts all of the standard X Toolkit command line options, which are documented in the OPTIONS section in the X(1X) refer-
ence page.
DESCRIPTION
The Process Tuner application, dxproctuner, is used to monitor and manage processes.
Use Process Tuner to: Display a list of processes and their characteristics Display the processes running for yourself or all users Display
and modify process priorities Send a signal to a process
The Process Tuner application can be invoked from the CDE Application Manager from the following categories:
Application Group: System_Admin
System Admin Subgroup: MonitoringTuning
EXAMPLES
To start Process Tuner from the command line, enter: dxproctuner You can view the Process Tuner online help volume without running the
application. To open the Process Tuner help volume from the command line, enter the following command: /usr/dt/bin/dthelpview -h
/usr/dt/appconfig/help/C/Dxproctuner.sdl
FILES
Contains user preferences that control the appearance of the application Contains the Process Tuner application executable Contains the
Process Tuner help volume Contains the default values for the application's X resources
SEE ALSO
Commands: kill(1), ps(1), X(1X)
System Calls: exit(2), kill(2), sigaction(2)
Files: signal(4)
dxproctuner(8)