Skip to content

[bug] ${!prefix@} name-prefix expansion is 'bad substitution' (GNU lists matching variable names) #338

Closed

Description

@caomengxuan666

Found by gnusweep3 lane (cat2 e098; WSL GNU Bash 5.3.0 oracle, worktree 0fe8d0f).

Repro:

v=w
w=inner
echo "${!v}"      # works in rubash
echo "${!v@}"     # rubash: line 4: ${!v@}: bad substitution (rc=1)

GNU 5.3.0 prints inner then v (the names-with-prefix form, cf. ${!prefix*}).
rubash: first line ok, then bad substitution and rc=1.

Related-but-distinct from #239 (that one is the ${!a[@]} indirect-array-keys form printing literal).
GNU C owner: subst.c:9777 parameter_brace_expand() — the sig == '@' || sig == '*' after ${! prefix-name branch.
Artifacts: target/issue-suites/results/gnusweep3/cat2/case/e098.; minimal target/issue-suites/results/gnusweep3/probes/min/m03-bang-prefix.

Activity

  1. added
    bug
    gnu-baseline
    on Sep 30, 2026
  2. added a commit that references this issue on Sep 30, 2026
  3. caomengxuan666 commented on Sep 30, 2026

    @caomengxuan666
    MemberAuthor

    Fixed by wt20/deepsweep (11f7cfa7): ${!v@} name list — invalid_at_transform_base was eating the bang+empty-@ marker (subst.c:9978-10007).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    buggnu-baseline

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions