[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Help-bash] Can anyone explain this?
From: |
Dan Douglas |
Subject: |
Re: [Help-bash] Can anyone explain this? |
Date: |
Fri, 04 May 2012 19:50:25 -0500 |
User-agent: |
KMail/4.8.3 (Linux/3.3.4-pf+; KDE/4.8.3; x86_64; ; ) |
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