|
From: | Grisha Levit |
Subject: | Re: param expansion with single-character special vars in the environment |
Date: | Sat, 14 May 2016 12:41:05 -0400 |
On Mon, May 2, 2016 at 2:30 PM, Chet Ramey <chet.ramey@case.edu> wrote:
I ended up writing a new function: valid_nameref_value(name, flags) which
I can customize to serve this purpose.
Looks like this ends up getting bypassed in some cases when the value is an empty string:
declare -n r; : ${r=}
declare -n r; r=""
declare -n r; printf -v r ''
r=""; declare -n r
Each of these result in:
$ declare -p r
declare -n r=""
Which itself is invalid:
$ declare -n r=""
bash: declare: `': not a valid identifier
This new nameref takes assignments but doesn’t seem to do anything with them. It does cause at least one segfault though:
$ declare -n r; r=""
$ export r # or readonly r
Segmentation fault: 11
[Prev in Thread] | Current Thread | [Next in Thread] |