From: queen...@gmail.com To: bug-bash@gnu.org Subject: 2 same var name in different function causing mix
Configuration Information [Automatically generated, do not change]: Machine: x86_64 OS: linux-gnu Compiler: gcc Compilation CFLAGS: -g -O2 -fdebug-prefix-map=/build/bash-2bxm7h/bash-5.0=. -fstack-protector-strong -Wformat -Werror=format-security -Wall -Wno-parentheses -Wno-format-security uname output: Linux debian 4.19.0-25-amd64 #1 SMP Debian 4.19.289-2 (2023-08-08) x86_64 GNU/Linux Machine Type: x86_64-pc-linux-gnu Bash Version: 5.0 Patch Level: 3 Release Status: release Description: function sub { aa=8;return_value=$aa; } function sub { aa=8; } function main { aa=3;sub;aa=$(($aa+1));printf "$aa\n"; } calling main will print 9 instead of 4