[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: Greg Wooledge
Subject: Re: bash "extglob" needs to upgrade at least like zsh "kshglob"
Date: Mon, 31 Oct 2022 07:20:20 -0400

On Mon, Oct 31, 2022 at 05:00:40AM +0200, Oğuz wrote:
> 31 Ekim 2022 Pazartesi tarihinde Martin D Kealey <martin@kurahaupo.gen.nz>
> yazdı:
> > If we use the standard POSIX BRE or ERE, then there's no additional code to
> > ship; it's included as part of the OS. The hard part is what to do with
> > (!LIST), which was the point of my previous post.
> That'd be clunkier than what we already have. Bash targets many platforms
> and it'd have to target as many regex engines if it were to translate
> extglobs to posix regexes. You can't expect all of them to be compatible
> with each other, and they are not. So, if we wish to translate extglobs to
> regexes and have them work regardless of the platform, the easiest way
> forward is to adopt a third party regex engine; about which I said enough
> in my previous email.

Bash already uses the POSIX regex functions (regcomp(3) et al.) to do
[[ =~ ]] using POSIX ERE.  If it weren't for !(list) it would be possible,
even easy, for bash to convert extglobs into POSIX EREs, syntactically,
and then call the same libraries it's already calling.

I'm not sure where your claim of incompatibility comes from.

Regardling !(list), I know that many people use it.  It's fairly
popular, at least among the sort of people who come to IRC asking how
they can match all files except foo and bar.  So, simply dropping it
would not be a viable option.

reply via email to

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