Skip to content

Commit 54c0dfc

Browse files
committed
profile: POSIXify
1 parent ecc8f56 commit 54c0dfc

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

profile

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,21 +10,20 @@
1010
# ~/.bash_profile. Personal aliases and functions should go into
1111
# ~/.bashrc.
1212

13-
# Enable extglob for exclusion synatxes
14-
shopt -s extglob
15-
1613
# Set up PATH and MANPATH
1714
unset PATH MANPATH
1815
_IFS='
1916
' # $' \t\n'
2017
IFS='
2118
' # $'\n'
2219
for pth in $(cat /etc/paths.d/._* /etc/paths /etc/paths.d/*); do
23-
[ "${pth:0:1}" != '#' ] && PATH="$PATH:$pth"
20+
case "$pth" in \#*) continue;; esac
21+
PATH="$PATH:$pth"
2422
done 2>/dev/null
2523

2624
for pth in $(cat /etc/manpaths.d/._* /etc/manpaths /etc/manpaths.d/*); do
27-
[ "${pth:0:1}" != '#' ] && MANPATH="$MANPATH:$pth"
25+
case "$pth" in \#*) continue;; esac
26+
MANPATH="$MANPATH:$pth"
2827
done 2>/dev/null
2928
IFS="$_IFS"
3029

@@ -38,9 +37,11 @@ export HISTFILESIZE=4096
3837
# Timezone variable $TZ, Wine and stuff alike need it.
3938
export TZ="$(readlink /etc/localtime | sed -e 's/^\.\.//g' -e 's@/usr/share/zoneinfo/@@')"
4039

41-
# Source profile scripts, excluding csh scripts
42-
for script in /etc/profile.d/!(*.csh) ; do
43-
[ -r $script ] && . "$script"
40+
# Source profile scripts
41+
for script in /etc/profile.d/* ; do
42+
# No! Go away, csh!
43+
case "$script" in *.csh) continue;; esac
44+
[ -r "$script" ] && . "$script"
4445
done
4546

4647
# Now to clean up

0 commit comments

Comments
 (0)