Re: [SLE] KILL in 9.3 not killing process
- From: Randall R Schulz <rschulz@xxxxxxxxx>
- Date: Mon, 20 Feb 2006 20:35:43 -0800
Hi,
On Monday 20 February 2006 20:10, Ken Schneider wrote:
...
This is one that I use...
ps auxww | grep -v grep | grep $*
Using "pidof" obviates the grep to remove the grep(s).
My take on this, which I use quite frequently, is called "psp":
-==--==--==--==--==--==--==--==--==--==--==--==--==--==--==-
#!/bin/bash --norc
while [ $# -gt 0 ]; do
arg="$1"
case "$arg" in
-)
shift
break
;;
-*)
break
;;
*)
targets=( "${targets[@]}" "$arg" )
PIDs=( $(pidof "$arg") )
if [ ${#PIDs[*]} -eq 0 ]; then
echo "psp: No process running named \"$arg\"" >&2
fi
targetPIDs=( ${targetPIDs[*]} ${PIDs[@]} )
;;
esac
shift
done
if [ ${#targetPIDs[*]} -eq 0 ]; then
echo "psp: No target processes running" >&2
exit 1
fi
ps "$@" ${targetPIDs[@]}
-==--==--==--==--==--==--==--==--==--==--==--==--==--==--==-
Arguments up to the first one that starts with a hyphen are program
names. The rest, if any, are passed to ps as the leading arguments
followed by any PIDs discovered (by pidof) for the specified program
names. If the first non-program-name argument is a single hyphen, it is
not passed to ps.
Ken Schneider
Randall Schulz
--
Check the headers for your unsubscription address
For additional commands send e-mail to suse-linux-e-help@xxxxxxxx
Also check the archives at http://lists.suse.com
Please read the FAQs: suse-linux-e-faq@xxxxxxxx
- References:
- [SLE] KILL in 9.3 not killing process
- From: Mike McMullin
- Re: [SLE] KILL in 9.3 not killing process
- From: Carlos E. R.
- Re: [SLE] KILL in 9.3 not killing process
- From: Ken Schneider
- [SLE] KILL in 9.3 not killing process
- Prev by Date: Re: [SLE] cisco vpn client for linux?
- Next by Date: [SLE] USB Devices Fail to Automount
- Previous by thread: Re: [SLE] KILL in 9.3 not killing process
- Next by thread: Re: [SLE] KILL in 9.3 not killing process
- Index(es):