help needed to understand the process entry in ps -ef


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting help needed to understand the process entry in ps -ef
# 1  
Old 11-27-2008
help needed to understand the process entry in ps -ef

Hi Guys,

I am running a script which will refresh the views in my database.
After running the script, when i ran ps -ef | grep "script_name"

I found there are two entries for the same script process (actually 3 including the grep process).

/bin/ksh path/scriptname
sh -c path/scriptname

Why there are two process entry for the same script and what can be understood from the two process..
Can we find out which is the parent process?

Thanks for ur help in advance.
Magesh.
# 2  
Old 11-27-2008
Please check the PID and PPID of the 2 processes ( 2nd and 3rd column in ps -ef output ), you can make out which one is the parent.
# 3  
Old 11-27-2008
It is very comon that shell scripts are executing subshells. this hppen f.eg. every time u use a | or a () statement. also some loop constructs are running in a subshell.
U can determine the parent in the 2. culoumn of the ps command.
# 4  
Old 11-27-2008
7279 7278
7278 288

this is the information u said.. u mean to say then 7278 is the parent rite??
# 5  
Old 11-27-2008
that is right.
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Process to read a new file entry and execute a command

I need to develop a process/daemon which will constantly monitor a file for new entry and execute a command. for eg, there is a file /var/log/inotify.log When a new entry like below gets appeneded to this file, execute the command as follows. /home/user/public_html/bad.php|CREATE ... (2 Replies)
Discussion started by: anil510
2 Replies

2. Solaris

Trying to understand the boot process

I understand the OBP program looks for the boot-device, loads the bootblk (located on physical disk sectors 1 through 15). Then the secondary boot program, /platform/`arch -k`/ufsboot is run. This program loads the kernel core image files (genunix and unix). So how does it uses the ufsboot and... (1 Reply)
Discussion started by: MR.bean
1 Replies

3. Shell Programming and Scripting

Idea needed regarding process related script

I want to write a script which will take two time as input parameters and display the details of running processes between the two times, any ideas about the script ? (6 Replies)
Discussion started by: sandip250382
6 Replies

4. UNIX for Dummies Questions & Answers

Help needed to understand partitions in linux

Hi guys, It has been more than 2 month i switched to linux but i m still very much confused how linux handles and names the partitions. I have gone through couple of beginners material and found linux doesnt treat partitions as c: and d: instead it uses /dev/hda1 /dev/hda2 hda3 .But now i... (7 Replies)
Discussion started by: pinga123
7 Replies

5. Shell Programming and Scripting

Help needed in killing a process

I'm trying to kill a process which is in sleep mode and the parent PID is 1 but I can't kill it with "kill -9" command. Is there a way to kill this process without rebooting? Any help will be appreciated. Steve (10 Replies)
Discussion started by: stevefox
10 Replies

6. UNIX for Advanced & Expert Users

to understand stopped process in top

Hi, top process is shows like this in solaris server oracle 8i running: load averages: 5.01, 3.35, 2.82 18:24:45 344 processes: 332 sleeping, 5 running, 2 stopped, 5 on cpu CPU states: 22.2% idle, 29.6% user, 14.7% kernel, 33.5% iowait, 0.0% swap... (3 Replies)
Discussion started by: prakash.gr
3 Replies

7. Shell Programming and Scripting

perl - understand process status and continue the code execution

Hello, I need advice on how to check if started processes are finished in perl, here's explanation : OS is RHEL 4, perl -v = "This is perl, v5.8.0 built for i386-linux-thread-multi" The logic of the script : #!/usr/bin/perl use warnings; $param1 = $ARGV; $param2 = $ARGV; $param3 =... (2 Replies)
Discussion started by: sysgate
2 Replies

8. UNIX for Advanced & Expert Users

process automation ...help needed

hi all i am working in a organisation where we are using Ab Initio tool for datawarehousing purpose.Ab initio is installed on a unix environment.after developing the code we migrate it to production using certain commands which gets executed in the unix box.there are specific number of predefined... (6 Replies)
Discussion started by: dr46014
6 Replies

9. UNIX for Advanced & Expert Users

Runaway process. Opinions needed

not too long ago, i wrote a very short script that will bring up 4 customized xterms. The script went completely abnormal simply because of an error I had made in a while loop. This script took control of the system and rendered everything useless. The system admin team which i was part of... (4 Replies)
Discussion started by: TRUEST
4 Replies
Login or Register to Ask a Question