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

Patton, Eric epatton at nrcan.gc.ca
Wed Nov 8 12:50:12 EST 2006


Michael,

a lot of scripts populate GRASS environment variables at the beginning of the script, so these variables can be called by name later inthe script:

 
# Capture environment variables.
eval `g.gisenv`
: ${GISDBASE?} ${GISBASE?} ${LOCATION_NAME?} ${MAPSET?}

You see this one a lot in the Grass add-on scripts.

~ Eric.

-----Original Message-----
From: Moritz Lennert
To: Michaël Rabotin
Cc: Patton, Eric; grassuser at grass.itc.it
Sent: 11/8/2006 10:28 AM
Subject: Re: [GRASS-user] shell script to break a vector line by a vector point

Michaël Rabotin wrote:
> Thanks for the comment
> 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

Moritz

> 
> Mick
> 
> 
> 2006/11/8, Patton, Eric < epatton at nrcan.gc.ca
<mailto:epatton at nrcan.gc.ca>>:
> 
>     Michael,
> 
>     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.
> 
>     ~ Eric.
> 
>     -----Original Message-----
>     From: grassuser-bounces at grass.itc.it
>     <mailto:grassuser-bounces at grass.itc.it>
>     To: grassuser at grass.itc.it <mailto:grassuser at grass.itc.it>
>     Sent: 11/6/2006 9:24 AM
>     Subject: [GRASS-user] shell script to break a vector line by a
>     vector point
> 
>     Hi everybody
>     A few weeks ago, a discussion abour how to break a vector line by
a
>     vector point was beginned.
>     I create a script in shell to solve this issue in grass 6.0.1. You
need
>     the add on v.append and v.out.ascii.db to launch this script (add
on
>     avalaible on http://grass.gdf-hannover.de/wiki/GRASS_AddOns
>     < http://grass.gdf-hannover.de/wiki/GRASS_AddOns> )
> 
>     Mick
> 
> 
> 
>
------------------------------------------------------------------------
> 
> _______________________________________________
> grassuser mailing list
> grassuser at grass.itc.it
> http://grass.itc.it/mailman/listinfo/grassuser





More information about the grass-user mailing list