[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
Sun May 17 21:40:09 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 glynn):

 Replying to [comment:14 hamish]:

 > > The command is being treated as a string, and passed as a single
 > > argument. It should be a list, and each element should be a
 > > separate argument to "exec". See the "term" procedure in
 > > runandoutput.tcl for an example of calling "exec" with a list
 > > of arguments.
 >
 > ok, thanks.
 > but more fundamentally the $cmd string is passed from
 gis.m/runandoutput.tcl as a whole concatenated string, and so run_term in
 gtcltk/gronsole.tcl has no $args list to work with.

 In Tcl, everything is a string, including lists.

 > and how can runandoutput.tcl know how to parse apart the "Run (in
 Xterm)" command string into a series of without extra quoting parsing and
 logic? As a "document it and walk away" solution I tried replacing "" with
 {} for the quoting in my input command, but that didn't help at all.

 If you change Gronsole::run_xterm to treat $cmd as a list, then the string
 will be interpreted according to Tcl list syntax, i.e. spaces separate
 arguments, but you can provide an argument which contains spaces by using
 braces or backslashes.

 > aside: I notice gronsole.tcl uses "&" at the end of the cmd.exe
 run_xterm. does that work on windows?

 It should do. The "&" is part of the syntax of Tcl's "exec" command. The
 shell isn't involved in any way.

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


More information about the grass-dev mailing list