On 1/4/23 1:21 AM, Carlos Prieto López wrote:
Bash Version: 5.1
Patch Level: 4
Release Status: release
Description:
Errors are ignored when a command with error is assigned to a
local variable on the same line of declaration.
This comes up often; just last month, in fact:
https://l
On Wed, Jan 04, 2023 at 12:21:27AM -0600, Carlos Prieto López wrote:
> Description:
> Errors are ignored when a command with error is assigned to a local
> variable on the same line of declaration.
>
> f(){
> return 1
> }
>
> g(){
> local v=`f`
> }
> g && echo g
> the output is 'g', but
Configuration Information [Automatically generated, do not change]:
Machine: x86_64
OS: linux-gnu
Compiler: gcc
Compilation CFLAGS: -g -O2 -fstack-protector-strong -Wformat
-Werror=format-security -Wall
uname output: Linux pingu 5.10.0-20-amd64 #1 SMP Debian 5.10.158-2
(2022-12-13) x86_64 GNU/Li