> # Set the PYTHONPATH variable
> PYTHONPATH="$GISBASE/etc/python:$GISBASE/Python25:$PYTHONPATH"
> export PYTHONPATH
I don't know if it matters much for PYTHONPATH, but there is a small
issue with $PATH if set as above. If $PYTHONPATH is previously empty
then the search path becomes:
$GISBASE/etc/python:$GISBASE/Python25:
The final ":" at the end causes the pwd (".") to be added to the path.
that isn't always a problem but it can lead to unexpected results.
if the "$EMPTY:" comes first in the $PATH then it is more of a problem
because the unexpected copy is run not the system copy. e.g. it's a lot
easier for a nasty person to inject a program called "ls" into your home
directory and trick you into running it by mistake.
so longer but better is
if [ -z "$PYTHONPATH" ] ; then
PYTHONPATH="$GISBASE/etc/python:$GISBASE/Python25"
else
PYTHONPATH="$GISBASE/etc/python:$GISBASE/Python25:$PYTHONPATH"
fi
export PYTHONPATH
Hamish
_______________________________________________
grass-dev mailing list
[email protected]
http://lists.osgeo.org/mailman/listinfo/grass-dev