#!/bin/bash
if [ "$#" -ne 1 ];
then
echo "please input your process"
else
echo -n "Do you need to kill these process(y|n):";
echo
ps -ef | grep -v grep | grep $1 | grep -v $0
read ANS
case $ANS in
y|Y)
kill -9 `ps -ef | grep -i $1 | grep -v grep | grep -v $0| awk '{print $2}'`
;;
n|N)
exit;
;;
esac
fi