]> git.ipfire.org Git - thirdparty/bash.git/blob - tests/attr.tests
Bash-4.4 patch 19
[thirdparty/bash.git] / tests / attr.tests
1 a=(outside)
2
3 f1() { readonly a=(1) ; }
4 f2() { readonly -a a=(2) ; }
5 f3() { readonly 'a=(3)' ; }
6 f4() { readonly -a 'a=(4)' ; }
7
8 f1
9 echo -n after f1:
10 declare -p a
11 f2
12 echo -n after f2:
13 declare -p a
14 f3
15 echo -n after f3:
16 declare -p a
17 f4
18 echo -n after f4:
19 declare -p a
20
21 b=(outside)
22 c=(outside)
23 d=(outside)
24
25 f2() { readonly -a b=(2) ; }
26 f3() { readonly 'c=(3)' ; }
27 f4() { readonly -a 'd=(4)' ; }
28
29 f2
30 echo -n after f2:
31 declare -p b
32 f3
33 echo -n after f3:
34 declare -p c
35 f4
36 echo -n after f4:
37 declare -p d
38
39 ${THIS_SH} ./attr1.sub
40 ${THIS_SH} ./attr2.sub
41