just playing around with with running several GRASS modules in windows
bat-files.
example
test.bat with content:
REM ---------- @ECHO ON
g.region -p
v.in.region output=myreg2
v.db.addtable map=myreg2
v.db.addcolumn map=myreg2 columns="col1 inetger"
REM ----------
then copy the path to the bat-file into the winGRASS windows console, e.g.
C:\>D:\wd\test.bat
to run the bat file.
g.region, v.in.region and v.db.addtable are working, but the second python
module v.db.addcolumn fails.
I've tested it in several combinations, all binary modules are starting,
also the first python module, but never a second pthon module listed in the
bat-file.
On Wed, Jun 14, 2017 at 8:39 AM, Helmut Kudrnovsky <hellik@web.de> wrote:
hi,
just playing around with with running several GRASS modules in windows
bat-files.
example
test.bat with content:
REM ---------- @ECHO ON
g.region -p
v.in.region output=myreg2
v.db.addtable map=myreg2
v.db.addcolumn map=myreg2 columns="col1 inetger"
typo in 'inetger'?
how does it fail?
REM ----------
then copy the path to the bat-file into the winGRASS windows console, e.g.
C:\>D:\wd\test.bat
to run the bat file.
g.region, v.in.region and v.db.addtable are working, but the second python
module v.db.addcolumn fails.
I've tested it in several combinations, all binary modules are starting,
also the first python module, but never a second pthon module listed in the
bat-file.
if you have several python modules listed in the bat file, only the first
one starts, the other aren't invoked.
the reason may be: in winGRASS the python scripts are invoked by bat-file
wrapper; if the first python module is started, it changes to the e.g.
v.db.addtable.bat, invokes the python script, but then it doesnt't come back
to test.bat, therefore the next python module in the list isn't started.
if you have several python modules listed in the bat file, only the first
one starts, the other aren't invoked.
the reason may be: in winGRASS the python scripts are invoked by bat-file
wrapper; if the first python module is started, it changes to the e.g.
v.db.addtable.bat, invokes the python script, but then it doesnt't come
back to test.bat, therefore the next python module in the list isn't
started.
the solution is to call the python script wrapper:
REM ---------- @ECHO ON
g.region -p
v.in.region output=myreg3
call v.db.addtable map=myreg3
echo module done
call v.db.addcolumn map=myreg3 columns="col1 integer"
REM ----------
if you have several python modules listed in the bat file, only the first
one starts, the other aren't invoked.
the reason may be: in winGRASS the python scripts are invoked by bat-file
wrapper; if the first python module is started, it changes to the e.g.
v.db.addtable.bat, invokes the python script, but then it doesnt't come
back to test.bat, therefore the next python module in the list isn't
started.
the solution is to call the python script wrapper:
REM ---------- @ECHO ON
g.region -p
v.in.region output=myreg3
call v.db.addtable map=myreg3
echo module done
call v.db.addcolumn map=myreg3 columns="col1 integer"
REM ----------