On Nov 27, 2008, at 14:04, David Korn wrote:
wait returns when all are complete.
How about a shell variable that limits the number of child processes.
It you try to run another process, the shell would block until
one of the running processes completes.
With old "sh" I once used a FIFO as a limiter; roughly:
mkfifo F
exec 3<F 4>F
rm F
echo "A
B
C" >&4
for P in $PROCESSES; do
( read X <&3
P
echo X>&4 ) & done
wait
(from memory; not tested)
-- gil
_______________________________________________
ast-users mailing list
[email protected]
https://mailman.research.att.com/mailman/listinfo/ast-users