#
# C.STOLL's .profile
# for /bin/sh & /bin/bash
#
umask 002
############################
# Set the default X server #
############################
if [ ${DISPLAY:-setdisplay} = setdisplay ]
then
if [ ${REMOTEHOST:-islocal} != islocal ]
then
DISPLAY=${REMOTEHOST}:0
else
DISPLAY=:0
fi
export DISPLAY
fi
############################
# Custom Path Deffinitions #
############################
pathalreadydone=`echo "$PATH" | awk -F: '{
path = ENVIRON["PATH"]
ndirs = split(path, pathlist, ":")
for (i = 1; i <= ndirs; i++) {print pathlist[i]}
}' | grep '~'`
if [ "$pathalreadydone" = "" ]; then
PATH=$PATH~:
PATH=$PATH~/bin:
PATH=$PATH/xyzuser/root/bin:
PATH=$PATH/xyzuser/root/bin/updaters:
fi
###########################################################
# Add some "Linux" settings (make the console friendlier) #
###########################################################
if [ -e /usr/freeware/bin/ls ]; then
alias ls='/usr/freeware/bin/ls --color --classify --human-readable'
alias dir='/usr/freeware/bin/ls --color --classify --human-readable -l'
fi
if [ -e /usr/freeware/bin/mcedit ]; then
alias edt='/usr/freeware/bin/mcedit'
alias edit='/usr/freeware/bin/mcedit'
fi
#################
# Misc. Aliases #
#################
alias del='rm -i'
alias cls='clear'
############################################
# If it is available use BASH as my shell, #
# if not use /bin/sh #
############################################
if [ "$SHELL" != '/bin/bash' ];
then
# This runs when we first login.
# It switches us to bash, if it exists.
if [ -e /bin/bash ];
then
SHELL=/bin/bash
/bin/bash
exit
else
echo "[01;37m"
echo "/bin/bash not found."
echo "Using $SHELL"
echo "[00m"
fi
else
# This runs only when we switch to bash.
# These niceties only work with bash.
if [ -e ~/bin/quote ];
then
# Print my login quote.
~/bin/quote
echo ""
else
echo "Quote program, ~/bin/quote, missing"
fi
# Set my prompt and titlebar message.
# Titlebar: \h=hostname =time(24hr) \w=pwd
# Prompt: \u=username \h=host
PS1="\[]0c\u@\h.na.xyz.com < > \w\]\u@\h>"
fi