a little more ornate version

Somewhere I meet such much better script,
but now can not remember where it was. Or did they include such command in the standard distribution of SCO 5.0.7 ?
:
# @(#) killusr.sh 1.2 92/06/20
#
# Cansel all processes of user
# Script is similar to killterm
#
# Parameter
# 1. user name
#
# Example
# $ killusr ivo
#
# Stiliyan Stankow, NOAC EOOD, tel. +359-2-8569094,
# stan@noac.biz
#
OK=0
FAIL=1
if [ $# -ne 1 ] # check parameters number
then
echo "Usage:" $0 "<name>"
exit $FAIL
fi
#
# Prevent root's suicide
#
if [ $1 = "root" ]
then
echo $0: name must be different from \"root\"
exit $FAIL
fi
#
# List ot all users processes
#
PROCESSES=`ps -ef | grep $1 | awk '$1 == "'$1'" {print $2}'`
#
# First signal to exit
#
kill $PROCESSES
#
# Then unconditional exit
#
kill -9 $PROCESSES
exit $O