Skip to content

[bug] compgen -A command/-c order: GNU keywords then builtins then PATH, rubash builtins first #1795

Closed

Description

@caomengxuan666

形状

compgen -A command(及 -c)候选集合相同、组间顺序不同:GNU 先关键字 → 再内建 → 再 PATH 命令;rubash 先内建 → 再关键字 → 再 PATH 命令。组内顺序与跨组重复(如 echo 在内建与 PATH 各出现一次)两边一致,差的只是关键字组与内建组的先后。

复现(master 202de47,GNU oracle = 自编 bash 5.3.20,两轮同集)

compgen -A command e
# GNU 前段:    else elif esac | echo enable eval exec exit export | eatmydata echo editor egrep ...
# rubash 前段: echo enable eval exec exit export | else elif esac | eatmydata echo editor egrep ...

compgen -A command t
# GNU 前段:    then time | test times trap true type typeset | tabs tac tail ...
# rubash 前段: test times trap true type typeset | then time | tabs tac tail ...

compgen -A command d
# GNU 前段:    do done | declare dirs disown | dash date ...
# rubash 前段: declare dirs disown | do done | dash date ...

compgen -c e   # 与 -A command 同形

出处

diff-hunt r9 裁定(cases ca14–ca17),两轮同集:~/workspace/rubash-hunt-runs/2026-10-26-r9/results-r8-pass1.json。旧案 #1089 处理过 -A command 去重与 -A file 排序,本条是关键字/内建两组的组间次序残差。

归宿

compgen 族修复簇(r9 同批)。在飞线收完后开簇。修复须带回归钉(测试名含本 issue 号、断言 GNU 期望)。

Regression seed: ca14–ca17。

Activity

  1. added
    bug
    gnu-baseline
    P3-low
    area:builtins
    on Oct 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

P3-lowarea:builtinsbuggnu-baseline

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions