[gmx-developers] GMXRC scripts palindromes PATH

Daniel Larsson larsson at xray.bmc.uu.se
Wed Jan 5 16:57:28 CET 2011


Slightly annoying and unexpected behavior. The csh version is ok, but both the zsh and the bash version does this. It also goes for the MANPATH and the LD_LIBRARY_PATH variables.

Daniel


Here is a patch for GMXRC.bash:

--- GMXRC.bash	2011-01-05 16:39:57.370898465 +0100
+++ GMXRC_new.bash	2011-01-05 16:34:32.767682956 +0100
@@ -8,7 +8,7 @@
 tmppath=""
 for i in `echo $LD_LIBRARY_PATH | sed "s/:/ /g"`; do
   if test "$i" != "$GMXLDLIB"; then
-    tmppath="${i}${tmppath:+:}${tmppath}"
+    tmppath="${tmppath}${tmppath:+:}${i}"
   fi
 done
 LD_LIBRARY_PATH=$tmppath
@@ -17,7 +17,7 @@
 tmppath=""
 for i in `echo $PKG_CONFIG_PATH | sed "s/:/ /g"`; do
   if test "$i" != "$GMXLDLIB/pkgconfig"; then
-    tmppath="${i}${tmppath:+:}${tmppath}"
+    tmppath="${tmppath}${tmppath:+:}${i}"
   fi
 done
 PKG_CONFIG_PATH=$tmppath
@@ -26,7 +26,7 @@
 tmppath=""
 for i in `echo $PATH | sed "s/:/ /g"`; do
   if test "$i" != "$GMXBIN"; then
-    tmppath="${i}${tmppath:+:}${tmppath}"
+    tmppath="${tmppath}${tmppath:+:}${i}"
   fi
 done
 PATH=$tmppath
@@ -35,7 +35,7 @@
 tmppath=""
 for i in `echo $MANPATH | sed "s/:/ /g"`; do
   if test "$i" != "$GMXMAN"; then
-    tmppath="${i}${tmppath:+:}${tmppath}"
+    tmppath="${tmppath}${tmppath:+:}${i}"
   fi
 done
 MANPATH=$tmppath




More information about the gromacs.org_gmx-developers mailing list