The /etc/profile configuration file is used to configure the bash shell environment and startup programs when a user logs on. This is the system-wide default configuration file for all users who log into the system.

This file is also located at: /usr/local/etc/profile on some systems.

     The settings created in the /etc/profile configuration file can be overriden by users by placing the the .bash_profile configuration file into their home directory.

Note: Redhat overrides /etc/profile with /etc/bashrc and the .bash_profile in the users home directory with .bashrc.

     The /.bashrc configuration file is a non-interactive setup file. The /.bash_profile configuration file is interactive. The non-interactive type sets environment variables permanently from interative.

#/etc/profile
	umask 022
	WHEEL=`/usr/bin/id | grep '0(wheel)'`
	if [ "$WHEEL" = "" ]; then
		ulimit -c 2     # core file limit (blocks)
	#	ulimit -f 2048  # file size (blocks)
		ulimit -n 64    # open files

		ulimit -d 6144  # data segment (kbytes)
		ulimit -l 2048  # locked mem (kbytes)
		ulimit -m 2048  # mem size (kbytes)
	#	ulimit -p 1     # pipe size (512 bytes)
		ulimit -s 2048  # stack size (kbytes)
		ulimit -t 30    # cpu time (seconds)
		ulimit -u 10    # process limit
	#	ulimit -v 2048  # virtual mem (kbytes)
		export PS1="<\u@\h> [\w] \\$ "
	else
		export PS1="<\u.wheel@\h> [\w] \\$ "
	fi
	unset WHEEL
 
	export MAIL=/st1/blank005/.newmail
	export MAILBOX=/st1/blank005/.newmail
	export MAILMSG=[You have new mail]
	export EDITOR=/usr/local/bin/pico
	export PAGER=less
	export PATH=~/bin:/usr/local/bin:/usr/bin:/bin:/usr/games:.

	alias back='cd $OLDPWD'
	alias bx='BitchX'
	alias df='df -k'
	alias dir='ls'
	alias du='du -k'
	alias edit='pico'
	alias finger='finger -m'
	alias la='/bin/ls -alF'
	alias ls='/bin/ls -F'
	alias md='mkdir'
	alias pico='pico -w'
	alias rd='rmdir'
	alias talk='ytalk'

	alias info='cat /info/info'
	alias about='less /info/about'
	alias usage='less /info/acceptable_use'
	alias copyright='less /info/copyright'
	alias disclaimer='less /info/disclaimer'
	alias news='less /info/news'
	alias sysinfo='less /info/system_info'
	export HOSTTYPE=sparc
	export OSTYPE=solaris2.5.1

	mesg y	# [ny] Display (do not display) messages from other users.
	biff y	# [ny] Be notified if mail arrives and who it is from.

	if [ $TERM = "ansi" ] then
		export TERM=vt100
	fi
	if [ $TERM = "" ] then
		if /bin/i386 then
			TERM=AT386
		else
			TERM=sun
		fi
		export TERM
	fi
	# set ENV to a file invoked each time sh is started for
	# interactive use.
	#export ENV=$HOME/.shrc
	export ENV=$HOME/.bashrc
  # /etc/profile

  # System wide environment and startup programs
  # Functions and aliases go in /etc/bashrc

  # This file sets up the following features and programs:
  #
  #   o path
  #   o prompts
  #   o a few environment variables
  #   o colour ls
  #   o less
  #   o rxvt
  #
  # Users can override these settings and/or add others in their
  # $HOME/.bash_profile

  # set a decent path
  PATH="$PATH:/usr/X11R6/bin:$HOME/bin:."

  # notify the user: login or non-login shell. If login, the prompt is
  # coloured in blue; otherwise in magenta. Root's prompt is red.
  # See the Colour-ls mini HOWTO for an explanation of the escape codes.
  USER=`whoami`
  if [ $LOGNAME = $USER ] ; then
    COLOUR=44  # blue
  else
    COLOUR=45  # magenta
  fi

  if [ $USER = 'root' ] ; then
    COLOUR=41  # red
    PATH="$PATH:/usr/local/bin"
  fi

  ESC="\033"
  PROMPT='\h'    # hostname
  STYLE=';1m'    # bold
  # PROMPT='\u'  # username
  # STYLE='m'    # plain
  PS1="\[$ESC[$COLOUR;37$STYLE\]$PROMPT:\[$ESC[37;40$STYLE\]\w\\$ "
  PS2="> "

  # no core dumps, please
  ulimit -c 0

  # set umask
  if [ `id -gn` = `id -un` -a `id -u` -gt 14 ]; then
    umask 002
  else
    umask 022
  fi

  # a few variables
  USER=`id -un`
  LOGNAME=$USER
  MAIL="/var/spool/mail/$USER"  # sendmail, postfix, smail
  # MAIL="$HOME/Mailbox"        # qmail
  NNTPSERVER=news.myisp.it      # put your own here
  VISUAL=jed
  EDITOR=jed
  HOSTNAME=`/bin/hostname`
  HISTSIZE=1000
  HISTFILESIZE=1000
  export PATH PS1 PS2 USER LOGNAME MAIL NNTPSERVER
  export VISUAL EDITOR HOSTNAME HISTSIZE HISTFILESIZE

  # enable colour ls
  eval `dircolors /etc/DIR_COLORS -b`
  export LS_OPTIONS='-s -F -T 0 --color=yes'

  # customize less
  LESS='-M-Q'
  LESSEDIT="%E ?lt+%lt. %f"
  LESSOPEN="| lesspipe.sh %s"
  LESSCHARDEF=8bcccbcc13b.4b95.33b. # show colours in ls -l | less
  # LESSCHARSET=latin1
  PAGER=less
  export LESS LESSEDIT LESSOPEN VISUAL LESSCHARDEF

  # fix the backspace key in rxvt/xterm
  CTRL_H="\010"
  NULL_STRING=" $CTRL_H" # space + backspace
  if [ "$NULL_STRING" != "" ] ; then
    stty erase ^?
  else
    stty erase ^H
  fi

  # set xterm title: full path
  case $TERM in
    xterm*)
      PROMPT_COMMAND='echo -ne "\033]0;${USER}@${HOSTNAME}: ${PWD}\007"'
      ;;
  esac

  for i in /etc/profile.d/*.sh ; do
    if [ -x $i ]; then
      . $i # beware - variables and aliases might get overridden!
    fi
  done

  # call fortune, if available
  if [ -x /usr/games/fortune ] ; then
    echo ; /usr/games/fortune ; echo
  fi