From owner-freebsd-stable Sat May 27 7:49:28 2000 Delivered-To: freebsd-stable@freebsd.org Received: from mail.rdc1.va.home.com (ha1.rdc1.va.home.com [24.2.32.66]) by hub.freebsd.org (Postfix) with ESMTP id 0F7C837BB8C for ; Sat, 27 May 2000 07:49:21 -0700 (PDT) (envelope-from jhb@FreeBSD.org) Received: from john.baldwin.cx ([24.6.244.187]) by mail.rdc1.va.home.com (InterMail vM.4.01.02.00 201-229-116) with ESMTP id <20000527144920.WNSL22611.mail.rdc1.va.home.com@john.baldwin.cx>; Sat, 27 May 2000 07:49:20 -0700 Content-Length: 940 X-Mailer: XFMail 1.4.0 on FreeBSD X-Priority: 3 (Normal) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 8bit MIME-Version: 1.0 In-Reply-To: <20000527093625.A1557@nc.rr.com> Date: Sat, 27 May 2000 10:49:20 -0400 (EDT) Organization: BSD, Inc. From: John Baldwin To: Randall Hopper Subject: Re: killall question Cc: stable@FreeBSD.ORG, housley@thehousleys.net Message-Id: <20000527144920.WNSL22611.mail.rdc1.va.home.com@john.baldwin.cx> Sender: owner-freebsd-stable@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On 27-May-00 Randall Hopper wrote: > housley@thehousleys.net: > |Randall Hopper said: > | > |> I have a script I run named "newroot". I want to kill it with killall. > |> > |> > ps -ax | grep newroot > |> 842 1 rhh /bin/sh /home/rhh/bin/newroot 360 > |> > |You will have to do something like > | > |kill `ps -ax | grep newroot | sed -e '^[0-9]*'` > > Ok. I thought I'd at least try to use the system version, but sounds like > it's just not as flexible as killall's on other systems. > > Here's the shell script I settled on to override the default /usr/bin/killall: > > ps -x | grep "$1" | egrep -v "grep|$0" | awk '{print $1;}' % killall grep > Thanks for the help. Good luck. :) -- John Baldwin -- http://www.FreeBSD.org/~jhb/ PGP Key: http://www.cslab.vt.edu/~jobaldwi/pgpkey.asc "Power Users Use the Power to Serve!" - http://www.FreeBSD.org/ To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-stable" in the body of the message