#!/bin/ksh93
#
# .profile	-- Commands executed by a login Korn shell
#

[ -d /usr/local/bin -a -x /usr/local/bin ] && PATH=$PATH:/usr/local/bin
PATH=$PATH:$HOME/bin:.			# set command search path
export PATH

if [ -z "$LOGNAME" ]; then
	LOGNAME=`logname`		# name of user who logged in
	export LOGNAME
fi

MAIL=/usr/spool/mail/$LOGNAME		# mailbox location
export MAIL

if [ -z "$PWD" ]; then
	PWD=$HOME			# assumes initial cwd is HOME
	export PWD
fi

if [ -f $HOME/.ksh93rc -a -r $HOME/.ksh93rc ]; then
	ENV=$HOME/.ksh93rc		# set ENV if there is an rc file
	export ENV
elif [ -f $HOME/.kshrc -a -r $HOME/.kshrc ]; then
	ENV=$HOME/.kshrc		# set ENV if there is an rc file
	export ENV
fi

# use default system file creation mask (umask)

eval `tset -m scoansi:${TERM:-scoansi} -m :\?${TERM:-scoansi} -r -s -Q`

# If job control is enabled, set the suspend character to ^Z (control-z):
case $- in
*m*)	stty susp '^z'
	;;
esac

set -o ignoreeof			# don't let control-d logout

case $LOGNAME in			# include command number in prompt
root)	PS1="!# " ;;
*)	PS1="!$ " ;;
esac
export PS1

/usr/bin/prwarn			# issue a warning if password due to expire
