![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !! |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Diff b/n kill and kill -9 | ammu | UNIX for Advanced & Expert Users | 2 | 07-18-2007 05:29 PM |
| kill(0,-9) don't kill the process | umen | High Level Programming | 9 | 06-19-2007 06:09 AM |
| not able to kill find with kill -9 | Amardeep | UNIX for Dummies Questions & Answers | 5 | 01-04-2007 05:49 PM |
| KILL PID, intern should kill another PID. | rkrgarlapati | Shell Programming and Scripting | 4 | 10-17-2006 07:47 AM |
| When kill doesnt work, how to kill a process ? | VijayHegde | UNIX for Advanced & Expert Users | 3 | 05-12-2006 04:24 PM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
Which field to match on really depends on which platform you are on and which ps options you are using -- these vary rather wildly.
As such, good advice -- especially if the command name is short an cryptic, you might get accidental matches. As always, look before you dive. The use of [a]bc is a trick to avoid having the script find and kill itself in the listing; unlike "abc", "[a]bc" does not match itself, so it avoids this suicide syndrome. There are other ways to work around that, of course. Here's one attempt. Code:
ps -ef | awk '$9 == "a" "bc" { print $2 }' | xargs kill
|
|
||||
|
Yes, come to think of it, the suicide issue only applies when the script's arguments might match.
|
| Sponsored Links | ||
|
|
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|