Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

kill processes

Status
Not open for further replies.

230173

MIS
Jun 22, 2001
208
SG
Hi,

How can kill a couple of processes.
I 've got to get the ID's and then kill them or can i kill them using the names?
One thing they 've got in common is that their names start with lm_*
 
Please use
#ps -ef|grep lv*

and
#kill -9 pid1 pid2 ......


AIXBUFF
 
Levw,

If i try this i get the message:
kill_process_test.sh[3]: NUMB: Specify a process identifier or a %job number.

???
 
Levw,
I'm don't quit understand.
This is the whole script.

#!/bin/ksh

for NUMB in `ps -ef |grep lm_ |awk '{ print $2 }'`
do
kill $NUMB
done


So in your last reply you said:
Use ` ,not ' quotesas stated
So it's => `ps -ef |grep lm_ |awk `{ print $2 }``
instead of => `ps -ef |grep lm_ |awk '{ print $2 }'`
right?
 
Hi,

The original script is correct :
#!/bin/ksh

for NUMB in `ps -ef |grep lm_ |awk '{ print $2 }'`
do
kill $NUMB
done
==============
I get good results with it.

Please run it as following and post results:

# ksh -x <script>




&quot;Long live king Moshiach !&quot;
h
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top