From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12542 invoked from network); 18 Jun 1997 20:36:44 -0000 Received: from euclid.skiles.gatech.edu (list@130.207.146.50) by ns1.primenet.com.au with SMTP; 18 Jun 1997 20:36:44 -0000 Received: (from list@localhost) by euclid.skiles.gatech.edu (8.7.3/8.7.3) id QAA03879; Wed, 18 Jun 1997 16:12:42 -0400 (EDT) Resent-Date: Wed, 18 Jun 1997 16:12:17 -0400 (EDT) Date: Wed, 18 Jun 1997 16:16:13 -0400 (EDT) From: Timothy J Luoma X-Sender: luomat@cc344191-a.ewndsr1.nj.home.com Reply-To: luomat@peak.org To: Robert Stone cc: zsh-users@math.gatech.edu Subject: Re: kill and pid files In-Reply-To: Message-ID: Organization: The PEAK FTP site for OpenStep & NeXTStep X-FTP: ftp://ftp.next.peak.org/pub/next/ X-URL: http://www.next.peak.org/~luomat MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Resent-Message-ID: <"-1xNG.0.bx.X44gp"@euclid> Resent-From: zsh-users@math.gatech.edu X-Mailing-List: archive/latest/905 X-Loop: zsh-users@math.gatech.edu X-Loop: zsh-workers@math.gatech.edu Precedence: list Resent-Sender: zsh-workers-request@math.gatech.edu On Wed, 18 Jun 1997, Robert Stone wrote: > Is there any reason kill should not take a filename as an > argument? i.e. if the job specification is not a legal job name, or a > legal pid, why not try to open a file with that name and see if it's > first line is a valid pid? well, I don't have the file part, but I use this pid () { for i in $* do echo `/bin/ps -auxwww | grep -v grep | grep -w $i | awk '{print $2}' | tr -s '\012' ' '` done } and then use it for something like kill -HUP `pid sendmail` but it doesn't have the nice expansion/matching stuff... more often than not I know exactly what I want to kill. Note my version is only going to match exactly (grep -w) and is case sensitive. I don't know if this is anything like you wanted, I'm just trying to contribute rather than just always asking .... TjL