bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Defect in manual section "Conditional Constructs" / case


From: Dietmar P. Schindler
Subject: Re: Defect in manual section "Conditional Constructs" / case
Date: Tue, 24 Aug 2021 22:44:58 +0200

----- Original Message -----
From: "Andreas Schwab" <schwab@linux-m68k.org>
To: <Dietmar_Schindler@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_Schindler@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

[Prev in Thread] Current Thread [Next in Thread]