bug-bash
[Top][All Lists]
Advanced

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

Re: Unsuccessful assignment of a readonly variable does not return 1


From: Laur Aliste
Subject: Re: Unsuccessful assignment of a readonly variable does not return 1
Date: Mon, 12 Dec 2016 11:12:54 +0100

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 <address@hidden> 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

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