On 27-May-00 Randall Hopper wrote:
> [EMAIL PROTECTED]:
> |Randall Hopper <[EMAIL PROTECTED]> 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 <[EMAIL PROTECTED]> -- 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 [EMAIL PROTECTED]
with "unsubscribe freebsd-stable" in the body of the message