If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > Unix Shell Scripts > ksh: -exec: not found

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 08-12-03, 03:50
oab oab is offline
Registered User
 
Join Date: Aug 2003
Posts: 2
ksh: -exec: not found

when running this query in soalris :

ps -ef | grep xyz | grep -v grep | awk '{print $2 }' | -exec kill -9 {} \;

My objective is to kill all processes that have xyz in common.

Help please.... Thanks
Reply With Quote
  #2 (permalink)  
Old 08-12-03, 05:20
Damian Ibbotson Damian Ibbotson is offline
Padawan
 
Join Date: Jun 2002
Location: UK
Posts: 525
Untested...

You'd best make sure that 'xyz' is a pretty unique string. I'll let you judge how safe this is!

kill -9 $(ps -ef | awk '/xyz/ && $3 != thisPPID {print $2}' thisPPID=$$)
Reply With Quote
  #3 (permalink)  
Old 08-19-03, 03:17
henbance henbance is offline
Registered User
 
Join Date: Mar 2003
Location: shanghai,china
Posts: 3
maybe you can use grep "precise match function" to realize it.
kill -9 `ps -ef |grep "\<xyz\>" |awk '{print $2}'`

just only match the word "xyz", not xxyz,xyz1.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On