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

Radim Blazek radim.blazek at gmail.com
Fri Apr 21 04:29:39 EDT 2006


The same problem appears on native port. It seems to be caused
by execl() which creates a new process instead of replacing the
current process.
http://www.koders.com/c/fidBE86F115AFA6E74AB2C152B94B88C601A2CAEEE1.aspx
#define P_WAIT		1
#define P_NOWAIT	2	/* always generates error */
#define P_OVERLAY	3
int execl(const char *path, const char *argv0, ...)
{
  return spawnve(P_OVERLAY, path, &argv0, environ);
}

I think that spawnve with P_WAIT should help, I'll try it with the native port.

Radim


On 4/21/06, Luigi Ponti <lponti at infinito.it> 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-dev mailing list