diff options
author | Rob Landley <rob@landley.net> | 2014-09-04 00:23:51 -0500 |
---|---|---|
committer | Rob Landley <rob@landley.net> | 2014-09-04 00:23:51 -0500 |
commit | 9bb73ade0bb019c0819052d27c34959ec55dbe02 (patch) | |
tree | c42b52f2afb5e9a32aa539ded5b6f70cbe387e2d | |
parent | 01e6a73bf9506803bd1725726177f55e58498dba (diff) | |
download | toybox-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
-rwxr-xr-x | scripts/make.sh | 2 |
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)" |