On 11/27/16 5:07 AM, Otenba wrote: > Bash Version: 4.4 > Patch Level: 5 > Release Status: release > > Description: > Performing variable indirection using an empty value causes an error. It > didn't in Bash 4.3.
It's pretty clear that indirect expansion that attempts to reference through an unset variable or a variable whose value is null should be an error. Bash-4.3 didn't have the greatest error checking, and bash-4.4 catches the null value case. I'll fix it to catch the unset variable case, too. > Repeat-By: > $ reference=1 > $ echo ${!indirect} #variable indirection using an unset variable If you think of indirect expansion as just a simple string replacement, though it's more complicated than that, it's clear that this is logically equivalent to echo ${}, which should be an error. > $ indirect= > $ echo ${!indirect} #variable indirection using an empty variable > -bash: : bad substitution Using the same logic as above, this expands to the equivalent of echo ${" "}, which is another obvious error, though the message could be a little better. Chet -- ``The lyf so short, the craft so long to lerne.'' - Chaucer ``Ars longa, vita brevis'' - Hippocrates Chet Ramey, UTech, CWRU c...@case.edu http://cnswww.cns.cwru.edu/~chet/