<div dir="ltr"><br><br>On Thu, Sep 19, 2019 at 12:36 AM Rich Shepard <<a href="mailto:rshepard@appl-ecosys.com">rshepard@appl-ecosys.com</a>> wrote:<br>><br>> On Wed, 18 Sep 2019, Moritz Lennert wrote:<br>><br>> > You cannot launch GRASS GIS within the script in this way. You have to<br>> > put the actual module calls into a script and then either<br>> ><br>> > - launch GRASS GIS and from the GRASS command line launch the script, or<br>> > - follow<br>> >  <a href="https://grasswiki.osgeo.org/wiki/GRASS_and_Shell#GRASS_Batch_jobs">https://grasswiki.osgeo.org/wiki/GRASS_and_Shell#GRASS_Batch_jobs</a>,<br>> >  i.e. let the GRASS_BATCH_JOB variable point to your script<br>><br>> Moritz,<br>><br>> Through a lot of trial-and-error I've learned that all I can batch are the<br>> commands run in a single location. For each row in the Ohio-system (A-H from<br>> south to north) there are 8 columns and I was trying -- and failing -- to<br>> process each row (G1-G8) in a single batch file.<br>><br>> I've learned that I can create a shell script file that creates eight new<br>> locations, one for each column in the row.<br>><br>> But I cannot import then reproject (twice) in a single batch file because<br>> each action is done in a different location.<br>><br>> What I need to do is create 24 batch files and run each manually by setting<br>> and unsetting the GRASS_BATCH_JOB environmental variable. This is actually<br>> longer than copying and pasting lines from the inclusive (but ineffective)<br>> batch file to the command line, invoking and exiting grass after all<br>> operations in a single location.<br>><br>> I'll add a feature request for 8.x in trac to expand batch file processing<br>> so that commands such as r.in.gdal/r.import in one location can be followed<br><div>> by r.proj in other locations.</div><div><br></div><div>within a running GRASS session, you can switch the mapset (and location) with g.mapset</div><div><br></div><div>HTH,</div><div><br></div><div>Markus M<br> </div>><br>> Thanks for the pointers,<br>><br>> Rich<br>><br>><br>><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></div>