Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > gnu.bash.bug > #16325

Re: local failure

Path csiph.com!xmission!news.snarked.org!news.linkpendium.com!news.linkpendium.com!panix!usenet.stanford.edu!not-for-mail
From Laurent Picquet <lpicquet@gmail.com>
Newsgroups gnu.bash.bug
Subject Re: local failure
Date Sun, 31 May 2020 10:29:27 +0100
Lines 96
Approved bug-bash@gnu.org
Message-ID <mailman.792.1590917384.2541.bug-bash@gnu.org> (permalink)
References <CAH+roKWmQLjDGf_UpDabq6AHN+CVF_bKd1uyO2d8EadXzJ72MA@mail.gmail.com> <87tuzzh34x.fsf@hobgoblin.ariadne.com> <CAH+roKX_x6t3sKkbkgc-xa7XXSMpFCUJr6p4kVzXUB=E_pbw8A@mail.gmail.com> <CAH7i3LoKQ_-QMMeMU-=5hcbqZPLfyu0i63f+KcMot+pQ6ruEtw@mail.gmail.com> <CAH+roKX-H_PjDu+UBPDiVUQjnd2eKK0E=L1r=0wg33X5paJpEg@mail.gmail.com>
NNTP-Posting-Host lists.gnu.org
Mime-Version 1.0
Content-Type text/plain; charset="UTF-8"
Content-Transfer-Encoding quoted-printable
X-Trace usenet.stanford.edu 1590917385 10924 209.51.188.17 (31 May 2020 09:29:45 GMT)
X-Complaints-To action@cs.stanford.edu
Cc "Dale R. Worley" <worley@alum.mit.edu>, bug-bash@gnu.org, "bash@packages.debian.org" <bash@packages.debian.org>
To Oğuz <oguzismailuysal@gmail.com>
Envelope-to bug-bash@gnu.org
DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=LBSOV4XeMpBeWQ88nqP95LTp9wdjuzqQJM40/swDLbo=; b=HJpqDwe3UQ83ZXbYabuFjBX3WHo1i2PxNRLGYpWLkCaIdmU20wqymmdUHrF99grTJZ q0+3mOQo9Pc28yVpIwV8B2WY4puGtqvKJ5aLHTSoosSpIoT3DRe706+6jqu/WmnK601z +osV9Z00zWWvAo8pH4Ka+7Zl1Dl2pL9OEeYlA2MT9wHjI07QZ3G67VN/lwllPEWHc1Ij 6JeMK/9S63BdZS75RVppw4pMUC93c2b/2TFUrgvTTaRi5WwoCVJ2nUL9vTLkMtC9lUYV WyCvzQC7t8voSrTD70c4Rf5Pa+TEHA5CtqHVzHpzGo0HD789lxr5MAWfxto11udTj1Ik /rhg==
X-Google-DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=LBSOV4XeMpBeWQ88nqP95LTp9wdjuzqQJM40/swDLbo=; b=lIw0Xkalspaa+k9bExQTtajOggftE69/K1tfPqGRO4JZkYai7kMVvgHgQV082JtJx5 n7vnljqQmOkWAuorKfMIjcM8uDecR9UX5Y7lWniszNsHHOWaKcbJ0TnJg6t6fynqWRh4 +kmeiwbIZTAklTI6Cdgl2Fx4Jui3IUjPtImc81NRlznTuuyezwcV/KrAzh/kDay+PJb/ YQZNkMWFN4fYT/QUDiMecxiF44V8EA6FZduAqDn4FwPtBnS6AYmRwBvmQQlNvuuGTqZy TqG/q83d9deK7amDBaFR5brLPpunIktNDR2A5svCjRR+rPT9rpr/2HM6sHCag8NglToY SLAg==
X-Gm-Message-State AOAM532CMW+hifA4dL7rs1tzoom+9ZsBsBvDg0v8JCnyxWjQThnOt3Tr dXBfYBxOVrE6xXWzK1/2/07DgKwO+GYclT+AZK0=
X-Google-Smtp-Source ABdhPJwEHWnMBEDYTEa9P/Yvq6Yxt5Dp7FK7Q6Ft8dme6qZ0B5bdl56RvDj4WzD2lEHJxpYkR20DYwuzzaN8kM5u8kM=
X-Received by 2002:ac2:5586:: with SMTP id v6mr8127990lfg.172.1590917379024; Sun, 31 May 2020 02:29:39 -0700 (PDT)
In-Reply-To <CAH7i3LoKQ_-QMMeMU-=5hcbqZPLfyu0i63f+KcMot+pQ6ruEtw@mail.gmail.com>
Received-SPF pass client-ip=2a00:1450:4864:20::12f; envelope-from=lpicquet@gmail.com; helo=mail-lf1-x12f.google.com
X-detected-operating-system by eggs.gnu.org: No matching host in p0f cache. That's all we know.
X-Spam_score_int -20
X-Spam_score -2.1
X-Spam_bar --
X-Spam_report (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_PASS=-0.001 autolearn=_AUTOLEARN
X-Spam_action no action
X-Content-Filtered-By Mailman/MimeDel 2.1.23
X-BeenThere bug-bash@gnu.org
X-Mailman-Version 2.1.23
Precedence list
List-Id Bug reports for the GNU Bourne Again SHell <bug-bash.gnu.org>
List-Unsubscribe <https://lists.gnu.org/mailman/options/bug-bash>, <mailto:bug-bash-request@gnu.org?subject=unsubscribe>
List-Archive <https://lists.gnu.org/archive/html/bug-bash>
List-Post <mailto:bug-bash@gnu.org>
List-Help <mailto:bug-bash-request@gnu.org?subject=help>
List-Subscribe <https://lists.gnu.org/mailman/listinfo/bug-bash>, <mailto:bug-bash-request@gnu.org?subject=subscribe>
X-Mailman-Original-Message-ID <CAH+roKX-H_PjDu+UBPDiVUQjnd2eKK0E=L1r=0wg33X5paJpEg@mail.gmail.com>
X-Mailman-Original-References <CAH+roKWmQLjDGf_UpDabq6AHN+CVF_bKd1uyO2d8EadXzJ72MA@mail.gmail.com> <87tuzzh34x.fsf@hobgoblin.ariadne.com> <CAH+roKX_x6t3sKkbkgc-xa7XXSMpFCUJr6p4kVzXUB=E_pbw8A@mail.gmail.com> <CAH7i3LoKQ_-QMMeMU-=5hcbqZPLfyu0i63f+KcMot+pQ6ruEtw@mail.gmail.com>
Xref csiph.com gnu.bash.bug:16325

Show key headers only | View raw


Ok, thanks for the clarification.

This behaviour is not fully documented and I believe this should be
addressed.

I don't mind participating. Could you point me in the right direction to do
that and raise a pull request?

Regards,
Laurent

On Sat, 30 May 2020, 16:32 Oğuz, <oguzismailuysal@gmail.com> wrote:

>
>
> 30 Mayıs 2020 Cumartesi tarihinde Laurent Picquet <lpicquet@gmail.com>
> yazdı:
>
>> Hello Dale,
>>
>> This is really interesting.
>> Should the 'local' command be the one able to detect that the assignment
>> to
>> the variable had an non-zero exit code and return the non-zero exit code?
>>
>> as a developer, it is counter-intuitive that the 'local' command tells us
>> everything is ok when it wasn't. If feel it should know that the
>> assignment
>> encountered a problem and should report it
>>
>>
> Everything is ok for `local` though; it takes a valid assignment statement
> and successfully evaluates that. So it's not that the assignment
> encountered a problem, but that the expansion has failed, which has nothing
> to do with `local`. So there is no reason for `local` to return a non-zero
> exit status in that case.
>
>
>> The return status is zero unless local is used outside a function, an
>> invalid name is supplied, or name is a readonly variable.
>>
>>
>>
>> On Fri, 29 May 2020 at 03:43, Dale R. Worley <worley@alum.mit.edu> wrote:
>>
>> > It's a subtle point.  See this paragraph in the bash manual page:
>> >
>> >        If there is a command name left after expansion, execution
>> >        proceeds as described below.  Otherwise, the command exits.  If
>> >        one of the expansions contained a command substitution, the exit
>> >        status of the command is the exit status of the last command
>> >        substitution performed.  If there were no command substitutions,
>> >        the command exits with a status of zero.
>> >
>> > In one of your examples, a "local" command is generated using a command
>> > substitution, so the exit status is that of the local command.  In the
>> > other, only an assignment is done, which is not a command, so the exit
>> > status is that of the last command substitution.
>> >
>> > Dale
>> >
>>
>>
>> --
>>
>>
>> --
>>
>> Laurent Picquet
>>
>> 16, Hunters Chase
>>
>> South Godstone
>>
>> RH98HR
>>
>> England
>>
>> tel: 07882 356 104
>>
>
>
> --
> Oğuz
>
>

Back to gnu.bash.bug | Previous | Next | Find similar


Thread

Re: local failure Laurent Picquet <lpicquet@gmail.com> - 2020-05-31 10:29 +0100

csiph-web