Created
April 23, 2017 08:48
-
-
Save nvgoldin/7049f34fecf56545e91f6f0d0681432c to your computer and use it in GitHub Desktop.
inspect whether a variable declared with 'local' is local
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash -ex | |
a="global" | |
b="global" | |
c="global" | |
d="global" | |
function koko() { | |
local a b c d | |
a="xxx" | |
b="zzz" | |
c="ddd" | |
local | |
} | |
koko | |
./inspect_local.sh | |
+ a=global | |
+ b=global | |
+ c=global | |
+ d=global | |
+ koko | |
+ local a b c d | |
+ a=xxx | |
+ b=zzz | |
+ c=ddd | |
+ local | |
a=xxx | |
b=zzz | |
c=ddd |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment