X-Git-Url: http://git.iain.cx/?a=blobdiff_plain;f=.profile.d%2FPATH.bashrc;h=4c5d535330a150da2a4bd0b54ebf05ba2e134c6b;hb=8c1da009c60a70fc256405ca5d9d044ac694a2ad;hp=1a271aa46a80c305e316d8f618312baa99059487;hpb=6b44a934006d39120df7760d7e55b6148a4e818a;p=profile.git diff --git a/.profile.d/PATH.bashrc b/.profile.d/PATH.bashrc index 1a271aa..4c5d535 100644 --- a/.profile.d/PATH.bashrc +++ b/.profile.d/PATH.bashrc @@ -27,6 +27,10 @@ function makepath() { # Check the file exists. [ -e "$DIR/$dirs" ] || return + # Set IFS to newline only so that we can read $(embedded shell commands). + JGD=$IFS + IFS=' +' # Read them. path= for dir in $(cat "$DIR/$dirs"); do @@ -37,6 +41,10 @@ function makepath() { done unset dir + # Restore IFS. + IFS=$JGD + unset JGD + # Sanitise path. path=${path#:} [ -z "$path" ] && return