bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[bugreport] declare -n z is inconsistent with the z


From: Melvin
Subject: [bugreport] declare -n z is inconsistent with the z
Date: Sun, 8 Aug 2021 15:27:05 +0200

From: m
To: bug-bash@gnu.org
Subject: declare -n z is inconsistent with the z

Configuration Information [Automatically generated, do not change]:
Machine: x86_64
OS: linux-gnu
Compiler: gcc
Compilation CFLAGS: -g -O2 -fdebug-prefix-map=/build/bash-a6qmCk/bash-5.0=.
-fstack-protector-strong -Wformat -Werror=format-security -Wall
-Wno-parentheses -Wno-format-security
uname output: Linux m 5.11.0-25-generic #27~20.04.1-Ubuntu SMP Tue Jul 13
17:41:23 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
Machine Type: x86_64-pc-linux-gnu

Bash Version: 5.0
Patch Level: 17
Release Status: release

Description:
The `declare -n variable` call seems to have inconsistent behavior.
Use the Repeat-By code to see a clear example.

Repeat-By:

Example code:
```bash
declare -n z
echo "${z}"  # "" (empty)
z="somevalue"
echo "${z}"  # "" (empty)

declare -n z
echo "${z}"  # "" (empty)
z="somevalue"
echo "${z}"  # "somevalue"
```


reply via email to

[Prev in Thread] Current Thread [Next in Thread]