diff options
Diffstat (limited to 'Build/source/utils/dialog/dialog-1.1-20080819/samples/killall')
-rwxr-xr-x | Build/source/utils/dialog/dialog-1.1-20080819/samples/killall | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/Build/source/utils/dialog/dialog-1.1-20080819/samples/killall b/Build/source/utils/dialog/dialog-1.1-20080819/samples/killall new file mode 100755 index 00000000000..9d233f0a92d --- /dev/null +++ b/Build/source/utils/dialog/dialog-1.1-20080819/samples/killall @@ -0,0 +1,13 @@ +#! /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 |