aboutsummaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorRob Landley <rob@landley.net>2014-09-04 00:23:51 -0500
committerRob Landley <rob@landley.net>2014-09-04 00:23:51 -0500
commit9bb73ade0bb019c0819052d27c34959ec55dbe02 (patch)
treec42b52f2afb5e9a32aa539ded5b6f70cbe387e2d /scripts
parent01e6a73bf9506803bd1725726177f55e58498dba (diff)
downloadtoybox-9bb73ade0bb019c0819052d27c34959ec55dbe02.tar.gz
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
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/make.sh2
1 files changed, 1 insertions, 1 deletions
diff --git a/scripts/make.sh b/scripts/make.sh
index 23e4a9b6..3bd8b4d1 100755
--- a/scripts/make.sh
+++ b/scripts/make.sh
@@ -199,7 +199,7 @@ do
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)"