var=old
f() { echo "var=$var"; }
var=val f
echo "var=$var"