I have simple bash script. My bash version is GNU bash, version 4.4.20(1)-release (x86_64-redhat-linux-gnu)
#!/bin/bash
func() {
nlvar="i'm not local variable"
local lvar="i'm local variable"
}
echo $nlvar
echo $lvar
If I use
eval nlvar="i'm not local variable"
or
export nlvar="i'm not local variable"
still nothing is echoed