bug-bash
[Top][All Lists]
Advanced

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

export/readonly unset value of target variable if passed an array refere


From: Grisha Levit
Subject: export/readonly unset value of target variable if passed an array reference
Date: Tue, 17 May 2016 20:33:09 -0400

$ var=foo; declare -n ref=var[0]
$ readonly ref
$ declare -p var
declare -ar var

works even with readonly variables:

$ readonly RO=foo
$ declare -n ref=RO[0]
$ readonly ref
bash: RO: readonly variable
$ declare -p RO
declare -r RO

presumably they should behave as if they were passed a subscripted variable

$ readonly var[0]
bash: readonly: `var[0]': not a valid identifier
‚Äč

reply via email to

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