bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


From: ziyunfei
Subject: `foo=1 declare -r foo' prints an error message but its exit status is zero
Date: Wed, 9 Sep 2015 14:17:30 +0800

$ foo=1 declare -r foo
bash: foo: readonly variable
$ echo $?
0
$ echo $foo
1

Is this a bug? 

$ bar=1 readonly bar; # throw an error in Bash 4.2, fixed in Bash 4.3







reply via email to

[Prev in Thread] Current Thread [Next in Thread]