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/Linux
Machine Type: x86_64-pc-linux-gnu
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.
Repeat-By:
f(){
return 1
}
g(){
local v=`f`
}
h(){
v=`f`
}
i(){
local v
v=`f`
}
f && echo f
g && echo g
h && echo h
i && echo i
-----
the output is 'g', but I believe there should be no output