Re: parsing ps -ax output and killing processes
From: Rob (rob_at_nospam.com)
Date: 02/15/05
- Next message: Icarus Sparry: "Re: parsing ps -ax output and killing processes"
- Previous message: Rob: "Re: parsing ps -ax output and killing processes"
- In reply to: Rob: "Re: parsing ps -ax output and killing processes"
- Next in thread: Icarus Sparry: "Re: parsing ps -ax output and killing processes"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Tue, 15 Feb 2005 12:31:16 GMT
"Rob" <rob@nospam.com> wrote in message
news:lOlQd.28361$uc.27028@trnddc09...
>
> "Rob" <rob@nospam.com> wrote in message
> news:yMlQd.28360$uc.5215@trnddc09...
>> "Rob" <rob@nospam.com> wrote in message
>> news:ctlQd.28350$uc.1458@trnddc09...
>>> After the success of writing my first script yesterday (thanks guys!)
>>> I'm motivated to move on to something more complex today.
>>> How would I go about doing something like a
>>>
>>> ps -ax | grep xxxx
>>>
>>> and then killing any processes listed (except for the one running the
>>> command of course). There may not be any processes, I
>>> was thinking to detect that I could write out to a file and check the
>>> file size, but I guess that doesn't really help me if there are
>>> any processes listed. Basically I run a shutdown script which doesn't
>>> always work, then need to verify that the script did work
>>> by seeing if processes are still running and manually killing them if
>>> they arent.
>>>
>>
>> im reading the awk man pages, it looks like that's probably what
>> i should be looking at but talk about confusing :). oh, this is for
>> bash on redhat if that makes a difference.
>>
>> im playing with something along the lines of
>> awk -F: '{ print $1 }' | ps -ax | grep xxx
>>
>>
>> to at least output the process numbers, but it doesn't return me to the
>> shell and i'm not sure what to do from there anyway :)
>>
>>
> it just occured to me the above example isn't doing anything more than
> the ps -ax | grep xxx is :) :). oops!
>
>
new direction ... i just found pgrep and pkill commands :).
- Next message: Icarus Sparry: "Re: parsing ps -ax output and killing processes"
- Previous message: Rob: "Re: parsing ps -ax output and killing processes"
- In reply to: Rob: "Re: parsing ps -ax output and killing processes"
- Next in thread: Icarus Sparry: "Re: parsing ps -ax output and killing processes"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|