Do not call do_build_target in a subshell, because increasing nb_defconfigs there will act on a local variable there instead of increasing the variable in the parent shell. Signed-off-by: Sascha Hauer <s.hauer@xxxxxxxxxxxxxx> --- MAKEALL | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/MAKEALL b/MAKEALL index 4dcfa4138c..75f2f63a1d 100755 --- a/MAKEALL +++ b/MAKEALL @@ -157,8 +157,8 @@ do_build() { local arch=$1 local regex=$2 - find arch/${arch}/configs -name "${regex}_defconfig" | sort | while read i - do + configs=$(find arch/${arch}/configs -name "${regex}_defconfig" | sort) + for i in ${configs}; do local target=$(basename $i) do_build_target ${arch} ${target} -- 2.39.2