Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
Search Forums:



Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

Closed Thread    
 
Thread Tools Search this Thread Display Modes
    #1  
Old 07-29-2010
Registered User
 

Join Date: Jul 2010
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Unhappy Script to kill the specific process

Hi

I have the process to kill regulary, but the PSID is dymatic change and not sure how to kill the specific process ID

Check the tradekast_rvd is running , if such process, kill the els process id


Code:
ps -e f |grep tradekast_rvd 
 
ps -ef |grep els

then I kill els process id

CODE

Code:
Processid=2404
if   ps -e f |grep tradekast_rvd   
then 
ps -ef | grep els ; kill$
else
echo " No such Process
 
end if

What is another way to do the script ?

Thank you

Last edited by pludi; 07-30-2010 at 01:03 AM..
Sponsored Links
    #2  
Old 07-29-2010
Registered User
 

Join Date: May 2008
Posts: 109
Thanks: 1
Thanked 2 Times in 2 Posts
ps -ae | awk '/els/ {print $1}' | xargs kill

I'd use that line to kill els
Sponsored Links
    #3  
Old 07-29-2010
Registered User
 

Join Date: Jul 2010
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Thank your reply

I check it. thanks
Sponsored Links
Closed Thread

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Script to start background process and then kill process holocene UNIX for Dummies Questions & Answers 4 06-10-2010 03:39 AM
Script to Kill a Process by Name... cannon1707 Shell Programming and Scripting 7 04-21-2010 06:47 PM
Shell Script to Kill Process(number of process) Unix/Solaris jonnyvic Shell Programming and Scripting 2 12-03-2009 01:44 PM
Script to kill process... malcomex999 Shell Programming and Scripting 2 03-02-2009 10:29 AM
Script to kill process Lestat Shell Programming and Scripting 5 06-15-2005 12:09 PM



All times are GMT -4. The time now is 03:56 AM.