[GRASS5] 5.0.2 trashes .grassrc5

Glynn Clements glynn.clements at virgin.net
Thu Mar 13 04:17:42 EST 2003


Markus Neteler wrote:

> > I see what you are trying to do, but it's the wrong approach. The
> > grass5 script itself needs to be changed to preserve argument
> > boundaries, e.g.
> > 
> > 	exec "$GISBASE/etc/Init.sh" "$GRASS_GUI" "$@"
> > 
> > Actually, the grass5 script should be reduced to just:
> > 
> > 	#!/bin/sh
> > 	GISBASE=...
> > 	export GISBASE
> > 	exec "$GISBASE/etc/Init.sh" "$@"
> > 
> > with everything else moved into Init.sh. That will work for every
> > possible combination of arguments, even those which include embedded
> > spaces, newlines, quotes etc.
> 
> I have submitted an update to 5.0/CVS/HEAD for
> src/general/init/grass.src
> src/general/init/init.sh
> 
> according to the suggestions above. White space support should be present
> (I tried on Linu only) again.

1. The updated init.sh script still uses the following idiom:

	    CMD_LINE_ARGS="$CMD_LINE_ARGS $i "

This is broken, for the reasons outlined in my previous message. Also,
it should no longer be relevant, as the code has been moved into
init.sh.

The correct way to process arguments is to have the cases for -text
and -tcltk use the "shift" command to remove those arguments from the
argument list. At the end of the loop, "$@" will hold the remaining
arguments; there should only be one of these, and it should be
referenced as "$1".

2. You have re-introduced the original awk bug at line 291:

    awk '$CMD_LINE_ARGS !~ /GRASS_GUI/ {print}' "$GISRC" > "$GISRC.$$"

This should be:

    awk '$1 !~ /GRASS_GUI/ {print}' "$GISRC" > "$GISRC.$$"

-- 
Glynn Clements <glynn.clements at virgin.net>




More information about the grass-dev mailing list