On 10/30/22 6:32 AM, Oğuz wrote:
Or (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 c...@case.edu http://tiswww.cwru.edu/~chet/