[GRASS-dev] gis.m in wingrass: using where clause in d.vect causes error :can't read "_data(.gronsole.gronsole, 9, donecmd)": no such element in array

Michael Barton michael.barton at asu.edu
Tue Oct 24 10:57:57 EDT 2006


This error suggests that the d.vect command is failing to create an image.

Michael
__________________________________________
Michael Barton, Professor of Anthropology
School of Human Evolution & Social Change
Center for Social Dynamics & Complexity
Arizona State University

phone: 480-965-6213
fax: 480-965-7671
www: http://www.public.asu.edu/~cmbarton



> From: Moritz Lennert <mlennert at club.worldonline.be>
> Date: Tue, 24 Oct 2006 10:39:04 +0200 (CEST)
> To: Glynn Clements <glynn at gclements.plus.com>
> Cc: Huidae Cho <grass4u at gmail.com>, <michael.barton at asu.edu>,
> <grass-dev at grass.itc.it>
> Subject: Re: [GRASS-dev] gis.m in wingrass: using where clause in d.vect
> causes error :can't read "_data(.gronsole.gronsole, 9, donecmd)": no such
> element in array
> 
> On Tue, October 24, 2006 02:49, Glynn Clements wrote:
>> 
>> Moritz Lennert wrote:
>> 
>>>> IOW, "sh -c '$cmd'" will only work for commands where none of the
>>>> arguments contain either Tcl or shell metacharacters. If you want to
>>>> invoke $cmd via "sh -c ...", you have to take the list apart and
>>>> construct a command line using shell syntax.
>>>> 
>>>> E.g. (untested):
>>>> 
>>>> set shcmd ""
>>>> foreach arg $cmd {
>>>> set arg2 [regsub -all {'} $arg {'\''}]
>>>> if {$shcmd == ""} {
>>>> set shcmd "'$arg2'"
>>>> } else {
>>>> set shcmd "$shcmd '$arg2'"
>>>> }
>>>> }
>>>> set cmd [concat | sh -c $shcmd]
>>> 
>>> Finally gotten around to trying this. After adding simple quotes to the
>>> last line:
>>> 
>>>       set cmd [concat | sh -c '$shcmd']
>> 
>> That's wrong. There definitely shouldn't be quotes around the command
>> as a whole. If it doesn't work without them, that suggests that
>> something else is messing with the command.
> 
> When I don't put in these quotes, and I try to simply display a map, I get:
> 
> couldn't open "1708.1.ppm": no such file or directory
> couldn't open "1708.1.ppm": no such file or directory
>     while executing
> "image create photo mapimg.$mon -file "$outfile($mon)""
>     (procedure "MapCanvas::composite" line 21)
>     invoked from within
> "MapCanvas::composite $mon"
>     (procedure "MapCanvas::drawmap" line 40)
>     invoked from within
> "MapCanvas::drawmap $mon"
>     (procedure "MapCanvas::display_server" line 9)
>     invoked from within
> "MapCanvas::display_server"
>     ("after" script)
> 
> When I put them in, the map displays as it should.
> 
> 
>> 
>>>> However, for various reasons, it would be better if we could find a
>>>> way avoid using "sh -c ..." altogether. The problem there is that you
>>>> can't directly execute shell scripts on Windows.
>>> 
>>> agreed, but have we found a way for doing this, yet, at least
>>> theoretically ?
>> 
>> Execute commands via a launcher program.
> 
> What would be the best choice of language for such a program.
> 
> Moritz
> 




More information about the grass-dev mailing list