Configuration Information: Machine: x86_64 OS: linux-gnu Compiler: x86_64-pc-linux-gnu-gcc Compilation CFLAGS: -O0 -fno-omit-frame-pointer -ggdb -pipe -Wno- parentheses -Wno-format-security uname output: Linux gentoo-test 4.14.78-gentoo #1 SMP Wed Oct 24 20:06:13 MSK 2018 x86_64 Westmere E56xx/L56xx/X56xx (IBRS update) GenuineIntel GNU/Linux Machine Type: x86_64-pc-linux-gnu
Bash Version: 5.0 Patch Level: 2 Release Status: release Description: There is a problem with variable scoping when variable is created from assignment statement preceding function call in posix-mode. See an example below. Repeat-By: $ cat test.sh #!/bin/sh myecho() { echo $var } foo() { local var="foo: FAIL" var="foo: bar" myecho } foo $ bash test.sh foo: bar $ bash --posix test.sh foo: FAIL