Repository navigation
fix(ens): make setup-ens-resolver.sh run on bash 3.2 - #82
Merged
Merged
Conversation
`${var,,}` is a bash 4 expansion. macOS ships /bin/bash 3.2, which
parses it and then stops with "bad substitution" at the owner check, so
the script cannot run there, dry run included.
Both comparisons now lowercase through `tr` under LC_ALL=C. macOS `tr`
follows the locale: unpinned, `A-Z` mis-maps hex digits in 111 of the
288 locales on macOS 26.3 and `[:upper:]` in 2, and equal addresses in
different case are refused.
Assisted-by: Claude Fable 5.1
Signed-off-by: Green Baneling <XgreenX9999@gmail.com>
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.
scripts/setup-ens-resolver.shlowercases addresses with${var,,}, a bash 4 expansion. macOS ships/bin/bash3.2, where the script stops with "bad substitution" at the owner check.Changes
setResolver: each side is lowercased withLC_ALL=C tr '[:upper:]' '[:lower:]'.LC_ALL=Cbecause macOStrfollows the locale. Unpinned, it refuses equal addresses that differ in case:tr A-Z a-ztr '[:upper:]' '[:lower:]'Verified
/bin/bash3.2.57:bash -npasses. It also passes onmain: 3.2 rejects${var,,}only at run time.cast, offline:mainstops at line 57 with "bad substitution". This branch completes for the owner in checksum, lower and upper case, and refuses another owner.tr9.1:mainand this branch give identical output and exit codes over 6 dry-run cases. Old and new read-back blocks agree on 6 address pairs.main.Not verified
cast wallet address --aws, and this ran without AWS access.--execute: never run. The read-back comparison ran only as a block cut from the file.🤖 Generated with Claude Code