cat /etc/profile ## /etc/profile ## Handle interactive/terminal sessions here if tty -s then trap "" 1 2 3 eval $(ttytype -s) # ID the terminal export ERASE="^H" # Fix backspace LINES=${LINES:-""} # preset to "" if undefined (GSP/MP/iLO) COLUMNS=${COLUMNS:-""} if [[ "$LINES" = "" || "$COLUMNS" = "" ]] then eval $(resize) # terminal ID is not clean - fixup with resize [[ "$LINES" = "" ]] && LINES=24 # failsafe assignment [[ "$COLUMNS" = "" ]] && COLUMNS=80 fi echo "To read copyright, type: cat /etc/copyright" stty erase "^H" kill "^U" intr "^C" eof "^D" -parity ixoff stty susp \^Z dsusp \^Y tabs echo "$(tput rmln)$(tput sgr0)\c" # Turn off labels HN=$(hostname) HN=${HN%%.*} # simple hostname, no FQDN [[ $(id -u) -eq 0 ]] && TAG="#" || TAG="$" # PS1 shows lowest 2 directories only export PS1='$HN ${PWD##${PWD%/*/*}/} $TAG ' [[ -r /etc/MANPATH ]] && MANPATH=$(cat /etc/MANPATH) || MANPATH=/usr/share/man:/usr/contrib/man:/usr/local/man trap 1 2 3 ## end of interactive fi ## Setup common items here if [[ ! -d /usr/sbin ]] then PATH=$PATH:/sbin elif [[ -r /etc/PATH ]] then # Insure that $PATH includes /usr/bin [[ $(grep -c -e "^/usr/bin$" \ -e "^/usr/bin:" \ -e ":/usr/bin:" \ -e ":/usr/bin$" \ /etc/PATH) -eq 0 ]] && PATH=`cat /etc/PATH` || PATH=$PATH:$(cat /etc/PATH) fi