Test for a prefix without double brackets
Test for a prefix in POSIX sh with a case pattern such as release-*), which works in dash and every other shell where double brackets are a syntax error.
A script that runs under #!/bin/sh cannot use [[ $s == pre* ]], so a prefix test needs the construct every POSIX shell has.
s=release-2.4
case $s in
release-*) echo "starts with release-" ;;
*) echo "no match" ;;
esacstarts with release-s=release-2.4
if [[ $s == release-* ]]; then echo yes; fimain.sh: 2: [[: not foundEach case pattern is matched with the shell's pattern matching rules, so a trailing star means "anything after this". The construct is part of the POSIX shell command language, and unlike [, it needs no quoting of the glob. The second run shows what dash does with double brackets on Debian 12.
Pattern matching in case is a glob, not a regular expression, and an unquoted variable on the pattern side is itself treated as a pattern. Quote it, as in "$prefix"*, when it can contain a star or a question mark.