.profile: Make POSIX-compliant again

Turns out basic sh can do exactly what I wanted
Blessed be the manpages
This commit is contained in:
Salt 2018-11-21 15:38:34 -06:00
parent 00a2100047
commit 325f2850f7

View File

@ -43,8 +43,8 @@ for path in $desiredpath; do
done
unset IFS
# We remove any prepending colons to make it appear neater
while [ "${PATH:0:1}" == ":" ]; do
PATH="${PATH:1}"
while [ "${PATH#:}" != "$PATH" ]; do
PATH="${PATH#:}"
done
# Then finally set up our path
PATH="$desiredpath:$PATH"