2 # Written for Beyond Linux From Scratch
3 # by James Robertson <jameswrobertson@earthlink.net>
4 # modifications by Dagmar d'Surreal <rivyqntzne@pbzpnfg.arg>
6 # System wide environment variables and startup programs.
8 # System wide aliases and functions should go in /etc/bashrc. Personal
9 # environment variables and startup programs should go into
10 # ~/.bash_profile. Personal aliases and functions should go into
13 # Functions to help us manage paths. Second argument is the name of the
14 # path variable to be modified (default: PATH)
19 local PATHVARIABLE=${2:-PATH}
20 for DIR in ${!PATHVARIABLE} ; do
21 if [ "$DIR" != "$1" ] ; then
22 NEWPATH=${NEWPATH:+$NEWPATH:}$DIR
25 export $PATHVARIABLE="$NEWPATH"
30 local PATHVARIABLE=${2:-PATH}
31 export $PATHVARIABLE="$1${!PATHVARIABLE:+:${!PATHVARIABLE}}"
36 local PATHVARIABLE=${2:-PATH}
37 export $PATHVARIABLE="${!PATHVARIABLE:+${!PATHVARIABLE}:}$1"
41 # Set the initial path
42 export PATH=/bin:/usr/bin
44 if [ $EUID -eq 0 ] ; then
45 pathappend /sbin:/usr/sbin
49 # Setup some environment variables.
51 export HISTIGNORE="&:[bf]g:exit"
52 export PS1="[\u@\h \w]\\$ "
53 #export PS1='\u@\h:\w\$ '
55 for script in /etc/profile.d/*.sh ; do
56 if [ -r $script ] ; then
62 unset pathremove pathprepend pathappend