Created
April 8, 2018 20:50
-
-
Save Trucido/7c4da232569bf111adf90e18982e4ead to your computer and use it in GitHub Desktop.
uniquefy_buttpaths
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
uniquefy_search_path () | |
{ | |
OIFS="$IFS" | |
IFS=' | |
' | |
set -- $(echo ${1+"$@"} | sed -r 's@/*:|([^\\]):@\1\n@g;H;x;s@/\n@\n@') | |
IFS="$OIFS" | |
_y="" | |
for _x ; do | |
case ":${_y}:" in | |
*:"${_x}":*) continue | |
esac | |
_y=${_y:+"$_y:"}${_x} | |
done | |
echo "${_y}" | |
unset _y _x | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment