Sophie

Sophie

distrib > Fedora > 14 > x86_64 > by-pkgid > df2239b60a0b35ec5643511ed59a0425 > files > 104

dialog-1.1-11.20100428.fc14.i686.rpm

#! /bin/sh
# $Id: killall,v 1.2 2004/09/17 19:56:18 tom Exp $
# Linux has a program that does this correctly.
for prog in $*
do
	pid=`ps -a |fgrep $prog |fgrep -v fgrep|sed -e 's/^[ ]*//' -e 's/ .*//' `
	if test -n "$pid" ; then
		echo killing pid=$pid, $prog
		kill -1 $pid || \
		kill -15 $pid || \
		kill -9 $pid
	fi
done