File tree Expand file tree Collapse file tree 2 files changed +15
-31
lines changed Expand file tree Collapse file tree 2 files changed +15
-31
lines changed Original file line number Diff line number Diff line change 10
10
# ~/.bash_profile. Personal aliases and functions should go into
11
11
# ~/.bashrc.
12
12
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
- }
27
-
28
- pathprepend () {
29
- pathremove $1 $2
30
- local PATHVARIABLE=${2:- PATH}
31
- export $PATHVARIABLE =" $1 ${! PATHVARIABLE: +: ${! PATHVARIABLE} } "
32
- }
33
-
34
- pathappend () {
35
- pathremove $1 $2
36
- local PATHVARIABLE=${2:- PATH}
37
- export $PATHVARIABLE =" ${! PATHVARIABLE: +${! PATHVARIABLE} : } $1 "
38
- }
13
+ _IFS=" $IFS " IFS='
14
+ '
15
+ export PATH MANPATH
39
16
17
+ for pth in $( cat /etc/paths.d/._* /etc/paths /etc/paths.d/* ) ; do
18
+ PATH=" $PATH :$pth "
19
+ done 2> /dev/null
40
20
41
- # Set the initial path
42
- export PATH=/bin:/usr/bin
21
+ for pth in $( cat /etc/manpaths.d/._* /etc/manpaths /etc/manpaths.d/* ) ; do
22
+ MANPATH=" $MANPATH :$pth "
23
+ done 2> /dev/null
24
+ : ${PATH=/ bin:/ sbin:/ usr/ bin:/ usr/ sbin:/ usr/ local/ bin:/ usr/ local/ sbin}
25
+ : ${MANPATH=/ usr/ share/ man:/ usr/ local/ share/ man}
43
26
27
+ # Set the initial path
44
28
if [ $EUID -eq 0 ] ; then
45
29
pathappend /sbin:/usr/sbin
46
30
unset HISTFILE
@@ -57,6 +41,6 @@ for script in /etc/profile.d/*.sh ; do
57
41
done
58
42
59
43
# Now to clean up
60
- unset pathremove pathprepend pathappend script
61
-
44
+ unset pth script
45
+ IFS= " $_IFS "
62
46
# End /etc/profile
Original file line number Diff line number Diff line change 1
1
if [ -d ~/bin ]; then
2
- pathprepend ~ /bin
2
+ PATH="$HOME /bin:$PATH"
3
3
fi
You can’t perform that action at this time.
0 commit comments