Sponsored Content
Top Forums Shell Programming and Scripting Need to know rhe PID for the Shell Script running Post 302104402 by pbsrinivas on Thursday 25th of January 2007 04:50:37 AM
Old 01-25-2007
Need to know rhe PID for the Shell Script running

I have a Shell Scritp named "Statistics" which has a Infinate Wille Loop Running

I want to restart this Srcipt "Statistics" when i try to run other srcipt Ex "ABC"

so i want to kill the "Statistics" script in "ABC"
so for this I what to know the PID for that Script "Statistics" which is running continusly

When i try ps -ef | grep Statistics it does not give me any thing

How do i know the PID for the script "Statictics" ?
 

10 More Discussions You Might Find Interesting

1. Linux

Display to PC via ssh/putty (RHE 5)

Hi all, I just installed Red Hat Enterprise and I would like to have the KDE/GNOME windows display to my PC. When I am root (via ssh, putty) I type startx but it fails. I'm not sure what has to be configured! Any help would be greatly appreciated. Thanks! (1 Reply)
Discussion started by: kjbaumann
1 Replies

2. Solaris

Running from Shell Vs running from RC script

Hi, i have a script which need to do behave differently when run as a startup process from init.d/ rc2.d script and when run manually from shell. How do i distinguish whether my script is run by init process or by shell?? Will the command /proc/$$/psinfo | grep "myscript" work well???... (2 Replies)
Discussion started by: vickylife
2 Replies

3. UNIX for Dummies Questions & Answers

How to find the details of the previously running process with PID

OS: Unix or Linux I (only) know the pid of the process which was running earlier (say 5 hrs back) but it is not running now. Is there a way I could find the details of that process? (atleast the name of the process). Please let me know. (2 Replies)
Discussion started by: vijay.d
2 Replies

4. UNIX for Advanced & Expert Users

delete all PID that running by UID ??

Hi experts, How can I delete the process running by particular UID. For an example- I want to delete all PID that running by UID- purple UID PID PPID C STIME TTY TIME CMD purple 120 122 0 Jan 17 ? 0:02 sched purple 234 235 0 Jan 17 ?... (6 Replies)
Discussion started by: thepurple
6 Replies

5. Shell Programming and Scripting

shell script for getting pid of spawn processes from shell

Hi, I am new this forum. I request you peoples help in understanding and finding some solution to my problem. Here it goes: I need to perform this set of actions by writing a shell script. I need to read a config file for the bunch of processes to execute. I need to fecth the pid of... (4 Replies)
Discussion started by: sachin4sachi
4 Replies

6. AIX

Having problem with executing shell script to get the pid details!

Hello Everyone, I am new to shell scripting and also i am very new to AIX machine I have a question. I have shell script which contains the follwing "ps -e |grep $1 echo $2" i run this schell script by doing this ./startSehllscript 3444 passed with two parameters . Accroiding my... (4 Replies)
Discussion started by: swati
4 Replies

7. Shell Programming and Scripting

Check process running Status with PID

Good day I am fairly new to Shell Scripting. I want a script to check if a process is up by checking the process's PID and then return a value for when it's running which would be 0. If it isn't running it should give any other value that 0. Any Help is appreciated Regards (9 Replies)
Discussion started by: 1nsyz1on
9 Replies

8. Shell Programming and Scripting

kill PID running in background in for loop

Guys, can you help me in killing the process which is running in back ground under for loop I am not able to find the PID using ps -afx|grep <word in command I entered> (1 Reply)
Discussion started by: mohan_xunil
1 Replies

9. Shell Programming and Scripting

Cp not working in shell script but running perfectly from shell

Dear All, I have script. Dest="" IFS=' ' for translation in $(echo $MY_MAP) do t1=$(echo $translation | cut -d"=" -f1) t2=$(echo $translation | cut -d"=" -f2| cut -d"," -f1) if then Dest=$UNX/$u_product_path/$u_study_path/$UNXTR/$t2 break; ... (4 Replies)
Discussion started by: yadavricky
4 Replies

10. Shell Programming and Scripting

Shell script to report file size, pid and also kill the process

Hi All, Looking for a quick LINUX shell script which can continuously monitors the flle size, report the process which is creating a file greater than certain limit and also kill that process. Can someone please help me on this? (4 Replies)
Discussion started by: vasavimacherla
4 Replies
Sys::Statistics::Linux::ProcStats(3pm)			User Contributed Perl Documentation		    Sys::Statistics::Linux::ProcStats(3pm)

NAME
Sys::Statistics::Linux::ProcStats - Collect linux process statistics. SYNOPSIS
use Sys::Statistics::Linux::ProcStats; my $lxs = Sys::Statistics::Linux::ProcStats->new; $lxs->init; sleep 1; my $stat = $lxs->get; Or my $lxs = Sys::Statistics::Linux::ProcStats->new(initfile => $file); $lxs->init; my $stat = $lxs->get; DESCRIPTION
Sys::Statistics::Linux::ProcStats gathers process statistics from the virtual /proc filesystem (procfs). For more information read the documentation of the front-end module Sys::Statistics::Linux. IMPORTANT
I renamed key "procs_blocked" to "blocked"! LOAD AVERAGE STATISTICS
Generated by /proc/stat and /proc/loadavg. new - Number of new processes that were produced per second. runqueue - The number of currently executing kernel scheduling entities (processes, threads). count - The number of kernel scheduling entities that currently exist on the system (processes, threads). blocked - Number of processes blocked waiting for I/O to complete (Linux 2.5.45 onwards). running - Number of processes in runnable state (Linux 2.5.45 onwards). METHODS
new() Call "new()" to create a new object. my $lxs = Sys::Statistics::Linux::ProcStats->new; Maybe you want to store/load the initial statistics to/from a file: my $lxs = Sys::Statistics::Linux::ProcStats->new(initfile => '/tmp/procstats.yml'); If you set "initfile" it's not necessary to call sleep before "get()". It's also possible to set the path to the proc filesystem. Sys::Statistics::Linux::ProcStats->new( files => { # This is the default path => '/proc', loadavg => 'loadavg', stat => 'stat', } ); init() Call "init()" to initialize the statistics. $lxs->init; get() Call "get()" to get the statistics. "get()" returns the statistics as a hash reference. my $stat = $lxs->get; raw() Get raw values. EXPORTS
No exports. SEE ALSO
proc(5) REPORTING BUGS
Please report all bugs to <jschulz.cpan(at)bloonix.de>. AUTHOR
Jonny Schulz <jschulz.cpan(at)bloonix.de>. COPYRIGHT
Copyright (c) 2006, 2007 by Jonny Schulz. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. perl v5.14.2 2012-03-09 Sys::Statistics::Linux::ProcStats(3pm)
All times are GMT -4. The time now is 01:06 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy