Last active
May 5, 2018 22:59
-
-
Save h1ros/e09a41ab5ba5eba686fabe0198442271 to your computer and use it in GitHub Desktop.
Remove duplicated path in LD_LIBRARY_PATH
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
if [ -n "$LD_LIBRARY_PATH" ]; then | |
old_PATH=$LD_LIBRARY_PATH:; LD_LIBRARY_PATH= | |
while [ -n "$old_PATH" ]; do | |
x=${old_PATH%%:*} # the first remaining entry | |
case $LD_LIBRARY_PATH: in | |
*:"$x":*) ;; # already there | |
*) LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$x;; # not there yet | |
esac | |
old_PATH=${old_PATH#*:} | |
done | |
LD_LIBRARY_PATH=${LD_LIBRARY_PATH#:} | |
unset old_PATH x | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment