]>
Commit | Line | Data |
---|---|---|
71e32384 MT |
1 | # Begin /etc/profile |
2 | # Written for Beyond Linux From Scratch | |
3 | # by James Robertson <jameswrobertson@earthlink.net> | |
4 | # modifications by Dagmar d'Surreal <rivyqntzne@pbzpnfg.arg> | |
5 | ||
6 | # System wide environment variables and startup programs. | |
cd1a2927 | 7 | |
71e32384 MT |
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 | |
11 | # ~/.bashrc. | |
cd1a2927 | 12 | |
71e32384 MT |
13 | # Functions to help us manage paths. Second argument is the name of the |
14 | # path variable to be modified (default: PATH) | |
15 | pathremove () { | |
16 | local IFS=':' | |
17 | local NEWPATH | |
18 | local DIR | |
19 | local PATHVARIABLE=${2:-PATH} | |
20 | for DIR in ${!PATHVARIABLE} ; do | |
21 | if [ "$DIR" != "$1" ] ; then | |
22 | NEWPATH=${NEWPATH:+$NEWPATH:}$DIR | |
23 | fi | |
24 | done | |
25 | export $PATHVARIABLE="$NEWPATH" | |
26 | } | |
cd1a2927 | 27 | |
71e32384 MT |
28 | pathprepend () { |
29 | pathremove $1 $2 | |
30 | local PATHVARIABLE=${2:-PATH} | |
31 | export $PATHVARIABLE="$1${!PATHVARIABLE:+:${!PATHVARIABLE}}" | |
32 | } | |
cd1a2927 | 33 | |
71e32384 MT |
34 | pathappend () { |
35 | pathremove $1 $2 | |
36 | local PATHVARIABLE=${2:-PATH} | |
37 | export $PATHVARIABLE="${!PATHVARIABLE:+${!PATHVARIABLE}:}$1" | |
38 | } | |
cd1a2927 | 39 | |
71e32384 MT |
40 | |
41 | # Set the initial path | |
42 | export PATH=/bin:/usr/bin | |
43 | ||
44 | if [ $EUID -eq 0 ] ; then | |
45 | pathappend /sbin:/usr/sbin | |
46 | unset HISTFILE | |
cd1a2927 MT |
47 | fi |
48 | ||
71e32384 MT |
49 | # Setup some environment variables. |
50 | export HISTSIZE=1000 | |
51 | export HISTIGNORE="&:[bf]g:exit" | |
52 | #export PS1="[\u@\h \w]\\$ " | |
53 | export PS1='\u@\h:\w\$ ' | |
cd1a2927 | 54 | |
71e32384 MT |
55 | for script in /etc/profile.d/*.sh ; do |
56 | if [ -r $script ] ; then | |
57 | . $script | |
58 | fi | |
59 | done | |
cd1a2927 | 60 | |
71e32384 MT |
61 | # Now to clean up |
62 | unset pathremove pathprepend pathappend | |
cd1a2927 | 63 | |
71e32384 | 64 | # End /etc/profile |