2019-06-27 12:27:55 +0200, Joerg Schilling: [...] > > 4 is portable in practice. 5 as well but only because of the > > buggy fallback string comparison in ksh93. > > So you wrote this because the shell that makes @ special also > has the fallback? [...]
Well, it may be tempting to suspect that ksh93 does the fallback there for backward compatibility So that a='@(foo)'; case $a in $a) echo yes; esac outputs yes like it did in the Bourne shell or ksh88 which didn't have or didn't enable that extended operator in that case, but we know that fallback behaviour comes from Bourne shell originally and predates ksh88. same problem with a='[a]' case $a in $a) echo yes; esac outputting yes in those cases. But yes, I would say it's noteworthy to point-out that it's that ksh fallback behaviour that has the side effect of making that code more portable, if only so people don't get the wrong impression that ksh93 disables that @(...) processing in that case. -- Stephane