[gmx-users] MANPATH setting in GMXRC.bash

Ansgar Esztermann aeszter at gwdg.de
Wed Jan 17 14:54:59 CET 2007


On Wed, Jan 17, 2007 at 10:06:26AM +0000, Ignacio Fernández Galván wrote:
> 
> I don't know if it works differently for other versions of man/bash,
> but in my case, if MANPATH is empty, changing it to something else
> without adding an empty string is not nice.

Yes, this is so. I think the cleanest possibility would be to set the
path using manpath(1) rather than $MANPATH, like this:


--- gromacs-3.3.1/scripts/GMXRC.bash	2007-01-17 09:30:00.697904526 +0100
+++ gromacs-3.3.1-mine/scripts/GMXRC.bash	2007-01-17 14:51:36.838276115 +0100
@@ -24,7 +24,7 @@
 
 # and remove the gmx part of manpath
 tmppath=""
-for i in `echo $MANPATH | sed "s/:/ /g"`; do
+for i in `eval manpath 2>/dev/null | sed "s/:/ /g"`; do
   if test "$i" != "$GMXMAN"; then
     tmppath=${tmppath}:$i
   fi
--- gromacs-3.3.1/scripts/GMXRC.bash.in	2001-08-18 13:07:31.000000000 +0200
+++ gromacs-3.3.1-mine/scripts/GMXRC.bash.in	2007-01-17 14:51:56.128925785 +0100
@@ -24,7 +24,7 @@
 
 # and remove the gmx part of manpath
 tmppath=""
-for i in `echo $MANPATH | sed "s/:/ /g"`; do
+for i in `eval manpath 2>/dev/null | sed "s/:/ /g"`; do
   if test "$i" != "$GMXMAN"; then
     tmppath=${tmppath}:$i
   fi



A.
-- 
Ansgar Esztermann
Researcher & Sysadmin
http://www.mpibpc.mpg.de/groups/grubmueller/start/people/aeszter/index.shtml
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://maillist.sys.kth.se/pipermail/gromacs.org_gmx-users/attachments/20070117/2bb781d5/attachment.sig>


More information about the gromacs.org_gmx-users mailing list