[GRASS5] tcltkgrass and wish error

Eric G. Miller egm2 at jps.net
Tue Aug 27 00:08:03 EDT 2002


On Tue, Aug 27, 2002 at 03:17:10AM +0100, Glynn Clements wrote:

> It should be impossible for GRASS_WISH to be unset within GRASS
> (unless the user explicitly unsets it, in which case they deserve what
> they get).

Your forgetting users trying to execute tcltkgrass from outside a
GRASS session.

> In any case, $GRASS_WISH should be quoted, i.e.
> 
> 	exec "$GRASS_WISH" "$0" "$@"
> 
> At least this will fail immediately (albeit with a cryptic error
> message), rather than looping.
> 
> As a general principle, shell variables should almost always be
> quoted.
> 
> I would guess that, if you examined all occurrences of unquoted
> variables within GRASS' shell scripts, 1% of them would be unquoted
> for a valid reason, and 99% because the programmer simply forgot.

Well, shell scripting is something of a black art -- with quoting
rules being near the top of the list of confusing things.

-- 
Eric G. Miller <egm2 at jps.net>




More information about the grass-dev mailing list