Variable scope in subshell
Variable scope in subshell functions [mlf4aiur@4aiur Shell]$ cat function_return.sh subshell () { # pipeline will generate subshell echo 1 2 3 | while read line do echo “subshell: inside 1”; var=1; return 1 done echo “subshell: inside 0”; var=0; return 0 } subshell echo “subshell: outside return $? var=$var” foo () { for line in […]