$ 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
$ 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