Account for path entries with spaces in remove_from_path
This commit is contained in:
parent
114b81c9a4
commit
5d0a6630b9
@ -27,7 +27,10 @@ remove_from_path() {
|
|||||||
return
|
return
|
||||||
fi
|
fi
|
||||||
|
|
||||||
for path in ${PATH//:/$'\n'}; do
|
local paths
|
||||||
|
IFS=: paths=($PATH)
|
||||||
|
|
||||||
|
for path in "${paths[@]}"; do
|
||||||
path="$(expand_path "$path" || true)"
|
path="$(expand_path "$path" || true)"
|
||||||
if [ -n "$path" ] && [ "$path" != "$path_to_remove" ]; then
|
if [ -n "$path" ] && [ "$path" != "$path_to_remove" ]; then
|
||||||
result="${result}${path}:"
|
result="${result}${path}:"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user