[GRASS-user] Stopping/killing a "puased" command
Stefan.Blumentrath at nina.no
Thu Oct 30 01:06:57 PDT 2014
I am trying to combine a commandline tool (MarZone) with GRASS in a shell script (MSYS in OSGeo4W or Ubuntu).
The MarZone command should run in a loop where it recives new input from GRASS in each iteration.
My scripts works in principle, however, unlike other command line tools, MarZone does not end when it is done, but one has to press enter to stop.
It ends with "Press return to exit." on screen.
In order to handle this in a loop, I simply kill the process after the time I expect the sofware to run (plus a little time buffer):
perl -e 'alarm shift @ARGV; exec @ARGV' 60 ./MarZone_x64.exe
Unfortunately, this is neither an effient nor a stable solution as the time the software runs can vary quite a bit, depending on some parameter settings.
My question is, is there a way to somehow catch, that the software is ready (when it prints "Press return to exit."), an kill it then?
Thanks for helping,
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the grass-user