X-Git-Url: http://git.iain.cx/?a=blobdiff_plain;f=.profile.d%2FPATH.bashrc;h=4c5d535330a150da2a4bd0b54ebf05ba2e134c6b;hb=8c1da009c60a70fc256405ca5d9d044ac694a2ad;hp=66d61b3b304716b2bb881bb83ea1e7053e03886c;hpb=7e973fb6a4ec8da564b4621658e2c4d583560d33;p=profile.git diff --git a/.profile.d/PATH.bashrc b/.profile.d/PATH.bashrc index 66d61b3..4c5d535 100644 --- a/.profile.d/PATH.bashrc +++ b/.profile.d/PATH.bashrc @@ -27,15 +27,24 @@ 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 + dir=$(eval echo "$dir") [ -d "$dir" ] || continue path="$path:$dir" done unset dir + # Restore IFS. + IFS=$JGD + unset JGD + # Sanitise path. path=${path#:} [ -z "$path" ] && return