how to know that a perticular process is started!!!


 
Thread Tools Search this Thread
Top Forums UNIX for Advanced & Expert Users how to know that a perticular process is started!!!
# 8  
Old 05-17-2007
the first line says this is a script to be run by /bin/sh

the second line says spawn program B but attach stdin, stdout and stderr to /dev/null so they don't affect the output of the current process, this process will spin off on it's merry way due to the "&", the "$$" will be replaced by the current process id. this is the program that says "A" is running and allows you to do your funky custom stuff here.

the third line says run the original program using the original arguments in this process so the process-id we gave out in line two is still the correct one.
# 9  
Old 05-17-2007
When "$$" is replaced by the shell id....is it passed as an argument to process B.
# 10  
Old 05-18-2007
Clever. I like it.
# 11  
Old 05-19-2007
How about checking and using the access time of the binary provided in /etc/fstab noatime is not set !!! Smilie
# 12  
Old 05-19-2007
That wouldn't be much better than some of ther other options. You would still end up polling the file to check for a change.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Programming

Can someone summarize what exactly this perticular code is doing

#include<stdio.h> #include<string.h> int main() { char a={0,1,2,3,4,5,6,7,8,9}; printf("\n--%s-- unable to access values",a); printf("\n--%d %d-- able to access through direct acess",a,a); printf("\n--%d-- but the failing to read the size\n",strlen(a)); return 0; } (2 Replies)
Discussion started by: hk108
2 Replies

2. Shell Programming and Scripting

how to check whether a process started at particular time

I want to check whether a particular process has started at 10:00a.m or not. I can check process by ps -fu but dont know how to check it with respect to time. Could anyone help me with this? ---------- Post updated at 11:14 AM ---------- Previous update was at 10:52 AM ---------- can i use... (9 Replies)
Discussion started by: kishore kumar
9 Replies

3. Shell Programming and Scripting

stopping process started with "while"

Hello unix forum ! how do i get rid of this while thing ? if started some where by crontab for example. while ; do ./script > /dev/null ; done & or for example if in terminal while ; do ./script ; done & and the script is outputing and I can't write commands. other... (2 Replies)
Discussion started by: max_475
2 Replies

4. Red Hat

Killing child daemon started by parent process

Hi All, Hope this is right area to ask this question. I have a shell script (bash) "wrapper.sh", which contains few simple shell command which executes a "server.sh" (conatins code to execute a java server) as a daemon. Now what I want to kill this "server.sh" so that the server should... (2 Replies)
Discussion started by: jw_amp
2 Replies

5. Shell Programming and Scripting

Process id of the exe started with nohup

Hi, I have a strange problem. In my shell script, i am startting another program (a c++ exe) with nohup . I am getting the process id of this started process with using $! I am writing this process id into another file so that i can keep checking for this process ids to check whether the... (2 Replies)
Discussion started by: parvathi_rd
2 Replies

6. Shell Programming and Scripting

How to get rid of message when script kills process it started?

When I run the following script I get the following error message whcih I would like to suppress when the kill is issued: ./kill.sh: line 13: 31854 Killed nc -l -p 12345 Script: #!/bin/bash echo running nc in the background nc -l -p 12345 & PID=$! echo nc pid: $PID ... (1 Reply)
Discussion started by: cmarkle
1 Replies

7. UNIX for Dummies Questions & Answers

Process started on console

Please can someone describe what causes undesired process startup on system console. ps -ef output is like: root 1763 1 0 16:22:24 console 0:00 /bin/sh /usr/System........ process is blocking system console for any access (2 Replies)
Discussion started by: zverzak
2 Replies

8. Programming

Child process is not getting started

Hi, When i m trying to run below code,its entering into wait stage. output: In parent pid=2134 // some random value assigned to child process parent waiting..... and then it keeps on waiting for child to get terminate Y this child is not getting... (5 Replies)
Discussion started by: Crab
5 Replies

9. UNIX for Dummies Questions & Answers

is there any way to know how much time process was running from the moment it started

i have process that was started few days ago , is there way to know by its id how long it was alive in the system ? Thanks (2 Replies)
Discussion started by: umen
2 Replies

10. Shell Programming and Scripting

PID of process started in background??

I am having a problem getting the PID of a process I start in the background is a csh. In tcsh and sh it's simple $! give it to you But in csh this just returns Variable syntax From the man page it should work but it doesn't???? Any help. (2 Replies)
Discussion started by: stilllooking
2 Replies
Login or Register to Ask a Question