var="hello" function foo(){ local var="sup?" echo "inside function, var=$var" } foo echo "outside function, var=$var"
Will output
inside function, var=sup? outside function, var=hello