Repository navigation
fix(expansion): pattern, case and transform operators on array elements - #2576
Merged
Merged
Conversation
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
bashkit | b08725b | Commit Preview URL Branch Preview URL |
Oct 07 2026, 05:26 PM |
`${a[@]/x/y}`, `${a[i]#p}`, `${a[@]^^}`, `${a[@]@q}` and friends printed
the array followed by the operator text. The parser now parses these
operators after a subscript, quoted `"${a[@]op}"` / `"${@op}"` keep one
field per element, and `${v^^pat}`-style case changes honour the pattern.
Claude-Session: https://claude.ai/code/session_019aFikmptPc91Fj4N2iDXQA
chaliy
force-pushed
the
claude/param-transforms
branch
from
October 7, 2026 17:26
903e3e2 to
b08725b
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
Pattern, case and transform operators now work on array elements, whole arrays and
$@/$*:${a[@]/x/y},${a[i]#p},${a[@]%s},${a[@]^^},${m[k],},${a[@]@Q},${a[0]@U}. Quoted"${a[@]op}"and"${@op}"give one field per element.${v^^pat},${v^pat},${v,,pat}and${v,pat}change only the characters that matchpat.Why
These gaps were found by the pseudo-linus thread's Debian comparison (
shell/param-case-modification,shell/param-transform-ops). Common agent idioms such as"${files[@]##*/}"or"${args[@]@Q}"silently produced wrong output.Before
After
All match bash 5.2. The new spec file
param-array-ops.test.shhas 8 cases, each checked against real bash.Risk
Low. The interpreter already applied these operators per element; only the parser was missing the operator after
]. Per-element output keeps the existing 10 MB expansion cap.${v~}/${v~~}(undocumented case toggles) are still unsupported.Checklist
cargo test -p bashkit --lib,--test integration, bash comparisoncargo clippy -D warnings,cargo fmtcompatibility.md) andknowledge/log.mdupdatedhttps://claude.ai/code/session_019aFikmptPc91Fj4N2iDXQA
Generated by Claude Code