Geoff Clare <g...@opengroup.org> wrote: > Robert Elz <k...@munnari.oz.au> wrote, on 11 Apr 2018: > > > > Lower down, it says ... > > > > In order from the beginning to the end of the case statement, each > > pattern > > that labels a compound-list shall be subjected to tilde expansion, > > parameter > > expansion, command substitution, and arithmetic expansion, and the > > result > > [note: no quote removal] > > of these expansions shall be compared against the expansion of word, > > The missing quote removal here is a known defect in the standard. > See http://austingroupbugs.net/view.php?id=985 > > > Not doing quote removal on patterns is correct. > > No it isn't. As bug 985 notes: > > $ case 'foo bar' in "foo bar") echo "quotes removed";; esac > quotes removed
In the Bourne Shell, this matches the C-string "foo bar" against the pattern \f\o\o\ \ \b\a\r since the "case pattern" is subject of macro expansion that expands '"' quoted strings to strings with quoted characters. Jörg -- EMail:jo...@schily.net (home) Jörg Schilling D-13353 Berlin joerg.schill...@fokus.fraunhofer.de (work) Blog: http://schily.blogspot.com/ URL: http://cdrecord.org/private/ http://sf.net/projects/schilytools/files/'