On Mon, 29 Sep 2025 14:30:14 +0800
Yumei Huang
Running test pasta/tcp with debug enabled would get stuck with below error:
+ printf 'DEBUG: ns socat -u OPEN:__BASEPATH__/big.bin TCP6:[__GW6__%__IFNAME__]:10003\n' lib/term: line 38: printf: `_': invalid format character
The error occurs because printf interprets the % character as the start of a format specifier, and the following '_' isn't one of them.
Fix it by replacing 'printf "${*}\n"' with 'printf "%s\n" "$*"'.
I'm not sure why, but this breaks colour highlights for me. Instead of seeing a part of this message in blue, now I get: Test layout: \033[1;34msingle passt instance with guest\033[0m.\n I can look into it if it only happens for me, or if needed. By the way (I'm not sure if it's related), I used curly brackets everywhere to unambiguously distinguish names of variables, and '*' is a name. The curly brackets are almost always optional, see POSIX.1-2024 for the cases where they are needed: https://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html#ta... ...to avoid possible issues, I just used them everywhere, and I think it would be good to keep this consistent. That is, the $* should remain as ${*}. -- Stefano