Skip to content

[bug] Process substitution parse admission: rejected inside array assignment a=(<(echo e)) and after leading digits cat 2>(echo x) (GNU accepts both) #339

Closed

Description

@caomengxuan666

Found by gnusweep3 lane (cat3 p009/p014; WSL GNU Bash 5.3.0 oracle, worktree 0fe8d0f). Same admission family as #325 (bare <> <(:)).

Repro A (array element):

a=(<(echo e))
cat "${a[0]}"

GNU: runs (cat: /dev/fd/63: No such file or directory — the fd is closed by the time cat runs; rc=1).
rubash: line 1: syntax error near unexpected token <'` rc=2 — parse reject.

Repro B (digit-leading word):

cat 2>(echo x)

GNU: 2>(echo x) is a WORD: literal 2 concatenated with the procsub path -> cat gets argument 2/dev/fd/63; stderr cat: 2/dev/fd/63: No such file or directory, and x is written to stderr via the procsub, rc=1.
rubash: syntax error near unexpected token ('` rc=2 — parse reject.

GNU C owner: parse.y read_token_word() (parse.y:5305) — >(/<( recognized mid-word after any word constituent; array-element words go through the same tokenizer (parse.y mkwdarray / array assignment path).
Artifacts: target/issue-suites/results/gnusweep3/cat3/case/p009.* / p014.; minimals target/issue-suites/results/gnusweep3/probes/min/m04-procsub-array. / m05-procsub-digit.*

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 (edda851f): array a=(<(e)), digit-word 2>(echo x), and mid-word p<(x)q all admit (parse.y:5490-5524 shellexp, :5729-5738 got_token, :7140 parse_compound_assignment; subst.c:1311/11349 extract_process_subst). Residual: temp-vs-/dev/fd lifecycle is #355 class.

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