🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: chile.comp.misc
Article #35669

Re: Matar procesos en serie

#35669
From: B. Javier S.
Date: Fri, 05 Dec 1997 00:00
37 lines
1694 bytes
Rodrigo Soto <rsoto@cec.uchile.cl> wrote:
>Mediante un script se lanzan a correr varios procesos, con nombre
>similar. Necesito un script para UNIX que me presmita matarlos
>indiscriminadamente.

>Los procesos tienen nombre tipo simula* y entonces puedo saber cuales
>estan corriendo con:

>ps -u rsoto | grep simula

>pero de la info que aparece no se como matarlos sistematicamente sin
>hacer un kill a mano para cada uno. El formato del ps de mi maquina
>entrega el PID como primer numero.

	En una maquina corriendo OSF/1 yo uso el siguiente script
("killtty") para matar procesos por nombre. Es ineficiente, pero funciona
razonablemente. En tu caso, le dices "killtty simula".

-----8<--------8<--------8<--------8<--------8<--------8<--------8<-----
# usage: killtty tin tty7 ...

for i
do

ps -au whoami | grep $i | grep -v grep | awk '{print $1}' | grep -v PID | \
xargs kill -9

done
-----8<--------8<--------8<--------8<--------8<--------8<--------8<-----

Saludos!

-- 
B. Javier Siu F.  (javier@webhost.cl)
Disclaimer: Mis opiniones son PERSONALES y no representan a nadie mas.
********* [!] <Your newsreader cannot display java-enabled .sigs.> *********
Technical Details
Message-ID: <669ao8$8su$4@antonia.webhost.cl>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail
References: <34883ECF.4DFB@cec.uchile.cl>

Show Full Headers
Complete Article Headers
X-Google-Language: SPANISH,ASCII-7-bit
X-Google-Thread: 107d6b,278e3cf4b81a7371,start
X-Google-Attributes: gid107d6b,public
From: "B. Javier S." <javier@antonia.webhost.cl>
Subject: Re: Matar procesos en serie
Date: 1997/12/05
Message-ID: <669ao8$8su$4@antonia.webhost.cl>
X-Deja-AN: 296043372
Sender: B. Javier S. <javier@antonia.webhost.cl>
References: <34883ECF.4DFB@cec.uchile.cl>
Organization: Yo mismo y NADIE MAS
Reply-To: bsiu@ing.puc.cl
Newsgroups: chile.comp.misc