Skip to content

Commit c4321d8

Browse files
committed
bash_profile: Safety
1 parent 531d88f commit c4321d8

File tree

1 file changed

+3
-8
lines changed

1 file changed

+3
-8
lines changed

skel/.bash_profile

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,24 +12,19 @@
1212
append () {
1313
# First remove the directory
1414
local IFS=':'
15-
local NEWPATH
15+
local NEWPATH DIR
1616
for DIR in $PATH; do
1717
if [ "$DIR" != "$1" ]; then
18-
NEWPATH=${NEWPATH:+$NEWPATH:}$DIR
18+
NEWPATH="${NEWPATH:+$NEWPATH:}$DIR"
1919
fi
2020
done
2121
# Then append the directory
22-
export PATH=$NEWPATH:$1
22+
export PATH="$NEWPATH:$1"
2323
}
2424

2525
if [ -f "$HOME/.bashrc" ] ; then
2626
source $HOME/.bashrc
2727
fi
2828

29-
if [ -d "$HOME/bin" ] ; then
30-
append $HOME/bin
31-
fi
32-
33-
unset append
3429

3530
# End ~/.bash_profile

0 commit comments

Comments
 (0)