## 复现 ```bash dirs -Q ``` | | stdout+stderr | rc | |---|---|---| | GNU bash 5.3.0 | `bash: line 1: dirs: -Q: invalid number` + usage 行 | **2** | | rubash 764b9dde | 消息完全一致 | **1** | ## 爆炸半径(复核时收窄了 bugs.md 的初判:不是"内建 usage 统一 rc=1") 一般内建 usage/invalid-option 在 rubash 是对的:`pwd -Q` / `cd --foo` / `umask -Q` / `type -Q` → rc=2 ✔。 错的集中在 **dirstack 族数字参数验证**: | 探针 | rubash | GNU 5.3.0 | |---|---|---| | `dirs +x` | 1 | 2 | | `dirs -Q` | 1 | 2 | | `popd +x` | 1 | 2 | | `pushd +q` | 1 | 2 | | `dirs -l +q` | **0(静默通过!)** | 2 | `dirs -l +q` 连错误都不报(rc=0 无输出),比 rc=1 更糟。 ## 规范/源码依据 bash 内建的数字参数解析统一走 builtins/common.c `get_numeric_arg()`:失败时 `builtin_error("%s: invalid number", ...)` 并返回 `EX_USAGE`(=2)。dirs/popd/pushd 的 ±N 参数同源(builtins/dirs.def)。 ## 跨实现互证(huck) - [huck#519 "pushd/popd/dirs: `-N` is a NUMBER in bash, not an option — and `pushd -Q` misroutes to cd"](https://github.com/jdstanhope/huck/issues/519)(sev:medium,已修复)——dirstack 数字参数解析的同一语义点。 - [huck#513 "mapfile -n/-s with a non-numeric value: wrong message and exit code"](https://github.com/jdstanhope/huck/issues/513)(已修复)——"非数字参数 → 消息+退出码"成对正确的同族先例。 ## 证据 - 语料出处:dirstack_args_diff_check.sh:33(fragment F045) - 复核:764b9dde 仍复现 + 上述扩展探针
Activity
caomengxuan666 commentedon Oct 12, 2026
审计互证(huck 443-issue 全量对照,issues-audit we-diverge B4):本 issue 的爆炸半径表已被独立审计复现确认——
pushd -Q/dirs -Q/popd -Q三内建:消息与 usage 逐字一致(invalid number),rc 均 rubash 1 / GNU 2(huck 侧对应 huck#519 "pushd/popd/dirs:-Nis a NUMBER in bash, not an option — andpushd -Qmisroutes to cd",已修复)。语料出处:dirstack_args_diff_check.sh(fragment F045)。无需新开 issue,归并本条跟踪。fix: P1 semantic batch - errexit body adjudication, stdin rc, write-f…
caomengxuan666 commentedon Oct 12, 2026
Fixed and merged (see the linked PR in timeline).