On Friday, May 04, 2012 08:43:01 PM Chet Ramey wrote:
> On 5/4/12 6:25 PM, Dan Douglas wrote:
> > It also appears seting a readonly variable to null is inconsistent with
> > other types of assignment.
> >
> > $ ( declare -r x; declare -p x )
> > -bash: declare: x: not found
> > $ ( declare -r x=; declare -p x )
> > declare -r x=""
>
> A variable is not set unless it has been assigned a value. The empty
> string is a valid value.
Oh sorry about that, I must have had x set previously by accident when
testing. I see this only applies to setting an array attribute on an unset
variable.
--
Dan Douglas