[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Bash parameter expansion (remove largest trailing match, remove larg
From: |
Chet Ramey |
Subject: |
Re: Bash parameter expansion (remove largest trailing match, remove largest leading match, pattern replacement) does not work |
Date: |
Mon, 31 Aug 2020 11:44:45 -0400 |
User-agent: |
Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:68.0) Gecko/20100101 Thunderbird/68.11.0 |
On 8/29/20 10:22 AM, Bruce Lilly wrote:
> Bash Version: 5.0
> Patch Level: 17
> Release Status: release
>
> Description:
> Bash parameter expansion (remove largest trailing match, remove
> largest leading match, pattern replacement) does not work
> Tested on OpenSUSE Leap 15.2, bash version 4.4.2.3(1)-release
> (x86_64-suse-linux-gnu)
> OpenBSD 6.7 bash version 5.0.17(1)-release (x86_64-unknown-openbsd6.7)
> NetBSD 9.0 bash version 5.0.17(1)-release (x86_64--netbsd)
> FreeBSD 12.1-STABLE bash version 5.0.18(2)-release (amd64-portbld-freebsd12.1)
>
> Same results in all cases; this report posted from NetBSD 9.0.
There are a number of things wrong with this report; I think later messages
in the thread cover them. In short,
1. BRE bracket expression matching doesn't perform backslash-interpretation
of anything, except to quote the next character, much less octal
constant expansion;
2. You need `shopt -s extglob' to enable the pattern matching you want to
use.
Chet
--
``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/
- Re: Bash parameter expansion (remove largest trailing match, remove largest leading match, pattern replacement) does not work, (continued)
- Re: Bash parameter expansion (remove largest trailing match, remove largest leading match, pattern replacement) does not work, Koichi Murase, 2020/08/29
- Re: Bash parameter expansion (remove largest trailing match, remove largest leading match, pattern replacement) does not work, Bruce Lilly, 2020/08/29
- Re: Bash parameter expansion (remove largest trailing match, remove largest leading match, pattern replacement) does not work, Koichi Murase, 2020/08/29
- Re: Bash parameter expansion (remove largest trailing match, remove largest leading match, pattern replacement) does not work, Bruce Lilly, 2020/08/29
- Re: Bash parameter expansion (remove largest trailing match, remove largest leading match, pattern replacement) does not work, Lawrence Velázquez, 2020/08/29
- Re: Bash parameter expansion (remove largest trailing match, remove largest leading match, pattern replacement) does not work, Bruce Lilly, 2020/08/29
- Re: Bash parameter expansion (remove largest trailing match, remove largest leading match, pattern replacement) does not work, Robert Elz, 2020/08/30
- Re: Bash parameter expansion (remove largest trailing match, remove largest leading match, pattern replacement) does not work, Chet Ramey, 2020/08/31
- Re: Bash parameter expansion (remove largest trailing match, remove largest leading match, pattern replacement) does not work, Ángel, 2020/08/29
Re: Bash parameter expansion (remove largest trailing match, remove largest leading match, pattern replacement) does not work, Bruce Lilly, 2020/08/29
Re: Bash parameter expansion (remove largest trailing match, remove largest leading match, pattern replacement) does not work,
Chet Ramey <=