# /etc/profile

# PLEASE DON'T CHANGE /etc/profile. Chances are that your changes will
#  be lost during the next upgrade. 
# Use /etc/profile.local for your favourite global aliases, your VISUAL and
#  EDITOR variables, etc ...

PROFILEREAD=true


umask 022

# adjust some limits (see bash(1))
ulimit -d 5000		# max data size of a program is 5 MB
ulimit -s 5000		# max stack size of a program is 5 MB
ulimit -m 5000		# max resident set size is 5 MB
ulimit -Sc 0			# don't create core files

#
# make path more comfortable
#
MACHINE=`test -x /bin/uname && /bin/uname -m`
PATH=/usr/bin:/bin
for DIR in ~/bin/$MACHINE ~/bin ; do
    test -d $DIR && PATH=$DIR:$PATH
done
#test "$UID" = 0 && PATH=/sbin:/usr/sbin:$PATH
test "$UID" = 0 && PATH=/sbin:/usr/sbin:/usr/local/sbin/:$PATH
for DIR in /usr/lib/java/bin \
           /var/lib/dosemu \
           /usr/games/bin \
           /usr/games \
           /opt/bin \
           /opt/gnome/bin \
           /opt/kde/bin \
	   /usr/openwin/bin ; do
    test -d $DIR && PATH=$PATH:$DIR
done
test "$UID" = 0 || PATH="$PATH:."
export PATH

#
# set some environment variables
#

if [ -x /usr/bin/dircolors ] ; then
  #
  # set up the color-ls environment variables:
  #
  if test -f ~/.dir_colors ; then
    eval `dircolors -b ~/.dir_colors`
  elif test -f /etc/DIR_COLORS ; then
    eval `dircolors -b /etc/DIR_COLORS`
  fi
fi

# do not save dupes in the bash history file
HISTCONTROL=ignoredups
export HISTCONTROL

#
# ls color option depends on the terminal
# If LS_COLROS is set but empty, the terminal has no colors.
#
if test "${LS_COLORS+empty}" = "${LS_COLORS:+empty}" ; then
    LS_OPTIONS=--color=tty
else
    LS_OPTIONS=--color=none
fi
if test "$UID" = 0 ; then
    LS_OPTIONS="-a -N $LS_OPTIONS -T 0"
else
    LS_OPTIONS="-N $LS_OPTIONS -T 0"
fi
export LS_OPTIONS

alias ls='ls $LS_OPTIONS'
alias dir='ls -l'
alias ll='ls -l'
alias la='ls -la'
alias l='ls -alF'
alias ls-l='ls -l'
alias o='less'
alias ..='cd ..'
alias ...='cd ../..'
alias rd=rmdir
alias md='mkdir -p'
alias unix2dos='recode lat1..ibmpc'
alias dos2unix='recode ibmpc..lat1'
alias unzip='unzip -L'
alias which='type -p'
alias rehash='hash -r'
alias beep='echo -en "\x07"'

alias unmount='echo "Error: Try the command: umount"'

function remount { /bin/mount -o remount,$* ; }

#
# set prompt
#
#PS1='`hostname`:`pwd`# '
if [ -n "$BASH_VERSION" ] ; then
    # set -P
    set -p
    if test "$UID" = 0 ; then
        PS1="\h:\w # "
    else
        PS1="\u@\h:\w > "
    fi
    # PROMPT_COMMAND='PS1=`if test "$UID" = 0 ; then \
    #         echo "\h:\`pwd -P\` # " ; \
    #     else \
    #         echo "\u@\h:\`pwd -P\` > " ; \
    #     fi `'
    # export PROMPT_COMMAND
else
    PS1='\h:\w \$ '
    #PS1='\u \w \$ '
fi
PS2='> '
ignoreeof=0
export PS1 PS2 ignoreeof
if [ -n "$KSH_VERSION" ]; then
 if [ -r /etc/ksh.kshrc ]; then
  . /etc/ksh.kshrc
 fi
 if [ -r $HOME/.kshrc ]; then
  . $HOME/.kshrc
 fi
fi

#
# and now let's look if there is a local profile (for stuff not 
# defined by SuSE Linux, but your friendly admin)
#
test -e /etc/profile.local && . /etc/profile.local

unset DIR
TZ=UTC0
TERM=vt100
MIBS=ALL
MIBDIRS=/usr/local/share/snmp/mibs
export TZ
export TERM
export MIBS
export MIBDIRS

