Re: Incorrect / Inconsistent behavior with nameref assignments in functions

2020-08-31 Thread Binarus
On 30.08.2020 20:01, Koichi Murase wrote: > 2020-08-30 19:24 Binarus : > Yes, I recognize the problem when the function isn't properly used. > But, the use of eval itself is not fatal. When another user can call > the function as in your example, > > Dummy 'myArray1[@]}"); echo Gotcha!; #' >

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

2020-08-31 Thread Greg Wooledge
On Sat, Aug 29, 2020 at 03:25:44PM -0400, Bruce Lilly wrote: > Unfortunately, because bash is GPL, I can't post the copyrighted script > which is covered by a non-GPL license. On the extremely slim chance that you are genuinely confused, and not just a troll: The GPL covers bash. The GPL does NO

Re: [PATCH] Bash 5.0+: Fix a problem that interactive sessions close with `eval {'

2020-08-31 Thread Chet Ramey
On 8/27/20 8:33 PM, Koichi Murase wrote: > Bash Version: 5.1 > Patch Level: 0 > Release Status: release > > Description: > > When a command string with an incomplete construct is supplied to > the `eval' builtin in interactive sessions, the process will be > terminated. This does not happ

Re: [PATCH] Fix segfault with self-modifying array PROMPT_COMMAND

2020-08-31 Thread Chet Ramey
On 8/30/20 9:36 PM, Koichi Murase wrote: > Bash Version: 5.1 > Patch Level: 0 > Release Status: release > > Description: > > In the devel branch (e4d38c2d: commit bash-20200819 snapshot), a > segmentation fault occurs when a prompt command stored in the array > version of PROMPT_COMMAND un

Re: Incorrect / Inconsistent behavior with nameref assignments in functions

2020-08-31 Thread Chet Ramey
On 8/28/20 4:56 AM, Binarus wrote: > Bash Version: 4.4 > Patch Level: 12 > Release Status: release > > > Description: > > > Under certain circumstances, assignments of namerefs to local variables > in functions behaves in a way which makes namerefs completely useless. > Furthermore

Re: Incorrect / Inconsistent behavior with nameref assignments in functions

2020-08-31 Thread Chet Ramey
On 8/28/20 11:28 AM, Greg Wooledge wrote: > > You've got a local variable with the same name as the global variable > that you're attempting to pass by reference. This will not work. > > Namerefs (declare -n) in bash are *not* like uplevel commands in Tcl. > They cause the referenced variable n

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

2020-08-31 Thread Chet Ramey
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 versio

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

2020-08-31 Thread Chet Ramey
On 8/29/20 3:25 PM, Bruce Lilly wrote: > Unfortunately, because bash is GPL, I can't post the copyrighted script > which is covered by a non-GPL license. This is ridiculous on its face. A script that bash executes doesn't have any relevance to bash's copyright. You might have reasons for not want

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

2020-08-31 Thread Chet Ramey
On 8/29/20 3:54 PM, Bruce Lilly 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. This is not at all the same thing, and could (and would) be handled separ

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

2020-08-31 Thread Chet Ramey
On 8/29/20 9:12 PM, Lawrence Velázquez wrote: >> Actually, it works (portably) with >> separator2=$'\057' > > (a) $'...' is not POSIX. For instance, dash does not recognize it. I believe it made the cut and will be in the next edition of the standard. -- ``The lyf so short, the craft so long