Forgot to add: GNU bash, version *4.4.5(1)-release* (x86_64-pc-linux-gnu),
running on Debian testing.

On Mon, Dec 12, 2016 at 11:11 AM, Laur Aliste <laur.ali...@gmail.com> wrote:

>
> Hi,
> is it accepted behavior for a failing assignment of a readonly variable to
> return successfully?
>
> See following code:
>
> fail() {
>     return 1
> }
>
> o() {
>     local i j
>
>     i="$(fail)" || echo "i init failed"
>     readonly j="$(fail)" || echo "j init failed"  # this echo is not
> executed
> }
>
>
> Expected assignment of a variable *j* to return 1 as well, but it doesn't.
>

Reply via email to