From e0727d957b8e399ec6aad4baf98d813e786989fb Mon Sep 17 00:00:00 2001 From: AngePierre Date: Thu, 10 Sep 2026 16:57:53 +0200 Subject: [PATCH] detect_platform: %q-escape output so eval survives spaces in MODEL The Jetson model string has spaces; emitted unquoted, eval ran its second word as a command ("Jetson: command not found"). printf %q makes the output safe to eval, which is how every other script consumes it. Co-Authored-By: Claude Opus 5 (1M context) --- scripts/detect_platform.sh | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/scripts/detect_platform.sh b/scripts/detect_platform.sh index 26735a9..3ae323c 100755 --- a/scripts/detect_platform.sh +++ b/scripts/detect_platform.sh @@ -49,9 +49,12 @@ case "$major" in *) jetpack="unknown" ;; esac -echo "L4T=${l4t:-unknown}" -echo "L4T_MAJOR=${major:-unknown}" -echo "JETPACK=${jetpack}" -echo "SOC=${soc}" -echo "ARCH=$(uname -m)" -echo "MODEL=${model}" +# %q-escaped so a caller can `eval` the output safely: MODEL holds spaces +# ("NVIDIA Jetson Orin Nano …"), which unquoted would make eval run "Jetson" as a +# command. +printf 'L4T=%q\n' "${l4t:-unknown}" +printf 'L4T_MAJOR=%q\n' "${major:-unknown}" +printf 'JETPACK=%q\n' "${jetpack}" +printf 'SOC=%q\n' "${soc}" +printf 'ARCH=%q\n' "$(uname -m)" +printf 'MODEL=%q\n' "${model}"