#!/bin/csh
# http://www.berklix.com/~jhs/bin/.csh/unsetenv.csh

# See also ../.sh/unset.sh
# See also env i `which csh`
# Unsets all environment variables.

# Invoke with 	source `which unsetenv.csh`
# not just as	unsetenv.csh
# as the latter runs in a sub shell & does not affect the original shell.

foreach i ( ` /usr/bin/printenv |grep -v TERMCAP | grep -v DISPLAY ` )
	set xx = `echo "$i" | awk -F = '{printf "%s\n",$1}'`
	unsetenv $xx
	end
# I no longer use
#	--field-separator = string
# as FreeBSD-5.0-DP2 does not support it, whereas 4.7 & 5 both support -F
setenv PATH /sbin:/bin:/usr/sbin:/usr/bin:/usr/games:/usr/local/bin
# /usr/local/bin added to avoid ports complaint can't find gmake

set prompt="% "
set history=50

# TERMCAP probably needed for pront curses config

# Needed else make ports goes wrong on curses type install selectors.
setenv TERM xterm
setenv DESTDIR "/"	# needed for cd /usr/src ; make world

# TERMPATH ? Needed else lynx fails, lynx used for net debug
setenv TERMPATH /etc/termcap:/usr/share/misc/termcap

echo -n "Remaining: "
printenv | sort | awk -F = '{ print $1 }' | fmt

cat << EOF
Consider:
	printenv | sort
	rm -rf /var/db/ports/*
	ls -l /etc/make.conf /etc/src.conf 
	ls -l /site/etc/make.conf /site/etc/src.conf 
	setenv FTPSERVER	gate.js.berklix.net
	setenv FTP_PASSWORD	jhs@berklix.net
	setenv FTP_PROXY	ftp://gate
	setenv HTTP_PROXY	http://gate.js.berklix.net:80
	setenv NOCLEANDEPENDS	(For ports/ see src/share/man/man7/ports.7 )
	setenv NO_PROXY		localhost,js.berklix.net
	setenv all_proxy	http://gate.js.berklix.net
	setenv ftp_proxy	http://gate.js.berklix.net:80
	setenv http_proxy	http://gate.js.berklix.net:80
EOF
grep make.conf.cflags /site/domain/this/etc/make.conf
