Skip to content

fix(ens): make setup-ens-resolver.sh run on bash 3.2 - #82

Merged
xgreenx merged 1 commit into
mainfrom
fix/setup-ens-resolver-bash-3.2
Oct 4, 2026
Merged

xgreenx merged 1 commit into
mainfrom
fix/setup-ens-resolver-bash-3.2

Conversation

@xgreenx

@xgreenx xgreenx commented Oct 4, 2026

Copy link
Copy Markdown
Contributor

scripts/setup-ens-resolver.sh lowercases addresses with ${var,,}, a bash 4 expansion. macOS ships /bin/bash 3.2, where the script stops with "bad substitution" at the owner check.

Changes

  • Owner check and read-back after setResolver: each side is lowercased with LC_ALL=C tr '[:upper:]' '[:lower:]'.
  • LC_ALL=C because macOS tr follows the locale. Unpinned, it refuses equal addresses that differ in case:
unpinned, macOS 26.3 locales that refuse
tr A-Z a-z 111 of 288
tr '[:upper:]' '[:lower:]' 2 of 288

Verified

  • /bin/bash 3.2.57: bash -n passes. It also passes on main: 3.2 rejects ${var,,} only at run time.
  • Dry run against a stub cast, offline: main stops at line 57 with "bad substitution". This branch completes for the owner in checksum, lower and upper case, and refuses another owner.
  • Both comparison blocks, cut from the file and evaluated under bash 3.2 in all 288 locales: 2304 checks, 0 wrong.
  • bash 5.2.15, GNU tr 9.1: main and this branch give identical output and exit codes over 6 dry-run cases. Old and new read-back blocks agree on 6 address pairs.
  • shellcheck 0.11.0: clean, as on main.

Not verified

  • A dry run against real KMS and RPC: the script calls 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.
  • CI: no job runs this script.

🤖 Generated with Claude Code

`${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>
@xgreenx
xgreenx merged commit c9fea63 into main Oct 4, 2026
12 checks passed
@xgreenx
xgreenx deleted the fix/setup-ens-resolver-bash-3.2 branch October 4, 2026 23:23
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.

1 participant