#!/bin/sh

if [ $# -lt 1 ]
then
    echo "usage: $0 PROCNAME ..." > /dev/stderr
    exit 1
fi

while [ $# -gt 0 ]
do
    for LINE in `ps -U $USER|grep $1|tr -s ' ' '\;'`
    do
        PID=`echo $LINE|cut -d\; -f1`
        echo $LINE|tr \; ' '
        echo -n "kill process? "
        read ANSWER
        case $ANSWER in
            y*|Y*) kill $PID;;
        esac
    done
    shift
done
exit 0
