[GRASS5] 5.7 - GIS manager - zoom and pan - change term to execute in d.m.tcl

Michael Barton michael.barton at asu.edu
Wed Oct 20 23:02:52 EDT 2004


Could this somehow be worked into the init.sh script so as to do a tiny bit
to keep multiple file clutter to a minimum? If not I'd suggest to put it in
gui.tcl as a procedure, or barring that in $GISBASE/etc/d.m/script except
that it seems like some people need it for the command line in a few cases
if I understood some of the comments earlier.

Michael


On 10/20/04 6:28 PM, "Hamish" <hamish_nospam at yahoo.com> wrote:

>> 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

____________________
C. Michael Barton, Professor of Anthropology
School of Human, Cultural, and Social Change
PO Box 872402
Arizona State University
Tempe, AZ  85287-2402
USA

Phone: 480-965-6262
Fax: 480-965-7671
www: <www.public.asu.edu/~cmbarton>




More information about the grass-dev mailing list