Shell Script for PIDs


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Shell Script for PIDs
# 1  
Old 12-18-2007
Shell Script for PIDs

I am trying to write a Shell script wherein the shell needs to read a list of PID in the File $stat/bin/Process and compare it to the PID of the processes running on a server.

Also the script should return KO(not OK) with corresponding label :-


a) When an environmental variable not defined.


b) There is no running process.


c) There is less running PID than registered PID.


d) There is more running PID than registered PID.


Any inputs please.


Thanks a lot in advance.
# 2  
Old 12-18-2007
Marconi,

It's against the forum rules to post homework here.

Regards
# 3  
Old 12-18-2007
Quote:
Originally Posted by Franklin52
Marconi,

It's against the forum rules to post homework here.

Regards
Not to offend you, if so am very sorry

Could you elaborate on part a) of the question ?

What is that you had tried so far, post us your script and we should be able to definitely help you !
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Get all associated pids

im looking for a portable way to get the PID of the script that is running, and to get every other PIDs that are spawned from it. and by ever other PIDs, i presume, that would be "child processes". however, i want to shy away from using any command that is not available on every single unix... (1 Reply)
Discussion started by: SkySmart
1 Replies

2. Shell Programming and Scripting

Need help to kill pids

Hi there !!! I am writing a script to kill the pids on different linux boxes :cool: the output of my command gives the pids running on that box, but how can I kill all the pids without looping? :confused: Code: ssh $i ps -fu $USER | grep ManServer | grep -v grep | awk '{print $2}' | kill ... (4 Replies)
Discussion started by: prany_cool
4 Replies

3. Homework & Coursework Questions

script to write PIDs to a file

script to write PIDs to a file Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted! 1. The problem statement, all variables and given/known data: write a script that writes the PID of 2 different processes to a file every... (1 Reply)
Discussion started by: navlelo
1 Replies

4. Solaris

Conflict with PIDs

I am trying to determine the root cause of a java process that dies trying to startup during it's cron job. I did go ahead and change the time that it starts up in the cron file and now it starts successfully. However is there a way to determine what PID a process was attempting to get when... (5 Replies)
Discussion started by: vedder191
5 Replies

5. Shell Programming and Scripting

differentiating PIDs under 200

Hey, So I'm new to shell scripting, and I'm trying to write one for my lab that will keep down the work load by deleting processes that are left over from previous sessions. Basically I want it to do three things. 1) Check the processes running 2) See if that person is logged on. 3) if... (2 Replies)
Discussion started by: prgoodwin
2 Replies

6. Shell Programming and Scripting

Track and kill the PIDS

I have a script that conducts some SSH calls and I would like to capture the child info so that I can do a sleep and then a cleanup to make sure they do not stay out there as ghosts. I was told I could do something like this... #!/bin/sh for m = job1, job2, job3 x=1... (4 Replies)
Discussion started by: LRoberts
4 Replies

7. Shell Programming and Scripting

Comparing PIDs in a Shell...

Hi, There is a file having a list of running PIDs (pid_process) and another file having a list of registered PIDs (pid_regieter). I want to check if:- a) there is at least one running PID that does not correspond to a registered PID (listing the PID not registered in the file) ... (1 Reply)
Discussion started by: marconi
1 Replies

8. Shell Programming and Scripting

comparing PIDs in shell..

Hi, There is a file having a list of running PIDs and another file having a list of registered PIDs. How can we check if the number of running PIDs are less or more than the registered PIDs, comparing the total no. in each and also each value. Request you to pls give your inputs. Thanks a... (2 Replies)
Discussion started by: marconi
2 Replies

9. Shell Programming and Scripting

Script to AutoKill PIDs of LOGED in Active User

:confused: Hi i am trying to make a script through which i can get the total number of User and their PID after that kill all Users except the one by which i am currently logged in. (i m using SCO UNIX 5.06) # id of current usre < total number of current user USR=`who -u |wc -l` # id of... (2 Replies)
Discussion started by: aafflatoon
2 Replies

10. HP-UX

PIDs of background process

How to track the pid of a background child process(shell script) from a parent script ? For example :- $ sleep 10000 & 4220 where 4220 is the pid of bg process sleep. Now my requirement is to keep the sleep statement in a shell script(test.ksh) and will be invoking it from... (3 Replies)
Discussion started by: ramkumar
3 Replies
Login or Register to Ask a Question