Skip to content

key expansion prints the literal string (new-exp: 'a Sub = "${!a[@]}"' instead of indices) #239

Closed

Description

@caomengxuan666

Observed in the Linux true-baseline run (new-exp.tests, 6 stdout diff lines); likely engine-wide, not platform-specific.

Evidence (target/issue-suites/results/true-baseline/new-exp/{gnu.out,rb.out} around line 716):

a Value = 1 2 3 4 5
 GNU: a Sub = 0 1 2 3 4        RUB: a Sub = "${!a[@]}"
b Value = a b c d e
 GNU: b Sub = 0 1 2 3 4        RUB: b Sub = "${!a[@]}"   (name follows the array, structure same)
c Value = 10 20 40 80
 GNU: c Sub = 0 2 4 8          RUB: c Sub = "${!c[@]}"

The suite does Sub=${!Array[@]}-style indirect key expansion; GNU expands to the array's subscripts, rubash yields the literal text of the expansion.

Owning anchor: subst.c parameter_brace_expand / parameter_brace_expand_word ${!prefix...} family (subst.c:9777 area) - the ${!name[@]} case expands to the list of subscripts. NOTE rubash has prior art for quoted ${!arr[@]} keys (bashdb work, 2026-09 cf322dd) - the assignment-position unquoted list form here still takes the literal path.

Artifacts: as above; ledger new-exp 6 env=0.

Activity

  1. added
    bug
    gnu-baseline
    on Sep 27, 2026
  2. caomengxuan666 commented on Sep 27, 2026

    @caomengxuan666
    MemberAuthor

    已修复并合入 master(commit b2e41b4e,lane wt4/linuxfix;GNU 引用与验证见提交信息:Linux 真机 WSL 双壳验证、24 套件平价 17→19)。感谢报告!

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