Skip to content

Conversation

@armorshard1
Copy link
Contributor

In bash, if [ ... ] does not support pattern matching, so we have to use bash-specific double square brackets.

As an example, the following program will print no match:

#!/bin/bash

COMPILE_TARGET="mac-arm64"

if [ "$COMPILE_TARGET" == "mac-"* ]; then
	echo "match"
else
	echo "no match"
fi

But if we change it to if [[ "$COMPILE_TARGET" == "mac-"* ]] it works as expected.

I found this bug with the shellcheck program

@dktapps dktapps merged commit 68c216d into pmmp:stable Oct 30, 2025
31 checks passed
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.

2 participants