bug-bash
[Top][All Lists]
Advanced

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

Unsuccessful assignment of a readonly variable does not return 1


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


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]