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: Andreas Schwab
Subject: Re: Defect in manual section "Conditional Constructs" / case
Date: Tue, 24 Aug 2021 15:19:09 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux)

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.

Andreas.

-- 
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."



reply via email to

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