Detect empty LD_LIBRARY_PATH.
authorOleksandr Gavenko <gavenkoa@gmail.com>
Fri, 26 Sep 2014 01:18:54 +0300
changeset 708 06a040a98984
parent 707 efc6cf05e919
child 709 f66c791c839b
Detect empty LD_LIBRARY_PATH.
.env
--- a/.env	Fri Sep 19 20:03:02 2014 +0300
+++ b/.env	Fri Sep 26 01:18:54 2014 +0300
@@ -36,19 +36,18 @@
   export PATH=/sbin:$PATH
 fi
 
-if [[ ! $LD_LIBRARY_PATH =~ $HOME/usr/lib ]]; then
-  export LD_LIBRARY_PATH=$HOME/usr/lib
-else
+[[ -z $LD_LIBRARY_PATH ]] && LD_LIBRARY_PATH=$HOME/usr/lib
+if [[ ! :$LD_LIBRARY_PATH =~ :$HOME/usr/lib ]]; then
   export LD_LIBRARY_PATH="$LD_LIBRARY_PATH":$HOME/usr/lib
 fi
 
-if [[ -z "$MANPATH" ]]; then
+if [[ -z $MANPATH ]]; then
   export MANPATH=~/usr/share/man:
 elif [[ ! $MANPATH =~ $HOME/usr/share/man: ]]; then
   export MANPATH=$MANPATH:$HOME/usr/share/man:
 fi
 
-if [[ -z "$INFOPATH" ]]; then
+if [[ -z $INFOPATH ]]; then
   export INFOPATH=~/usr/share/info:
 elif [[ ! $INFOPATH =~ $HOME/usr/share/info: ]]; then
   export INFOPATH=$INFOPATH:$HOME/usr/share/info: