[GRASSLIST:832] Re: bash scripts don't wait for grass

Luigi Ponti lponti at infinito.it
Sun Apr 23 23:55:00 EDT 2006


Thanks Benjamin and Radim for the reply.

I will try to make the script as verbose as I can.
Another thing I find useful, although not exactly elegant, is to send 
the script to "sleep" for a couple of seconds --you have to adjust it 
iteratively. It is not a path to efficiency but if nothing else works, 
you can at least get the job done.

Ciao,

Luigi


Benjamin Ducke wrote:
> Hmmm, I think there is one major problem with CygWin and
> Unix scripting in general: CygWin really is Windows, thus
> incapable of doing a few basic things that true Unix can.
>
> One really sore spot is the fact that Windows cannot redirect
> the stderr output. The CygWin console suffers from the same
> defficiency. If you have a module that tries to redirect
> its stderr to a file, e.g. for hiding status messages, you
> will get a total mess!
>
> I ran into the same problem a while ago and found no solution
> other than this:
>
> Disable all sorts of message hiding, quiet options etc. in
> the modules causing problems and make them dump there full
> verbose output to the console. This is the only place where
> stderr does not make a mess in Windows.
> This means that you will get a lot of unwanted status messages
> on your console, but at least your processes will run in clean
> order.
>
> If anyone has a better solution for this, I would be very
> interested to know, indeed!
>
> Best,
>
> Benjamin
>
>
>
>
> Luigi Ponti wrote:
>> Hello,
>>
>> Maybe unrelated but I remember a similar question on the list.
>>
>> When I run a ~400 lines bash script to batch process more than just a 
>> couple of files, the script kind of of gets tangled and stops before 
>> processing the last file (it is basically v.in.ascii importing plus 
>> v.rast.idw interpolating, and some Perl scripts), as if some 
>> overlapping between child processes occurred.
>>
>> I tried with the "wait" bash command which should have fixed it, but 
>> it still occurs. Is it a known issue? Or is it related to the fact 
>> that I am running grass60 on cygwin?
>>
>> Any hints to make grass batch processing more reliable will be 
>> appreciated.
>>
>> Thanks,
>>
>> Luigi
>>
>>
>>
>




More information about the grass-user mailing list