Last active
October 20, 2015 15:41
-
-
Save yevhene/483aba86ae23d81c41ca to your computer and use it in GitHub Desktop.
Kills the first greped process passed by an argument.
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
function shoot() { | |
local pid=`ps x \ | |
| grep '$@' \ | |
| grep -v grep \ | |
| head -n1 \ | |
| awk '{ print $1 }' | |
kill -9 $pid | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment