Skip to content

Instantly share code, notes, and snippets.

View DaveyDevOps's full-sized avatar

David F. Quiroga DaveyDevOps

  • The Desert Southwest, United States
View GitHub Profile
@dentearl
dentearl / gist:3278446
Last active May 8, 2020 17:53
bash loop to run tons of jobs but limit the background to a certain smaller number at a time. change the -gt 0 to be -gt _n_ to limit the number of background jobs to _n_
# primate version
for f in ../packagePrimates/analysis/comparatorWrapper-primates.*/; do
for c in A B C D; do
##########
# This block holds the background process count in check
while [ $(jobs | wc -l) -gt 0 ]; do
sleep 2;
done;
##########
for partner in simChimp simGorilla simOrang; do