Child Process Name


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Child Process Name
# 1  
Old 11-30-2009
Child Process Name

Hi ,

I want to find out the child process name given its PID. I have used the ps command but it displays the parent process name against child PID.

Is there any way to find out name of child program executing under any parent program?
# 2  
Old 11-30-2009
????
Code:
uv04:/home/vbe $ echo $$
2334736
uv04:/home/vbe $ sh         # is child PPID:2334736
uv04:/home/vbe $ echo $$
2392180
uv04:/home/vbe $ ps -ef|grep 2334736
     vbe 2334736 1163282   0   Nov 18  pts/0  0:00 -ksh 
     vbe 2392180 2334736   0 18:13:28  pts/0  0:00 sh 
uv04:/home/vbe $

Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

forking a child process and kill its parent to show that child process has init() as its parent

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

2. Emergency UNIX and Linux Support

signal between parent process and child process

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

3. Shell Programming and Scripting

script to get child process for a process

!/bin/sh pid=$(ps -Aj | grep MSTRSvr | grep -v grep | awk '{print $1}') sid=$(ps -Aj | grep MSTRSvr | grep -v grep | awk '{print $3}') ps -s "$sid" I am not able to get the desired output it says process list error if i use watch ps -s "$sid" it considers only the first session id (5 Replies)
Discussion started by: schippada
5 Replies

4. Shell Programming and Scripting

[KSH/Bash] Starting a parent process from a child process?

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

5. Shell Programming and Scripting

How to make the parent process to wait for the child process

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

6. Programming

Why does my child process not exit?

Im sure it has something to do with the wait() call, but everything ive tried either leaves me with a zombie or with the exec executing indefinitely. switch(pid = fork()) { case -1:perror("fork failed"); exit(1); case 0: if(key == "cd") { execl("/bin/cd", "cd",... (2 Replies)
Discussion started by: p00ndawg
2 Replies

7. UNIX for Dummies Questions & Answers

doubt in child process

fork() system is used to create a child a process.lets consider fork() echo krace will print krace twice .if i give it in loop it will print krace 2 power n time..in this case all child and parent process executes same process ...but i want to create a four different child process to execute four... (4 Replies)
Discussion started by: kracekumar
4 Replies

8. UNIX for Dummies Questions & Answers

about child process

hello every one, i want to know more about creation of child process. UNDER WHAT CIRCUMSTANCES child process is created? WHAT ARE THE PREREQUISITES for a child process to be created? let us say we have a prog.c, prog.obj(compiled.c),.a\.out files. is any child PROCESS CREATED... (12 Replies)
Discussion started by: compbug
12 Replies

9. Programming

creating child process

i want to create 3 child processes from the same parent using folk. I know how to use folk but my child processes did not come from the same parent. Any suggestion what i did wrong ? (12 Replies)
Discussion started by: Confuse
12 Replies

10. UNIX for Dummies Questions & Answers

KDM child process

Hello all, I got this little problem. I don't know what happen, but its not stopping work but is more of an FYI. I have this funny process running when I do ps -aef (on RedHat AS3 ) server I get this funny child process. root 2345 1 .... /usr/bin/kdm -nodaemon root... (6 Replies)
Discussion started by: larryase
6 Replies
Login or Register to Ask a Question