#! /bin/csh -f
# grepnkill - Grep and Kill
#
# grep ps -x for $1 and kill that process.
#
# Note that this process and the grep process are saved by the grep -v grep
#    because the name of this script includes "grep"
#

if (-f /hp-ux) then
    set NUM=`ps -ef | grep $1 | grep -v grep | awk '{print $2}'`
else
    set NUM=`ps -auxww | grep $1 | grep -v grep | awk '{print $2}'`
endif

echo "About to kill $NUM"
kill -1 $NUM 

