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

2020-08-29 Thread Bruce Lilly
Configuration Information [Automatically generated, do not change]: Machine: x86_64 OS: netbsd Compiler: gcc Compilation CFLAGS: -O2 -D_FORTIFY_SOURCE=2 -I/usr/include -Wno-parentheses -Wno-format-security uname output: NetBSD cq60-615dx.blilly.net 9.0 NetBSD 9.0 (GENERIC) #0: Fri Feb 14 00:06:28 U

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

2020-08-29 Thread Robert Elz
Date:Sat, 29 Aug 2020 10:22:39 -0400 From:Bruce Lilly Message-ID: |Bash parameter expansion (remove largest trailing match, remove | largest leading match, pattern replacement) does not work This is no more a bug in bash than it is for your similar rep

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

2020-08-29 Thread Bruce Lilly
Robert, Did you look at the relevant bash manual pages linked in the bug report? > >

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

2020-08-29 Thread Robert Elz
Date:Sat, 29 Aug 2020 13:33:37 -0400 From:Bruce Lilly Message-ID: | Did you look at the relevant bash manual pages linked in the bug report? Enough to know that [\057] doesn't mean what you seem to believe it should. kre

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

2020-08-29 Thread Bruce Lilly
On Sat, Aug 29, 2020, 13:48 Robert Elz wrote: > Date:Sat, 29 Aug 2020 13:33:37 -0400 > From:Bruce Lilly > Message-ID: n...@mail.gmail.com> > > | Did you look at the relevant bash manual pages linked in the bug > report? > > Enough to know that [\057] doesn't mean

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

2020-08-29 Thread Robert Elz
Date:Sat, 29 Aug 2020 13:51:39 -0400 From:Bruce Lilly Message-ID: | 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 (whic

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

2020-08-29 Thread Koichi Murase
2020-08-29 23:47 Bruce Lilly : > Description: > Bash parameter expansion (remove largest trailing match, > remove largest leading match, pattern replacement) does not work In short, (1) ``octal escape \057'' doesn't have special meaning in Bash glob patterns. `[\057]' means just one of a

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

2020-08-29 Thread Bruce Lilly
Please don't assume that something output by printf (without quoting) for clarity is representative of actual expansion by the shell when properly quoted. On Sat, Aug 29, 2020, 14:52 Koichi Murase wrote: > 2020-08-29 23:47 Bruce Lilly : > > Description: > > Bash parameter expansion (remo

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

2020-08-29 Thread Bruce Lilly
Thanks for the pointer to "shopt"; I'll check when I get a chance. On Sat, Aug 29, 2020, 14:52 Koichi Murase wrote: > 2020-08-29 23:47 Bruce Lilly : > > Description: > > Bash parameter expansion (remove largest trailing match, > > remove largest leading match, pattern replacement) does n

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

2020-08-29 Thread Ilkka Virta
On Sat, Aug 29, 2020 at 9:56 PM Bruce Lilly wrote: > Please don't assume that something output by printf (without quoting) for > clarity is representative of actual expansion by the shell when properly > quoted. > If you don't want people to assume (and you shouldn't, if you want them to help yo

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

2020-08-29 Thread Bruce Lilly
Unfortunately, because bash is GPL, I can't post the copyrighted script which is covered by a non-GPL license. On Sat, Aug 29, 2020, 15:22 Ilkka Virta wrote: > On Sat, Aug 29, 2020 at 9:56 PM Bruce Lilly wrote: > >> Please don't assume that something output by printf (without quoting) for >> cl

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

2020-08-29 Thread Koichi Murase
2020年8月30日(日) 3:55 Bruce Lilly : > Please don't assume that something output by printf (without > quoting) for clarity is representative of actual expansion by the > shell when properly quoted. Please don't assume that I have assumed something strange. To begin with, you didn't provide the script

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

2020-08-29 Thread Davide Brini
On Sat, 29 Aug 2020 15:25:44 -0400, Bruce Lilly wrote: > Unfortunately, because bash is GPL, I can't post the copyrighted script > which is covered by a non-GPL license. That's ridiculous. You don't have to post the whole script (neither should you), just a simple code snippet that shows the iss

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

2020-08-29 Thread Koichi Murase
2020-08-30 4:25 Bruce Lilly : > Unfortunately, because bash is GPL, I can't post the copyrighted > script which is covered by a non-GPL license. Don't worry. In this case, the GPL doesn't apply. Please read the following Q&A. https://www.gnu.org/licenses/gpl-faq.en.html#IfInterpreterIsGPL Even

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

2020-08-29 Thread Bruce Lilly
On Sat, Aug 29, 2020, 15:40 Koichi Murase wrote: > Don't worry. In this case, the GPL doesn't apply. Please read the > following Q&A. > > https://www.gnu.org/licenses/gpl-faq.en.html#IfInterpreterIsGPL > > Even if your original `shellbug' is licensed under something other, > and it prohibits to

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

2020-08-29 Thread Bruce Lilly
On Sat, Aug 29, 2020, 15:27 Koichi Murase wrote: > I assumed that you have written like > > separator2='\057' > pattern1="${number1}(${separator1})" > > because otherwise, it doesn't work with ksh93 either. > You are correct. To explain it in more detail, first, these parameter expansions w

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

2020-08-29 Thread Koichi Murase
2020-08-30 4:54 Bruce Lilly : > On Sat, Aug 29, 2020, 15:40 Koichi Murase wrote: >> Don't worry. In this case, the GPL doesn't apply. Please read the >> following Q&A. >> >> https://www.gnu.org/licenses/gpl-faq.en.html#IfInterpreterIsGPL >> >> Even if your original `shellbug' is licensed under s

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

2020-08-29 Thread Bruce Lilly
On Sat, Aug 29, 2020 at 4:53 PM Koichi Murase wrote: [...] > That's an interesting discussion. I don't know how you define the > "work", but basically GPL only affects the derivative > programs/software but not all the "work" including the output of the > programs or the knowledge obtained in run

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

2020-08-29 Thread Ángel
On 2020-08-30 at 05:53 +0900, Koichi Murase wrote: > > It's a bit more complicated than that; if, for example, some > > excerpt ended up in regression tests, there would be a question > > about whether or not there was a copyright violation. As I > > understand the GPL (IANAL), it requires all par

Re: Incorrect / Inconsistent behavior with nameref assignments in functions

2020-08-29 Thread Koichi Murase
2020-08-29 14:46 Binarus : > I am wondering when debian will include bash 5.1. It looks like > debian testing and debian unstable are on bash 5.0, so it will > probably take several years. Actually the problem of the function `Dummy' will not be solved even in bash 5.1. There is another but simil

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

2020-08-29 Thread Lawrence Velázquez
> On Aug 29, 2020, at 8:41 PM, Bruce Lilly wrote: > >> On Sat, Aug 29, 2020 at 4:53 PM Koichi Murase wrote: >> >> Yes, I know that it is confusing to those who are familiar with modern >> Perl-style regular expressions. But historically, POSIX regular >> expressions do not support the backslas

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

2020-08-29 Thread Bruce Lilly
On Sat, Aug 29, 2020 at 9:12 PM Lawrence Velázquez wrote: > (a) $'...' is not POSIX. For instance, dash does not recognize it. dash also doesn't have adequate pattern matching for the example task (building a path while ensuring no empty components); it has no way to specify one-or-more (or zero