-# /etc/bashrc
-
-umask 022
-unset i
-
-# are we an interactive shell?
-if [ "$PS1" ]; then
- if [ -x /usr/bin/tput ]; then
- if [ "x`tput kbs`" != "x" ]; then # We can't do this with "dumb" terminal
- stty erase `tput kbs`
- elif [ -x /usr/bin/wc ]; then
- if [ "`tput kbs|wc -c `" -gt 0 ]; then # We can't do this with "dumb" terminal
- stty erase `tput kbs`
- fi
- fi
- fi
-fi
+# Begin /etc/profile
+# Written for Beyond Linux From Scratch
+# by James Robertson <jameswrobertson@earthlink.net>
+# modifications by Dagmar d'Surreal <rivyqntzne@pbzpnfg.arg>
+
+# System wide environment variables and startup programs.
-# Path manipulation
-PATH="/sbin:/usr/sbin:/usr/local/sbin:/bin:/usr/bin:/usr/local/bin"
+# System wide aliases and functions should go in /etc/bashrc. Personal
+# environment variables and startup programs should go into
+# ~/.bash_profile. Personal aliases and functions should go into
+# ~/.bashrc.
-# No core files by default
-ulimit -S -c 0 > /dev/null 2>&1
+# Functions to help us manage paths. Second argument is the name of the
+# path variable to be modified (default: PATH)
+pathremove () {
+ local IFS=':'
+ local NEWPATH
+ local DIR
+ local PATHVARIABLE=${2:-PATH}
+ for DIR in ${!PATHVARIABLE} ; do
+ if [ "$DIR" != "$1" ] ; then
+ NEWPATH=${NEWPATH:+$NEWPATH:}$DIR
+ fi
+ done
+ export $PATHVARIABLE="$NEWPATH"
+}
-USER=`id -un`
-LOGNAME=$USER
+pathprepend () {
+ pathremove $1 $2
+ local PATHVARIABLE=${2:-PATH}
+ export $PATHVARIABLE="$1${!PATHVARIABLE:+:${!PATHVARIABLE}}"
+}
-HOSTNAME=`/bin/hostname`
-HISTSIZE=250
+pathappend () {
+ pathremove $1 $2
+ local PATHVARIABLE=${2:-PATH}
+ export $PATHVARIABLE="${!PATHVARIABLE:+${!PATHVARIABLE}:}$1"
+}
-if [ -z "$INPUTRC" -a ! -f "$HOME/.inputrc" ]; then
- INPUTRC=/etc/inputrc
+
+# Set the initial path
+export PATH=/bin:/usr/bin
+
+if [ $EUID -eq 0 ] ; then
+ pathappend /sbin:/usr/sbin
+ unset HISTFILE
fi
-export PATH USER LOGNAME HOSTNAME HISTSIZE INPUTRC
+# Setup some environment variables.
+export HISTSIZE=1000
+export HISTIGNORE="&:[bf]g:exit"
+export PS1="[\u@\h \w]\\$ "
+#export PS1='\u@\h:\w\$ '
-# LS Colors
-alias dir='ls'
-alias ll='ls -l --color=tty'
-alias ls='ls --color=tty'
+for script in /etc/profile.d/*.sh ; do
+ if [ -r $script ] ; then
+ . $script
+ fi
+done
-# IPFire language settings
-LANG=en_US.utf8
-PS1='\[\033[1;33m\]\u\[\033[1;37m\]@\[\033[1;32m\]\h\[\033[1;37m\]:\[\033[1;31m\]\w \[\033[1;36m\]\$ \[\033[0m\]'
-echo -n -e '\033%G'
+# Now to clean up
+unset pathremove pathprepend pathappend
-export LANG PS1
-# Enable colors for applications like mc....
-export TERM=xterm-color
+# End /etc/profile