Skip to content

Instantly share code, notes, and snippets.

@kristm
Created August 28, 2015 05:23
Show Gist options
  • Save kristm/beedbed53905565d62dc to your computer and use it in GitHub Desktop.
Save kristm/beedbed53905565d62dc to your computer and use it in GitHub Desktop.
#!/bin/bash
if [ $# -lt 1 ]; then
echo -e "Usage: $0 <target process>"
exit
fi
target=`ps aux|grep pow|awk -v app="$1" '{ if($11 == app) { pid = $2 } } END { print pid }'`
if [ ! -z "$target" -a "$target" != " " ]; then
kill -9 $target
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment