[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
${parameter@A} doesn't work should no value be set
From: |
Michal Pesa |
Subject: |
${parameter@A} doesn't work should no value be set |
Date: |
Sat, 14 Jul 2018 21:10:45 +0200 |
Configuration Information:
Machine: x86_64
OS: linux-gnu
Compiler: gcc
Compilation CFLAGS: -DPROGRAM='bash' -DCONF_HOSTTYPE='x86_64'
-DCONF_OSTYPE='linux-gnu' -DCONF_MACHTYP$
uname output: Linux pish-lub 4.15.0-23-generic #25-Ubuntu SMP Wed May 23
18:02:16 UTC 2018 x86_64 x86_6$
Machine Type: x86_64-pc-linux-gnu
Bash Version: 4.4
Patch Level: 19
Release Status: release
Description:
Hello, I would like to report a bug or rather a feature I think should be
implemented. The new parameter expansions ${parameter@A} and ${parameter@a}
don't work if only attributes are set but value is not. Demo:
$ declare -r foo
$ echo ${foo@a} ${foo@A}
$ declare -p foo # output of @a @A should in my opinion match declare's
output
declare -r foo
$ declare -r bar=10
$ echo ${bar@a} ${bar@A} # outputs correctly
r declare -r bar='10'
$ declare -r var=
$ echo ${var@a} ${var@A} # setting an empty value is enough to get the
correct output
r declare -r var=''
The behavior is the same for arrays. Tested even on 5.5.0 alpha.
Thank you for your time.
- ${parameter@A} doesn't work should no value be set,
Michal Pesa <=