Skip to content

Instantly share code, notes, and snippets.

@masawada
Created November 13, 2014 01:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save masawada/9cdbd9e09c91c7b8603c to your computer and use it in GitHub Desktop.
Save masawada/9cdbd9e09c91c7b8603c to your computer and use it in GitHub Desktop.
COMMAND=$1
PID=$(ps ax | grep $COMMAND | peco | awk '{print $1}')
if [ ${#PID} -ne 0 ]; then
/bin/echo -n "Are you sure to kill process $[PID]? [y/n] "
read ans
if [ $ans = "y" ]; then
kill -9 $PID
fi
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment