Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: kill and pid files



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





Messages sorted by: Reverse Date, Date, Thread, Author