diff options
Diffstat (limited to 'test2.sh')
-rwxr-xr-x | test2.sh | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/test2.sh b/test2.sh new file mode 100755 index 0000000..c4d433a --- /dev/null +++ b/test2.sh @@ -0,0 +1,13 @@ +#!/bin/bash + +set -eux + +maxprocs=2 +while true; do + read filename <fifo + sh -c "sleep 10; echo 'done: $filename'" & + if test "$(jobs | wc -l)" -ge $maxprocs; then + wait + fi + sleep 1 +done |