----- Original Message -----
From: "Andreas Schwab" <sch...@linux-m68k.org>
To: <dietmar_schind...@web.de>
Cc: <bug-bash@gnu.org>
Sent: Tuesday, August 24, 2021 3:19 PM
Subject: Re: Defect in manual section "Conditional Constructs" / case


On Aug 24 2021, dietmar_schind...@web.de wrote:

In the section
https://www.gnu.org/software/bash/manual/bash.html#Conditional-Constructs
in the description of the "case" command there is no mention (as far as I
can see, it doesn't follow from the documented expansions etc.) that a
_pattern_ undergoes quote removal, but it does [see e. g. case aa in
a""a)
echo match;; esac]. (One might think it does self-evidently in the
process
of "Shell Expansions" performed on the command line, but this expansion
series is not performed on the case command's _word_ and patterns - they
for
example don't undergo brace expansion -; for _word_, it is explicitly
said:
"The _word_ undergoes tilde expansion, parameter expansion, command
substitution, arithmetic expansion, and quote removal …"; for _pattern_:
"Each _pattern_ undergoes tilde expansion, parameter expansion, command
substitution, and arithmetic expansion." - quote removal is missing.)

That's because quote removal is _not_ performed.  The quotes are
significant for pattern matching, which needs to respect quoting.

Doesn't the example I gave above show that quotes are removed? If they
weren't, how could word aa with pattern a""a constitute a match?

--
Dietmar


Reply via email to