diff options
author | Chet Ramey <chet.ramey@case.edu> | 2019-08-26 11:40:13 -0400 |
---|---|---|
committer | Chet Ramey <chet.ramey@case.edu> | 2019-08-26 11:40:13 -0400 |
commit | 2dc823ee9663f2a011677aa95bfb5d183360d81f (patch) | |
tree | 6de7258277b8a0f05fe57460637460707ec15b6b /tests | |
parent | d11d79842a99e3312751fc783a83de9f173d9943 (diff) | |
download | bash-2dc823ee9663f2a011677aa95bfb5d183360d81f.tar.gz |
commit bash-20190823 snapshot
Diffstat (limited to 'tests')
-rw-r--r-- | tests/varenv.right | 4 | ||||
-rw-r--r-- | tests/varenv12.sub | 25 |
2 files changed, 29 insertions, 0 deletions
diff --git a/tests/varenv.right b/tests/varenv.right index b8620227..82845dfe 100644 --- a/tests/varenv.right +++ b/tests/varenv.right @@ -159,6 +159,10 @@ inside func1: var=value outside 3.0: var=value inside func2: var=global outside 4.0: var=outside +foo: hello world +after foo: var=outside +bar: hello world +after bar: var=bar: hello world ./varenv13.sub: line 3: `var[0]': not a valid identifier ./varenv13.sub: line 3: `var[@]': not a valid identifier ./varenv13.sub: line 1: declare: var: not found diff --git a/tests/varenv12.sub b/tests/varenv12.sub index 7e384ac7..f286cfbd 100644 --- a/tests/varenv12.sub +++ b/tests/varenv12.sub @@ -131,3 +131,28 @@ func2() var=outside func2 echo -n 'outside 4.0: ' ; echo "var=${var-<unset>}" + +unset -v var +unset -f fecho foo bar + +fecho() { + echo $var +} + +foo() { + local var="foo: bye bye" + var="foo: hello world" fecho +} + +bar() { + var="bar: hello world" fecho +} + +var=global +var=outside foo +echo after foo: var=$var +var=global +var=outside bar +echo after bar: var=$var + +unset -v var |