[GRASS-user] Detecting GRASS version when only specifying GRASS
dicko.ahmadou at gmail.com
Mon Sep 12 20:12:57 EDT 2011
The way Rainer use R for scripting GRASS don't allow him to use the
GRASS_VERSION variable, so i think the only way is to use the second
solution proposed by Hamish.
something like that should do the trick in R
readLines(paste(Sys.getenv("GISBASE"), "etc", "VERSIONNUMBER", sep = "/"))
But if you launch R from GRASS or set some GRASS variable permanently you
can simply do
2011/9/12 Hamish <hamish_b at yahoo.com>
> Rainer wrote:
> > I am using GRASS from within an R script, and would need
> > the GRASS version. I do not know the startup script, so grass
> > --version is not an option. Nevertheless, I have obviously
> > specified the GRASS directory where the grass executables and
> > scripts sit. Is there one which I can use to get the grass
> > version?
> If grass is started you can use the GRASS_VERSION enviro variable
> or the g.version module to get it.
> If GRASS is not started you can look in the
> $GISBASE/etc/VERSIONNUMER file.
> grass-user mailing list
> grass-user at lists.osgeo.org
-------------- section suivante --------------
Une pi?ce jointe HTML a ?t? enlev?e...
More information about the grass-user