Skip to content

fix(interpreter): support exec {var}>&- fd-variable redirect syntax#1060

Merged
chaliy merged 1 commit intomainfrom
fix/issue-964-exec-fd-variable
Apr 4, 2026
Merged

fix(interpreter): support exec {var}>&- fd-variable redirect syntax#1060
chaliy merged 1 commit intomainfrom
fix/issue-964-exec-fd-variable

Conversation

@chaliy
Copy link
Copy Markdown
Contributor

@chaliy chaliy commented Apr 4, 2026

Summary

  • Add parser support for {varname} fd-variable redirect syntax (e.g., exec {myfd}>&-)
  • Added fd_var: Option<String> to Redirect AST node
  • Parser detects {identifier} pattern before redirect operators via pop_fd_var()
  • Interpreter resolves fd variable from shell variables in execute_exec_builtin

Test plan

  • exec_fd_variable_close — close fd via variable reference
  • exec_fd_variable_open — open fd via variable reference
  • All 1925 bash spec tests pass
  • Full test suite passes (2226+ tests)

Closes #964

@chaliy chaliy merged commit 0b91a41 into main Apr 4, 2026
27 checks passed
@chaliy chaliy deleted the fix/issue-964-exec-fd-variable branch April 4, 2026 01:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

exec {var}>&- fd-variable redirect syntax not supported

1 participant