# @(#)profile	4.8 - 92/02/11
# UNIX SR10 system profile for Bourne shell and Korn shell users.
# This is run before the users .profile

trap '' 2 3

# set PATH based on SYSTYPE.

if [ ${SYSTYPE} = bsd4.3 -o ${SYSTYPE} = bsd4.2 ]
then
	PATH=/bin:/usr/bin:/usr/ucb:/usr/apollo/bin:
else
	PATH=/bin:/usr/bin:/usr/apollo/bin:	# sys5.3 path
fi

# make sure TZ gets exported; see sys5.3 timezone(4) for details.

if [ -f /etc/TIMEZONE ]
then
	. /etc/TIMEZONE
fi
export TZ

case $0 in

-sh | -ksh )
	
	#	Allow the user to break the Message-Of-The-Day only.
	trap "trap '' 2"  2
	cat -s /etc/motd
	trap "" 2

        if [ ${SYSTYPE} = sys5.3 ]
        then
		if mail -e
		then
			echo "you have mail"
		fi

		if [ ${LOGNAME} != root ]
		then
			news -n
		fi
        fi
	;;

esac
                                           
if [ $0 = ksh -o $0 = -ksh -o $0 = sh -o $0 = -sh ]
then
	# This is important on the Apollo DM.  It tells the ksh to use the
	# special built in pad editor.  If FCEDIT is set to vi or emacs the
	# pad will need to flip in and out of raw mode.  If the TERM is
	# not an Apollo pad, set FCEDIT to your favorite value.

	if [ ${TERM%%_*} = apollo ]
	then
		export FCEDIT=pad
		unset  VISUAL
        fi    
	if [ $0 = ksh -o $0 = -ksh ]
	then
		# Show the history command number in the prompt.
		# This can easily be changed but is set here to help
		# avoid confusion with so many shells using the $ prompt.
		PS1="[!]$ "
	else  # bourne shell prompt
		PS1="$ "
	fi

	# Uncomment the following to include the ksh functions.
	#if [ -f /etc/profile.ksh ]
	#then
	#	. /etc/profile.ksh
	#fi                                             
fi

export PATH LOGNAME

umask 022
trap  2 3

#Uncomment the following if you wish to use a local profile
#if [ -x /etc/localprofile ]
#then
#	. /etc/localprofile
#fi


