Hi,
Thanks for the heads-up.

Regards

Pete

2010/1/4 David Korn <[email protected]>


> With the version in beta, (soon to be released), you can use
> the following, to wait for background jobs and to get their
> exit status.
>
> For example, the following script:
> ==============cut here=====================
> trap 'print pid=$! completed with exit status=$?' CHLD
> for (( i= 0; i < 10; i++))
> do      { r=$((1+(RANDOM%8))); sleep $r; exit $r;} &
> done
> wait
> ==============cut here=====================
>
> produce the output
> pid=188346 completed with exit status=2
> pid=188351 completed with exit status=2
> pid=188349 completed with exit status=3
> pid=188347 completed with exit status=4
> pid=188345 completed with exit status=6
> pid=188353 completed with exit status=6
> pid=188344 completed with exit status=6
> pid=188350 completed with exit status=6
> pid=188352 completed with exit status=7
> pid=188348 completed with exit status=8
>
>
> David Korn
> [email protected]
> _______________________________________________
> ast-users mailing list
> [email protected]
> https://mailman.research.att.com/mailman/listinfo/ast-users
>
_______________________________________________
ast-users mailing list
[email protected]
https://mailman.research.att.com/mailman/listinfo/ast-users

Reply via email to