#	cgunprofile -- Undefines the environment for CONGEN execution.
#	The Bourne or Korn shell must be used and this procedure executed with
#       a . command.
#
# 	The purpose of this script is to remove congen references from your
#  	path variables.

newpath=""
for dir in `echo $PATH | tr ':' ' '`
do
    case $dir in
      *congen* ) : ;;
      * ) newpath="$newpath:$dir" ;;
    esac
done
PATH=`echo $newpath | cut -c2-` ; export PATH
unset newpath

if [ "$MANPATH" != "" ]
then 
    newmanpath=""
    for dir in `echo $MANPATH | tr ':' ' '`
    do
	case $dir in
          *congen* ) : ;;
          * ) newmanpath="$newmanpath:$dir" ;;
	esac
    done
    MANPATH=`echo $newmanpath | cut -c2-` ; export MANPATH
    unset newmanpath
fi

for name in `printenv | grep "^CG" | cut -d= -f1`
do
    unset $name
done
unset name
unset dir

