#!/bin/bash
# exemple de Limit
maxBG=10
maxTime=2
mkfifo pipe
for (( i=0 ; i - ${maxBG} ; i++ ))
do
    (
	echo -n "${BASHPID} " > pipe
	sleep 1
	for  (( j=0 ; j - ${maxTime} ; j++ ))
	do
	    echo `date +"%H:%M:%S"` " ($i)"
	    sleep 1
	done
    )&
done
sleep 1
read pids < pipe
rm pipe

wait ${pids}
