bug-bash
[Top][All Lists]
Advanced

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

Re: String substitution bug


From: Lawrence Velázquez
Subject: Re: String substitution bug
Date: Mon, 25 Nov 2024 15:18:17 -0500

On Mon, Nov 25, 2024, at 2:18 PM, marcel.plch via Bug reports for
the GNU Bourne Again SHell wrote:
> Not in one place the pattern "[[:space:]]" is mentioned.

Why should the "space" character class be called out in particular?
It's not special.

> If adding just one sentence containing "[[:space:]]" to
> clarify the section a tiny bit more, I think that
> it is well worth it.

I'm not opposed to modest clarification, but mentioning "[[:class:]]"
would be misleading because it would give the impression that
character class expressions must occur alone within their bracket
expressions.  "Mixed" bracket expressions are valid:

        $ unset IFS
        $ LC_ALL=C
        $ foo='a b c d e f g h i j k l m n o p'
        $ printf '<%s>\n' "${foo%%[![:blank:]abc[=d=]e-g[.h.]]*}"
        <a b c d e f g h >

Martin's suggestion of "[...[:class:]...]" would be more honest.

-- 
vq



reply via email to

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