Skip to content

Comments

fix(bash): input redirections on compound commands#245

Merged
chaliy merged 1 commit intomainfrom
claude/bashkit-bash-compatibility-BsDKD
Feb 24, 2026
Merged

fix(bash): input redirections on compound commands#245
chaliy merged 1 commit intomainfrom
claude/bashkit-bash-compatibility-BsDKD

Conversation

@chaliy
Copy link
Contributor

@chaliy chaliy commented Feb 24, 2026

Summary

  • while read ... done < file and done <<< string and done << EOF now work
  • Parser's parse_trailing_redirects handles HereString/HereDoc/HereDocStrip tokens
  • Interpreter processes input redirects before compound execution, setting pipeline_stdin
  • Preserves existing pipe-based pipeline_stdin when no input redirects present

Test plan

  • 5 new tests: while read < file, herestring, heredoc, sum, for output redirect
  • Existing pipe-to-while tests still pass (regression check)
  • cargo test --all-features passes
  • cargo clippy and cargo fmt clean

while/for/if with < file, <<< herestring, and << heredoc now work.
Parser's parse_trailing_redirects handles HereString/HereDoc tokens.
Interpreter sets pipeline_stdin from input redirects before executing
compound, without interfering with pipe-based pipeline_stdin.

Adds 5 tests: while read < file, herestring, heredoc, sum from file,
for loop output redirect.

https://claude.ai/code/session_012rzB3FRw7yoQWCG1mxyW7J
@chaliy chaliy merged commit 335cb4f into main Feb 24, 2026
16 checks passed
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.

2 participants