Repository navigation
fix(builtins): printf -v, readonly assignment, quoted $@ fields and */ globs like bash - #2633
Merged
Merged
Conversation
… the interpreter printf -v now assigns through the SetVariable side effect, so declare -i arithmetic, a[i] targets and readonly apply. -vNAME, invalid names, missing -v argument / format and invalid options fail with status 2. A readonly target of read/printf/getopts fails with status 1.
…lement "x$@y", x"${a[@]}"y and "${1+"$@"}" split at element boundaries like bash.
…lds, */ globs, L-STREAM-002
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
bashkit | 9194ecd | Commit Preview URL Branch Preview URL |
Oct 08 2026, 05:20 AM |
3 tasks done
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
Closes 16 of the 17 skipped BashBox
declare/ just-bash-compat spec cases, plus printf invalid-number errors.printf -vparses options like bash (-vNAME, repeated-v,--); a missing-vargument or format, a bad option or an invalid name fail with status 2 and the usage line.printf -vassigns through the interpreter likeread:declare -itargets evaluate,a[i]sets elements, locals stay local.read,printf -vandgetoptsinto a readonly variable fail withreadonly variable, status 1 (silently succeeded before).$@inside a larger word gives one field per element ("x$@y",x"${a[@]}"y);${1+"$@"}keeps the original fields./matches only directories (and symlinks to them) and keeps the slash.cp -nno longer overwrites.$'\xc3\xa9'decodes as UTF-8 text.printf '%d' abc/12abcprint0/12, reportprintf: abc: invalid number, exit 1.Why
Bash-verified cases from the BashBox corpus import (#2585) that bashkit failed.
Before
After
Matches real bash (
bash_comparison_testspass).Risk
Low to medium: printf option parsing and quoted-
$@field splitting are widely used; covered by existing and new spec cases plus real-bash differential tests. One case stays skipped (declare -pof$'\xff', L-STREAM-001).Checklist
cargo fmt --check, clippy-D warningscargo test -p bashkit -p bashkit-cli --lib --bins --tests -- --include-ignoredfoundations/builtins.md,operations/limitations.md,log.md)Generated by Claude Code