[Top][All Lists]

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

Re: bash "extglob" needs to upgrade at least like zsh "kshglob"

From: Chet Ramey
Subject: Re: bash "extglob" needs to upgrade at least like zsh "kshglob"
Date: Mon, 31 Oct 2022 12:06:23 -0400
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.4.0

On 10/30/22 6:32 AM, Oğuz wrote:

(g) make the existing extglob code faster and avoid introducing more
complexity into the shell.

The extglob code has reasonable performance when it's asked to do the most
common thing: check whether a given null-terminated string matches a given
(possibly extended) pattern, anchored at start and end.

The problem arises when you want to support the leftmost-longest substring
match semantics required by pattern substitution. There's no
straightforward way to simply extend the model -- you have to implement
something new that supports those semantics to replace the simple way it's
done now.

If you want to stick with bash when performance for your use case becomes
unacceptable and eschew the (easy, simple, fast) sed workarounds, you're
going to be frustrated until something changes.

``The lyf so short, the craft so long to lerne.'' - Chaucer
                 ``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, UTech, CWRU    chet@case.edu    http://tiswww.cwru.edu/~chet/

reply via email to

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