pkill is a basic necessity of life. For cygwin, this comes in the package procps which is not available for x64. You can of course ps and grep then awk but who has the time.
This small script from cygwin mailing list archives to the rescue:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# pkill | |
# be VERY careful with parameter $1 | |
case $1 in | |
'' ) | |
cat "$0" | |
;; | |
* ) | |
for pid in $( ps -aW | grep -i $1 | awk '{ print $4 }' ); | |
do tskill $pid /V; | |
done | |
;; | |
esac |
tskill
is actually a kill
equivalent in the Windows world.
Comments