Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Demonstrate bash dynamic scoping
start: str=begin
inner: str=outer
end: str=begin
str="begin"
echo "start: str=$str"
function inner {
echo "inner: str=$str"
}
function outer {
local str="outer"
inner
}
outer
echo "end: str=$str"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.