Skip to content

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

@ZeroToH3ro

Description

@ZeroToH3ro

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions