On Monday, November 25th, 2024 at 5:49 PM, Chet Ramey <chet.ra...@case.edu> wrote:
> On 11/23/24 9:29 PM, marcel.plch via Bug reports for the GNU Bourne Again > SHell wrote: > > > Thank you for clarifictaion. > > > > Maybe adding an extra clarification to the bash manpage > > in the Pattern Matching section would be a good idea? > > > I can add some clarifying text, but I figure that the since this text > appears in the section describing [...] bracket expressions that it > would have been reasonable to infer that it describes how pattern > matching treats characters between those brackets, and that if the > description of, say, character classes includes additional brackets, > then those are required. Not in one place the pattern "[[:space:]]" is mentioned. I understand that the current formulation of the manpage sounds rather obvious to you (it does to me as well now that I get it), but when reading it for the first time, I thought that the "between [ and ]" part is speaking of the brackets already contained within the "[:space:]" expression and that the check of whether or not this is a class is based on the fact that the expression has the first brace followed by a colon and the second brace lead by a colon. This small assumption lead me to losing a whole evening pulling my hair out and 3 (three!) points of reputation on Stackoverflow [0]. If adding just one sentence containing "[[:space:]]" to clarify the section a tiny bit more, I think that it is well worth it. [0] - https://stackoverflow.com/questions/79219041/bash-string-substitution-bug -- Dormouse
publickey - marcel.plch@proton.me - 0x1094A451.asc
Description: application/pgp-keys
signature.asc
Description: OpenPGP digital signature