[GRASS-user] shell script to break a vector line by a vector point

Hamish hamish_nospam at yahoo.com
Sat Nov 18 07:43:46 EST 2006


> > I just had a quick glance, but maybe it would be better to check
> > for v.append and v.out.ascii.db by looking in $GISBASE rather
> > than /usr/lib/grass/scripts? Your script wouldn't run on my
> > machine, for instance, as my scripts are in
> > /opt/grass6.3.cvs/scripts.
..
> > but can you explain a little more how to check by looking in
> > $GISBASE Is this something like g.gisenv?
> 
> instead of
> 
> if [ ! -e "/usr/lib/grass/scripts/v.out.ascii.db" ] ; then
> use
> if [ ! -e "$GISBASE/scripts/v.out.ascii.db" ] ; then


Don't use $GISBASE at all -- the add-on scripts can go anywhere. putting
them in $GISBASE means they'll likely to get deleted next time you upgrade.

e.g. put them in /usr/local/bin, ~/bin/, or $GRASS_ADDON_PATH

test to see the program exists, don't worry where it is installed,

#### check for cs2cs
if [ ! -x "`which cs2cs`" ] ; then
    echo "cs2cs program not found, install it first" 1>&2
    exit 1
fi


Hamish




More information about the grass-user mailing list