Re: local failure

2020-06-02 Thread Dale R. Worley
Laurent Picquet writes: > 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? John Passaro writes: > I think the underlying question here is not exactly "how do I gather this > from the docs" as m

Re: local failure

2020-06-01 Thread Greg Wooledge
On Sun, May 31, 2020 at 11:57:03PM -0400, John Passaro wrote: > I think the underlying question here is not exactly "how do I gather this > from the docs" as much as it is "how was I supposed to know about this and > act on it before I had to debug it?" I don't believe the bash documentation is th

Re: local failure

2020-05-31 Thread John Passaro
I think the underlying question here is not exactly "how do I gather this from the docs" as much as it is "how was I supposed to know about this and act on it before I had to debug it?" The bash manual is always "adequate" in the sense that almost any question can be answered by carefully consultin

Re: local failure

2020-05-31 Thread Robert Elz
Date:Sun, 31 May 2020 10:29:27 +0100 From:Laurent Picquet Message-ID: | This behaviour is not fully documented Nothing is ever "fully" documented, as it is always possible to write even more text about anything at all - and if that were done then it is clear that

Re: local failure

2020-05-31 Thread Pierre Gaston
On Sun, May 31, 2020 at 5:22 PM Oğuz wrote: > 31 Mayıs 2020 Pazar tarihinde Laurent Picquet yazdı: > > > Ok, thanks for the clarification. > > > > This behaviour is not fully documented and I believe this should be > > addressed. > > > > > I think it is very well documented in the Simple Command

Re: local failure

2020-05-31 Thread Oğuz
31 Mayıs 2020 Pazar tarihinde Laurent Picquet yazdı: > Ok, thanks for the clarification. > > This behaviour is not fully documented and I believe this should be > addressed. > > I think it is very well documented in the Simple Command Expansion section of the manual ( https://www.gnu.org/software

Re: local failure

2020-05-31 Thread Laurent Picquet
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, wrote: > > > 30 Mayıs 2

Re: local failure

2020-05-30 Thread Oğuz
30 Mayıs 2020 Cumartesi tarihinde Laurent Picquet 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-intuit

Re: local failure

2020-05-30 Thread Laurent Picquet
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.

Re: local failure

2020-05-28 Thread Dale R. Worley
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 co

Re: local failure

2020-05-28 Thread Greg Wooledge
On Thu, May 28, 2020 at 08:02:18AM +0100, Laurent Picquet wrote: > function aFunction { > local aVar="$(somethingThatFails)" || { echo "is expected to go there"; > return 1; } > } "local" is a command with its own separate exit status. It masks the exit status of the command substitution. Ru

local failure

2020-05-28 Thread Laurent Picquet
Configuration Information [Automatically generated, do not change]: Machine: x86_64 OS: linux-gnu Compiler: gcc Compilation CFLAGS: -DPROGRAM='bash' -DCONF_HOSTTYPE='x86_64' -DCONF_OSTYPE='linux-gnu' -DCONF_MACHTYPE='x86_64-pc-linux-gnu' -DCONF_VENDOR='pc' -DLOCALEDIR='/usr/share/locale' -DPACKAGE