[GRASS-user] Stopping/killing a "puased" command

Blumentrath, Stefan Stefan.Blumentrath at nina.no
Thu Oct 30 01:06:57 PDT 2014



Hi,



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):

Like this:

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?

Any idea?



Thanks for helping,

Stefan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/grass-user/attachments/20141030/9f334a8d/attachment.html>


More information about the grass-user mailing list