aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVG <vg@devys.org>2016-04-22 17:56:49 +0200
committerVG <vg@devys.org>2016-04-22 17:56:49 +0200
commit37944c977c0fa30079ca6b0c31e906974b0909be (patch)
tree3af1577c305787f0890e5f8eda84e116362d3755
parentb4dc0e4e38e5ad1c02915b1b1dd44e0e5d7816ce (diff)
downloadteaqueue-37944c977c0fa30079ca6b0c31e906974b0909be.tar.gz
teaqueue-37944c977c0fa30079ca6b0c31e906974b0909be.tar.bz2
teaqueue-37944c977c0fa30079ca6b0c31e906974b0909be.zip
Auto-commit on 6d1dbe8495b5fafbc5f50d80268d0ca5b7b097be
-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