If an empty array is declared using `declare -a NAME` and then immediately `declare -p NAME` is invoked, it says there is no such variable. However, if one assigns some values to the array, `declare -p` works then as expected.
That is: `declare -p NAME` does not work on an array which has been declared
but not yet assigned anything.
However, the array can be found in output of `declare -p` without NAME given.
Testcase:
----
$ declare -a __test
$ declare -p | grep __test
declare -- _="__test"
declare -a __test='()'
$ declare -p __test
bash: declare: __test: not found
$ __test=("")
$ declare -p __test
declare -a __test='([0]="")'
----
Bash version: 4.3.30(1)-release
Distro: Arch Linux
Thanks,
--
Ivan Shapovalov / intelfx /
signature.asc
Description: This is a digitally signed message part.
