Command substitution / word splitting question

2010-05-05 Thread Binarus
Hi all, the bash reference manual states in chapter 3.5.7: "The shell scans the results of parameter expansion, command substitution, and arithmetic expansion that did not occur within double quotes for word splitting.". I thought I had understood this, but then came across a problem. Let's look

Incorrect / Inconsistent behavior with nameref assignments in functions

2020-08-28 Thread Binarus
ite sure about is that the behavior, whether or not it is correct, should not differ between the two variants. The attributes -a and -i in this case should not make any difference, but actually make a fundamental difference. Thank you very much, and best regards, Binarus

Re: Incorrect / Inconsistent behavior with nameref assignments in functions

2020-08-28 Thread Binarus
On 28.08.2020 17:28, Greg Wooledge wrote: > On Fri, Aug 28, 2020 at 10:56:34AM +0200, Binarus wrote: >> #!/bin/bash >> >> function Dummy() { >> >> local -n namerefArray="$1" >> local -a -i myArray=("${namerefArray[@]}") &g

Re: Incorrect / Inconsistent behavior with nameref assignments in functions

2020-08-28 Thread Binarus
On 28.08.2020 17:37, Oğuz wrote: > 28 Ağustos 2020 Cuma tarihinde Greg Wooledge yazdı: > >> On Fri, Aug 28, 2020 at 10:56:34AM +0200, Binarus wrote: >>> #!/bin/bash >>> >>> function Dummy() { >>> >>> local -n namerefArray="$1&quo

Re: Incorrect / Inconsistent behavior with nameref assignments in functions

2020-08-28 Thread Binarus
rs until bash 5.1 arrives in debian (the current testing and even the current unstable obviously will include 5.0). The second script not copying the integer attribute is no problem. We can just use the first script :-) Once again, thank you very much for all your effort and testing! Best regards, Binarus

Re: Incorrect / Inconsistent behavior with nameref assignments in functions

2020-08-28 Thread Binarus
At first, thank you very much for your effort and the understandable explanation. On 28.08.2020 20:28, Robert Elz wrote: > Date:Fri, 28 Aug 2020 18:25:23 +0200 > From: Binarus > Message-ID: <8313a366-6ecd-5e87-5552-6a4e0fe18...@binarus.de> > >

Re: Incorrect / Inconsistent behavior with nameref assignments in functions

2020-08-28 Thread Binarus
Thank you very much for your effort, testing and support! On 29.08.2020 01:46, Koichi Murase wrote: > 2020-08-28 22:04 Binarus : >> Description: >> >> >> Under certain circumstances, assignments of namerefs to local variables >> in functions beha

Re: Incorrect / Inconsistent behavior with nameref assignments in functions

2020-08-30 Thread Binarus
On 30.08.2020 02:59, Koichi Murase wrote: > 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 th

Re: Incorrect / Inconsistent behavior with nameref assignments in functions

2020-08-30 Thread Binarus
anything that is more complex than a one-liner. Even though bash 5.1 seems to solve my current problem, I suspect that there are more surprises like this which I just haven't come across yet. Thank you very much, and best regards, Binarus

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 '