#	cgundef -- UnDefines the environment for CONGEN execution.
#	The C shell must be used and this procedure executed with a source command.
#
# 	The purpose of this script is to remove congen references from your
#  	path variables.

set newpath=""
foreach dir ($path)
    if ($dir !~ *congen*) then
	set newpath=($newpath $dir)
    endif
end
set path=($newpath)
unset newpath

if ($?MANPATH) then 
    set newmanpath=""
    foreach dir (`echo $MANPATH | tr ':' ' '`)
	if ($dir !~ *congen*) then
	    set newmanpath="$newmanpath $dir"
	endif
    end
    setenv MANPATH `echo $newmanpath | tr ' ' ':'`
    unset newmanpath
endif

foreach name (`printenv | grep "^CG" | cut -d= -f1`)
    unsetenv $name
end
unset name
unset dir

