OT - shell script to kill a process

Ken Ray kray at sonsothunder.com
Tue Jul 10 13:01:23 EDT 2007

On Tue, 10 Jul 2007 10:55:14 -0600, chris bohnert wrote:

> Chris,
> Try this:
>  ps -awx | awk '{print $2}'
> if that prints you a list of pid's you should be good to replace the cut
> pipe with the awk command.  By the way, what version of os X are you
> running..mine doesn't seem to behave as you describe.

Ah... actually use {print $1} (you want the first chunk)... so try this:

ps -awx | grep 'TextEdit' | grep -v 'grep' | awk '{print $1}' | xargs 
-I pid kill -9 pid

(all one line of course...)

Ken Ray
Sons of Thunder Software, Inc.
Email: kray at sonsothunder.com
Web Site: http://www.sonsothunder.com/

More information about the Use-livecode mailing list