[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: `foo=1 declare -r foo' prints an error message but its exit status i
From: |
Chet Ramey |
Subject: |
Re: `foo=1 declare -r foo' prints an error message but its exit status is zero |
Date: |
Wed, 9 Sep 2015 16:45:50 -0400 |
User-agent: |
Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:38.0) Gecko/20100101 Thunderbird/38.2.0 |
On 9/9/15 2:17 AM, ziyunfei wrote:
> $ foo=1 declare -r foo
> bash: foo: readonly variable
> $ echo $?
> 0
> $ echo $foo
> 1
>
> Is this a bug?
This has already been changed for the next version of bash.
Chet
--
``The lyf so short, the craft so long to lerne.'' - Chaucer
``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, ITS, CWRU chet@case.edu http://cnswww.cns.cwru.edu/~chet/