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 behaves in a way which makes namerefs compl
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>
>
>
> | > This doesn't ma
On 28.08.2020 22:08, Oğuz wrote:
>
> 5.1 is still in beta phase.
I see. I couldn't use it anyway because the script in question (where I
make heavy use of namerefs and nested function calls) is for production,
and I won't use software which I need to compile myself on those servers
for security
2020-08-28 22:04 Binarus :
> Description:
>
>
> Under certain circumstances, assignments of namerefs to local variables
> in functions behaves in a way which makes namerefs completely useless.
> Furthermore, the behavior is not consistent.
This is actually not related to namerefs and
28 Ağustos 2020 Cuma tarihinde Binarus yazdı:
>
>
> 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="$
Date:Fri, 28 Aug 2020 18:25:23 +0200
From:Binarus
Message-ID: <8313a366-6ecd-5e87-5552-6a4e0fe18...@binarus.de>
| > This doesn't make the slightest sense. What is the point of having local
| > variables then?
|
| Or namerefs ... I totally agree. Either locals
On Fri, Aug 28, 2020 at 06:20:04PM +0200, Binarus wrote:
> However, the main question is why leaving away the -a and -i in the
> second script makes things work as expected.
I'll leave aside my usual rant about -i for now. Here's your original
code:
#!/bin/bash
function Dummy() {
local -n na
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"
>>> local -a -i myArray=("${namerefArray[@]}")
>>>
>>> local
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[@]}")
>>
>> local -p
>> }
>>
>> declare -a -i myArray=('1' '2' '3')
>
> You
On Fri, Aug 28, 2020 at 06:37:00PM +0300, Oğuz wrote:
> 28 Ağustos 2020 Cuma tarihinde Greg Wooledge yazdı:
> > func1() {
> > declare -n _func1_ref="$1"
> > local _func1_i
> > ...
> > }
> >
> This doesn't make the slightest sense. What is the point of having local
> variables then?
You need
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"
> > local -a -i myArray=("${namerefArray[@]}")
> >
> > local -p
> > }
> >
> > declare -a -i myArray=('
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[@]}")
>
> local -p
> }
>
> declare -a -i myArray=('1' '2' '3')
You've got a local variable with the same name as the global
On Fri, Aug 28, 2020 at 08:00:30AM +, Gabriel Winkler wrote:
> # Causes error
> test=0
> ((test++))
> echo $?
> 1
> echo $test
> 1
https://mywiki.wooledge.org/BashFAQ/105
Exercise 1. And 2. And the whole rest of the page.
On Fri, Aug 28, 2020 at 4:04 PM Gabriel Winkler
wrote:
> # Causes error
> test=0
> ((test++))
> echo $?
> 1
>
It's not an error, just a falsy exit code. An error would probably give a
message.
But to elaborate on the earlier answers, the value of the post-increment
expression
var++ is the _old_
On 28/08/2020 09:00 am, Gabriel Winkler wrote:
Configuration Information [Automatically generated, do not change]:
Machine: x86_64
OS: linux-gnu
Compiler: gcc -I/home/abuild/rpmbuild/BUILD/bash-4.4
-L/home/abuild/rpmbuild/BUILD/bash-4.4/../readline-7.0
Compilation CFLAGS: -DPROGRAM='bash' -DCON
On 28/08/2020 09:00, Gabriel Winkler wrote:
Configuration Information [Automatically generated, do not change]:
Machine: x86_64
OS: linux-gnu
Compiler: gcc -I/home/abuild/rpmbuild/BUILD/bash-4.4
-L/home/abuild/rpmbuild/BUILD/bash-4.4/../readline-7.0
Compilation CFLAGS: -DPROGRAM='bash' -DCONF_H
Configuration Information [Automatically generated, do not change]:
Machine: x86_64
OS: linux-gnu
Compiler: gcc
Compilation CFLAGS: -DPROGRAM='bash' -DCONF_HOSTTYPE='x86_64'
-DCONF_OSTYPE='linux-gnu' -DCONF_MACHTYPE='x86_64-pc-linux-gnu'
-DCONF_VENDOR='pc' -DLOCALEDIR$
uname output: Linux cerberus
Configuration Information [Automatically generated, do not change]:
Machine: x86_64
OS: linux-gnu
Compiler: gcc -I/home/abuild/rpmbuild/BUILD/bash-4.4
-L/home/abuild/rpmbuild/BUILD/bash-4.4/../readline-7.0
Compilation CFLAGS: -DPROGRAM='bash' -DCONF_HOSTTYPE='x86_64'
-DCONF_OSTYPE='linux-gnu' -D
18 matches
Mail list logo