From owner-freebsd-stable Sat May 27 6:35:33 2000 Delivered-To: freebsd-stable@freebsd.org Received: from rr.com (rdu25-28-182.nc.rr.com [24.25.28.182]) by hub.freebsd.org (Postfix) with ESMTP id D327337BAC0 for ; Sat, 27 May 2000 06:35:23 -0700 (PDT) (envelope-from rhh@rr.com) Received: (from rhh@localhost) by rr.com (8.9.3/8.9.3) id JAA01817; Sat, 27 May 2000 09:36:25 -0400 (EDT) (envelope-from rhh) Date: Sat, 27 May 2000 09:36:25 -0400 From: Randall Hopper To: housley@thehousleys.net Cc: stable@FreeBSD.ORG Subject: Re: killall question Message-ID: <20000527093625.A1557@nc.rr.com> References: <200005271258.IAA29766@thehousleys.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2i In-Reply-To: <200005271258.IAA29766@thehousleys.net>; from housley@thehousleys.net on Sat, May 27, 2000 at 12:58:25PM -0000 Sender: owner-freebsd-stable@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG 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;}' Thanks for the help. -- Randall Hopper aa8vb@nc.rr.com To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-stable" in the body of the message