Pi's bash tool (shellPath), bench dev and the board terminal run commands with pipe-note.sh: the exit code stays the last step's (no pipefail, so | head is still 0), and a failed earlier step of the final pipeline gets one stderr line. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2 lines
267 B
Bash
2 lines
267 B
Bash
trap '__s=("${PIPESTATUS[@]}"); for __i in "${!__s[@]}"; do ((__i < ${#__s[@]} - 1)) && [[ ${__s[__i]} != 0 && ${__s[__i]} != 141 ]] && echo "[bench] 管道第 $((__i + 1)) 步退出码 ${__s[__i]};整条命令的退出码只取最后一步" >&2; done; true' EXIT;
|