Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > gnu.bash.bug > #11484

Re: `foo=1 declare -r foo' prints an error message but its exit status is zero

From Chet Ramey <chet.ramey@case.edu>
Newsgroups gnu.bash.bug
Subject Re: `foo=1 declare -r foo' prints an error message but its exit status is zero
Date 2015-09-09 16:45 -0400
Message-ID <mailman.790.1441831563.19560.bug-bash@gnu.org> (permalink)
References <D447E11E-FFFF-4AE2-B737-1885D6C4FE75@qq.com>

Show all headers | View raw


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/

Back to gnu.bash.bug | Previous | Next | Find similar


Thread

Re: `foo=1 declare -r foo' prints an error message but its exit status is zero Chet Ramey <chet.ramey@case.edu> - 2015-09-09 16:45 -0400

csiph-web