mpcium icon indicating copy to clipboard operation
mpcium copied to clipboard

File setup_identities.sh fails on macOS due to BSD sed regex incompatibility

Open musashi0x opened this issue 10 months ago • 0 comments

Description

The script setup_identities.sh does not work on macOS because it uses a GNU sed-style regular expression that is not compatible with BSD sed (the default on macOS). This causes the script to crash during the chain_code replacement step.

Error Log

sed: 1: "s|^([[:space:]]*chain_c ...": \1 not defined in the RE

Root Cause

macOS uses BSD sed, while most Linux systems use GNU sed. The script relies on features that only work in GNU sed: • Extended regex groups without -E • \1 backreference not recognized due to regex mismatch

Example problematic pattern:

sed "s|^([[:space:]]*chain_code:).*|\1 \"$CHAIN_CODE\"|"

This works in GNU sed but fails in BSD sed.

Steps to Reproduce

  1. Run the script on macOS: ./setup_identities.sh

  2. Script crashes with: sed: 1: "...": \1 not defined in the RE

Environment

OS: macOS (Apple Silicon) Shell: zsh sed version: BSD sed

musashi0x avatar Jan 20 '26 10:01 musashi0x