Groups | Search | Server Info | Keyboard shortcuts | Login | Register


Groups > gnu.bash.bug > #16846

Re: Bash parameter expansion (remove largest trailing match, remove largest leading match, pattern replacement) does not work

Path csiph.com!goblin2!goblin1!goblin.stu.neva.ru!usenet.stanford.edu!not-for-mail
From Robert Elz <kre@munnari.OZ.AU>
Newsgroups gnu.bash.bug
Subject Re: Bash parameter expansion (remove largest trailing match, remove largest leading match, pattern replacement) does not work
Date Sun, 30 Aug 2020 01:30:28 +0700
Lines 33
Approved bug-bash@gnu.org
Message-ID <mailman.1719.1598725860.2469.bug-bash@gnu.org> (permalink)
References <CAPyES344Y8SAXmxCXo8DMJt2OpyzKxvBYY7Vsszw81rSgd5jHA@mail.gmail.com> <CAPyES363zNvUZHWo6imXOyC3UPU5FAbsyFGzWkcJMO-HBhT6gQ@mail.gmail.com> <20974.1598722020@jinx.noi.kre.to> <CAPyES34z6N9+3ir44QHJze=6WBMjX+3mzgBft4m_Y0N_7p=nOw@mail.gmail.com> <11537.1598723278@jinx.noi.kre.to> <11587.1598725828@jinx.noi.kre.to>
NNTP-Posting-Host lists.gnu.org
Mime-Version 1.0
Content-Type text/plain; charset=us-ascii
X-Trace usenet.stanford.edu 1598725861 31845 209.51.188.17 (29 Aug 2020 18:31:01 GMT)
X-Complaints-To action@cs.stanford.edu
Cc bug-bash@gnu.org
To Bruce Lilly <bruce.lilly@gmail.com>
Envelope-to bug-bash@gnu.org
In-Reply-To <CAPyES344Y8SAXmxCXo8DMJt2OpyzKxvBYY7Vsszw81rSgd5jHA@mail.gmail.com>
Received-SPF permerror client-ip=2001:3c8:9009:181::2; envelope-from=kre@munnari.OZ.AU; helo=munnari.OZ.AU
X-detected-operating-system by eggs.gnu.org: No matching host in p0f cache. That's all we know.
X-Spam_score_int -14
X-Spam_score -1.5
X-Spam_bar -
X-Spam_report (-1.5 / 5.0 requ) BAYES_00=-1.9, KHOP_HELO_FCRDNS=0.4, T_SPF_HELO_PERMERROR=0.01, T_SPF_PERMERROR=0.01 autolearn=no autolearn_force=no
X-Spam_action no action
X-BeenThere bug-bash@gnu.org
X-Mailman-Version 2.1.23
Precedence list
List-Id Bug reports for the GNU Bourne Again SHell <bug-bash.gnu.org>
List-Unsubscribe <https://lists.gnu.org/mailman/options/bug-bash>, <mailto:bug-bash-request@gnu.org?subject=unsubscribe>
List-Archive <https://lists.gnu.org/archive/html/bug-bash>
List-Post <mailto:bug-bash@gnu.org>
List-Help <mailto:bug-bash-request@gnu.org?subject=help>
List-Subscribe <https://lists.gnu.org/mailman/listinfo/bug-bash>, <mailto:bug-bash-request@gnu.org?subject=subscribe>
X-Mailman-Original-Message-ID <11587.1598725828@jinx.noi.kre.to>
X-Mailman-Original-References <CAPyES344Y8SAXmxCXo8DMJt2OpyzKxvBYY7Vsszw81rSgd5jHA@mail.gmail.com> <CAPyES363zNvUZHWo6imXOyC3UPU5FAbsyFGzWkcJMO-HBhT6gQ@mail.gmail.com> <20974.1598722020@jinx.noi.kre.to> <CAPyES34z6N9+3ir44QHJze=6WBMjX+3mzgBft4m_Y0N_7p=nOw@mail.gmail.com> <11537.1598723278@jinx.noi.kre.to>
Xref csiph.com gnu.bash.bug:16846

Show key headers only | View raw


    Date:        Sat, 29 Aug 2020 13:51:39 -0400
    From:        Bruce Lilly <bruce.lilly@gmail.com>
    Message-ID:  <CAPyES344Y8SAXmxCXo8DMJt2OpyzKxvBYY7Vsszw81rSgd5jHA@mail.gmail.com>


  | Evidently not enough to see the specifications for pattern matching...

But I did, and I still fail to see anywhere where anything even
suggests that [\057] means anything other than either (which it
should be is less clear) than "a '0', or a '5', or a '7'" or perhaps
the same with the addition of "or a '\'" (that is, in char classes
in glob patterns, it isn't 100% clear whether the \ is a quoting
character, leading to a quoted '0' (which is just a '0') in the
example given, or whether it is just a character.   Doesn't matter
here, neither interpretation is what you seem to expect it to mean.

Further, and probably worse here, is that you didn't bother to provide
your "shellbug" test script, so no-one can see what you're actually
doing, and repeat it for themselves.  If there was an actual bug here,
perhaps one of the people running a pre-release of bash 5.1 could determine
if the bug still exists there or had already been fixed (but there isn't
likely to be any bug here, so that probably doesn't matter).  But without
it we cannot see if you're driving bash correctly to even have an outside
chance of your extended glob patterns working (bash supports some of those
extensions, but not by default).

That lack didn't matter for the NetBSD sh bug report, as it was obvious
you were attempting non-standard extensions, that we simply don't support.
It does matter here.

kre

Back to gnu.bash.bug | Previous | Next | Find similar


Thread

Re: Bash parameter expansion (remove largest trailing match, remove largest leading match, pattern replacement) does not work Robert Elz <kre@munnari.OZ.AU> - 2020-08-30 01:30 +0700

csiph-web