From 77a07ffc308e17df850e93625c61c8498401c960 Mon Sep 17 00:00:00 2001 From: Frank Date: Wed, 16 Sep 2026 21:43:09 -0700 Subject: [PATCH] scripts: fix the unbound local that killed the sweep at its first cell `local b=$1 ub=$2 dir="$OUT/b${b}_ub${ub}"` expands every argument of the builtin before the builtin assigns any of them, so $b was unbound and set -u aborted the run four seconds in - after the service was already stopped. Two statements instead. Found by running it under systemd-run: it exited non-zero with no cells run, which is exactly what the per-cell TSV is for. --- scripts/bench-batch-ubatch.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/scripts/bench-batch-ubatch.sh b/scripts/bench-batch-ubatch.sh index 47129da..084af65 100755 --- a/scripts/bench-batch-ubatch.sh +++ b/scripts/bench-batch-ubatch.sh @@ -74,7 +74,10 @@ service_start() { trap service_start EXIT run_cell() { - local b=$1 ub=$2 dir="$OUT/b${b}_ub${ub}" sampler start rc wall + # two statements: `local a=1 b=$a` expands b before the builtin assigns a, and + # set -u turns that into "b: unbound variable" + local b=$1 ub=$2 + local dir="$OUT/b${b}_ub${ub}" sampler start rc wall mkdir -p "$dir" if [ -s "$dir/bench.json" ]; then echo "b=$b ub=$ub: bench.json present, skipping" >&2