You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[bug] Parser rejects bare <> redirect followed by process substitution: 'read -rt 0.1 <> <(:)' is a syntax error (GNU runs it) #325
GNU bash 5.3.0: p7-ok, rc=0 (bare <> opens fd 0 read-write; <(:) feeds a process substitution into it as the redirect target)
rubash: p7.sh: line 3: syntax error near unexpected token <``, rc=2
Minimal shape: : <> <(:).
GNU anchor
parse.y redirection word grammar: a redirection operator with NO attached word followed by another redirection is accepted — the bare <> takes no filename and defaults (see parse.yredir() production / redir.credir_open with NULL filename → r->filename NULL is legal for <>); the next <( is then lexed as a process substitution word via parse.y $(:-handling in read_token_word. If this needs a tighter citation, grep parse.y for the redirection production accepting an empty word.
Impact
pbb read_sleep idiom unparseable; any script using the fd-scrambling <> <(:) self-pipe trick (also used in timer loops) fails at parse time.
C anchor refinement: parse.y:602LESS_GREATER WORD production requires a word; the following <(:) is lexed as that WORD because read_token()'s case '<': (parse.y:3692) falls through to word reading when the peek is (, and read_token_word()'s <( path builds the process substitution inside the word. So GNU grammar = LESS_GREATER followed by a procsub-bearing word; rubash's lexer treats the second < as a new redirection operator.
Fixed by wt14/pbbfix (9930e6c, master): assign_redirect_out_target only accepted the >(... output substitution form; <> <(:) fell into missing_redirect_target. LESS_GREATER WORD (parse.y:614-619) + token-initial <( is a process substitution. Repro/write/N=0-target/<> <(echo x)/exec 3<>/classic < <(...) all byte-identical. Known RUNTIME residual (recorded, not parse): GNU <> holds the pipe write end in O_RDWR so read waits for full close (rc 142 timeout); our text-transport model EOFs at byte exhaustion (rc 1) - the || : idiom is observably identical; the timeout shape is FUNCTION_STDIN-model follow-up.
Activity
caomengxuan666 commentedon Sep 29, 2026
C anchor refinement:
parse.y:602LESS_GREATER WORDproduction requires a word; the following<(:)is lexed as that WORD becauseread_token()'scase '<':(parse.y:3692) falls through to word reading when the peek is(, andread_token_word()'s<(path builds the process substitution inside the word. So GNU grammar = LESS_GREATER followed by a procsub-bearing word; rubash's lexer treats the second<as a new redirection operator.fix(#325): `<> <(:)` parses - the read-write operator accepts an inpu…
caomengxuan666 commentedon Sep 29, 2026
Fixed by wt14/pbbfix (9930e6c, master): assign_redirect_out_target only accepted the >(... output substitution form; <> <(:) fell into missing_redirect_target. LESS_GREATER WORD (parse.y:614-619) + token-initial <( is a process substitution. Repro/write/N=0-target/<> <(echo x)/exec 3<>/classic < <(...) all byte-identical. Known RUNTIME residual (recorded, not parse): GNU <> holds the pipe write end in O_RDWR so read waits for full close (rc 142 timeout); our text-transport model EOFs at byte exhaustion (rc 1) - the || : idiom is observably identical; the timeout shape is FUNCTION_STDIN-model follow-up.