Skip to content

Instantly share code, notes, and snippets.

@defHLT
Forked from jonpryor/output.txt
Created February 24, 2018 11:40
Show Gist options
  • Save defHLT/259073e36e4d5d47d56c1a4a89cc48c7 to your computer and use it in GitHub Desktop.
Save defHLT/259073e36e4d5d47d56c1a4a89cc48c7 to your computer and use it in GitHub Desktop.
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