[GRASS-dev] Tk implemantation of a query function

Moritz Lennert mlennert at club.worldonline.be
Mon Oct 23 12:36:14 EDT 2006


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




More information about the grass-dev mailing list