To focus on the @() syntax mentionned in this question :
[[ $OSTYPE == *@(darwin|freebsd|solaris|cygwin|openbsd)* ]]
Where does this syntax come from ? Why is it used in this case ? And what is the difference with :
[[ $OSTYPE =~ (darwin|freebsd|solaris|cygwin|openbsd) ]]
or
[[ $OSTYPE == *(darwin|freebsd|solaris|cygwin|openbsd) ]]
that all seems equivalents.
Is this syntax used in place of the =~ operator for better portability with regex ?
Thanks for your clarifications