aboutsummaryrefslogtreecommitdiffstats
path: root/test2.sh
diff options
context:
space:
mode:
Diffstat (limited to 'test2.sh')
-rwxr-xr-xtest2.sh13
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