[GRASS-dev] Re: [GRASS GIS] #604: /usr/lib/grass64/etc/grass-run.sh does not work properly when called by gis.m to execute in a external xterm

GRASS GIS trac at osgeo.org
Tue May 19 13:18:46 EDT 2009


#604: /usr/lib/grass64/etc/grass-run.sh does not work properly when called by
gis.m to execute in a external xterm
-----------------------+----------------------------------------------------
  Reporter:  frankie   |       Owner:  grass-dev at lists.osgeo.org
      Type:  defect    |      Status:  new                      
  Priority:  critical  |   Milestone:  6.4.0                    
 Component:  Tcl       |     Version:  6.4.0 RCs                
Resolution:            |    Keywords:  xterm                    
  Platform:  Linux     |         Cpu:  Unspecified              
-----------------------+----------------------------------------------------
Comment (by hamish):

 I've checked in r37289 which calls $cmd as a list, but it's still not
 right. I could get a little closer by using

 {{{
   [lindex $cmd 0] [split [lrange $cmd 1 end]]
 }}}

 instead of $cmd, but then it treats $* as a single argv string:

 {{{
 argv[ 0] = 'print_args'
 argv[ 1] = 'v.db.select'
 argv[ 2] = 'roads where=\"label ~ 'highway'\"'

 =================================================================
 If you wish to resize the X monitor, do so now. Window size is
 locked while interactive modules are running.
 =================================================================

 Sorry, <roads where> is not a valid parameter

 ERROR: Required parameter <map> not set:
     (Name of input vector map).
 }}}


 or if I quote with {} instead of "":

 {{{
 argv[ 0] = 'print_args'
 argv[ 1] = 'v.db.select'
 argv[ 2] = 'roads where=\{label ~ 'highway'\}'
 }}}


 and if I replace $cmd with
 {{{
  ... [lindex $cmd 0] [lindex $cmd 1] [lrange $cmd 2 end] ] &
 }}}

 I get

 {{{
 argv[ 0] = 'print_args'
 argv[ 1] = 'v.db.select'
 argv[ 2] = 'roads'
 argv[ 3] = 'where=\{label ~ 'highway'\}'
 }}}

 there was an idea was to write the command to a g.tempfile then /bin/sh
 that, but I'd rather keep everything in memory.


 Hamish

-- 
Ticket URL: <https://trac.osgeo.org/grass/ticket/604#comment:18>
GRASS GIS <http://grass.osgeo.org>


More information about the grass-dev mailing list