[GRASS5] 5.7 - GIS manager - zoom and pan - change term to
execute in d.m.tcl
Hamish
hamish_nospam at yahoo.com
Wed Oct 20 21:28:16 EDT 2004
> A better solution is to install a script to re-set LD_LIBRARY_PATH,
> e.g.:
>
> #!/bin/sh
> if [ -n "$LD_LIBRARY_PATH" ] ; then
> LD_LIBRARY_PATH=$GISBASE/lib:$LD_LIBRARY_PATH
> else
> LD_LIBRARY_PATH=$GISBASE/lib
> fi
> export LD_LIBRARY_PATH
> prog="$1"
> shift
> exec "$prog" "$@"
>
> then change the "term" function to use it, e.g.:
>
> proc term {cmd args} {
> eval exec -- xterm -e $env(GISBASE)/etc/run $cmd $args &
> }
>
> The script would have to be dynamically generated to use the correct
> variable name, as is currently done for etc/Init.sh.
...
> > from the command line:
> > xterm -e "ls $LD_LIBRARY_PATH/libgrass_gis* ; g.version ; read"
> >
> > pops up a window with this output:
> > /usr/local/src/grass/grass57/dist.i686-pc-linux-gnu/lib/libgrass_gis.so
> > g.version: error while loading shared libraries: libgrass_gis.so: cannot open shared object file: No such file or directory
> >
> >
> > so $LD_LIBRARY_PATH survives, ???
>
> No. The expansion is performed by the shell from which xterm is run.
aah, yes.
> You would need to use e.g.:
>
> xterm -e sh -c 'ls $LD_LIBRARY_PATH/libgrass_gis* ; g.version ; read'
>
> [Note: *single* quotes.]
That gives:
ls: /libgrass_gis*: No such file or directory
g.version: error while loading shared libraries: libgrass_gis.so: cannot open shared object file: No such file or directory
Other checks show that $PATH and $GISBASE both survive.
So implementing the above script should fix this.
Hamish
More information about the grass-dev
mailing list