Repository navigation
fix(interpreter): eval syntax errors exit 2 with bash's line prefix - #2596
Merged
Merged
Conversation
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
bashkit | 1fa7d56 | Commit Preview URL Branch Preview URL |
Oct 07 2026, 09:42 PM |
chaliy
force-pushed
the
claude/eval-syntax-status
branch
from
October 7, 2026 21:12
8920905 to
4f95d26
Compare
eval parse failures now return status 2, print "bash: eval: line N:" with the offending source line, and honor the eval's redirects. Command substitution bodies are parsed from the outer line so $LINENO matches. Claude-Session: https://claude.ai/code/session_019aFikmptPc91Fj4N2iDXQA
chaliy
force-pushed
the
claude/eval-syntax-status
branch
from
October 7, 2026 21:42
4f95d26 to
1fa7d56
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Requested by Михайло · project thread
What changed
evalwith a syntax error exits with status 2 (was 1), like bash.bash: eval: line N: syntax error: ...followed bybash: eval: line N: \, both newline-terminated. N counts from the line of theeval` itself.x=$(eval "$bad" 2>&1)captures it (it was dropped before).$LINENOinside$( )counts from the outer script line instead of restarting at 1.Why
Debian-oracle gaps: scripts that probe syntax with
evaland check$? -eq 2, and scripts that log$LINENOfrom command substitutions.Before / After
eval "if then"; echo $?12x=$(eval fi 2>&1); echo "$x"bash: eval: line 1: syntax error: ......clauserc=1)x=$(echo $LINENO)13New spec file
eval-syntax-error.test.sh(4 cases), verified against bash 5.2. The parser's message wording still differs from bash'snear unexpected tokentext; tests check the prefix and status only.Risk
Low. The parser change only shifts line numbers of
$( )bodies. The two-MiB recursion stack probe (f() { f; }; funderulimit -s) needs 2028 KB on this branch and 2032 KB on main.Checklist
cargo test -p bashkit --lib,--test integration, bash_comparisoncargo clippy --all-targets -D warnings,cargo fmt --checkhttps://claude.ai/code/session_019aFikmptPc91Fj4N2iDXQA
Generated by Claude Code