I am looking to limit the number of concurrent jobs run based on process name.
I am running audio conversion on a server using pacpl with the following script but it isnt limiting jobs like i want it to.
num_jobs = 13
while [ $(ps -A | grep -v grep | grep -c pacpl) -ge $num_jobs ]
pacpl -t mp3 --outdir /my/out/dir $1 >> /var/log/pacpl/34.log &
Any help would be greatly appreciated