<div dir="ltr"><div><div><br><br>On Tue, Jan 23, 2018 at 12:01 PM, Markus Neteler <<a href="mailto:neteler@osgeo.org">neteler@osgeo.org</a>> wrote:<br>><br>> On Mon, Jan 22, 2018 at 2:04 PM, Marino Vetuschi Zuccolini<br>> <<a href="mailto:zucco@dipteris.unige.it">zucco@dipteris.unige.it</a>> wrote:<br>> > Hello to all,<br>> > I’m trying to use well tested shell scripts with grass5/6 packages with a<br>> > more recent grass7 in Mint distribution (from ppa:ubuntugis/ubuntugis-stable)<br>> > realising a singular error:<br>> ><br>> > ERROR: Variable ‘LOCATION_NAME’ not set<br>> ><br>> > despite the variable declaration (with "export" keyword in bash) is made INSIDE the script<br>> > or in the directly in the terminal.<br>><br>> Do you intend to run GRASS GIS in a terminal without being explicitely<br>> in a session?<br>> If yes, please see here for instructions:<br>> <a href="https://grasswiki.osgeo.org/wiki/Working_with_GRASS_without_starting_it_explicitly#Bash_examples_.28GNU.2FLinux.29">https://grasswiki.osgeo.org/wiki/Working_with_GRASS_without_starting_it_explicitly#Bash_examples_.28GNU.2FLinux.29</a><br><br>As you can see there, LOCATION_NAME is not an environment variable, but a GRASS variable stored in $GISRC. The relevant code sniplet is<br><br>--><br># Set the global grassrc file to individual file name<br>MYGISRC="$HOME/.grassrc.$GRASS_VERSION.$$"<br><br>echo "GISDBASE: $MYGISDBASE" > "$MYGISRC"<br>echo "LOCATION_NAME: $MYLOC" >> "$MYGISRC"<br>echo "MAPSET: $MYMAPSET" >> "$MYGISRC"<br>echo "GRASS_GUI: text" >> "$MYGISRC"<br> <br># path to GRASS settings file<br>export GISRC=$MYGISRC<br><--<br><br></div>HTH,<br><br></div>Markus M<br><br><div><div>><br>> Furthermore, due to flags and parameters standardization, some (minor)<br>> changes my be needed in your scripts:<br>> <a href="https://trac.osgeo.org/grass/wiki/Grass7/NewFeatures74#MigratingfromGRASSGIS6toversion7.x">https://trac.osgeo.org/grass/wiki/Grass7/NewFeatures74#MigratingfromGRASSGIS6toversion7.x</a><br>> (at page bottom)<br>><br>> Best,<br>> Markus<br>><br>> --<br>> Markus Neteler, PhD<br>> <a href="http://www.mundialis.de">http://www.mundialis.de</a> - free data with free software<br>> <a href="http://grass.osgeo.org">http://grass.osgeo.org</a><br>> <a href="http://courses.neteler.org/blog">http://courses.neteler.org/blog</a><br>> _______________________________________________<br>> grass-user mailing list<br>> <a href="mailto:grass-user@lists.osgeo.org">grass-user@lists.osgeo.org</a><br>> <a href="https://lists.osgeo.org/mailman/listinfo/grass-user">https://lists.osgeo.org/mailman/listinfo/grass-user</a><br></div></div></div>