]>
Commit | Line | Data |
---|---|---|
da5e21dc MT |
1 | # Begin ~/.bash_profile |
2 | ||
3 | # Personal environment variables and startup programs. | |
4 | ||
5 | # Personal aliases and functions should go in ~/.bashrc. System wide | |
6 | # environment variables and startup programs are in /etc/profile. | |
7 | # System wide aliases and functions are in /etc/bashrc. | |
8 | ||
9 | append () { | |
10 | # First remove the directory | |
11 | local IFS=':' | |
12 | local NEWPATH | |
13 | for DIR in $PATH; do | |
14 | if [ "$DIR" != "$1" ]; then | |
15 | NEWPATH=${NEWPATH:+$NEWPATH:}$DIR | |
16 | fi | |
17 | done | |
18 | ||
19 | # Then append the directory | |
20 | export PATH=$NEWPATH:$1 | |
21 | } | |
22 | ||
23 | if [ -f "$HOME/.bashrc" ] ; then | |
24 | source $HOME/.bashrc | |
25 | fi | |
26 | ||
27 | if [ -d "$HOME/bin" ] ; then | |
28 | append $HOME/bin | |
29 | fi | |
30 | ||
31 | unset append | |
32 | ||
33 | # End ~/.bash_profile |