This code running on GNU bash, version 5.0.7(1)-release (x86_64-redhat-linux-gnu):
var="r=x"
case "$var" in
r=?(x|xy|xyz))
echo "suchess"
;;
esac
Is generating this error:
bash: test.sh: line 3: syntax error near unexpected token `('
bash: test.sh: line 3: ` r=?(x|xy|xyz))'
Cannot for the life of me figure out why... tested code found here and it works.