Re: errexit and local variable set by failing command

2020-04-01 Thread Chet Ramey
On 4/1/20 1:21 PM, Krystian Wojtas wrote: > Aha, already known. Thank you for link. I'll get familiar with other cases. > > I just figured out that it works as expected if local variable is firstly > declared and then set. That's because the exit status of a command consisting only of assignment

Re: errexit and local variable set by failing command

2020-04-01 Thread Krystian Wojtas
Aha, already known. Thank you for link. I'll get familiar with other cases. I just figured out that it works as expected if local variable is firstly declared and then set. Pozdrawiam, Krystian Wojtas Sent with ProtonMail Secure Email. ‐‐‐ Original Message ‐‐‐ środa, kwiecień 1, 2020

Re: errexit and local variable set by failing command

2020-04-01 Thread Greg Wooledge
On Wed, Apr 01, 2020 at 04:54:42PM +, Krystian Wojtas via Bug reports for the GNU Bourne Again SHell wrote: > Script has set errexit flag. It runs function. Function declares > local variable and set it to output of run subcommand. Subcommand fails. > Script does not care and continu

errexit and local variable set by failing command

2020-04-01 Thread Krystian Wojtas via Bug reports for the GNU Bourne Again SHell
Configuration Information [Automatically generated, do not change]: Machine: x86_64 OS: linux-musl Compiler: gcc Compilation CFLAGS: -g -O2 -Wno-parentheses -Wno-format-security uname output: Linux bc55e8b47896 5.3.0-42-generic #34~18.04.1-Ubuntu SMP Fri Feb 28 13:42:26 UTC 2020 x86_64 Linux Machi