Killing run away processes

Hans Mulder hansm at cs.kun.nl
Tue Oct 9 19:55:33 AEST 1990


In article <708 at VAX1.CC.UAKRON.EDU> r3jjs at VAX1.CC.UAKRON.EDU (Jeremy J Starcher) writes:
>#!/bin/sh
>#########################################################################
>#  This shell script will zot (kill -9) all process except the user's	#
>#  shells.	 							#

Moreover, it will also kill all the user's shells, except maybe their
login shell if it happens be named csh.  It will also kill their
window system if they use one, preferably leaving their terminal
in an unusable state.

>#  	    Several processes will return as none existent or some other #
>#  error.  Ignore those.						#

You don't like reliable software, do you?

>#  Caveat:  This script must be named zot                               #

Translation: "zot" is the Dutch word for "fool".

>#  Author:  Jeremy J Starcher (r3jjs at vax1.cc.uakron.edu)		#
>#  Date:    2 October 1990						#
>#########################################################################
>
>kill -9 `ps -aux | grep $USER | grep -v -e -csh | grep -v 'sh zot' | cut -c10-15 | paste -s -`

Ignore in particular any messages "sh: cut: not found" and "sh: paste:
not found".  Those merely indicate you live in BSD land and you knew
that already.

Have a nice day,

Hans Mulder	hansm at cs.kun.nl



More information about the Comp.unix.shell mailing list