changeset 1458:4428d64c0c40

Don't hang for $CPUS=1. echo prints a newline if it has nothing to print, so wc -l always returns at least 1. Fix: echo -n
author Rob Landley <rob@landley.net>
date Thu, 04 Sep 2014 00:23:51 -0500
parents d9e937417636
children 240bd13db413
files scripts/make.sh
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/scripts/make.sh	Wed Sep 03 13:38:18 2014 -0500
+++ b/scripts/make.sh	Thu Sep 04 00:23:51 2014 -0500
@@ -199,7 +199,7 @@
   while true
   do
     PENDING="$(echo $PENDING $(jobs -rp) | tr ' ' '\n' | sort -u)"
-    [ $(echo "$PENDING" | wc -l) -lt "$CPUS" ] && break;
+    [ $(echo -n "$PENDING" | wc -l) -lt "$CPUS" ] && break;
 
     wait $(echo "$PENDING" | head -n 1) || exit 1
     PENDING="$(echo "$PENDING" | tail -n +2)"