[GRASS-dev] Tk implemantation of a query function

Moritz Lennert mlennert at club.worldonline.be
Mon Oct 23 13:19:38 EDT 2006


Thierry Gonon wrote:
> Thanks Moritz !
> 
> It helps for the beginning, but after that, the problem is that it can't run db.table (I call it this way :
> exec {db.tables driver=$DB_DRIVER database=$DB_DATABASE > /tmp/tables}
> Anyone can help me (one more time !!) ??

I am really not an expert of tcltk, so don't think I can help you much 
further, but are you sure you need curly braces here ?

If I take them away, it seems to run, with the only problem that the 
DB_DRIVER variable is empty... Are you sure this variable exists as a 
gisenv variable ? The same for DB_DATABASE and DB_GROUP ? If they do, I 
don't think that they are normally set. Try using db.connect instead.

Moritz


> 
> Thanks !
> 
> Le lundi, 23 octobre, 2006, à 19h35, Moritz Lennert <mlennert at club.worldonline.be> a écrit :
> 
>> On Mon, October 23, 2006 17:27, Thierry Gonon wrote:
>>> Hi everybody,
>>>
>>> I'm a beginner in programmation and my goal (as wanted by my boss) is to
>>> add a function to make the building of a query easier and more friendly
>>> that it is actually (so that people who don't know SQL syntax can build
>>> queries !!).
>>> I've made a first script in bash, that works quite well (for postgres, but
>>> I'm planning to extend it to other databases used by GRASS). And now,
>>> Im'trying to make it more friendly, thru Tk. My problem is the following
>>> error :
>>> Error in startup script: can't read "GRASS_WISH": no such variable
>>>     while executing
>>> "exec $GRASS_WISH "$0" "$@""
>>> If I only write "exec $GRASS_WISH" in this line, the error is that it
>>> opens a new window and freeze everything...
>>> I think my problems are very small... But can someone helps me ??
>>> I join my code to help !
>>
>> I think your second line should end with a backslash:
>>
>> #!/bin/sh
>> #Version 0.5 (15 octobre 2006)\
>> exec $GRASS_WISH "$0" "$@"
>>
>> The backslash makes sure the line with 'exec' is only visible to the
>> shell, but not to tcltk (for which it is the continuation of the commented
>> line 2).
>>
>> Moritz
>>
>>
>>
> 
> 
> Thierry Gonon
> 2 Place de l'Eglise
> 01150 LAGNIEU
> Tél : 04 74 34 49 26
> 




More information about the grass-dev mailing list