Re: [ILUG] kill process by name

From: Thomas Bridge (tbridge at domain vianetworks.ie)
Date: Tue 16 Jul 2002 - 12:21:49 IST


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

At 12:08 16/07/2002 +0100, hrishy wrote:
>Hi David
>
>What i wanted to was accept the argument to the grep
>command.
>
>Say for example
>
>ps -ef| grep $1 | awk '{print $1}'| xargs kill
>
>where $1 is the name of the process that will be
>passed to this script.

As was already said, put the command in a file (say called kill-hrishy),
like so:

#!/bin/sh

ps -ef| grep $1 | awk '{print $1}'| xargs kill

#### End of File

make file executable, then run from the command line as follows:

kill-hrishy <processname>

Exactly what the difference between this and killall is is beyond me
(except that ps -ef will output very different information depending on
what platform you're running on).

T.

-----BEGIN PGP SIGNATURE-----
Version: PGPfreeware 7.0.3 for non-commercial use <http://www.pgp.com>

iQA/AwUBPTQBxr6WYZbx1eG3EQIEPwCfXxC2tI1I2G27qt4b73niu2adfOMAmwaA
HWPPlQeJgSus9KTPhWk+s6wH
=QaHT
-----END PGP SIGNATURE-----



This archive was generated by hypermail 2.1.6 : Thu 06 Feb 2003 - 13:17:54 GMT