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.<br><br>something like that should do the trick in R<br>
<br>readLines(paste(Sys.getenv("GISBASE"), "etc", "VERSIONNUMBER", sep = "/"))<br><br><br>But if you launch R from GRASS or set some GRASS variable permanently you can simply do <br>
<br>Sys.getenv("GRASS_VERSION")<br><br><br><br><br><div class="gmail_quote">2011/9/12 Hamish <span dir="ltr"><<a href="mailto:hamish_b@yahoo.com">hamish_b@yahoo.com</a>></span><br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<div class="im">Rainer wrote:<br>
> I am using GRASS from within an R script, and would need<br>
> the GRASS version. I do not know the startup script, so grass<br>
> --version is not an option. Nevertheless, I have obviously<br>
> specified the GRASS directory where the grass executables and<br>
> scripts sit. Is there one which I can use to get the grass<br>
> version?<br>
<br>
</div>If grass is started you can use the GRASS_VERSION enviro variable<br>
or the g.version module to get it.<br>
<br>
If GRASS is not started you can look in the<br>
$GISBASE/etc/VERSIONNUMER file.<br>
<font color="#888888"><br>
<br>
Hamish<br>
</font><div><div></div><div class="h5"><br>
_______________________________________________<br>
grass-user mailing list<br>
<a href="mailto:grass-user@lists.osgeo.org">grass-user@lists.osgeo.org</a><br>
<a href="http://lists.osgeo.org/mailman/listinfo/grass-user" target="_blank">http://lists.osgeo.org/mailman/listinfo/grass-user</a><br>
</div></div></blockquote></div><br>