trap "" 1 2 3 15 #echo "Executing $HOME/.profile " LogName=`logname` if [ \( "_$LogName" = "_root" \) -o \( "_$LogName" = "_" \) ] then OraIdent=root elif [ "_${OraIdent:=""}" = "_" ] ; then echo "Identifier? \c" ; read OraIdent # echo fi set -- `who am i` terminal=$2 USERNAME=$LOGNAME case "`uname`" in "SunOS" ) GREP=/bin/grep; location="`who -a | grep $terminal | grep $LogName | cut -d\( -f2 | cut -d\) -f1`";; "HP-UX" ) GREP=/usr/bin/grep; location="`who -R | grep $terminal | grep $LogName | cut -d\( -f2 | cut -d\) -f1`";; "OSF1" ) GREP=/usr/bin/grep; location="`who -M | grep $terminal | grep $LogName | cut -d\( -f2 | cut -d\) -f1`";; *) GREP=/usr/bin/grep; location="unknown";; esac echo "`date` $LogName/$OraIdent from $location at $terminal \c ">> .login_hist.log if [ -x $GREP ]; then set -- `$GREP "^$OraIdent " $HOME/.$USERNAME` if [ $? != 0 -o "_$OraIdent" = "_" -o ! -d $HOME/$OraIdent ] then echo " failed! ">> .login_hist.log exit # Don't remove: audit requirement fi fi echo " successfully! ">> .login_hist.log HISTFILE=$HOME/.sh_hist_$OraIdent HISTSIZE=512 TERM=$7 LPDEST="" SUusername=$2 SUfullusername="$3 $4" # DISPLAY=$5 set -- # clear argument list # Check terminal-definition; If "AUTO" or nothing defined autoselect ! if [ "$TERM" = "AUTO" -o "$TERM" = "" ] then eval `ttytype -s -a` fi export HISTFILE HISTSIZE OraIdent TERM SUusername SUfullusername DISPLAY LPDEST cd $HOME/$OraIdent 1>/dev/null 2>/dev/null set -u -o vi -o ignoreeof ; umask 022 ; trap "echo 'logout'" 0 #------------------------------------------------------------------------------- # Set Terminal basics #------------------------------------------------------------------------------- stty min 0 intr "^C" erase "^H" kill "^U" stty eol2 "^@" susp "^Z" werase "^@" lnext "^@" stty -inpck -istrip icrnl -ixany ixoff onlcr -iexten echo echoe echok stty -echoctl -echoke if [ -t 0 ] ; then stty kill "^U" intr "^C" erase "^?" eof "^D" susp "^Z" \ hupcl ixon ixoff cs8 -istrip [ -r TERM_$OraIdent ] && stty `cat TERM_$OraIdent` fi #------------------------------------------------------------------------------- # Set Prompt, SCCSDIR #------------------------------------------------------------------------------- [ -r $HOME/.thishost ] && read NODE_ID SCCSDIR SYSLOG <$HOME/.thishost NODE_ID=`uname -n` if [ "$USERNAME" != "root" ]; then PS1='${NODE_ID}:${PWD}> ' else PS1='${NODE_ID}:${PWD}# ' fi export NODE_ID PS1 SCCSDIR SYSLOG alias ll="ls -al" #------------------------------------------------------------------------------- # PATH ("." is a potential security breach) and other basics #------------------------------------------------------------------------------- EDITOR=/usr/bin/vi VISUAL=vi LANG=C ENV=$HOME/.kshrc CDPATH=.:$HOME [ -r $HOME/PATH ] && PATH=$PATH:`cat $HOME/PATH` [ -r $HOME/MANPATH ] && MANPATH=$MANPATH:`cat $HOME/MANPATH` export EDITOR VISUAL LANG CDPATH ENV PATH MANPATH #------------------------------------------------------------------------------- # Set OS-, applic- and user specific environment #------------------------------------------------------------------------------- OSspecific="$HOME/.`uname -s`" [ -r ${OSspecific} ] && . ${OSspecific} 2>/dev/null [ -r $HOME/.Application ] && . $HOME/.Application 2>/dev/null [ -r $HOME/$OraIdent/.profile ] && . $HOME/$OraIdent/.profile 2>/dev/null trap 1 2 3 15 echo Welcome, $SUfullusername