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.
This commit is contained in:
Frank
2026-09-16 21:43:09 -07:00
parent 87845fca22
commit 77a07ffc30
+4 -1
View File
@@ -74,7 +74,10 @@ service_start() {
trap service_start EXIT trap service_start EXIT
run_cell() { 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" mkdir -p "$dir"
if [ -s "$dir/bench.json" ]; then if [ -s "$dir/bench.json" ]; then
echo "b=$b ub=$ub: bench.json present, skipping" >&2 echo "b=$b ub=$ub: bench.json present, skipping" >&2