Current Path : /usr/src/contrib/dialog/samples/ |
FreeBSD hs32.drive.ne.jp 9.1-RELEASE FreeBSD 9.1-RELEASE #1: Wed Jan 14 12:18:08 JST 2015 root@hs32.drive.ne.jp:/sys/amd64/compile/hs32 amd64 |
Current File : //usr/src/contrib/dialog/samples/killall |
#! /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